@techdocs/cli 1.4.2-next.0 → 1.4.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/main.c470e19b.js +508 -0
- package/dist/embedded-app/static/main.c470e19b.js.map +1 -0
- package/dist/embedded-app/static/{runtime.8fd0fc33.js → runtime.c470e19b.js} +1 -1
- package/dist/embedded-app/static/{runtime.8fd0fc33.js.map → runtime.c470e19b.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.8fd0fc33.js → vendor.c470e19b.js} +52 -52
- package/dist/embedded-app/static/vendor.c470e19b.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +3 -3
- package/dist/embedded-app/static/main.8fd0fc33.js +0 -508
- package/dist/embedded-app/static/main.8fd0fc33.js.map +0 -1
- package/dist/embedded-app/static/vendor.8fd0fc33.js.map +0 -1
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(jt,De,r){"use strict";r.d(De,{n3:function(){return g},MS:function(){return me}});var t=r(87612),h=r(25271),H=r(23054),f=r(96279),W=r.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function d(ue){return!ue.cursor}function B(ue){return!d(ue)}class me{async getEntityAncestors(V,K){const{kind:I,namespace:w,name:se}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}/ancestry`,K)}async getLocationById(V,K){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,K)}async getEntities(V,K){const{filter:I=[],fields:w=[],order:se,offset:_,limit:te,after:$}=V!=null?V:{},T=this.getParams(I);if(w.length&&T.push(`fields=${w.map(encodeURIComponent).join(",")}`),se)for(const oe of[se].flat())oe&&T.push(`order=${encodeURIComponent(oe.order)}:${encodeURIComponent(oe.field)}`);_!==void 0&&T.push(`offset=${_}`),te!==void 0&&T.push(`limit=${te}`),$!==void 0&&T.push(`after=${encodeURIComponent($)}`);const P=T.length?`?${T.join("&")}`:"",L=await this.requestRequired("GET",`/entities${P}`,K),O=(oe,Le)=>{var Ve,z;if(((Ve=oe.metadata)===null||Ve===void 0?void 0:Ve.name)===void 0||oe.kind===void 0||((z=Le.metadata)===null||z===void 0?void 0:z.name)===void 0||Le.kind===void 0)return 0;const xt=(0,h.eE)(oe),ot=(0,h.eE)(Le);return xt<ot?-1:xt>ot?1:0};return{items:L.sort(O)}}async getEntitiesByRefs(V,K){var I;const w={entityRefs:V.entityRefs};!((I=V.fields)===null||I===void 0)&&I.length&&(w.fields=V.fields);const _=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,te=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify(w)});if(!te.ok)throw await H.VL.fromResponse(te);const{items:$}=await te.json();return{items:$.map(T=>T!=null?T:void 0)}}async queryEntities(V={},K){const I=[];if(d(V)){var w,se;const{fields:te=[],filter:$,limit:T,orderFields:P,fullTextFilter:L}=V;I.push(...this.getParams($)),T!==void 0&&I.push(`limit=${T}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:oe,order:Le})=>I.push(`orderField=${oe},${Le}`)),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`);const O=L==null||(w=L.term)===null||w===void 0?void 0:w.trim();O&&I.push(`fullTextFilterTerm=${O}`),!(L==null||(se=L.fields)===null||se===void 0)&&se.length&&I.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:te=[],limit:$,cursor:T}=V;I.push(`cursor=${T}`),$!==void 0&&I.push(`limit=${$}`),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`)}const _=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${_}`,K)}async getEntityByRef(V,K){const{kind:I,namespace:w,name:se}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}`,K)}async getEntityByName(V,K){const{kind:I,namespace:w="default",name:se}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}`,K)}async refreshEntity(V,K){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(V,K){const{filter:I=[],facets:w}=V,se=this.getParams(I);for(const te of w)se.push(`facet=${encodeURIComponent(te)}`);const _=se.length?`?${se.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${_}`,K)}async addLocation(V,K){const{type:I="url",target:w,dryRun:se}=V,_=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${se?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({type:I,target:w})});if(_.status!==201)throw new Error(await _.text());const{location:te,entities:$,exists:T}=await _.json();if(!te)throw new Error(`Location wasn't added: ${w}`);return{location:te,entities:$,exists:T}}async getLocationByRef(V,K){return(await this.requestRequired("GET","/locations",K)).map(w=>w.data).find(w=>V===(0,h.NZ)(w))}async removeLocationById(V,K){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,K)}async removeEntityByUid(V,K){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,K)}async validateEntity(V,K,I){const w=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(I==null?void 0:I.token)&&{Authorization:`Bearer ${I==null?void 0:I.token}`}},method:"POST",body:JSON.stringify({entity:V,location:K})});if(w.ok)return{valid:!0};if(w.status!==400)throw await H.VL.fromResponse(w);const{errors:se=[]}=await w.json();return{valid:!1,errors:se}}async requestIgnored(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok)throw await H.VL.fromResponse(_)}async requestRequired(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok)throw await H.VL.fromResponse(_);return _.json()}async requestOptional(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok){if(_.status===404)return;throw await H.VL.fromResponse(_)}return await _.json()}getParams(V=[]){const K=[];for(const I of[V].flat()){const w=[];for(const[se,_]of Object.entries(I))for(const te of[_].flat())te===g?w.push(encodeURIComponent(se)):typeof te=="string"&&w.push(`${encodeURIComponent(se)}=${encodeURIComponent(te)}`);w.length&&K.push(`filter=${w.join(",")}`)}return K}constructor(V){(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(jt,De,r){"use strict";r.d(De,{Tf:function(){return H},P1:function(){return cn},q1:function(){return In},M6:function(){return we},l2:function(){return h},zG:function(){return t},w$:function(){return $n},nP:function(){return vn},aS:function(){return Kn},S4:function(){return $t},cz:function(){return ft},iB:function(){return Ct},CV:function(){return _e},of:function(){return Tt},Ou:function(){return Be},eE:function(){return bt},NZ:function(){return Me}});const t="default",h="backstage.io/view-url",H="backstage.io/edit-url",f="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var d=r(76635),B=r.n(d);class me{async enforce(Z){return Z.metadata.namespace?Z:lodash.merge({metadata:{namespace:this.namespace}},Z)}constructor(Z=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=Z}}class ue{static isValidPrefixAndOrSuffix(Z,pe,Ze,Xe){if(typeof Z!="string")return!1;const lt=Z.split(pe);return lt.length===1?Xe(lt[0]):lt.length===2?Ze(lt[0])&&Xe(lt[1]):!1}static isJsonSafe(Z){try{return B().isEqual(Z,JSON.parse(JSON.stringify(Z)))}catch{return!1}}static isValidDnsSubdomain(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=253&&Z.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(Z)}static isValidTag(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(Z)}static isValidUrl(Z){if(typeof Z!="string")return!1;try{return new URL(Z),!0}catch{return!1}}static isValidString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}}var V=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),K=r(27991),I=r.n(K),w=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),_=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const te=new Map,$=[V,w,se,_];function T(ne){if(!(ne!=null&&ne.length))throw new TypeError("Unknown error");const Z=ne[0];throw new TypeError(`${Z.instancePath||"<root>"} ${Z.message}${Z.params?` - ${Object.entries(Z.params).map(([pe,Ze])=>`${pe}: ${Ze}`).join(", ")}`:""}`)}function P(ne,Z={}){var pe;const Ze=(pe=Z==null?void 0:Z.disableCache)!==null&&pe!==void 0?pe:!1,Xe=Ze?"":JSON.stringify(ne);if(!Ze){const X=te.get(Xe);if(X)return X}const lt=L(ne),Ot=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});lt.length&&Ot.addSchema(lt,void 0,void 0,!0);const Ft=Ot.compile(ne);return Ze||te.set(Xe,Ft),Ft}function L(ne){if(typeof ne!="object")return[];const Z=new Set;ne.$id&&Z.add(ne.$id);const pe=new Array,Ze=[ne];for(;Ze.length;){const Xe=Ze.pop();for(const lt of O(Xe))if(!Z.has(lt)){Z.add(lt);const Ot=$.find(Ft=>Ft.$id===lt);Ot&&(pe.push(Ot),Ze.push(Ot))}}return pe}function*O(ne){const Z=[ne];for(;Z.length;){const pe=Z.pop();if(typeof pe=="object"&&pe)for(const[Ze,Xe]of Object.entries(pe))Ze==="$ref"&&typeof Xe=="string"?yield Xe.split("#")[0]:Z.push(Xe)}}function oe(ne){const Z=compileAjvSchema(ne||entityEnvelopeSchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}function Le(ne){const Z=P(ne);return pe=>{var Ze;if(Z(pe)===!0)return pe;const lt=(Ze=Z.errors)===null||Ze===void 0?void 0:Ze.filter(Ot=>["/kind","/apiVersion"].includes(Ot.instancePath));if(lt!=null&<.length&<.every(Ot=>Ot.keyword==="enum"))return!1;throw T(Z.errors)}}function Ve(ne){const Z=compileAjvSchema(ne||entitySchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}class z{static isValidApiVersion(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(Z)}static isValidObjectName(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(Z)}static isValidNamespace(Z){return ue.isValidDnsLabel(Z)}static isValidLabelKey(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidLabelValue(Z){return Z===""||z.isValidObjectName(Z)}static isValidAnnotationKey(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidAnnotationValue(Z){return typeof Z=="string"}}const xt={isValidApiVersion:z.isValidApiVersion,isValidKind:z.isValidKind,isValidEntityName:z.isValidObjectName,isValidNamespace:z.isValidNamespace,isValidLabelKey:z.isValidLabelKey,isValidLabelValue:z.isValidLabelValue,isValidAnnotationKey:z.isValidAnnotationKey,isValidAnnotationValue:z.isValidAnnotationValue,isValidTag:ne=>typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ne)};function ot(ne={}){return{...xt,...ne}}class Ye{async enforce(Z){function pe(Se,y,M){if(y==null)throw new Error(`${Se} must have a value`);let re;try{re=M(y)}catch(q){throw new Error(`${Se} could not be validated, ${q}`)}if(!re){let q;switch(M.name){case"isValidLabelValue":case"isValidObjectName":q="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":q="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":q="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":q="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":q="a string";break;case"isValidKind":q="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":q="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":q="a non empty string";break;default:q=void 0;break}const Te=q?` expected ${q} but found "${y}".`:"";throw new Error(`"${Se}" is not valid;${Te} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ze(Se,y,M){return y===void 0||pe(Se,y,M)}pe("apiVersion",Z.apiVersion,this.validators.isValidApiVersion),pe("kind",Z.kind,this.validators.isValidKind),pe("metadata.name",Z.metadata.name,this.validators.isValidEntityName),Ze("metadata.namespace",Z.metadata.namespace,this.validators.isValidNamespace);var Xe;for(const[Se,y]of Object.entries((Xe=Z.metadata.labels)!==null&&Xe!==void 0?Xe:[]))pe(`labels.${Se}`,Se,this.validators.isValidLabelKey),pe(`labels.${Se}`,y,this.validators.isValidLabelValue);var lt;for(const[Se,y]of Object.entries((lt=Z.metadata.annotations)!==null&<!==void 0?lt:[]))pe(`annotations.${Se}`,Se,this.validators.isValidAnnotationKey),pe(`annotations.${Se}`,y,this.validators.isValidAnnotationValue);var Ot;const Ft=(Ot=Z.metadata.tags)!==null&&Ot!==void 0?Ot:[];for(let Se=0;Se<Ft.length;++Se)pe(`tags.${Se}`,Ft[Se],this.validators.isValidTag);var X;const Y=(X=Z.metadata.links)!==null&&X!==void 0?X:[];for(let Se=0;Se<Y.length;++Se){var le,ce,ye;pe(`links.${Se}.url`,(le=Y[Se])===null||le===void 0?void 0:le.url,CommonValidatorFunctions.isValidUrl),Ze(`links.${Se}.title`,(ce=Y[Se])===null||ce===void 0?void 0:ce.title,CommonValidatorFunctions.isNonEmptyString),Ze(`links.${Se}.icon`,(ye=Y[Se])===null||ye===void 0?void 0:ye.icon,KubernetesValidatorFunctions.isValidObjectName)}return Z}constructor(Z=makeValidator()){_define_property(this,"validators",void 0),this.validators=Z}}class st{async enforce(Z){if(!this.validate){const Xe=new Ajv({allowUnionTypes:!0});this.validate=Xe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(Z)===!0)return Z;const[Ze]=this.validate.errors||[];throw Ze?new Error(`Malformed envelope, ${Ze.instancePath||"<root>"} ${Ze.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Qe(ne){let Z=ne.indexOf(":");const pe=ne.indexOf("/");pe!==-1&&pe<Z&&(Z=-1);const Ze=Z===-1?void 0:ne.slice(0,Z),Xe=pe===-1?void 0:ne.slice(Z+1,pe),lt=ne.slice(Math.max(Z+1,pe+1));if(Ze===""||Xe===""||lt==="")throw new TypeError(`Entity reference "${ne}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ze,namespace:Xe,name:lt}}function Ct(ne){return{kind:ne.kind,namespace:ne.metadata.namespace||t,name:ne.metadata.name}}function Tt(ne,Z){if(!ne)throw new Error("Entity reference must not be empty");const pe=Z==null?void 0:Z.defaultKind,Ze=(Z==null?void 0:Z.defaultNamespace)||t;let Xe,lt,Ot;if(typeof ne=="string"){const ce=Qe(ne);var Ft;Xe=(Ft=ce.kind)!==null&&Ft!==void 0?Ft:pe;var X;lt=(X=ce.namespace)!==null&&X!==void 0?X:Ze,Ot=ce.name}else{var Y;Xe=(Y=ne.kind)!==null&&Y!==void 0?Y:pe;var le;lt=(le=ne.namespace)!==null&&le!==void 0?le:Ze,Ot=ne.name}if(Xe)if(lt){if(!Ot){const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty name`)}}else{const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty namespace`)}else{const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Xe,namespace:lt,name:Ot}}function bt(ne){let Z,pe,Ze;if("metadata"in ne){Z=ne.kind;var Xe;pe=(Xe=ne.metadata.namespace)!==null&&Xe!==void 0?Xe:t,Ze=ne.metadata.name}else{Z=ne.kind;var lt;pe=(lt=ne.namespace)!==null&<!==void 0?lt:t,Ze=ne.name}return`${Z.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Ze.toLocaleLowerCase("en-US")}`}var it=r(87612);class Pt{async enforce(Z){let pe=Z;for(const Ze of this.policies){const Xe=await Ze.enforce(pe);if(!Xe)throw new Error(`Policy ${Ze.constructor.name} did not return a result`);pe=Xe}return pe}constructor(Z){(0,it._)(this,"policies",void 0),this.policies=Z}}class Zt{async enforce(Z){for(const pe of this.policies){const Ze=await pe.enforce(Z);if(Ze)return Ze}throw new Error("The entity did not match any known policy")}constructor(Z){(0,it._)(this,"policies",void 0),this.policies=Z}}const Ke={allOf(ne){return new Pt(ne)},oneOf(ne){return new Zt(ne)}};var Xt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ge(ne){let Z;return{async check(pe){return Z||(Z=Le(ne)),Z(pe)===pe}}}const be=ge(Xt);var Ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const nt=ge(Ue);var yt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const gt=ge(yt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Bt=ge(pt);var zt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const Kt=ge(zt),$t="ownedBy",qt="ownerOf",_t="consumesApi",mn="apiConsumedBy",zn="providesApi",Bn="apiProvidedBy",vn="dependsOn",$n="dependencyOf",Dn="parentOf",en="childOf",En="memberOf",Wn="hasMember",ft="partOf",Kn="hasPart";var Rt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const at=ge(Rt);var bn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const Gt=ge(bn);var sn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const An=ge(sn),cn="backstage.io/managed-by-location",In="backstage.io/managed-by-origin-location",we="backstage.io/source-location",ae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function Be(ne){if(typeof ne!="string")throw new TypeError(`Unable to parse location ref '${ne}', unexpected argument ${typeof ne}`);const Z=ne.indexOf(":");if(Z<0)throw new TypeError(`Unable to parse location ref '${ne}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=ne.substring(0,Z).trim(),Ze=ne.substring(Z+1).trim();if(!pe||!Ze)throw new TypeError(`Unable to parse location ref '${ne}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${ne}', please prefix it with 'url:', e.g. 'url:${ne}'`);if(ae.test(Ze))throw new TypeError(`Invalid location ref '${ne}', target is a javascript: URL`);return{type:pe,target:Ze}}function Me(ne){const{type:Z,target:pe}=ne;if(Z){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ae.test(pe))throw new TypeError(`Invalid location ref '${Z}:${pe}', target is a javascript: URL`);return`${Z}:${pe}`}function _e(ne){var Z,pe,Ze,Xe,lt;const Ot=(lt=(Z=ne.metadata)===null||Z===void 0||(pe=Z.annotations)===null||pe===void 0?void 0:pe[we])!==null&<!==void 0?lt:(Ze=ne.metadata)===null||Ze===void 0||(Xe=Ze.annotations)===null||Xe===void 0?void 0:Xe[cn];if(!Ot)throw new Error(`Entity '${bt(ne)}' is missing location`);return Be(Ot)}},15332:function(jt,De,r){"use strict";r.d(De,{r:function(){return L}});var t=r(52322),h=r(60871),H=r(86689),f=r(79692),W=r(90436),g=r(72779),d=r.n(g),B=r(76635),me=r(2784),ue=r(73557),V=r(71597);function K(){const[O]=(0,ue.is)((0,t.jsx)(ue.AW,{index:!0,element:(0,t.jsx)("div",{})}));return!O.index}const I=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),w=O=>/^([a-z+.-]+):/.test(O),se=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,_=window.open;if(_&&!_.__backstage){const O=function(...Le){const Ve=String(Le[0]);if(se.test(Ve))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return _.apply(this,Le)};O.__backstage=!0,window.open=O}const te=()=>{try{return(0,h.h_)(h.Ds).getOptionalString("app.baseUrl")}catch{return}},$=()=>{const O="http://sample.dev";var oe;const Le=(oe=te())!==null&&oe!==void 0?oe:"/",{pathname:Ve}=new URL(Le,O);return(0,B.trimEnd)(Ve,"/")},T=O=>{let oe=String(O);const Le=$(),Ve=w(oe),z=oe.startsWith(Le);return!Ve&&!z&&(oe=Le.concat(oe)),oe},P=O=>{if(O instanceof Array)return O.map(P).join(" ").trim();if(typeof O=="object"&&O){var oe;return P(O==null||(oe=O.props)===null||oe===void 0?void 0:oe.children)}return["string","number"].includes(typeof O)?String(O):""},L=me.forwardRef(({onClick:O,noTrack:oe,...Le},Ve)=>{const z=I(),xt=(0,h.z$)(),ot=K()?T(Le.to):Le.to,Ye=P(Le.children)||ot,st=w(ot),Qe=st&&!!/^https?:/.exec(ot);if(se.test(ot))throw new Error("Link component rejected javascript: URL as a security precaution");const Ct=Tt=>{O==null||O(Tt),oe||xt.captureEvent("click",Ye,{attributes:{to:ot}})};return st?(0,t.jsxs)(H.Z,{...Qe?{target:"_blank",rel:"noopener"}:{},...Le,ref:Ve,href:ot,onClick:Ct,className:d()(z.externalLink,Le.className),children:[Le.children,(0,t.jsx)(W.Z,{component:"span",className:z.visuallyHidden,children:", Opens in a new window"})]}):(0,t.jsx)(H.Z,{...Le,ref:Ve,component:V.rU,to:ot,onClick:Ct})})},53974:function(jt,De,r){"use strict";r.d(De,{Oi:function(){return Le},VY:function(){return Us},yW:function(){return Wa},XF:function(){return ot},mn:function(){return $n},NX:function(){return Pt},ub:function(){return ae},mf:function(){return Ya},yu:function(){return St},h4:function(){return va},M6:function(){return c},i9:function(){return sl},aR:function(){return a},rJ:function(){return br},Oh:function(){return ul},hu:function(){return ll},rU:function(){return ue.r},Qj:function(){return K},nU:function(){return mr},SA:function(){return rr},sk:function(){return lt},Or:function(){return $r},T3:function(){return ya},g9:function(){return fl},Ex:function(){return eo},Gk:function(){return rn},tn:function(){return A},Ph:function(){return R},YE:function(){return pi},v7:function(){return bi},R6:function(){return Zs},tR:function(){return Vi},uw:function(){return Oe},qt:function(){return ei},iA:function(){return ma},GB:function(){return dt},po:function(){return hr},mZ:function(){return Ko},Pf:function(){return Yo}});var t=r(52322),h=r(60871),H=r(19928),f=r(2784);function W(e){const[o,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const N=u.alert$().subscribe(fe=>l(he=>he.concat(fe)));return()=>{N.unsubscribe()}},[u]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const N=setTimeout(()=>{l(fe=>{const he=fe.filter(Ce=>Ce!==U);return he.length===fe.length?fe:he})},j);return()=>clearTimeout(N)}},[U,j]),o.length===0)return null;const G=()=>{l(N=>N.filter(fe=>fe!==U))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:U.severity,children:_jsxs(Typography,{component:"span",children:[String(U.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=r(79692);const d=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function B(e){const{displayName:o,picture:l,customStyles:u}=e,m=d();let v={...u};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return l||(v={backgroundColor:stringToColor(o||""),...u}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:j,children:extractInitials(o)})})}var me=r(77277),ue=r(15332);const V=f.forwardRef((e,o)=>(0,t.jsx)(ue.r,{ref:o,...e,color:"initial"})),K=f.forwardRef((e,o)=>(0,t.jsx)(me.Z,{ref:o,component:V,...e})),I=null;var w=r(95544),se=r(60364),_=r(83229),te=r(26639),$=r(39595),T=r(61837),P=r(80030),L=r(19353),O=r(95074);function oe(e){const{text:o,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":m="Copy text"}=e,v=(0,h.h_)(h.VE),[j,U]=(0,f.useState)(!1),[{error:G},N]=(0,O.Z)();(0,f.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=he=>{he.stopPropagation(),U(!0),N(o)};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>U(!1),open:j,children:(0,t.jsx)(T.Z,{onClick:fe,"aria-label":m,children:(0,t.jsx)(L.Z,{})})})})}function Le(e){const{text:o,language:l,showLineNumbers:u=!1,highlightedNumbers:m,customStyle:v,showCopyCodeButton:j=!1}=e,U=(0,se.Z)(),G=U.palette.type==="dark"?te.Z:$.Z,N=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,t.jsxs)(w.Z,{position:"relative",children:[(0,t.jsx)(_.Z,{customStyle:v,language:l,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:N}}:{},children:o}),j&&(0,t.jsx)(w.Z,{position:"absolute",top:0,right:0,children:(0,t.jsx)(oe,{text:o})})]})}var Ve=r(41156),z=r(71597),xt=r(88188);function ot(e){const{title:o,to:l}=e,u=(0,Ve.Z)(m=>m.breakpoints.down("xs"));return l?u?(0,t.jsx)(T.Z,{component:z.rU,color:"primary",title:o,size:"small",to:l,children:(0,t.jsx)(xt.Z,{})}):(0,t.jsx)(me.Z,{component:z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Ye=r(27397),st=r(11105),Qe=r(97963),Ct=r(46506),Tt=r.n(Ct),bt=r(54073),it=r.n(bt),Pt;(function(e){let o;(function(v){v.TOP_BOTTOM="TB",v.BOTTOM_TOP="BT",v.LEFT_RIGHT="LR",v.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(v){v.UP_LEFT="UL",v.UP_RIGHT="UR",v.DOWN_LEFT="DL",v.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(v){v.NETWORK_SIMPLEX="network-simplex",v.TIGHT_TREE="tight-tree",v.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let m;(function(v){v.LEFT="l",v.RIGHT="r",v.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(Pt||(Pt={}));var Zt=r(10368);const Ke=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Xt({node:{id:e}}){const o=Ke(),[l,u]=f.useState(0),[m,v]=f.useState(0),j=f.useRef(null);f.useLayoutEffect(()=>{if(j.current){let{height:fe,width:he}=j.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==l)&&(u(he),v(fe))}},[l,m]);const U=10,G=l+U*2,N=m+U*2;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{className:o.node,width:G,height:N,rx:10}),(0,t.jsx)("text",{ref:j,className:o.text,y:N/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ge="arrow-marker",be="node",Ue="edge",nt="label",yt=(0,Zt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),gt=e=>(0,t.jsx)(Xt,{...e});function pt({render:e=gt,setNode:o,node:l}){const{width:u,height:m,x:v=0,y:j=0}=l,U=l,G=yt(),N=f.useRef(null);return f.useLayoutEffect(()=>{if(N.current){let{height:fe,width:he}=N.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==u)&&o(l.id,{...l,height:fe,width:he})}},[l,u,m,o]),(0,t.jsx)("g",{ref:N,"data-testid":be,className:G.node,transform:`translate(${v-u/2},${j-m/2})`,children:e({node:U})})}var Bt=r(76985),zt=r(39829),Kt=r(19574),$t=r.n(Kt);const qt=(0,Zt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function _t({edge:{label:e}}){const o=qt();return(0,t.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const mn=(0,Zt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),zn=e=>(0,t.jsx)(_t,{...e});function Bn({render:e=zn,setEdge:o,id:l,edge:u,curve:m}){const{x:v=0,y:j=0,width:U,height:G,points:N}=u,fe=u,he=mn(),Ce=f.useRef(null);f.useLayoutEffect(()=>{if(Ce.current){let{height:qe,width:Ut}=Ce.current.getBBox();qe=Math.round(qe),Ut=Math.round(Ut),(qe!==G||Ut!==U)&&o(l,{...u,height:qe,width:Ut})}},[u,G,U,o,l]);let Pe="";const ze=f.useMemo(()=>Bt.Z().x(qe=>qe.x).y(qe=>qe.y).curve(zt[m]),[m]);if(N){const qe=N.filter(Ut=>$t()(Ut.x)&&$t()(Ut.y));Pe=ze(qe)||""}return(0,t.jsxs)(t.Fragment,{children:[Pe&&(0,t.jsx)("path",{"data-testid":Ue,className:he.path,d:Pe}),fe.label?(0,t.jsx)("g",{ref:Ce,"data-testid":nt,className:he.label,transform:`translate(${v},${j})`,children:e({edge:fe})}):null]})}const vn="workspace";function $n(e){var o,l;const{edges:u,nodes:m,renderNode:v,direction:j=Pt.Direction.TOP_BOTTOM,align:U,nodeMargin:G=50,edgeMargin:N=10,rankMargin:fe=50,paddingX:he=0,paddingY:Ce=0,acyclicer:Pe,ranker:ze=Pt.Ranker.NETWORK_SIMPLEX,labelPosition:qe=Pt.LabelPosition.RIGHT,labelOffset:Ut=10,edgeRanks:un=1,edgeWeight:kn=1,renderLabel:nr,defs:Mt,zoom:hn="enabled",curve:pn="curveMonotoneX",fit:Rr="grow",...Ir}=e,Pr=(0,Qe.Z)(),[Lr,Li]=f.useState(100),[zr,Oi]=f.useState(100),nn=f.useRef(new(Tt()).graphlib.Graph),[wo,Ms]=f.useState(((o=nn.current.graph())===null||o===void 0?void 0:o.width)||0),[Wr,ki]=f.useState(((l=nn.current.graph())===null||l===void 0?void 0:l.height)||0),[Un,Cr]=f.useState([]),[Jr,Qr]=f.useState([]),fn=Math.max(wo,Lr),jn=Math.max(Wr,zr),jo=Math.min(Wr,zr),Xr=Rr==="grow"?jn:jo,rs=f.useMemo(()=>it()(xn=>{if(!xn)return;const Mn=st.Z(xn),gn=st.Z(xn.getElementById(vn));function fr(){Mn.call(Ye.sP().scaleExtent([1,10]).on("zoom",Or=>{Or.transform.x=Math.min(0,Math.max(Or.transform.x,fn-fn*Or.transform.k)),Or.transform.y=Math.min(0,Math.max(Or.transform.y,jn-jn*Or.transform.k)),gn.attr("transform",Or.transform)}))}hn==="enabled"?fr():hn==="enable-on-click"&&Mn.on("click",()=>fr());const{width:gr,height:zs}=xn.getBoundingClientRect();Lr!==gr&&Li(gr),zr!==zs&&Oi(zs)},100),[zr,Lr,fn,jn,hn]),Ea=f.useCallback(()=>{const xn=nn.current.nodes(),Mn=nn.current.edges();xn.forEach(gn=>{m.some(gr=>gr.id===gn)||nn.current.removeNode(gn)}),Mn.forEach(gn=>{u.some(gr=>gr.from===gn.v&&gr.to===gn.w)||nn.current.removeEdge(gn.v,gn.w)}),m.forEach(gn=>{const fr=nn.current.nodes().find(gr=>gn.id===gr);if(fr&&nn.current.node(fr)){const{width:gr,height:zs,x:Or,y:kl}=nn.current.node(fr);nn.current.setNode(fr,{...gn,width:gr,height:zs,x:Or,y:kl})}else nn.current.setNode(gn.id,{...gn,width:0,height:0})}),u.forEach(gn=>{nn.current.setEdge(gn.from,gn.to,{...gn,label:gn.label,width:0,height:0,labelpos:qe,labeloffset:Ut,weight:kn,minlen:un})})},[u,m,qe,Ut,kn,un]),os=f.useMemo(()=>it()(()=>{Tt().layout(nn.current);const{height:xn,width:Mn}=nn.current.graph(),gn=Math.max(0,xn||0),fr=Math.max(0,Mn||0);Ms(fr),ki(gn),Cr(nn.current.nodes()),Qr(nn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(nn.current.setGraph({rankdir:j,align:U,nodesep:G,edgesep:N,ranksep:fe,marginx:he,marginy:Ce,acyclicer:Pe,ranker:ze}),Ea(),os(),os.cancel),[Pe,U,j,N,he,Ce,G,fe,ze,Ea,os]);function Ll(xn,Mn){return nn.current.setNode(xn,Mn),os(),nn.current}function Ol(xn,Mn){return nn.current.setEdge(xn,Mn),os(),nn.current}return(0,t.jsxs)("svg",{ref:rs,...Ir,width:"100%",height:Xr,viewBox:`0 0 ${fn} ${jn}`,children:[(0,t.jsxs)("defs",{children:[(0,t.jsx)("marker",{id:ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,t.jsx)("path",{fill:Pr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Mt]}),(0,t.jsx)("g",{id:vn,children:(0,t.jsxs)("svg",{width:wo,height:Wr,y:jn/2-Wr/2,x:fn/2-wo/2,viewBox:`0 0 ${wo} ${Wr}`,children:[Jr.map(xn=>{const Mn=nn.current.edge(xn);return Mn?(0,t.jsx)(Bn,{id:xn,setEdge:Ol,render:nr,edge:Mn,curve:pn},`${xn.v}-${xn.w}`):null}),Un.map(xn=>{const Mn=nn.current.node(xn);return Mn?(0,t.jsx)(pt,{setNode:Ll,render:v,node:Mn},xn):null})]})})]})}var Dn=r(72779),en=r.n(Dn),En,Wn;const ft=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(En=e.palette.banner.closeButtonColor)!==null&&En!==void 0?En:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Wn=e.palette.banner.warning)!==null&&Wn!==void 0?Wn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Kn=e=>{const{variant:o,message:l,id:u,fixed:m=!1}=e,v=ft(),U=useApi(storageApiRef).forBucket("notifications");var G;const N=(G=U.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,he]=useState(new Set(N)),Ce=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(Ce!=null&&Ce.value){var ze;const qe=(ze=Ce==null?void 0:Ce.value)!==null&&ze!==void 0?ze:[];he(new Set(qe))}},[Ce==null?void 0:Ce.value]);const Pe=()=>{U.set("dismissedBanners",[...fe,u])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(u),classes:{root:classNames(v.root,!m&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:v.button,onClick:Pe,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Rt=r(60905),at=r(90436),bn=r.p+"static/missingAnnotation.67f79e98..svg",Gt=r.p+"static/noInformation.4b426325..svg",sn=r.p+"static/createComponent.975d1e1e..svg",An=r.p+"static/noBuild.1715fa71..svg";const cn=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),In=({missing:e})=>{const o=cn();switch(e){case"field":return(0,t.jsx)("img",{src:bn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,t.jsx)("img",{src:Gt,alt:"no Information",className:o.generalImg});case"content":return(0,t.jsx)("img",{src:sn,alt:"create Component",className:o.generalImg});case"data":return(0,t.jsx)("img",{src:An,alt:"no Build",className:o.generalImg});default:return null}},we=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ae(e){const{title:o,description:l,missing:u,action:m}=e,v=we();return(0,t.jsxs)(Rt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,t.jsx)(Rt.Z,{item:!0,xs:12,md:6,children:(0,t.jsxs)(Rt.Z,{container:!0,direction:"column",children:[(0,t.jsx)(Rt.Z,{item:!0,xs:!0,children:(0,t.jsx)(at.Z,{variant:"h5",children:o})}),(0,t.jsx)(Rt.Z,{item:!0,xs:!0,children:(0,t.jsx)(at.Z,{variant:"body1",children:l})}),(0,t.jsx)(Rt.Z,{item:!0,xs:!0,className:v.action,children:m})]})}),(0,t.jsx)(Rt.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,t.jsx)(In,{missing:u}):u.customImage})]})}const Be=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: example
|
|
5
|
-
description: example.com
|
|
6
|
-
annotations:
|
|
7
|
-
ANNOTATION: value
|
|
8
|
-
spec:
|
|
9
|
-
type: website
|
|
10
|
-
lifecycle: production
|
|
11
|
-
owner: user:guest`,Me=/^.*ANNOTATION.*$/m,_e=Be.match(Me)[0],ne=Be.split(`
|
|
12
|
-
`).findIndex(e=>Me.test(e)),Z=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function pe(e){return Array.from(Array(e+1).keys(),o=>o+ne)}function Ze(e){const o=e.map(l=>_e.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return Be.replace(_e,o)}function Xe(e){const o=e.length<=1;return(0,t.jsxs)(t.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,t.jsx)("code",{children:l})).reduce((l,u)=>(0,t.jsxs)(t.Fragment,{children:[l,", ",u]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function lt(e){const{annotation:o,readMoreUrl:l}=e,u=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=Z();return(0,t.jsx)(ae,{missing:"field",title:"Missing Annotation",description:Xe(u),action:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(at.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,t.jsx)(w.Z,{className:v.code,children:(0,t.jsx)(Le,{text:Ze(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:pe(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(me.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var Ot=r(11776),Ft=r(38402),X=r(49378),Y=r(41128),le=r(27616),ce=r(8284),ye=r(70660),Se=r(91750),y=r(38016);const M=(e,o)=>(o.palette.type==="light"?Y._j:Y.$n)(o.palette[e].light,.6),re=(e,o)=>(o.palette.type==="light"?Y.$n:Y._j)(o.palette[e].light,.9),q=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>M(o,e)}})),Te=({severity:e})=>{const o=q({severity:e});return(0,t.jsx)(Se.Z,{classes:o})},Ie=({severity:e})=>{const o=q({severity:e});return(0,t.jsx)(y.Z,{classes:o})},et=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>re(o,e),color:({severity:o})=>M(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>M(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>M(o,e),backgroundColor:({severity:o})=>re(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),wt=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function dt(e){const{severity:o="warning",title:l,message:u,children:m,defaultExpanded:v}=e,j=et({severity:o}),U=wt(o)+(l?`: ${l}`:"");return(0,t.jsxs)(le.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,t.jsxs)(ce.Z,{expandIcon:(0,t.jsx)(Ie,{severity:o}),className:j.summary,children:[(0,t.jsx)(Te,{severity:o}),(0,t.jsx)(at.Z,{className:j.summaryText,variant:"subtitle1",children:U})]}),(u||m)&&(0,t.jsx)(ye.Z,{children:(0,t.jsxs)(Rt.Z,{container:!0,children:[u&&(0,t.jsx)(Rt.Z,{item:!0,xs:12,children:(0,t.jsx)(at.Z,{className:j.message,variant:"body1",children:u})}),m&&(0,t.jsx)(Rt.Z,{item:!0,xs:12,className:j.details,children:m})]})})]})}const He=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),ut=({error:e,message:o,stack:l,children:u})=>{const m=He();return(0,t.jsxs)(Ot.Z,{dense:!0,children:[(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,t.jsx)(oe,{text:e})]}),(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,t.jsx)(oe,{text:o})]}),l&&(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,t.jsx)(oe,{text:l})]}),u]})};function St(e){const{title:o,error:l,defaultExpanded:u,children:m}=e;return(0,t.jsx)(dt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:u,children:(0,t.jsx)(ut,{error:l.name,message:l.message,stack:l.stack,children:m})})}var tt=r(85256);const Nt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function rn(e){var o;const{title:l,error:u,defaultExpanded:m}=e,v=Nt();if(u.name!=="ResponseError")return(0,t.jsx)(St,{title:l!=null?l:u.message,defaultExpanded:m,error:u});const{body:j,cause:U}=u,{request:G,response:N}=j,fe=`${N.statusCode}: ${U.name}`,he=G&&`${G.method} ${G.url}`,Ce=U.message.replace(/\\n/g,`
|
|
14
|
-
`),Pe=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),ze=JSON.stringify(j,void 0,2);return(0,t.jsxs)(St,{title:l!=null?l:u.message,defaultExpanded:m,error:{name:fe,message:Ce,stack:Pe},children:[he&&(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${he}`:void 0}),(0,t.jsx)(oe,{text:he})]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tt.Z,{component:"li",className:v.divider}),(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:(0,t.jsx)(X.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,t.jsx)(Le,{language:"json",text:ze,showCopyCodeButton:!0})]})]})}var Yt=r(28316);function Vt(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Dt(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function tn(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),v=m||Vt(e);return m||Dt(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Lt=null;const kt="core.calloutSeen";function dn(){const[e,o]=useState(()=>{const u=localStorage.getItem(kt);return u?JSON.parse(u):{}}),l=useCallback((u,m)=>{const v=localStorage.getItem(kt),U={...v?JSON.parse(v):{},[u]:m};o(U),localStorage.setItem(kt,JSON.stringify(U))},[]);return{states:e,setState:l}}function Sn(e){const{states:o,setState:l}=dn(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:u}}function Vn(e){const{seen:o,markSeen:l}=Sn(e);return{show:o===!1,hide:l}}const Yn=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function lr(e){const{featureId:o,title:l,description:u,children:m}=e,{show:v,hide:j}=useShowCallout(o),U=usePortal("core.callout"),G=useRef(null),[N,fe]=useState(),he=Yn(),Ce=useCallback(()=>{if(G.current){const Pe=G.current.getBoundingClientRect(),ze=Math.max(Pe.width,Pe.height),qe=800,Ut=Pe.x-(ze-Pe.width)/2-qe,un=Pe.y-(ze-Pe.height)/2-qe,kn=ze+2*qe,nr=450,Mt=Pe.x+Pe.width/2-nr,hn=Pe.y-(ze-Pe.height)/2+ze+20;fe({dotLeft:Ut,dotTop:un,dotSize:kn,borderWidth:qe,textTop:hn,textLeft:Mt,textWidth:nr})}},[]);return useEffect(()=>(window.addEventListener("resize",Ce),window.addEventListener("scroll",Ce),()=>{window.removeEventListener("resize",Ce),window.removeEventListener("scroll",Ce)}),[Ce]),useLayoutEffect(Ce,[G.current,Ce]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:he.featureWrapper,ref:G,children:m}),createPortal(_jsx(Box,{className:he.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:he.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx(Box,{className:he.pulseCircle})}),_jsxs(Box,{className:he.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:u})]})]})})}),U)]}):_jsx(_Fragment,{children:m})}var Tn=r(35292);const Zn=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function qn({color:e="primary",disabled:o=!1,href:l="#",icon:u=(0,t.jsx)(Tn.Z,{}),label:m,onClick:v,title:j}){const U=Zn();return o?(0,t.jsxs)(w.Z,{title:j,className:en()(U.link,U.disabled),children:[u,(0,t.jsx)(at.Z,{variant:"caption",component:"span",className:U.label,children:m})]}):(0,t.jsxs)(ue.r,{title:j,className:en()(U.link,U[e]),to:l,onClick:v,children:[u,(0,t.jsx)(at.Z,{variant:"caption",component:"span",className:U.label,children:m})]})}const S=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function c(e){const{links:o}=e,l=S();return(0,t.jsx)("nav",{className:l.links,children:o.map((u,m)=>(0,t.jsx)(qn,{...u},m+1))})}const b=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},E=100,J=10,xe=(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:E,height:`calc(100% + ${J}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-J,background:`linear-gradient(90deg, ${b(e.palette.type)})`},fadeRight:{right:-J,background:`linear-gradient(270deg, ${b(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Ee(e){const[[o,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){u([0,0]);return}const v=()=>{const j=m.scrollLeft,U=m.scrollWidth-m.offsetWidth-m.scrollLeft;u([j,U])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function ke(e,o,l){const[u,m]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=window.performance.now(),j=requestAnimationFrame(U=>{if(!e.current)return;const G=U-v,N=Math.abs(u)*G/o,he=Math.max(l,N)*Math.sign(u);e.current.scrollBy({left:he});const Ce=u-he;Math.sign(u)!==Math.sign(Ce)?m(0):m(Ce)});return()=>cancelAnimationFrame(j)},[e,u,o,l]),m}function ht(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:u=5,children:m,...v}=e,j=xe(e),U=React.useRef(),[G,N]=Ee(U),fe=ke(U,l,u),he=Ce=>{U.current&&fe(Ce?o:-o)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:U,children:m}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:N===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const mt=(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 yn(e){const o=mt(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const Nn=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function mr(e){const{Progress:o}=(0,h.qD)().getComponents();return(0,t.jsx)(f.Suspense,{fallback:(0,t.jsx)(o,{}),children:(0,t.jsx)(Nn,{...e})})}var kr=r(28865),Br=r(60251);const Eo=(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"}),qr=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(qr,e):e,vr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(qr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},wr={code:({inline:e,className:o,children:l,...u})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,t.jsx)(Le,{language:v[1],text:m}):(0,t.jsx)("code",{className:o,...u,children:l})},h1:vr,h2:vr,h3:vr,h4:vr,h5:vr,h6:vr};function rr(e){const{content:o,dialect:l="gfm",linkTarget:u,transformLinkUri:m,transformImageUri:v,className:j}=e,U=Eo();return(0,t.jsx)(kr.D,{remarkPlugins:l==="gfm"?[Br.Z]:[],className:`${U.markdown} ${j}`,children:o,components:wr,linkTarget:u,transformLinkUri:m,transformImageUri:v})}var Jn=r(23054);const jr=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),yr=({request:e,busy:o,setBusy:l})=>{const u=jr(),[m,v]=useState(),j=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var Ao=null;const To=(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 _r(e){const o=To(),[l,u]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var j;const U=(j=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&j!==void 0?j:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),N=()=>{G.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(G.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",children:"Login Required"}),U?_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:G.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:N,children:"Reject All"})})]})}var Ro=r(15277),Io=r.n(Ro),Vr=r(29862);const _n=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function $r(e){const[o,l]=(0,f.useState)(!1),u=(0,Vr.t)(),m=_n(),v=U=>{u()&&l(U)};var j;return(0,t.jsx)(P.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,t.jsx)(Io(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var Dr=r(67358);function eo(e){const o=(0,se.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>u(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,t.jsx)(Dr.Z,{...e,"data-testid":"progress"}):(0,t.jsx)(w.Z,{display:"none"})}var Er=r(94339),Hr=r(14503),Po=r(24579),to=r(32552),Cn=r(15459),no=r(27597);const ro=(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 oo(e){const{link:o,title:l,onClick:u}=e,m=ro();return(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(tt.Z,{}),(0,t.jsx)(ue.r,{to:o,onClick:u,underline:"none",children:(0,t.jsxs)(w.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,t.jsx)(w.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,t.jsx)(at.Z,{children:(0,t.jsx)("strong",{children:l})})}),(0,t.jsx)(no.Z,{className:m.arrow})]})})]})}const xr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,t.jsxs)(at.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,t.jsxs)(at.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,t.jsx)(K,{to:o.href,variant:"contained",children:o.name})},Lo=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:u}=this.state;return u?(0,t.jsx)(St,{title:"Something Went Wrong",error:u,children:(0,t.jsx)(xr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},so=(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"}),Oo=(0,Cn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Hr.Z),io={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function br(e){const{title:o,subheader:l,divider:u=!0,deepLink:m,slackChannel:v,errorBoundaryProps:j,variant:U,children:G,headerStyle:N,headerProps:fe,icon:he,action:Ce,actionsClassName:Pe,actions:ze,cardClassName:qe,actionsTopRight:Ut,className:un,noPadding:kn,titleTypographyProps:nr}=e,Mt=so();let hn={},pn={};U&&U.split(/[\s]+/g).forEach(Lr=>{hn={...hn,...io.card[Lr]},pn={...pn,...io.cardContent[Lr]}});const Rr=()=>!l&&!he?null:(0,t.jsxs)("div",{className:Mt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,t.jsx)("div",{className:Mt.subheader,children:l}),he]}),Ir=j||(v?{slackChannel:v}:{});return(0,t.jsx)(Er.Z,{style:hn,className:un,children:(0,t.jsxs)(Lo,{...Ir,children:[o&&(0,t.jsx)(to.Z,{classes:{root:Mt.header,title:Mt.headerTitle,subheader:Mt.headerSubheader,avatar:Mt.headerAvatar,action:Mt.headerAction,content:Mt.headerContent},title:o,subheader:Rr(),action:Ce,style:{...N},titleTypographyProps:nr,...fe}),Ut&&(0,t.jsx)(Oo,{children:Ut}),u&&(0,t.jsx)(tt.Z,{}),(0,t.jsx)(Po.Z,{className:en()(qe,{[Mt.noPadding]:kn}),style:pn,children:G}),ze&&(0,t.jsx)(Hr.Z,{className:Pe,children:ze}),m&&(0,t.jsx)(oo,{...m})]})})}var ss=r(39307);const ao=(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"}),cr={fractional:!0,inverse:!1,unit:"%",max:100},Ar=({palette:e,value:o,inverse:l,max:u})=>{if(isNaN(o))return"#ddd";const m=u||cr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function ko(e){const[o,l]=useState(null),{getColor:u=Ar}=e,m=ao(e),{palette:v}=useTheme(),{value:j,fractional:U,inverse:G,unit:N,max:fe,description:he}={...cr,...e},Ce=U?Math.round(j*fe):j,Pe=fe!==100?Math.round(j):Ce,[ze,qe]=useState(!1);return useEffect(()=>{const Ut=o,un=()=>qe(!0),kn=()=>qe(!1);return Ut&&he?(Ut.addEventListener("mouseenter",un),Ut.addEventListener("mouseleave",kn),()=>{Ut.removeEventListener("mouseenter",un),Ut.removeEventListener("mouseleave",kn)}):()=>{qe(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ce,strokeWidth:12,trailWidth:12,strokeColor:u({palette:v,value:Pe,inverse:G,max:fe}),className:m.circle}),he&&ze?_jsx(Box,{className:m.description,children:he}):_jsx(Box,{className:m.overlay,children:isNaN(j)?"N/A":`${Pe}${N}`})]})}const Qn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Ws(e){const o=Qn(e),{title:l,subheader:u,progress:m,inverse:v,deepLink:j,description:U,icon:G,variant:N,getColor:fe}=e,he={inverse:v,description:U,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:j,variant:N,icon:G,children:_jsx(Gauge,{...he})})})}function Bo(e){const{value:o,getColor:l=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:u,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var is=r(21324),as=r(7089),ls=r(1292),lo=r(42494),cs=r(74603),dr=r(56939),co=r(12231),$o=r(73698),Hn=r(12420),uo=r(72379);const Zr=(0,g.Z)(e=>(0,Hn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Do=()=>{const e=Zr();return(0,t.jsx)(uo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Zo=(0,g.Z)(e=>(0,Hn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var ho=()=>{const e=Zo();return(0,t.jsx)(uo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const x=(0,Cn.Z)(e=>(0,Hn.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"})(cs.Z),C=(0,g.Z)(e=>(0,Hn.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 R(e){const{multiple:o,items:l,label:u,placeholder:m,selected:v,onChange:j,triggerReset:U,native:G=!1,disabled:N=!1,margin:fe}=e,he=C(),[Ce,Pe]=(0,f.useState)(v||(o?[]:"")),[ze,qe]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Pe(o?[]:"")},[U,o]),(0,f.useEffect)(()=>{Pe(v||(o?[]:""))},[v,o]);const Ut=Mt=>{Pe(Mt.target.value),j(Mt.target.value)},un=Mt=>{if(N){Mt.preventDefault();return}qe(hn=>o&&!(Mt.target instanceof HTMLElement)?!0:!hn)},kn=()=>{qe(!1)},nr=Mt=>()=>{const hn=Ce.filter(pn=>pn!==Mt);Pe(hn),j(hn)};return(0,t.jsx)(w.Z,{className:he.root,children:(0,t.jsx)(ls.Z,{onClickAway:kn,children:(0,t.jsxs)(lo.Z,{className:he.formControl,children:[(0,t.jsx)(dr.Z,{className:he.formLabel,children:u}),(0,t.jsxs)($o.Z,{"aria-label":u,value:Ce,native:G,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Ut,onClick:un,open:ze,input:(0,t.jsx)(x,{}),label:u,tabIndex:0,renderValue:Mt=>{var hn;return o&&Ce.length!==0?(0,t.jsx)(w.Z,{className:he.chips,children:Mt.map(pn=>{var Rr,Ir;return(0,t.jsx)(as.Z,{label:(Rr=l.find(Pr=>Pr.value===pn))===null||Rr===void 0?void 0:Rr.label,clickable:!0,onDelete:nr(pn),className:he.chip},(Ir=l.find(Pr=>Pr.value===pn))===null||Ir===void 0?void 0:Ir.value)})}):(0,t.jsx)(at.Z,{children:Ce.length===0?m||"":(hn=l.find(pn=>pn.value===Mt))===null||hn===void 0?void 0:hn.label})},IconComponent:()=>ze?(0,t.jsx)(ho,{}):(0,t.jsx)(Do,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,t.jsx)(co.Z,{value:[],children:m}),G?l&&l.map(Mt=>(0,t.jsx)("option",{value:Mt.value,children:Mt.label},Mt.value)):l&&l.map(Mt=>(0,t.jsxs)(co.Z,{value:Mt.value,children:[o&&(0,t.jsx)(is.Z,{color:"primary",checked:Ce.includes(Mt.value)||!1,className:he.checkbox}),Mt.label]},Mt.value))]})]})})})}const D=()=>{},ee=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:D,stepHistory:[],setStepHistory:D,onStepChange:D});function de(e){const{children:o,elevated:l,onStepChange:u,activeStep:m=0}=e,[v,j]=useState(m),[U,G]=useState([0]);useEffect(()=>{j(m)},[m]);const N=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:N.push(he))}),_jsxs(_Fragment,{children:[_jsx(ee.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:U,setStepHistory:G,onStepChange:u,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:N})}),v>=Children.count(o)-1&&fe]})}const Q=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ve=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Ae=({text:e,handleClick:o,disabled:l,last:u,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(u?"Finish":"Next")}),Re=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:o,children:e||"Skip"}),Ne=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),Fe=({actions:e={},children:o})=>{const l=Q(),{stepperLength:u,stepIndex:m,setStepIndex:v,stepHistory:j,setStepHistory:U,onStepChange:G}=useContext(VerticalStepperContext),N=(Pe,ze)=>{ze&&ze(),G&&G(m,Pe),v(Pe)},fe=()=>{const Pe=e.nextStep?e.nextStep(m,u-1):m+1;N(Pe,e.onNext),U([...j,Pe])},he=()=>{j.pop(),N(j[j.length-1],e.onBack),U([...j])},Ce=()=>{N(0,e.onRestart),U([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(Ne,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Re,{text:e.skipText,handleClick:fe,disabled:!!u&&m>=u||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Ae,{text:e.nextText,handleClick:fe,disabled:!!u&&m>=u||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(ve,{text:e.restartText,handleClick:Ce,stepIndex:m}),o]})},rt=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function ct(e){const{title:o,children:l,end:u,actions:m,...v}=e,j=rt();return u?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const Ge=(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 $e(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Je(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Et(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function an(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Jt(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function on(e){const o=Ge(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var ln=r(74600),wn=r(15584);const Pn=e=>(0,Hn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Sr={root:{border:"0",verticalAlign:"top"}},Nr=e=>(0,Hn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Gr=e=>(0,Hn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ln=(0,Cn.Z)(Pn,{name:"BackstageMetadataTableTitleCell"})(wn.Z),Fn=(0,Cn.Z)(Sr,{name:"BackstageMetadataTableCell"})(wn.Z),Tr=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Vs=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ln,{children:e}),_jsx(Fn,{colSpan:e?1:2,...l,children:o})]}),hs=(0,Cn.Z)(Nr,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(Ot.Z,{disablePadding:!0,className:e.root,children:o})),Bi=(0,Cn.Z)(Gr,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,t.jsx)(Ft.Z,{className:e.root,children:o})),ps=(0,Hn.Z)({root:{margin:"0 0",listStyleType:"none"}}),fs=e=>(0,Hn.Z)({root:{...ps.root,paddingLeft:e.spacing(1)}}),er=(0,Cn.Z)(ps,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(hs,{classes:e,children:o})),tr=(0,Cn.Z)(fs,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,t.jsx)(hs,{classes:e,children:o}));function or(e,o){const l=e.map((u,m)=>_jsx(MetadataListItem,{children:Fo(u)},m));return o?_jsx(tr,{children:l}):_jsx(er,{children:l})}function No(e,o,l){const u=Object.keys(e).map(m=>{const v=Fo(e[m],!0),j=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},m)});return o?_jsx(tr,{children:u}):_jsx(er,{children:u})}function Fo(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?No(e,o,l):Array.isArray(e)?or(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Hs=({value:e,options:o})=>_jsx(Fragment,{children:Fo(e,o)}),Gs=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Hs,{value:o,options:l})});function Ks(e,o){return Object.keys(e).map(l=>_jsx(Gs,{title:l,value:e[l],options:o},l))}function Ys(e){const{metadata:o,dense:l=!0,options:u}=e,m=Ks(o,u||{});return _jsx(MetadataTable,{dense:l,children:m})}var gs=r(49429),Js=r(86136),ms=r(79784),Kr=r(76635),Qs=r(19126),Uo=r.n(Qs);function vs(e){return qs.stringify(e,{strictNullHandling:!0})}function ys(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function xs(e,o){return ys(e)[o]}function po(e,o,l){const u={...ys(e),[o]:l};return vs(u)}function Xs(e,o=250){const[l,u]=useSearchParams(),m=l.toString(),[v,j]=useState(xs(m,e));return useEffect(()=>{const U=xs(m,e);j(G=>isEqual(U,G)?G:U)},[m,j,e]),useDebouncedEffect(()=>{const U=po(m,e,v);m!==U&&u(U,{replace:!0})},[u,v,m,e],o),[v,j]}const _s={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 bs(){const o=(0,h.I_)().get(h.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return _s;var u;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((u=m.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var $i=r(80079);function Rn(e,o){const u=(0,h.qD)().getSystemIcon(e);return u?(0,t.jsx)(u,{...o}):(0,t.jsx)($i.Z,{...o})}function Di(e){return Rn("brokenImage",e)}function Gn(e){return Rn("catalog",e)}function Aa(e){return Rn("chat",e)}function Ta(e){return Rn("dashboard",e)}function Ra(e){return Rn("docs",e)}function Zi(e){return Rn("email",e)}function Ia(e){return Rn("github",e)}function Pa(e){return Rn("group",e)}function Fr(e){return Rn("help",e)}function Ni(e){return Rn("user",e)}function Mo(e){return Rn("warning",e)}const fo=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),go=({icon:e})=>{const o=(0,h.qD)();var l;const u=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Fr;return(0,t.jsx)(u,{})};var zo;const Ss=({link:e})=>(0,t.jsx)(ue.r,{to:e.url,children:(zo=e.title)!==null&&zo!==void 0?zo:e.url}),Cs=({item:e})=>{var o;return(0,t.jsxs)(Ft.Z,{children:[(0,t.jsx)(Js.Z,{children:(0,t.jsx)(go,{icon:e.icon})}),(0,t.jsx)(X.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,u,m)=>[...l,m>0&&(0,t.jsx)("br",{},m),(0,t.jsx)(Ss,{link:u},u.url)],[])})]})};function ei(e){const{title:o,items:l,children:u}=e,{items:m}=bs(),[v,j]=(0,f.useState)(!1),[U,G]=(0,f.useState)(null),N=fo(),fe=(0,Ve.Z)(Pe=>Pe.breakpoints.down("sm")),he=Pe=>{G(Pe.currentTarget),j(!0)},Ce=()=>{j(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{display:"flex",ml:1,children:fe?(0,t.jsx)(T.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,t.jsx)(Fr,{})}):(0,t.jsx)(me.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,t.jsx)(Fr,{}),children:"Support"})}),(0,t.jsxs)(ms.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ce,children:[(0,t.jsxs)(Ot.Z,{className:N.popoverList,children:[o&&(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:(0,t.jsx)(at.Z,{variant:"subtitle1",children:o})}),f.Children.map(u,(Pe,ze)=>(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:Pe},`child-${ze}`)),(l!=null?l:m).map((Pe,ze)=>(0,t.jsx)(Cs,{item:Pe},`item-${ze}`))]}),(0,t.jsx)(gs.Z,{children:(0,t.jsx)(me.Z,{color:"primary",onClick:Ce,"aria-label":"Close",children:"Close"})})]})]})}var Wo=r(18671),ur=r(73557),Vo=r(84800);const mo=72,ti=24,ws=18,hr={drawerWidthClosed:mo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:mo,iconSize:mo-ti*2,iconPadding:ti,selectedIndicatorWidth:3,userBadgePadding:ws,userBadgeDiameter:mo-ws*2,mobileSidebarHeight:56},Ho=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),js={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},ni=e=>({...js,...e}),ri="@backstage/core/sidebar-intro-dismissed",sr=(0,f.createContext)({sidebarConfig:hr,submenuConfig:js}),Es=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var oi=r(50023),si=r(4190),Fi=r(87685),ii=r(44882),vo=r(51837);const As={isOpen:!1,setOpen:()=>{}},Ts=(0,f.createContext)(As),Go=(0,vo.CT)("sidebar-open-state-context");function yo(e){const{children:o,value:l}=e;return(0,t.jsx)(Ts.Provider,{value:l,children:(0,t.jsx)(Go.Provider,{value:(0,vo.EI)({1:l}),children:o})})}const Ko=()=>{const e=(0,f.useContext)(Go),o=(0,f.useContext)(Ts);if(e===void 0)return o||As;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var ai=r(57998);const Rs={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Is=(0,f.createContext)(Rs),li=(0,vo.CT)("sidebar-pin-state-context");function xo(e){const{children:o,value:l}=e;return(0,t.jsx)(Is.Provider,{value:l,children:(0,t.jsx)(li.Provider,{value:(0,vo.EI)({1:l}),children:o})})}const Yo=()=>{const e=(0,f.useContext)(li),o=(0,f.useContext)(Is);if(e===void 0)return o||Rs;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ui=(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"}})),ci=e=>{const{to:o,label:l,icon:u,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(sr),j=Ui({sidebarConfig:v}),U=(0,ur.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:N}=(0,f.useContext)(Qo),fe=(Ce,Pe)=>{N(Pe===G?-1:Pe)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===U.pathname;return(0,t.jsx)(ai.Z,{"aria-label":l,label:l,icon:u,component:ue.r,to:o||U.pathname,onChange:fe,value:m,selected:he,classes:j})},Ps=e=>{const{children:o,to:l,label:u,icon:m,value:v}=e,{isMobile:j}=Yo();return j?(0,t.jsx)(ci,{to:l,label:u,icon:m,value:v}):(0,t.jsx)(t.Fragment,{children:o})},Jo=(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"},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`})})),Mi=e=>(0,Kr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),zi=f.createElement(Ps).type,Ls=({children:e,label:o="Menu",open:l,onClose:u})=>{const{sidebarConfig:m}=(0,f.useContext)(sr),v=Jo({sidebarConfig:m});return(0,t.jsxs)(si.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,t.jsxs)(w.Z,{className:v.overlayHeader,children:[(0,t.jsx)(at.Z,{variant:"h3",children:o}),(0,t.jsx)(T.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,t.jsx)(Fi.Z,{})})]}),(0,t.jsx)(w.Z,{component:"nav",children:e})]})},Qo=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),di=e=>{const{sidebarConfig:o}=(0,f.useContext)(sr),{children:l}=e,u=Jo({sidebarConfig:o}),m=(0,ur.TH)(),[v,j]=(0,f.useState)(-1);(0,f.useEffect)(()=>{j(-1)},[m.pathname]);let U=(0,h.vJ)(l,N=>N.getElements().filter(fe=>fe.type===zi));if(l)U.length?U=Mi(U):U.push((0,t.jsx)(Ps,{icon:(0,t.jsx)(ii.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!U[v].props.to;return(0,t.jsx)(yo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,t.jsxs)(Qo.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,t.jsx)(Ls,{label:U[v]&&U[v].props.label,open:G,onClose:()=>j(-1),children:U[v]&&U[v].props.children}),(0,t.jsx)(oi.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var bo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(bo||(bo={}));const Yr={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(bo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(bo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Wi=(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}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ui=(0,f.createContext)({content:{contentRef:void 0}});function Vi(e){const[o,l]=(0,f.useState)(()=>Yr.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(sr),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Yr.setSidebarPinState(o)},[o]);const j=(0,Ve.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),U=()=>l(!o),G=Wi({isPinned:o,sidebarConfig:u});return(0,t.jsx)(xo,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:j},children:(0,t.jsx)(ui.Provider,{value:v,children:(0,t.jsx)(w.Z,{className:G.root,children:e.children})})})}function hi(){const{content:e}=(0,f.useContext)(ui);return{focusContent:(0,f.useCallback)(()=>{var l,u;e==null||(l=e.contentRef)===null||l===void 0||(u=l.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Os=(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"}},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 Qt;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Qt||(Qt={}));const Hi=e=>{const{sidebarConfig:o}=(0,f.useContext)(sr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:u=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,j=Os({sidebarConfig:o}),U=(0,Ve.Z)(un=>un.breakpoints.down("md"),{noSsr:!0}),[G,N]=(0,f.useState)(Qt.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Ce}=Yo(),Pe=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Qt.Open&&!U&&(fe.current=window.setTimeout(()=>{fe.current=void 0,N(Qt.Open)},l),N(Qt.Idle)))},ze=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Qt.Idle?N(Qt.Closed):G===Qt.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,N(Qt.Closed)},u)))},qe=G===Qt.Open&&!U||he,Ut=un=>{un?(N(Qt.Open),Ce()):(N(Qt.Closed),Ce())};return(0,t.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,t.jsx)(Gi,{}),(0,t.jsx)(yo,{value:{isOpen:qe,setOpen:Ut},children:(0,t.jsx)(w.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Pe,onFocus:m?()=>{}:Pe,onMouseLeave:m?()=>{}:ze,onBlur:m?()=>{}:ze,children:(0,t.jsx)(w.Z,{className:en()(j.drawer,j.drawerWidth,{[j.drawerOpen]:qe}),children:v})})})]})},pi=e=>{var o;const l=Ho((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var u;const m=ni((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:j,openDelayMs:U,closeDelayMs:G}=e,{isMobile:N}=Yo();return N?(0,t.jsx)(di,{children:v}):(0,t.jsx)(sr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,t.jsx)(Hi,{openDelayMs:U,closeDelayMs:G,disableExpandOnHover:j,children:v})})};function Gi(){const{sidebarConfig:e}=(0,f.useContext)(sr),{focusContent:o,contentRef:l}=hi(),u=Os({sidebarConfig:e});return l!=null&&l.current?(0,t.jsx)(me.Z,{onClick:o,variant:"contained",className:en()(u.visuallyHidden),children:"Skip to content"}):null}function fi(e,o){const l=new URLSearchParams(o.search).toString(),u=Uo().parse(l),m=new URLSearchParams(e.search).toString(),v=Uo().parse(m);return(0,Kr.isEqual)(o.pathname,e.pathname)&&(0,Kr.isMatch)(v,u)}const Ki=(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"}),La=e=>{const{title:o,subtitle:l,to:u,icon:m,dropdownItems:v}=e,j=Ki(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),G=()=>{U(!1)},N=useResolvedPath(u!=null?u:""),fe=useLocation();let he=isLocationMatch(fe,N);const[Ce,Pe]=useState(!1),ze=()=>{Pe(!Ce)};return v!==void 0?(v.some(qe=>{const Ut=resolvePath(qe.to);return he=isLocationMatch(fe,Ut),he}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:ze,onTouchStart:qe=>qe.stopPropagation(),className:classnames(j.item,he?j.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]}),Ce?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&Ce&&_jsx(Box,{className:j.dropdown,children:v.map((qe,Ut)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:j.dropdownItem,onClick:G,onTouchStart:un=>un.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:qe.title})})},Ut))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(j.item,he?j.selected:void 0),onClick:G,onTouchStart:qe=>qe.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]})]})})})};var ks;const Yi=(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:(ks=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&ks!==void 0?ks:"#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"}),Ji=e=>{const{isOpen:o}=Ko(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(sr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=Yi({left:m,submenuConfig:u}),{isHoveredOn:j}=(0,f.useContext)(Es),[U,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(j)},[j]),(0,t.jsxs)(w.Z,{className:en()(v.drawer,{[v.drawerOpen]:U}),children:[(0,t.jsx)(at.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var Qi=r(26739),Xo=r(76600),Xi=r(83543),qi=r(59797),gi=r(98989);const Bs=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),_i=()=>{const e=Bs();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 ea=null;const mi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ta=()=>{const e=mi();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 na=null,qo,_o;const vi=e=>(0,g.Z)(o=>{var l,u;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:(qo=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&qo!==void 0?qo:"#404040"}},highlighted:{background:(_o=(u=o.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&_o!==void 0?_o:"#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 So(e){return(0,f.useMemo)(()=>vi(e),[e])()}const ra=(e,o)=>(0,h.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:j})=>u=u||fi(o,(0,Vo.i3)(j)));return}m&&(u=fi(o,(0,Vo.i3)(m)))}}),u},[o.pathname]);function $s(e){return e.to===void 0}const yi=f.createElement(Ji).type,oa=f.forwardRef(function({to:o,end:l,style:u,className:m,activeStyle:v,caseSensitive:j,activeClassName:U="active","aria-current":G="page",...N},fe){let{pathname:he}=(0,ur.TH)(),{pathname:Ce}=(0,ur.WU)(o);j||(he=he.toLocaleLowerCase("en-US"),Ce=Ce.toLocaleLowerCase("en-US"));let Pe=he===Ce;!Pe&&!l&&(Pe=he.startsWith(`${Ce}/`));const ze=Pe?G:void 0;return(0,t.jsx)(z.rU,{...N,to:o,ref:fe,"aria-current":ze,style:{...u,...Pe?v:void 0},className:en()([m,Pe?U:void 0])})}),Ds=(0,f.forwardRef)((e,o)=>{const{icon:l,text:u,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:U,children:G,className:N,...fe}=e,{sidebarConfig:he}=(0,f.useContext)(sr),Ce=So(he),{isOpen:Pe}=Ko(),ze=!Pe&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},qe=(0,t.jsxs)(w.Z,{style:ze,children:[(0,t.jsx)(l,{fontSize:"small"}),!Pe&&v?(0,t.jsx)(gi.Z,{fontSize:"small"}):(0,t.jsx)(t.Fragment,{})]}),Ut=(0,t.jsx)(Qi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:en()({[Ce.closedItemIcon]:!Pe}),children:qe}),un=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{"data-testid":"login-button",className:Ce.iconContainer,children:Ut}),u&&(0,t.jsx)(at.Z,{variant:"subtitle2",className:Ce.label,children:u}),(0,t.jsx)("div",{className:Ce.secondaryAction,children:G})]}),kn=Pe?un:Ut,nr={onClick:U,className:en()(N,Ce.root,Pe?Ce.open:Ce.closed,$s(e)&&Ce.buttonItem,{[Ce.highlightable]:!j})};return $s(e)?(0,t.jsx)(me.Z,{role:"button","aria-label":u,...nr,ref:o,children:kn}):(0,t.jsx)(oa,{...nr,activeClassName:Ce.selected,to:e.to?e.to:"",ref:o,"aria-label":u||e.to,...fe,children:kn})}),xi=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(sr),u=So(l),[m,v]=(0,f.useState)(!1),j=(0,ur.TH)(),U=ra(e,j),G=(0,Ve.Z)(Ce=>Ce.breakpoints.down("sm")),N=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,t.jsx)(qi.Z,{fontSize:"small",className:u.submenuArrow}):(0,t.jsx)(Xi.Z,{fontSize:"small",className:u.submenuArrow}):!m&&(0,t.jsx)(gi.Z,{fontSize:"small",className:u.submenuArrow});return(0,t.jsx)(Es.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,t.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:N,onMouseEnter:N,className:en()(m&&u.highlighted),children:[(0,t.jsx)(Ds,{hasSubmenu:!0,className:U?u.selected:"",...o,children:he()}),m&&e]})})},Zs=(0,f.forwardRef)((e,o)=>{const[l]=(0,h.vJ)(e.children,u=>u.getElements().filter(m=>m.type===yi));return l?(0,t.jsx)(xi,{...e,children:l}):(0,t.jsx)(Ds,{...e,ref:o})});function sa(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,u]=useState(""),m=So(o),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(l),u("")},U=he=>{he.key==="Enter"&&(he.preventDefault(),j())},G=he=>{u(he.target.value)},N=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{j(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Zs,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:N,onChange:G,onKeyDown:U,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const ia=(0,Xo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),aa=(0,Xo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),bi=(0,Xo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ir=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),la=(0,Xo.Z)("div")(({theme:e})=>{const o=ir(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),ca=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=So(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Si=(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 Ns(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Si({sidebarConfig:o}),{text:u,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:v,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Fs=e=>{const{text:o,onDismiss:l}=e,[u,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Ns,{text:o,onClose:v})})},Ci=null,wi="And your recently viewed plugins will pop up here!";function da(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=u!=null?u:{},U=()=>{m(N=>({...l,...N,starredItemsDismissed:!0}))},G=()=>{m(N=>({...l,...N,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Fs,{text:Ci,onDismiss:U}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Fs,{text:wi,onDismiss:G})]}):null}const ua=(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 Us(e){const{className:o,stretch:l,noPadding:u,children:m,...v}=e,{contentRef:j}=hi(),U=ua();return(0,t.jsx)("article",{ref:j,tabIndex:-1,...v,className:en()(U.root,o,{[U.stretch]:l,[U.noPadding]:u}),children:m})}var i=r(6487),n=r(99152);const s=(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 a(e){const{tabs:o,onChange:l,selectedIndex:u}=e,[m,v]=(0,f.useState)(u!=null?u:0),j=s(),U=(0,f.useCallback)((G,N)=>{u===void 0&&v(N),l&&u!==N&&l(N)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,t.jsx)(w.Z,{className:j.tabsWrapper,children:(0,t.jsx)(n.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:U,value:m,children:o.map((G,N)=>(0,f.createElement)(i.Z,{...G.tabProps,"data-testid":`header-tab-${N}`,label:G.label,key:G.id,value:N,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function p(e){const o=(0,ur.UO)(),u=e.map(({path:Ce,children:Pe})=>({caseSensitive:!1,path:`${Ce}/*`,element:Pe})).sort((Ce,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(Ce.path.replace(/\/\*$/,"")));var m;const v=(m=(0,ur.V$)(u))!==null&&m!==void 0?m:e[0].children;var j;let U=(j=o["*"])!==null&&j!==void 0?j:"";U.startsWith("/")||(U=`/${U}`);var G;const[N]=(G=(0,Vo.fp)(u,U))!==null&&G!==void 0?G:[],fe=N?e.findIndex(Ce=>`${Ce.path}/*`===N.route.path):0;var he;return{index:fe===-1?0:fe,element:v,route:(he=e[fe])!==null&&he!==void 0?he:e[0]}}function A(e){const{routes:o}=e,l=(0,ur.s0)(),{index:u,route:m,element:v}=p(o),j=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),U=G=>{let{path:N}=o[G];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),l(N)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{tabs:j,selectedIndex:u,onChange:U}),(0,t.jsxs)(Us,{children:[(0,t.jsx)(Wo.q,{title:m.title}),v]})]})}const k=()=>null;(0,h.R5)(k,"core.gatherMountPoints",!0);function F(e){const o=(0,t.jsx)(k,{path:"",title:"",children:(0,t.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return F(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:m,children:v,tabProps:j}=l.props;return[{path:u,title:m,children:v,tabProps:j}]})}function ie(e){const o=F(e.children);return(0,t.jsx)(A,{routes:o})}ie.Route=k;const je=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Oe(e){const{value:o,subvalue:l}=e,u=je();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{className:u.value,children:o}),(0,t.jsx)(w.Z,{className:u.subvalue,children:l})]})}var We=r(67222),vt=r(21070),At=r(90324),It=r(98281),Ht=r(48049),Wt=r(51209),On=r(33375),ar=r(44233),pr=r(27604),Ur=r(36444),ji=r(37971),Ei=r(59709),es=r(17373),Ai=r(3702),Mr=r(93111);const Oa=(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"}),ka=e=>{var o;const l=Oa(),{onChangeFilters:u}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[j,U]=(0,f.useState)(!1),G=()=>{v({}),U(N=>!N)};return(0,f.useEffect)(()=>{u(m)},[m,u]),(0,t.jsxs)(w.Z,{className:l.root,children:[(0,t.jsxs)(w.Z,{className:l.header,children:[(0,t.jsx)(w.Z,{className:l.value,children:"Filters"}),(0,t.jsx)(me.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,t.jsx)(w.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(N=>(0,t.jsx)(R,{triggerReset:j,...N.element,selected:m[N.element.label],onChange:fe=>v({...m,[N.element.label]:fe})},N.element.label))})]})},ha={Add:(0,f.forwardRef)((e,o)=>(0,t.jsx)(vt.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,t.jsx)(It.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,t.jsx)(On.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ar.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,t.jsx)(pr.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ai.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ur.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ji.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ei.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ht.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,t.jsx)(On.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ur.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,t.jsx)(At.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,t.jsx)(es.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Mr.Z,{...e,ref:o}))};function pa(e,o){const l=o.split(".");let u=e[l[0]];for(let m=1;m<l.length;++m){if(u===void 0)return u;const v=l[m];u=u[v]}return u}const Ba=(0,Cn.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}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(We.W$),fa=(0,Cn.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"})(We.UW),$a=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Da=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Za(e,o){return e.map(l=>{var u;const m=(u=l.headerStyle)!==null&&u!==void 0?u:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const j=v;v=(U,G,N)=>({...j(U,G,N),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Na(e,o){return(0,Kr.transform)(e,(l,u,m)=>{(0,Kr.isEqual)(u,o[m])||(l[m]=u)})}const ga={search:"",filtersOpen:!1,filters:{}};function Fa(e){const{toolbarRef:o,setSearch:l,hasFilters:u,selectedFiltersLength:m,toggleFilters:v}=e,j=$a(),U=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return u?(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsx)(T.Z,{onClick:v,"aria-label":"filter list",children:(0,t.jsx)(Ur.Z,{})}),(0,t.jsxs)(at.Z,{className:j.title,children:["Filters (",m,")"]})]}),(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:U})]}):(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:U})}function ma(e){const{data:o,columns:l,options:u,title:m,subtitle:v,filters:j,initialState:U,emptyContent:G,onStateChange:N,components:fe,...he}=e,Ce=Da(),Pe=(0,se.Z)(),ze={...ga,...U},[qe,Ut]=(0,f.useState)(ze.filtersOpen),un=(0,f.useCallback)(()=>Ut(Un=>!Un),[Ut]),[kn,nr]=(0,f.useState)(0),[Mt,hn]=(0,f.useState)(o),[pn,Rr]=(0,f.useState)(ze.filters),Ir=Za(l,Pe),[Pr,Lr]=(0,f.useState)(ze.search);(0,f.useEffect)(()=>{if(N){const Un=Na({search:Pr,filtersOpen:qe,filters:pn},ga);N(Un)}},[Pr,qe,pn,N]);const Li={headerStyle:{textTransform:"uppercase"}},zr=(0,f.useCallback)(Un=>{var Cr;return(Cr=l.find(Jr=>Jr.title===Un))===null||Cr===void 0?void 0:Cr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!pn){hn(o);return}const Un=Object.values(pn);if(o&&Un.flat().length){const Cr=o.filter(Jr=>!!Object.entries(pn).filter(([,Qr])=>!!Qr.length).every(([Qr,fn])=>{const jn=pa(Jr,zr(Qr));return Array.isArray(jn)&&Array.isArray(fn)?jn.some(jo=>fn.includes(jo)):Array.isArray(jn)?jn.includes(fn):Array.isArray(fn)?fn.includes(jn):jn===fn}));hn(Cr)}else hn(o);nr(Un.flat().length)},[o,pn,zr]);const Oi=(Un,Cr)=>{const Jr=fn=>{const jn=new Set,jo=Xr=>{Xr!=null&&jn.add(Xr)};return Cr&&Cr.forEach(Xr=>{const rs=pa(Xr,zr(fn));Array.isArray(rs)?rs.forEach(jo):jo(rs)}),jn},Qr=fn=>({placeholder:"All results",label:fn.column,multiple:fn.type==="multiple-select",items:[...Jr(fn.column)].sort().map(jn=>({label:jn,value:jn}))});return Un.map(fn=>({type:fn.type,element:Qr(fn)}))},nn=!!(j!=null&&j.length),wo=(0,f.useCallback)(Un=>(0,t.jsx)(Fa,{setSearch:Lr,hasFilters:nn,selectedFiltersLength:kn,toggleFilters:un,...Un}),[un,nn,kn,Lr]),Ms=typeof o!="function"&&o.length===0,Wr=l.length,ki=(0,f.useCallback)(Un=>G&&Ms?(0,t.jsx)("tbody",{children:(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:Wr,children:G})})}):(0,t.jsx)(We.os,{...Un}),[Ms,G,Wr]);return(0,t.jsxs)(w.Z,{className:Ce.root,children:[qe&&o&&typeof o!="function"&&(j==null?void 0:j.length)&&(0,t.jsx)(ka,{filters:Oi(j,o),selectedFilters:pn,onChangeFilters:Rr}),(0,t.jsx)(We.ZP,{components:{Header:Ba,Toolbar:wo,Body:ki,...fe},options:{...Li,...u},columns:Ir,icons:ha,title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(at.Z,{variant:"h5",component:"h2",children:m}),v&&(0,t.jsx)(at.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Mt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}ma.icons=Object.freeze(ha);var Bl=r(44311);function Ua(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 $l(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:Ua(e.data,o)})]})}const Ma=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"}),za=({title:e="Unknown page",className:o})=>(0,t.jsx)(at.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Wa(e){const{description:o,title:l,titleComponent:u=void 0,children:m,textAlign:v="left"}=e,j=Ma({textAlign:v})(),U=u||(0,t.jsx)(za,{title:l,className:j.title});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Wo.q,{title:l}),(0,t.jsxs)(w.Z,{className:j.container,children:[(0,t.jsxs)(w.Z,{className:j.leftItemsBox,children:[U,o&&(0,t.jsx)(at.Z,{className:j.description,variant:"body2",children:o})]}),(0,t.jsx)(w.Z,{className:j.rightItemsBox,children:m})]})]})}var Va=r.p+"static/mic-drop.fe3ef4d0..svg";const Ha=(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"}),Ga=()=>{const e=Ha();return(0,t.jsx)("img",{src:Va,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ka=(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 Ya(e){const{status:o,statusMessage:l,additionalInfo:u,supportUrl:m}=e,v=Ka(),j=(0,ur.s0)(),U=bs();return(0,t.jsxs)(Rt.Z,{container:!0,spacing:0,className:v.container,children:[(0,t.jsxs)(Rt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,t.jsxs)(at.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,t.jsx)(at.Z,{variant:"body1",className:v.subtitle,children:u}),(0,t.jsx)(at.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,t.jsxs)(at.Z,{variant:"h6",children:[(0,t.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,t.jsx)(ue.r,{to:m||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,t.jsx)(Ga,{})]})}var Ja=r(16173);const Qa=(0,Cn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(at.Z),Ti=(0,Cn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(w.Z);function Xa(e){const{children:o,...l}=e,[u,m]=f.useState(null),v=f.Children.toArray(o),[j,U,...G]=v,N=G.length?G.pop():v[v.length-1],fe=v.length>3,he=ze=>{m(ze.currentTarget)},Ce=()=>{m(null)},Pe=Boolean(u);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(Ja.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,t.jsx)(Ti,{clone:!0,children:j}),v.length>2&&(0,t.jsx)(Ti,{clone:!0,children:U}),fe&&(0,t.jsx)(Qa,{onClick:he,children:"..."}),(0,t.jsx)(w.Z,{style:{fontStyle:"italic"},children:N})]}),(0,t.jsx)(ms.ZP,{open:Pe,anchorEl:u,onClose:Ce,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)(Ot.Z,{children:G.map((ze,qe)=>(0,t.jsx)(Ft.Z,{button:!0,children:(0,t.jsx)(Ti,{clone:!0,children:ze})},qe))})})]})}const qa=(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"}),_a=({type:e,typeLink:o,classes:l,pageTitle:u})=>e?o?(0,t.jsxs)(Xa,{className:l.breadcrumb,children:[(0,t.jsx)(ue.r,{to:o,children:e}),(0,t.jsx)(at.Z,{children:u})]}):(0,t.jsx)(at.Z,{className:l.type,children:e}):null,el=({pageTitle:e,classes:o,tooltip:l})=>{const u=(0,t.jsx)(at.Z,{className:o.title,variant:"h1",children:e});return l?(0,t.jsx)(P.ZP,{title:l,placement:"top-start",children:u}):u},tl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,t.jsx)(t.Fragment,{children:o}):(0,t.jsx)(at.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function va(e){const{children:o,pageTitleOverride:l,style:u,subtitle:m,title:v,tooltip:j,type:U,typeLink:G}=e,N=qa(),he=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Ce=l||v,Pe=v||l,ze=`${Ce} | %s | ${he}`,qe=`${Ce} | ${he}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Wo.q,{titleTemplate:ze,defaultTitle:qe}),(0,t.jsxs)("header",{style:u,className:N.header,children:[(0,t.jsxs)(w.Z,{className:N.leftItemsBox,children:[(0,t.jsx)(_a,{classes:N,type:U,typeLink:G,pageTitle:Pe}),(0,t.jsx)(el,{classes:N,pageTitle:Pe,tooltip:j}),(0,t.jsx)(tl,{classes:N,subtitle:m})]}),(0,t.jsx)(Rt.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:o})]})]})}const nl=({label:e,secondaryLabel:o,icon:l,disabled:u=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:v=>{m&&m(v)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[u,m]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((j,U)=>_jsx(nl,{...j},`header-action-menu-${U}`))})})]})}const rl=(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,Y.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),ol=({value:e,className:o})=>(0,t.jsx)(at.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function sl(e){const{label:o,value:l,url:u}=e,m=rl(),v=(0,t.jsx)(ol,{className:m.value,value:l||"<Unknown>"});return(0,t.jsx)(Rt.Z,{item:!0,children:(0,t.jsxs)(at.Z,{component:"span",className:m.root,children:[(0,t.jsx)(at.Z,{className:m.label,children:o}),u?(0,t.jsx)(ue.r,{to:u,children:v}):v]})})}const il=e=>(0,Hn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),al=(0,g.Z)(il,{name:"BackstageItemCardHeader"});function ll(e){const{title:o,subtitle:l,children:u}=e,m=al(e);return(0,t.jsxs)(w.Z,{className:m.root,children:[l&&(0,t.jsx)(at.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,t.jsx)(at.Z,{variant:"h6",component:"h4",children:o}),u]})}function Zl(e){const{description:o,tags:l,title:u,type:m,subtitle:v,label:j,onClick:U,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((N,fe)=>_jsx(Chip,{size:"small",label:N},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:U,color:"primary",children:j}),G&&_jsx(LinkButton,{to:G,color:"primary",children:j})]})]})}const cl=e=>(0,Hn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),dl=(0,g.Z)(cl,{name:"BackstageItemCardGrid"});function ul(e){const{children:o,...l}=e,u=dl(l);return(0,t.jsx)(w.Z,{className:u.root,...l,children:o})}var hl=r(41547);const pl=(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%"}}}),{name:"BackstagePage"});function ya(e){const{themeId:o,children:l}=e,u=pl();return(0,t.jsx)(hl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,t.jsx)("main",{className:u.root,children:l})})}function fl(e){const{themeId:o,children:l,...u}=e;return(0,t.jsxs)(ya,{themeId:o,children:[(0,t.jsx)(va,{...u}),l]})}var Xn=r(30195);const Nl=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),xa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function gl(e){const o=new Date(Date.now()+xa.defaultTokenExpiryMillis);if(!e)return o;const[l,u,m]=e.split("."),v=JSON.parse(window.atob(u));return typeof v.exp!="number"?o:new Date(v.exp*1e3-xa.tokenExpiryMarginMillis)}class Fl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[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(u=>(this.state={type:"active",session:u,expiresAt:gl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});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,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,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:u},{execute:m}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},ml=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ri=({children:e})=>{const o=ml();return(0,t.jsx)(Rt.Z,{component:"li",item:!0,classes:o,children:e})};var ts=r(87612);class Ii{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 vl(e){const[o,l,u]=e.split(".");return JSON.parse(window.atob(l))}class Pi{getUserId(){return this.result.userId}static fromResult(o){return new Pi(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:u}=vl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}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,ts._)(this,"result",void 0),this.result=o}}class ns{static createGuest(){return new Ii}static fromLegacy(o){return Pi.fromResult(o)}static create(o){return new ns(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,u){(0,ts._)(this,"identity",void 0),(0,ts._)(this,"authApi",void 0),(0,ts._)(this,"profile",void 0),(0,ts._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=u}}const yl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:m,title:v,message:j}=e,U=(0,h.h_)(m),G=(0,h.h_)(h.VE),N=async()=>{try{o();const fe=await U.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await U.getProfile();l(ns.create({identity:fe.identity,profile:he,authApi:U}))}catch(fe){u(),G.post(new Jn.SP("Login failed",fe))}};return(0,t.jsx)(Ri,{children:(0,t.jsx)(br,{variant:"fullHeight",title:v,actions:(0,t.jsx)(me.Z,{color:"primary",variant:"outlined",onClick:N,children:"Sign In"}),children:(0,t.jsx)(at.Z,{variant:"body1",children:j})})})},loader:async(e,o)=>{const l=e.get(o),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const m=await l.getProfile();return ns.create({identity:u.identity,profile:m,authApi:l})}},xl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,t.jsx)(Ri,{children:(0,t.jsx)(br,{title:"Guest",variant:"fullHeight",actions:(0,t.jsx)(me.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ii)},children:"Enter"}),children:(0,t.jsxs)(at.Z,{variant:"body1",children:["Enter as a Guest User.",(0,t.jsx)("br",{}),"You will not have a verified identity,",(0,t.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ii};var bl=r(63955),ba=r(86619),Sa=r(74828),Sl=r(45455),Cl=r.n(Sl);const wl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,jl=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ca=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},El={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=jl(),{register:u,handleSubmit:m,formState:v}=(0,bl.cI)({mode:"onChange"}),{errors:j}=v,U=({userId:G,idToken:N})=>{e(),o(ns.fromLegacy({userId:G,getIdToken:N!==void 0?async()=>N:void 0,profile:{email:`${G}@example.com`}}))};return(0,t.jsx)(Ri,{children:(0,t.jsxs)(br,{title:"Custom User",variant:"fullHeight",children:[(0,t.jsxs)(at.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,t.jsx)("br",{}),"This selection will not be stored."]}),(0,t.jsxs)("form",{className:l.form,onSubmit:m(U),children:[(0,t.jsxs)(lo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(u("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(j.userId)}),j.userId&&(0,t.jsx)(Sa.Z,{error:!0,children:j.userId.message})]}),(0,t.jsxs)(lo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(u("idToken",{required:!1,validate:G=>!G||wl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(j.idToken)}),j.idToken&&(0,t.jsx)(Sa.Z,{error:!0,children:j.idToken.message})]}),(0,t.jsx)(me.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!Cl()(j),children:"Continue"})]})]})})},loader:async()=>{}},Co="@backstage/core:SignInPage:provider",wa={guest:xl,custom:El,common:yl};function ja(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,u)=>{if(typeof u=="string")return ja(u,l),l[u]={components:wa[u],id:u},l;const{id:m}=u;return ja(m,l),l[m]={components:wa.common,id:m,config:u},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),u=useApiHolder(),[m,v]=useState(!0),j=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var N;localStorage.removeItem(Co),await((N=G.signOut)===null||N===void 0?void 0:N.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const N=localStorage.getItem(Co);if(N===null){v(!1);return}const fe=e[N];if(!fe){v(!1);return}let he=!1;return fe.components.loader(u,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Ce=>{if(he){localStorage.removeItem(Co);return}Ce?j(Ce):v(!1)}).catch(Ce=>{localStorage.removeItem(Co),!he&&(l.post(Ce),v(!1))}),()=>{he=!0}},[m,l,o,u,e,j]);const U=useMemo(()=>Object.keys(e).map(G=>{const N=e[G],{Component:fe}=N.components,he=ze=>{j(ze)},Ce=()=>{var ze;localStorage.setItem(Co,(N==null||(ze=N.config)===null||ze===void 0?void 0:ze.id)||N.id)},Pe=()=>{localStorage.removeItem(Co)};return _jsx(fe,{config:N.config,onSignInStarted:Ce,onSignInSuccess:he,onSignInFailure:Pe},N.id)}),[e,j]);return[m,U]},Al=({onSignInSuccess:e,providers:o=[],title:l,align:u="left"})=>{const m=useApi(configApiRef),v=useStyles(),j=getSignInProviders(o),[U,G]=useSignInProviders(j,e);return U?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Tl=({provider:e,auto:o,onSignInSuccess:l})=>{const u=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[j,U]=useState(),[G,N]=useState(!1),fe=async({checkExisting:he,showPopup:Ce})=>{try{let Pe;if(he&&(Pe=await m.getBackstageIdentity({optional:!0})),!Pe&&(Ce||o)&&(N(!0),Pe=await m.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){N(!0);return}const ze=await m.getProfile();l(UserIdentity.create({identity:Pe.identity,authApi:m,profile:ze}))}catch(Pe){U(Pe),N(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,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}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Tl,{...e}):_jsx(Al,{...e})}const Rl=(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"}),Il=(0,Cn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(to.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:u,title:m,deepLink:v,value:j,onChange:U}=e,G=Rl(),[N,fe]=useState(0),he=U||((ze,qe)=>fe(qe));let Ce;j?React.Children.map(u,ze=>{if(React.isValidElement(ze)&&(ze==null?void 0:ze.props.value)===j){var qe;Ce=ze==null||(qe=ze.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(u,(ze,qe)=>{React.isValidElement(ze)&&qe===N&&(Ce=ze==null?void 0:ze.props.children)});const Pe=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[m&&_jsx(Il,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:j||N,onChange:he,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ce}),v&&_jsx(BottomLink,{...v})]})})}const Pl=(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,u=Pl();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(jt,De,r){"use strict";r.d(De,{fC:function(){return g},CL:function(){return Qe},sM:function(){return se},$v:function(){return Ve},v_:function(){return z},hg:function(){return xt},uB:function(){return Le},R5:function(){return nt},bq:function(){return O},Km:function(){return oe},Ds:function(){return ot},ni:function(){return w},T0:function(){return I},CO:function(){return at},x8:function(){return Dn},rx:function(){return In},YO:function(){return bn},P4:function(){return Rt},NT:function(){return Kt},NW:function(){return Ye},VE:function(){return st},W0:function(){return Ct},gP:function(){return Tt},IY:function(){return yt},F4:function(){return te},ux:function(){return T},Kp:function(){return _},$4:function(){return bt},p_:function(){return P},ZM:function(){return it},D:function(){return $},gW:function(){return L},E6:function(){return Pt},z$:function(){return Xt},h_:function(){return me},I_:function(){return B},qD:function(){return ge},vJ:function(){return An},tg:function(){return En},Oi:function(){return Wn}});var t=r(52322),h=r(51837),H=r(2784);const f=(0,h.CT)("analytics-context"),W=()=>{const we=(0,H.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ae=we.atVersion(1);if(ae===void 0)throw new Error("No context found for version 1.");return ae},g=we=>{const{attributes:ae,children:Be}=we,_e={...W(),...ae},ne=(0,h.EI)({1:_e});return(0,t.jsx)(f.Provider,{value:ne,children:Be})};function d(we,ae){const Be=Me=>_jsx(g,{attributes:ae,children:_jsx(we,{...Me})});return Be.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Be}function B(){const we=(0,h.Vt)("api-context");if(!we)throw new Error("API context is not available");const ae=we.atVersion(1);if(!ae)throw new Error("ApiContext v1 not available");return ae}function me(we){const Be=B().get(we);if(!Be)throw new Error(`No implementation available for ${we}`);return Be}function ue(we){return function(Be){const Me=ne=>{const Z=B(),pe={};for(const Ze in we)if(we.hasOwnProperty(Ze)){const Xe=we[Ze],lt=Z.get(Xe);if(!lt)throw new Error(`No implementation available for ${Xe}`);pe[Ze]=lt}return _jsx(Be,{...ne,...pe})},_e=Be.displayName||Be.name||"Component";return Me.displayName=`withApis(${_e})`,Me}}var V=r(87612);class K{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(ae){if((0,V._)(this,"config",void 0),this.config=ae,!ae.id.split(".").flatMap(Me=>Me.split("-")).every(Me=>Me.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ae.id}'`)}}function I(we){return new K(we)}function w(we,ae){return"id"in we?{api:we,deps:{},factory:()=>ae}:we}var se;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(se||(se={}));const _=I({id:"core.auth.google"}),te=I({id:"core.auth.github"}),$=I({id:"core.auth.okta"}),T=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),O=I({id:"core.auth.bitbucket"}),oe=I({id:"core.auth.bitbucket-server"}),Le=I({id:"core.auth.atlassian"}),Ve=I({id:"core.alert"}),z=I({id:"core.analytics"}),xt=I({id:"core.apptheme"}),ot=I({id:"core.config"}),Ye=I({id:"core.discovery"}),st=I({id:"core.error"});var Qe;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Qe||(Qe={}));const Ct=I({id:"core.featureflags"}),Tt=I({id:"core.fetch"}),bt=I({id:"core.identity"}),it=I({id:"core.oauthrequest"}),Pt=I({id:"core.storage"});class Zt{setContext(ae){this.context=ae}captureEvent(ae,Be,{value:Me,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:ae,subject:Be,value:Me,attributes:_e,context:this.context})}catch(ne){console.warn("Error during analytics event capture. %o",ne)}}constructor(ae,Be={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ae,this.context=Be}}function Ke(){try{return me(z)}catch{return{captureEvent:()=>{}}}}function Xt(){const we=(0,H.useRef)(null),ae=W(),Be=Ke();function Me(){return we.current===null&&(we.current=new Zt(Be)),we.current}const _e=Me();return _e.setContext(ae),_e}const ge=()=>{const we=(0,h.Vt)("app-context");if(!we)throw new Error("App context is not available");const ae=we.atVersion(1);if(!ae)throw new Error("AppContext v1 not available");return ae},be=(0,h.uW)("component-data-store",()=>new WeakMap),Ue="__backstage_data";function nt(we,ae,Be){const Me=we;var _e;let ne=(_e=Me[Ue])!==null&&_e!==void 0?_e:be.get(we);if(ne||(ne={map:new Map},Object.defineProperty(Me,Ue,{enumerable:!1,configurable:!0,writable:!1,value:ne}),be.set(we,ne)),ne.map.has(ae)){const Z=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${ae}" to component "${Z}"`)}ne.map.set(ae,Be)}function yt(we,ae){if(!we)return;const Be=we.type;if(!Be)return;var Me;const _e=(Me=Be[Ue])!==null&&Me!==void 0?Me:be.get(Be);if(_e)return _e.map.get(ae)}const gt=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let pt=gt,Bt=pt;class zt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ae,Be){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Bt,void 0),this.id=ae,this.params=Be,this[pt]="absolute"}}function Kt(we){var ae;return new zt(we.id,(ae=we.params)!==null&&ae!==void 0?ae:[])}const $t=/^\w+$/;let qt=null,_t=null;class mn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ae,Be,Me,_e){_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,_t,void 0),this.id=ae,this.path=Be,this.parent=Me,this.params=_e,this[qt]="sub"}}function zn(we){const{id:ae,path:Be,parent:Me}=we,_e=Be.split("/").filter(pe=>pe.startsWith(":")).map(pe=>pe.substring(1)),ne=[...Me.params,..._e];if(Me.params.some(pe=>_e.includes(pe)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Be.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Be}'`);if(Be.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Be}'`);for(const pe of _e)if(!$t.test(pe))throw new Error(`SubRouteRef path has invalid param, got '${pe}'`);return new mn(ae,Be,Me,ne)}let Bn=gt,vn=Bn;class $n{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ae,Be,Me){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,vn,void 0),this.id=ae,this.params=Be,this.optional=Me,this[Bn]="external"}}function Dn(we){var ae;return new $n(we.id,(ae=we.params)!==null&&ae!==void 0?ae:[],Boolean(we.optional))}var en=r(73557);function En(we){const{pathname:ae}=(0,en.TH)(),Be=(0,h.Vt)("routing-context");if(!Be)throw new Error("Routing context is not available");const Me=Be.atVersion(1),_e=(0,H.useMemo)(()=>Me&&Me.resolve(we,{pathname:ae}),[Me,we,ae]);if(!Be)throw new Error("useRouteRef used outside of routing context");if(!Me)throw new Error("RoutingContext v1 not available");const ne="optional"in we&&we.optional;if(!_e&&!ne)throw new Error(`No path for ${we}`);return _e}function Wn(we){return(0,en.UO)()}class ft extends H.Component{static getDerivedStateFromError(ae){return{error:ae}}render(){const{error:ae}=this.state,{app:Be,plugin:Me}=this.props,{ErrorBoundaryFallback:_e}=Be.getComponents();return ae?(0,t.jsx)(_e,{error:ae,resetError:this.handleErrorReset,plugin:Me}):this.props.children}constructor(...ae){super(...ae),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Kn=r(64355);function Rt(we){const{component:ae,mountPoint:Be,name:Me}=we;return bn({component:{lazy:()=>ae().then(_e=>{const ne=pe=>{try{En(Be)}catch(Ze){if(typeof Ze=="object"&&Ze!==null){const{message:Xe}=Ze;if(typeof Xe=="string"&&Xe.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Be} 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 Ze}return(0,t.jsx)(_e,{...pe})},Z=Me||_e.displayName||_e.name||"LazyComponent";return ne.displayName=`RoutableExtension(${Z})`,ne},_e=>Z=>{const pe=ge(),{BootErrorPage:Ze}=pe.getComponents();return(0,t.jsx)(Ze,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":Be},name:Me})}function at(we){const{component:ae,name:Be}=we;return bn({component:ae,name:Be})}function bn(we){const{data:ae={},name:Be}=we;Be||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Me;if("lazy"in we.component){const ne=we.component.lazy;Me=(0,H.lazy)(()=>ne().then(Z=>({default:Z})))}else Me=we.component.sync;const _e=Be||Me.displayName||Me.name||"Component";return{expose(ne){const Z=pe=>{const Ze=ge(),{Progress:Xe}=Ze.getComponents(),lt=ae==null?void 0:ae["core.mountPoint"];return(0,t.jsx)(H.Suspense,{fallback:(0,t.jsx)(Xe,{}),children:(0,t.jsx)(ft,{app:Ze,plugin:ne,children:(0,t.jsx)(g,{attributes:{pluginId:ne.getId(),...Be&&{extension:Be},...lt&&{routeRef:lt.id}},children:(0,t.jsx)(Kn.o,{plugin:ne,children:(0,t.jsx)(Me,{...pe})})})})})};nt(Z,"core.plugin",ne),nt(Z,"core.extensionName",Be);for(const[pe,Ze]of Object.entries(ae))nt(Z,pe,Ze);return Z.displayName=`Extension(${_e})`,Z}}}function Gt(we,ae,Be,Me){return H.Children.toArray(we).flatMap(_e=>{if(!(0,H.isValidElement)(_e))return[];if(_e.type===H.Fragment)return Gt(_e.props.children,ae,Be,Me);if(yt(_e,"core.featureFlagged")){const ne=_e.props;return("with"in ne?ae.isActive(ne.with):!ae.isActive(ne.without))?Gt(_e.props.children,ae,Be,Me):[]}if(Be===void 0||Be(_e))return[_e];if(Me)throw new Error(Me);return Gt(_e.props.children,ae,Be,Me)})}class sn{selectByComponentData(ae){const Be=Gt(this.node,this.featureFlagsApi,Me=>yt(Me,ae.key)!==void 0,ae.withStrictError);return new sn(Be,this.featureFlagsApi)}findComponentData(ae){return Gt(this.node,this.featureFlagsApi,Me=>yt(Me,ae.key)!==void 0).map(Me=>yt(Me,ae.key)).filter(Me=>Me!==void 0)}getElements(){return Gt(this.node,this.featureFlagsApi)}constructor(ae,Be){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ae,this.featureFlagsApi=Be}}function An(we,ae,Be=[]){const Me=me(Ct),_e=new sn(we,Me);return(0,H.useMemo)(()=>ae(_e),[we,...Be])}class cn{getId(){return this.config.id}getApis(){var ae;return(ae=this.config.apis)!==null&&ae!==void 0?ae:[]}getFeatureFlags(){var ae,Be;return(Be=(ae=this.config.featureFlags)===null||ae===void 0?void 0:ae.slice())!==null&&Be!==void 0?Be:[]}get routes(){var ae;return(ae=this.config.routes)!==null&&ae!==void 0?ae:{}}get externalRoutes(){var ae;return(ae=this.config.externalRoutes)!==null&&ae!==void 0?ae:{}}provide(ae){return ae.expose(this)}__experimentalReconfigure(ae){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ae))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ae;return(ae=this.options)!==null&&ae!==void 0?ae:{}}toString(){return`plugin{${this.config.id}}`}constructor(ae){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ae,this.options=void 0}}function In(we){return new cn(we)}},64355:function(jt,De,r){"use strict";r.d(De,{o:function(){return W},y:function(){return g}});var t=r(52322),h=r(51837),H=r(2784);const f="plugin-context",W=d=>{const{children:B,plugin:me}=d,{Provider:ue}=(0,h.CT)(f);return(0,t.jsx)(ue,{value:(0,h.EI)({1:{plugin:me}}),children:B})};function g(){const d=(0,h.Vt)(f);if(!d)throw new Error("Plugin Options context is not available");const B=d.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(jt,De,r){"use strict";r.d(De,{SP:function(){return _},dR:function(){return K},VL:function(){return $},BD:function(){return h}});function t(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const P=T;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function h(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const P=T;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var H=r(87612),f=r(24852);function W(T,P){const O={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return P!=null&&P.includeStack||delete O.stack,O}function g(T){const P=(0,f.deserializeError)(T);return T.stack||(P.stack=void 0),P}function d(T){if(t(T)){const P=String(T);return P!=="[object Object]"?P:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(P,L){var O;let oe=P;if(L!==void 0){const Le=d(L);oe?oe+=`; caused by ${Le}`:oe=`caused by ${Le}`}super(oe),(0,H._)(this,"cause",void 0),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=t(L)?L:void 0}}class me extends null{}class ue extends null{}class V extends null{}class K extends B{}class I extends null{}class w extends null{}class se extends null{}class _ extends B{constructor(P,L){super(P,L),this.name=t(L)?L.name:"Error"}}async function te(T){try{const L=await T.text();if(L){var P;if(!((P=T.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const O=JSON.parse(L);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class $ extends Error{static async fromResponse(P){const L=await te(P),O=L.response.statusCode||P.status,oe=L.error.name||P.statusText,Le=`Request failed with ${O} ${oe}`,Ve=g(L.error);return new $({message:Le,response:P,data:L,cause:Ve})}constructor(P){super(P.message),(0,H._)(this,"response",void 0),(0,H._)(this,"body",void 0),(0,H._)(this,"cause",void 0),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(jt,De,r){"use strict";r.d(De,{nW:function(){return _},ae:function(){return V},q3:function(){return K}});var t=r(60871);const h=(0,t.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials($){const T=new URL($.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(T));if(!P)throw new Error(`No auth provider available for '${$.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials($)}constructor($){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,$)}}var W=new WeakMap,g=new WeakMap,d=new WeakMap,B=new WeakMap;class me{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:$,gitlab:T,azure:P,bitbucket:L})=>me.merge(me.forGithub($),me.forGitlab(T),me.forAzure(P),me.forBitbucket(L))})}static forAuthApi($,T){return new me("generic",$,T.host,T.scopeMapping)}static forGithub($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"github.com";return new me("github",$,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"gitlab.com";return new me("gitlab",$,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"dev.azure.com";return new me("azure",$,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"bitbucket.org";return new me("bitbucket",$,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...$){return new f($)}isUrlSupported($){return $.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider($){var T;if(!($!=null&&$.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(T=$.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials($){const{url:T,additionalScope:P,...L}=$,O=_class_private_field_get(this,d).default.slice();P!=null&&P.repoWrite&&O.push(..._class_private_field_get(this,d).repoWrite);const oe=this.getAdditionalScopesForProvider(P);oe.length&&O.push(...oe);const Le=[...new Set(O)],Ve=await _class_private_field_get(this,W).getAccessToken(Le,L);return{token:Ve,headers:{Authorization:`Bearer ${Ve}`}}}constructor($,T,P,L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,d,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,T),_class_private_field_set(this,g,P),_class_private_field_set(this,d,L),_class_private_field_set(this,B,$)}}var ue=r(79158);class V{static fromConfig($){return ue.Lx.fromConfig($)}}const K=(0,t.T0)({id:"integration.scmintegrations"});var I=r(52322),w=r(73250),se=r(2784);const _=te=>{const{type:$}=te,T=(0,t.qD)(),P=w.Z;var L;const O=$&&(L=T.getSystemIcon($))!==null&&L!==void 0?L:P;return(0,I.jsx)(O,{})}},79158:function(jt,De,r){"use strict";r.d(De,{Lx:function(){return qn},BT:function(){return St}});var t=r(87612),h=r(82717),H=r.n(h),f=r(76635);function W(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 d(S,c){return{list(){return S},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return S.find(J=>c(J)===E.host)}catch{return}},byHost(b){return S.find(E=>c(E)===b)}}}function B(S){const{url:c,base:b,lineNumber:E}=S;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:xe}=H()(b);J=new URL(b);const Ee=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-xe.length),"/");J.pathname=`${Ee}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,E&&(J.hash=`L${E}`),J.toString()}function me(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const E=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,xe;if(c){try{const yn=new URL(c);J=yn.host,xe=yn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(xe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=ue;const Ee=S.getOptionalString("accessKeyId"),ke=S.getOptionalString("secretAccessKey"),ht=S.getOptionalString("roleArn"),mt=S.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:E,accessKeyId:Ee,secretAccessKey:ke,roleArn:ht,externalId:mt}}function K(S){const c=S.map(V);return c.some(b=>b.host===ue)||c.push({host:ue}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(I,"factory",({config:S})=>{var c;const b=K((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new I(E)),E=>E.config.host)});var w=r(88412),se=r(50629),_=r(80956);const te="GB";var $=new WeakMap,T=new WeakMap,P=new WeakMap,L=new WeakMap,O=new WeakMap,oe=new WeakMap,Le=new WeakMap;class Ve{static fromRepoUrl(c){const b=new URL(c);let E,J,xe;const Ee=b.pathname.split("/").map(Nn=>decodeURIComponent(Nn));if(Ee[2]==="_git"?(E=Ee[1],J=xe=Ee[3]):Ee[3]==="_git"?(E=Ee[1],J=Ee[2],xe=Ee[4]):Ee[4]==="_git"&&(E=`${Ee[1]}/${Ee[2]}`,J=Ee[3],xe=Ee[5]),!E||!J||!xe)throw new Error("Azure URL must point to a git repository");var ke;const ht=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let mt;const yn=b.searchParams.get("version");if(yn){if(yn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");mt=yn.slice(2)}return new Ve(b.origin,E,J,xe,ht,mt)}toRepoUrl(){let c;return(0,w._)(this,P)===(0,w._)(this,L)?c=(0,w._)(this,Le).call(this,(0,w._)(this,T),"_git",(0,w._)(this,L)):c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_git",(0,w._)(this,L)),(0,w._)(this,O)&&c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",te+(0,w._)(this,oe)),c.toString()}toFileUrl(){if(!(0,w._)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toArchiveUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,w._)(this,O)&&c.searchParams.set("scopePath",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toCommitsUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,w._)(this,oe)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,w._)(this,oe)),c.toString()}getOwner(){return(0,w._)(this,T)}getProject(){return(0,w._)(this,P)}getRepo(){return(0,w._)(this,L)}getPath(){return(0,w._)(this,O)}getRef(){return(0,w._)(this,oe)}constructor(c,b,E,J,xe,Ee){(0,se._)(this,$,{writable:!0,value:void 0}),(0,se._)(this,T,{writable:!0,value:void 0}),(0,se._)(this,P,{writable:!0,value:void 0}),(0,se._)(this,L,{writable:!0,value:void 0}),(0,se._)(this,O,{writable:!0,value:void 0}),(0,se._)(this,oe,{writable:!0,value:void 0}),(0,se._)(this,Le,{writable:!0,value:(...ke)=>{const ht=new URL((0,w._)(this,$));return ht.pathname=ke.map(mt=>encodeURIComponent(mt)).join("/"),ht}}),(0,_._)(this,$,c),(0,_._)(this,T,b),(0,_._)(this,P,E),(0,_._)(this,L,J),(0,_._)(this,O,xe),(0,_._)(this,oe,Ee)}}const z="dev.azure.com";function xt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:z,E=S.getOptionalString("token");if(!W(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:E}}function ot(S){const c=S.map(xt);return c.some(b=>b.host===z)||c.push({host:z}),c}class Ye{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E}=c;if(g(b))return b;try{const xe=Ve.fromRepoUrl(E),Ee=new URL(E);var J;const ke=new URL(`https://a.com${(J=xe.getPath())!==null&&J!==void 0?J:""}`),ht=new URL(b,ke).pathname;return Ee.searchParams.set("path",ht),c.lineNumber&&(Ee.searchParams.set("line",String(c.lineNumber)),Ee.searchParams.set("lineEnd",String(c.lineNumber+1)),Ee.searchParams.set("lineStartColumn","1"),Ee.searchParams.set("lineEndColumn","1")),Ee.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ye,"factory",({config:S})=>{var c;const b=ot((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new Ye(E)),E=>E.config.host)});var st=r(48834).lW;function Qe(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function Ct(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function Tt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function bt(S,c){const b=c?{...c}:{};if(S.token){const E=st.from(`:${S.token}`,"utf8");b.Authorization=`Basic ${E.toString("base64")}`}return{headers:b}}const it="bitbucket.org",Pt="https://api.bitbucket.org/2.0";function Zt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:it;let E=S.getOptionalString("apiBaseUrl");const J=S.getOptionalString("token"),xe=S.getOptionalString("username"),Ee=S.getOptionalString("appPassword");if(!W(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):b===it?E=Pt:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:J,username:xe,appPassword:Ee}}function Ke(S){const c=S.map(Zt);return c.some(b=>b.host===it)||c.push({host:it,apiBaseUrl:Pt}),c}class Xt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(!c.lineNumber)return b;const E=new URL(b);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const b=H()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Xt,"factory",({config:S})=>{var c,b,E;const J=Ke((E=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return d(J.map(xe=>new Xt(xe)),xe=>xe.config.host)});var ge=r(96279),be=r(48834).lW;async function Ue(S,c){const{name:b,owner:E,resource:J}=parseGitUrl(S),xe=J==="bitbucket.org";let Ee=xe?`${c.apiBaseUrl}/repositories/${E}/${b}`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ke=await fetch(Ee,gt(c));if(ke.status===404&&!xe&&(Ee=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ke=await fetch(Ee,gt(c))),!ke.ok){const mt=`Failed to retrieve default branch from ${Ee}, ${ke.status} ${ke.statusText}`;throw new Error(mt)}let ht;if(xe)ht=(await ke.json()).mainbranch.name;else{const{displayId:mt}=await ke.json();ht=mt}if(!ht)throw new Error(`Failed to read default branch from ${Ee}. Response ${ke.status} ${ke.json()}`);return ht}async function nt(S,c){const{name:b,owner:E,ref:J,protocol:xe,resource:Ee,filepath:ke}=parseGitUrl(S),ht=Ee==="bitbucket.org";let mt=J;mt||(mt=await Ue(S,c));const yn=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return ht?`${xe}://${Ee}/${E}/${b}/get/${mt}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${mt}&prefix=${E}-${b}${yn}`}function yt(S,c){try{const{owner:b,name:E,ref:J,filepathtype:xe,filepath:Ee}=parseGitUrl(S);if(!b||!E||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=Ee.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function gt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=be.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const pt="bitbucket.org",Bt="https://api.bitbucket.org/2.0";function zt(S){const c=pt,b=Bt,E=S.getString("username"),J=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:E,appPassword:J}}function Kt(S){const c=S.map(zt);return c.length===0&&c.push({host:pt,apiBaseUrl:Bt}),c}class $t{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const E=new URL(b);return E.hash=`lines-${c.lineNumber}`,E.toString()}return b}resolveEditUrl(c){const b=H()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)($t,"factory",({config:S})=>{var c;const b=Kt((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new $t(E)),E=>E.config.host)});var qt=r(48834).lW;async function _t(S,c){const{name:b,owner:E}=parseGitUrl(S),J=`${c.apiBaseUrl}/repositories/${E}/${b}`,xe=await fetch(J,Bn(c));if(!xe.ok){const ht=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(ht)}const ke=(await xe.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return ke}async function mn(S,c){const{name:b,owner:E,ref:J,protocol:xe,resource:Ee}=parseGitUrl(S);let ke=J;return ke||(ke=await _t(S,c)),`${xe}://${Ee}/${E}/${b}/get/${ke}.tar.gz`}function zn(S,c){try{const{owner:b,name:E,ref:J,filepathtype:xe,filepath:Ee}=parseGitUrl(S);if(!b||!E||xe!=="src"&&xe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=Ee.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Bn(S){const c={};if(S.username&&S.appPassword){const b=qt.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function vn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token"),J=S.getOptionalString("username"),xe=S.getOptionalString("password");if(!W(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:E,username:J,password:xe}}function $n(S){return S.map(vn)}class Dn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const E=new URL(b);return E.hash=c.lineNumber.toString(),E.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Dn,"factory",({config:S})=>{var c;const b=$n((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new Dn(E)),E=>E.config.host)});var en=r(48834).lW;async function En(S,c){const{name:b,owner:E}=parseGitUrl(S);let J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,xe=await fetch(J,Kn(c));if(xe.status===404&&(J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,xe=await fetch(J,Kn(c))),!xe.ok){const ht=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(ht)}const{displayId:Ee}=await xe.json(),ke=Ee;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return ke}async function Wn(S,c){const{name:b,owner:E,ref:J,filepath:xe}=parseGitUrl(S);let Ee=J;Ee||(Ee=await En(S,c));const ke=xe?`&path=${encodeURIComponent(decodeURIComponent(xe))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${Ee}&prefix=${E}-${b}${ke}`}function ft(S,c){try{const{owner:b,name:E,ref:J,filepathtype:xe,filepath:Ee}=parseGitUrl(S);if(!b||!E||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=Ee.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Kn(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=en.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Rt(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),E=S.getOptionalString("cloneUrl"),J=S.getOptionalString("gitilesBaseUrl");const xe=S.getOptionalString("username"),Ee=S.getOptionalString("password");if(W(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(J&&!g(J))throw new Error(`Invalid Gerrit integration config, '${J}' 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}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=b,{host:c,baseUrl:b,cloneUrl:E,gitilesBaseUrl:J,username:xe,password:Ee}}function at(S){return S.map(Rt)}var bn=r(48834).lW;const Gt=")]}'";function sn(S,c){const E=c.replace(S.gitilesBaseUrl,"").split("/").filter(mt=>!!mt),J=E.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${c}`);const xe=(0,f.trimStart)(E.slice(0,J).join("/"),"/"),Ee=E.indexOf("heads");if(Ee<=0)throw new Error(`Unable to parse branch from url: ${c}`);const ke=E[Ee+1],ht=E.slice(Ee+2).join("/");return{branch:ke,filePath:ht===""?"/":ht,project:xe}}function An(S,c,b,E){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(E,"/")}`}function cn(S){return S.password?"/a/":"/"}function In(S,c){const{branch:b,project:E}=sn(S,c);return`${S.baseUrl}${cn(S)}projects/${encodeURIComponent(E)}/branches/${b}`}function we(S,c){const{project:b}=sn(S,c);return`${S.cloneUrl}${cn(S)}${b}`}function ae(S,c){const{branch:b,filePath:E,project:J}=sn(S,c);return`${S.baseUrl}${cn(S)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function Be(S){return`${S.baseUrl}${cn(S)}projects/`}function Me(S){const c={};if(!S.password)return c;const b=bn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function _e(S){const c=await S.text();if(c.startsWith(Gt))try{return JSON.parse(c.slice(Gt.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 ne{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E,lineNumber:J}=c;let xe;if(b.startsWith("/")){const{branch:Ee,project:ke}=sn(this.config,E);return An(this.config,ke,Ee,b)}return b?xe=new URL(b,E):xe=new URL(E),J&&(xe.hash=J.toString()),xe.toString()}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(ne,"factory",({config:S})=>{var c;const b=at((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new ne(E)),E=>E.config.host)});function Z(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const E=S.getOptionalString("username"),J=S.getOptionalString("password");if(!W(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:E,password:J}}var pe=r(48834).lW;function Ze(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,xe,Ee,ke,ht,mt,...yn]=c.replace(E,"").split("/"),Nn=yn.join("/").replace(/^\//,"");return`${E}/${xe}/${Ee}/_edit/${mt}/${Nn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function Xe(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,xe,Ee,ke,ht,mt,...yn]=c.replace(E,"").split("/"),Nn=yn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${xe}/${Ee}/contents/${Nn}?ref=${mt}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function lt(S){const c={},{username:b,password:E}=S;return E?(b?c.Authorization=`basic ${pe.from(`${b}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class Ot{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return Ze(this.config,c)}constructor(c){(0,t._)(this,"config",void 0),this.config=c}}(0,t._)(Ot,"factory",({config:S})=>{var c;const E=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Z(J));return d(E.map(J=>new Ot(J)),J=>J.config.host)});const Ft="github.com",X="https://api.github.com",Y="https://raw.githubusercontent.com";function le(S){var c,b;const E=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Ft;let J=S.getOptionalString("apiBaseUrl"),xe=S.getOptionalString("rawBaseUrl");const Ee=S.getOptionalString("token"),ke=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(ht=>({appId:ht.getNumber("appId"),clientId:ht.getString("clientId"),clientSecret:ht.getString("clientSecret"),webhookSecret:ht.getString("webhookSecret"),privateKey:ht.getString("privateKey"),allowedInstallationOwners:ht.getOptionalStringArray("allowedInstallationOwners")}));if(!W(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):E===Ft&&(J=X),xe?xe=(0,f.trimEnd)(xe,"/"):E===Ft&&(xe=Y),{host:E,apiBaseUrl:J,rawBaseUrl:xe,token:Ee,apps:ke}}function ce(S){const c=S.map(le);return c.some(b=>b.host===Ft)||c.push({host:Ft,apiBaseUrl:X,rawBaseUrl:Y}),c}function ye(S,c,b){try{const{owner:E,name:J,ref:xe,filepathtype:Ee,filepath:ke}=parseGitUrl(S);if(!E||!J||!xe||Ee!=="blob"&&Ee!=="raw"&&Ee!=="tree")throw new Error("Invalid GitHub URL or file path");const ht=ke.replace(/^\//,"");return y(c,b)==="api"?`${c.apiBaseUrl}/repos/${E}/${J}/contents/${ht}?ref=${xe}`:`${c.rawBaseUrl}/${E}/${J}/${xe}/${ht}`}catch(E){throw new Error(`Incorrect URL: ${S}, ${E}`)}}function Se(S,c){const b={};return y(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function y(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var M=r(42822),re=r(89393),q=r(26228);class Te{async getOrCreateToken(c,b,E){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await E(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,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:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,t._)(this,"tokenCache",new Map),(0,t._)(this,"isExpired",c=>q.ou.local()>c)}}const Ie={Accept:"application/vnd.github.machine-man-preview+json"};class et{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:xe}=await this.getInstallationData(c);if(xe)throw new Error(`The GitHub application for ${c} is suspended`);const Ee=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:Ie});let ke;if(Ee.data.repository_selection==="selected"){const mt=new re.v({baseUrl:this.baseUrl,auth:Ee.data.token}),yn=await mt.paginate(mt.apps.listReposAccessibleToInstallation);var ht;ke=((ht=yn.repositories)!==null&&ht!==void 0?ht:yn).map(mr=>mr.name)}return{token:Ee.data.token,expiresAt:q.ou.fromISO(Ee.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(xe=>{var Ee,ke;return((Ee=xe.account)===null||Ee===void 0||(ke=Ee.login)===null||ke===void 0?void 0:ke.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,t._)(this,"appClient",void 0),(0,t._)(this,"baseUrl",void 0),(0,t._)(this,"baseAuthConfig",void 0),(0,t._)(this,"cache",new Te),(0,t._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new re.v({baseUrl:b,headers:Ie,authStrategy:M.i,auth:this.baseAuthConfig})}}class wt{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 E=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),J=E.find(ke=>{var ht;return(ht=ke.credentials)===null||ht===void 0?void 0:ht.accessToken});if(J)return J.credentials.accessToken;const Ee=E.map(ke=>ke.error).find(ke=>(ke==null?void 0:ke.name)!=="NotFoundError");if(Ee)throw Ee}constructor(c){var b;(0,t._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new et(J,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class dt{async getCredentials(c){const b=H()(c.url),E=b.owner||b.name,J=b.owner?b.name:void 0;let xe="app",Ee=await this.githubAppCredentialsMux.getAppToken(E,J);return Ee||(xe="token",Ee=this.token),{headers:Ee?{Authorization:`Bearer ${Ee}`}:void 0,token:Ee,type:xe}}constructor(c,b){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,t._)(dt,"create",S=>new dt(new wt(S),S.token));class He{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,J)}),new He(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class ut{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return St(B(c),"tree")}resolveEditUrl(c){return St(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(ut,"factory",({config:S})=>{var c;const b=ce((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new ut(E)),E=>E.config.host)});function St(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,J,xe)=>`//${E}/${J}/${xe}/${c}/`)}const tt=null;class Nt extends ut{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Nt,"factory",ut.factory);const rn=null,Yt=null,Vt=null,Dt="gitlab.com",tn="https://gitlab.com/api/v4";function Lt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token");let J=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Dt&&(b=tn),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:b,baseUrl:J}}function kt(S){const c=S.map(Lt);return c.some(b=>b.host===Dt)||c.push({host:Dt,apiBaseUrl:tn,baseUrl:`https://${Dt}`}),c}function dn(S){let c="";return S.host!==Dt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function Sn(S,c){const b=await lr(S,c);return Yn(S,b,c).toString()}function Vn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Yn(S,c,b){try{const E=new URL(S),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[xe,...Ee]=J.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(Ee.join("/"))),"raw"].join("/"),E.search=`?ref=${xe}`,E}catch(E){throw new Error(`Incorrect url: ${S}, ${E}`)}}async function lr(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 E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(E=E.replace(J,""));const xe=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),Ee=await fetch(xe.toString(),Vn(c)),ke=await Ee.json();if(!Ee.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${S}, ${E}`)}}class Tn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return Zn(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Tn,"factory",({config:S})=>{var c;const b=kt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return d(b.map(E=>new Tn(E)),E=>E.config.host)});function Zn(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class qn{static fromConfig(c){return new qn({awsS3:I.factory({config:c}),azure:Ye.factory({config:c}),bitbucket:Xt.factory({config:c}),bitbucketCloud:$t.factory({config:c}),bitbucketServer:Dn.factory({config:c}),gerrit:ne.factory({config:c}),github:ut.factory({config:c}),gitlab:Tn.factory({config:c}),gitea:Ot.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(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(J=>!(J instanceof Xt));E.length!==0&&(b=E)}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):B(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(jt,De,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const d=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var me=r(92077),ue=r(95481),V=r(7476),K=r(93225),I=r(86317),w=r(65124),se=r(22478),_=r(85478),te=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),O=r(52943),oe=r(61886),Le=r(13980),Ve=r.n(Le),z=r(87612);class xt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var ot=r(51837);const Ye=(0,ot.CT)("api-context"),st=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(Ye))===null||n===void 0?void 0:n.atVersion(1),A=p?new xt(s,p):s;return(0,h.jsx)(Ye.Provider,{value:(0,ot.EI)({1:A}),children:a})};st.propTypes={apis:Ve().shape({get:Ve().func.isRequired}).isRequired,children:Ve().node};class Qe{static validateFactories(n,s){for(const a of s){const p=[a],A=new Set;for(;p.length;){const k=p.shift(),F=n.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}`);A.has(ie)||(A.add(ie),p.push(ie))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const A=this.loadDeps(n,p.deps,[...s,p.api]),k=p.factory(A);return this.apis.set(n.id,k),k}loadDeps(n,s,a){const p={};for(const A in s)if(s.hasOwnProperty(A)){const k=s[A],F=this.load(k,a);if(!F)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);p[A]=F}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var Ct;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Ct||(Ct={}));class Tt{register(n,s){const a=Ct[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function bt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,A=window.screen.width/2-a/2,k=window.screen.height/2-p/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${A}`);let ie="";if(!F||typeof F.closed=="undefined"||F.closed){const vt=new Error("Failed to open auth popup.");vt.name="PopupRejectedError",s(vt);return}const je=vt=>{if(vt.source!==F||vt.origin!==i.origin)return;const{data:At}=vt;if(At.type==="config_info"){ie=At.targetOrigin;return}if(At.type!=="authorization_response")return;const It=At;if("error"in It){const Ht=new Error(It.error.message);Ht.name=It.error.name,s(Ht)}else n(It.response);We()},Oe=setInterval(()=>{if(F.closed){const vt=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,At=new Error(vt);At.name="PopupClosedError",s(At),We()}},100);function We(){window.removeEventListener("message",je),clearInterval(Oe)}window.addEventListener("message",je)})}let it=!1;function Pt(i){return[...i].join(" ")}class Zt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=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(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await bt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:A,joinScopes:k=Pt,oauthRequestApi:F,sessionTransform:ie=Oe=>Oe}=n;!it&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),it=!0);var je;this.enableExperimentalRedirectFlow=s&&(je=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&je!==void 0?je:!1,this.authRequester=F.createAuthRequester({provider:A,onAuthRequest:async Oe=>this.enableExperimentalRedirectFlow?this.executeRedirect(Oe):this.showPopup(Oe)}),this.discoveryApi=a,this.environment=p,this.provider=A,this.joinScopesFunc=k,this.sessionTransform=ie}}function Ke(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class Xt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return Ke(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const A of p)a.add(A)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),be=r.n(ge);let Ue=Symbol.observable;class nt{[Ue](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(be())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let yt=Symbol.observable;class gt{[yt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(be())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class pt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new gt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Bt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(a);return Ke(A,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.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(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new pt),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=A,this.helper=new Xt({sessionScopes:p,defaultScopes:a})}}class zt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_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:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Kt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class $t{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Kt,oauthRequestApi:k,defaultScopes:F=[],scopeTransform:ie=We=>We}=n,je=new Zt({configApi:s,discoveryApi:a,environment:p,provider:A,oauthRequestApi:k,sessionTransform(We){return{...We,providerInfo:{idToken:We.providerInfo.idToken,accessToken:We.providerInfo.accessToken,scopes:$t.normalizeScopes(ie,We.providerInfo.scope),expiresAt:new Date(Date.now()+We.providerInfo.expiresInSeconds*1e3)}}}}),Oe=new Bt({connector:je,defaultScopes:new Set(F),sessionScopes:We=>We.providerInfo.scopes,sessionShouldRefresh:We=>(We.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new $t({sessionManager:Oe,scopeTransform:ie})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=$t.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var A;return(A=p==null?void 0:p.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const qt={id:"github",title:"GitHub",icon:()=>null};class _t{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=qt,oauthRequestApi:k,defaultScopes:F=["read:user"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:F})}}const mn={id:"gitlab",title:"GitLab",icon:()=>null};class zn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=mn,oauthRequestApi:k,defaultScopes:F=["read_user"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:F})}}const Bn={id:"google",title:"Google",icon:()=>null},vn="https://www.googleapis.com/auth/";class $n{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:A="development",provider:k=Bn,defaultScopes:F=["openid",`${vn}userinfo.email`,`${vn}userinfo.profile`]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:A,defaultScopes:F,scopeTransform(ie){return ie.map(je=>je==="openid"?je:je==="profile"||je==="email"?`${vn}userinfo.${je}`:je.startsWith(vn)?je:`${vn}${je}`)}})}}const Dn={id:"okta",title:"Okta",icon:()=>null},en=new Set(["openid","profile","email","phone","address","groups","offline_access"]),En="okta.";class Wn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Dn,oauthRequestApi:k,defaultScopes:F=["openid","email","profile","offline_access"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:F,scopeTransform(ie){return ie.map(je=>en.has(je)||je.startsWith(En)?je:`${En}${je}`)}})}}var ft=r(30195);const Kn=ft.z.object({profile:ft.z.object({email:ft.z.string().optional(),displayName:ft.z.string().optional(),picture:ft.z.string().optional()}),backstageIdentity:ft.z.object({token:ft.z.string(),identity:ft.z.object({type:ft.z.literal("user"),userEntityRef:ft.z.string(),ownershipEntityRefs:ft.z.array(ft.z.string())})})}),Rt={id:"saml",title:"SAML",icon:()=>null};class at{static create(n){const{discoveryApi:s,environment:a="development",provider:p=Rt}=n,A=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:A}),F=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new at(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const bn={id:"microsoft",title:"Microsoft",icon:()=>null};class Gt{static create(n){return new Gt(n)}microsoftGraph(){return this.oauth2[Gt.MicrosoftGraphID]}static resourceForScopes(n){const s=n.split(" ").map(Gt.resourceForScope).filter(A=>A!=="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 p=(a=s[0])!==null&&a!==void 0?a:Gt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Gt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Gt.MicrosoftGraphID:await Gt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=bn,oauthRequestApi:A,discoveryApi:k,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:ie=je=>je.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=A,this.discoveryApi=k,this.scopeTransform=ie,this.oauth2={[Gt.MicrosoftGraphID]:$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,z._)(Gt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const sn={id:"onelogin",title:"onelogin",icon:()=>null},An=new Set(["openid","profile","email","phone","address","groups","offline_access"]),cn="onelogin.";class In{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=sn,oauthRequestApi:k}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(ie=>An.has(ie)||ie.startsWith(cn)?ie:`${cn}${ie}`)}})}}const we={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ae{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=we,oauthRequestApi:k,defaultScopes:F=["team"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:F})}}const Be={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Be,oauthRequestApi:k,defaultScopes:F=["PROJECT_ADMIN"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:F})}}const _e={id:"atlassian",title:"Atlassian",icon:()=>null};class ne{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=_e,oauthRequestApi:k}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p})}}class Z{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new nt)}}class pe{captureEvent(n){}}const Ze="theme";class Xe{static createWithStorage(n){const s=new Xe(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(Ze))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem(Ze,A):window.localStorage.removeItem(Ze)}),window.addEventListener("storage",A=>{if(A.key===Ze){var k;const F=(k=localStorage.getItem(Ze))!==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(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new gt(void 0)}}var lt=r(9850),Ot=r.n(lt),Ft=r(12782),X=r.n(Ft);const Y=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function le(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ce(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const ye={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class Se{static fromConfigs(n){return n.length===0?new Se(void 0):n.reduce((s,{data:a,context:p,filteredKeys:A,deprecatedKeys:k})=>{const F=new Se(a,p,s);if(F.filteredKeys=A,k)for(const{key:ie,description:je}of k)console.warn(`The configuration key '${ie}' of ${p} is deprecated and may be removed soon. ${je||""}`);return F},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=Ot()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var A;return p}else if(p===void 0)return a;return X()({},{value:p},{value:a},(k,F)=>!le(F)||!le(k)?F:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(le(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(ye.type(this.fullKey(n),this.context,ce(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[A,k]of p.entries())if(!le(k))return{expected:"object-array",value:k,key:`${n}[${A}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,A)=>this.copy(p,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(ye.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="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(ye.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new Se(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var A;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const k=s(a);if(k!==!0){const{key:F=n,value:ie=a,expected:je}=k;throw new TypeError(ye.type(this.fullKey(F),this.context,ce(ie),je))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!Y.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,A]of s.entries())if(le(a))a=a[A];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(ye.type(k,this.context,ce(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class M{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new M(s)}async getBaseUrl(n){return this.parts.join(encodeURIComponent(n))}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class re{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class q{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new nt)}}class Te{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Ie(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 et{registerFlag(n){Ie(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);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 n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,A])=>(Ie(p),A===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function wt(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class dt{static create(n){var s,a;const p=He(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=n.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new dt(n.identityApi,p,A,k)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:A}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(A)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function He(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?ut(i.urlPrefixAllowlist):i.config?ut([i.config.getString("backend.baseUrl")]):()=>!1}function ut(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function St(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class tt{apply(n){return async(s,a)=>{const p=new Request(s,a),A="plugin://";if(!p.url.startsWith(A))return n(s,a);const{hostname:k,pathname:F,search:ie,hash:je,username:Oe,password:We}=new URL(`http://${p.url.substring(A.length)}`);let vt=await this.discoveryApi.getBaseUrl(k);if(Oe||We){const It=new URL(vt),Ht=`${Oe}${We?`:${We}`:""}@`;vt=`${It.protocol}//${Ht}${It.host}${It.pathname}`}const At=`${St(vt,F)}${ie}${je}`;return n(At,typeof s=="string"||Nt(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Nt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class rn{static resolvePluginProtocol(n){return new tt(n.discoveryApi)}static injectIdentityAuth(n){return dt.create(n)}constructor(){}}function Yt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function Vt(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Dt{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Yt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Vt(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new gt(this.getCurrentPending()))}}class tn{createAuthRequester(n){const s=new Dt,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const A=this.currentRequests.slice(),k=this.makeAuthRequest(p,n);k?A[a]=k:delete A[a],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new gt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Lt=new Map;class kt{static create(n){var s;return new kt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Lt.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(A,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: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Lt.has(s)||Lt.set(s,new kt(s,this.errorApi)),Lt.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return kt.hasSubscribed||(kt.addStorageEventListener(),kt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(be())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(kt,"hasSubscribed",!1);const dn=(0,H.createContext)(void 0);function Sn(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var Vn=r(84800);const Yn=(i,n)=>{try{var s,a;const p=(0,Vn.fp)(n,{pathname:i}),A=(s=p==null?void 0:p.filter(F=>{var ie;return((ie=F==null?void 0:F.route.routeRefs)===null||ie===void 0?void 0:ie.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!A)return{};let k;return A.routeRefs.size===1&&(k=A.routeRefs.values().next().value),{extension:"App",pluginId:((a=A.plugin)===null||a===void 0?void 0:a.getId())||"root",...k?{routeRef:k.id}:{}}}catch{return{}}},lr=({pathname:i,search:n,hash:s})=>{const a=(0,g.z$)();return(0,H.useEffect)(()=>{a.captureEvent("navigate",`${i}${n}${s}`)},[a,i,n,s]),null},Tn=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)();return(0,h.jsx)(g.fC,{attributes:Yn(n,i),children:(0,h.jsx)(lr,{pathname:n,search:s,hash:a})})};function Zn(i){return Sn()?qn(i):""}function qn(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),A=(0,g.h_)(g.Ds),k=Zn(A);return a?(n.setTarget(a,{signOutTargetUrl:k||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=qn(a),A=`${p}/*`,k=(0,H.useContext)(dn);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:ie}=k;return s?Sn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(Tn,{routeObjects:F}),(0,h.jsx)(S,{component:s,appIdentityProxy:ie,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(Tn,{routeObjects:F}),(0,h.jsx)(S,{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:p||"/"}),Sn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(Tn,{routeObjects:F}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(Tn,{routeObjects:F}),i.children]}))}var b=r(88412),E=r(50629),J=r(80956),xe=r(64279);function Ee(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:A}=s.shift();H.Children.forEach(a,k=>{if(!(0,H.isValidElement)(k))return;const F={};for(const ie in n)if(n.hasOwnProperty(ie)){const je=n[ie];F[ie]=je.visit(je.accumulator,k,p,A[ie])}for(const ie of i.discoverers){const je=ie(k);je&&s.push({node:je,parent:k,contexts:F})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function ke(i,n){return()=>({accumulator:i(),visit:n})}function ht(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function mt(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.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 yn=ke(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),Nn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(Nn,"core.featureFlagged",!0);const mr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function kr(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function Br(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}Br(s.props.children,n)}),n}const Eo=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const k=(p=n.props)===null||p===void 0?void 0:p.path,F=(0,g.IY)(n,"core.mountPoint");if(F&&k)throw new Error(`Path property may not be set directly on a routable extension "${kr(n)}"`);var ie;const je=(ie=a==null||(A=a.obj)===null||A===void 0?void 0:A.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 "${kr(n)}"`);const At=k.startsWith("/")?k.slice(1):k,It=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Oe;if(It)throw new Error(`Mount point gatherers may not have an element prop "${kr(n)}"`);const Ht={path:At,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Oe=n.props)===null||Oe===void 0?void 0:Oe.caseSensitive),children:[mr],plugin:void 0};return je.push(Ht),{obj:Ht,gatherPath:At,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(It){var We;const[Ht,...Wt]=Br(It);if(Wt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Ht)return a;const{routeRef:On,plugin:ar}=Ht,pr={path:At,element:"mounted",routeRefs:new Set([On]),caseSensitive:Boolean((We=n.props)===null||We===void 0?void 0:We.caseSensitive),children:[mr],plugin:ar};return je.push(pr),i.paths.set(On,At),i.parents.set(On,a==null?void 0:a.routeRef),{obj:pr,routeRef:On!=null?On:a==null?void 0:a.routeRef,gatherPath:At,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var vt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${kr(n)}" with mount point "${F}" must be assigned a path`);return a==null||(vt=a.obj)===null||vt===void 0||vt.routeRefs.add(F),i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),qr=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A,k;if((s==null?void 0:s.props.element)===n)return a;let F=a==null?void 0:a.obj,ie=a==null?void 0:a.routeRef,je=a==null?void 0:a.sticky;const Oe=(p=n.props)===null||p===void 0?void 0:p.path;var We;const vt=(We=F==null?void 0:F.children)!==null&&We!==void 0?We:i.objects,At=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let It=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");It=Oe}const Ht=(k=n.props)===null||k===void 0?void 0:k.element;let Wt=(0,g.IY)(n,"core.mountPoint");if(!Wt&&(0,H.isValidElement)(Ht)&&(Wt=(0,g.IY)(Ht,"core.mountPoint")),Wt){let pr=Oe;if(It&&(pr?It=void 0:pr=It),!pr)throw new Error("Mounted routable extension must have a path");i.paths.set(Wt,pr),ie&&je?(i.parents.set(Wt,ie),Oe&&(ie=Wt,je=!1)):(i.parents.set(Wt,ie),ie=Wt),Oe?(F={caseSensitive:At,path:Oe,element:"mounted",routeRefs:new Set([Wt]),children:[mr],plugin:(0,g.IY)(n.props.element,"core.plugin")},vt.push(F)):F==null||F.routeRefs.add(Wt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(je=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");if(!Wt){var ar;F={caseSensitive:At,path:Oe,element:"gathered",routeRefs:new Set,children:[mr],plugin:a==null||(ar=a.obj)===null||ar===void 0?void 0:ar.plugin},vt.push(F)}}return{obj:F,path:It,routeRef:ie,sticky:je}}),vr=ke(()=>new Set,(i,n)=>{if(n.type===Nn){const s=n.props;i.add("with"in s?s.with:s.without)}}),wr=(0,ot.uW)("route-ref-type",()=>Symbol("route-ref-type"));function rr(i){return i[wr]==="absolute"}function Jn(i){return i[wr]==="sub"}function jr(i){return i[wr]==="external"}function yr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function Ao(i,n,s){let a,p="";if(rr(i))a=i;else if(Jn(i))a=i.parent,p=i.path;else if(jr(i)){const F=s.get(i);if(!F)return[void 0,""];if(rr(F))a=F;else if(Jn(F))a=F.parent,p=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[wr]?new Error(`Unknown or invalid route ref type, ${i[wr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const A=n.get(a);if(A===void 0)return[void 0,""];const k=yr(A,p);return[a,k]}function To(i,n,s,a,p){var A;const k=(A=(0,Vn.fp)(p,n))!==null&&A!==void 0?A:[],F=Array();let ie=-1;for(let We=i;We&&(ie=k.findIndex(vt=>vt.route.routeRefs.has(We)),ie===-1);We=a.get(We))F.unshift(We);F.length===0&&(ie-=1);const je=ie===-1?"":k[ie].pathname,Oe=F.slice(0,-1).map(We=>{const vt=s.get(We);if(vt===void 0)throw new Error(`No path for ${We}`);if(vt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${We} as it has parameters`);return vt});return`${yr(je,...Oe)}/`}class _r{resolve(n,s){const[a,p]=Ao(n,this.routePaths,this.routeBindings);if(!a)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const k=this.appBasePath+To(a,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>yr(k,(0,Vn.Gn)(p,ie))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,A){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=A}}const Ro=(0,ot.CT)("routing-context"),Io=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:A})=>{const k=new _r(i,n,s,a,p),F=(0,ot.EI)({1:k});return(0,h.jsx)(Ro.Provider,{value:F,children:A})};function Vr(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,A="";for(;p;){const F=i.get(p);if(F===void 0)throw new Error(`No path for ${p}`);A=yr(F,A),p=n.get(p)}const k=A.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 ${A}`)}}}function _n(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))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 $r=(0,ot.CT)("app-context"),Dr=({appContext:i,children:n})=>{const s=(0,ot.EI)({1:i});return(0,h.jsx)($r.Provider,{value:s,children:n})};function eo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Er(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Hr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw eo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Er("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw eo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Er("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Er("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Po=r(72164);function to(i,n,s){if(i!==void 0){const p=s.find(A=>A.id===i);if(p)return p}if(n){const p=s.find(A=>A.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const Cn=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function no({children:i}){const n=(0,g.h_)(g.hg),s=(0,Po.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?Cn():!1,p=to(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const ro=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class oo{add(n,s){return this.apis.push([n.id,s]),s}build(){return new xr(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class xr{static builder(){return new oo}static from(n){return new xr(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new xr(new Map([[n.id,s]]))}with(n,s){return new xr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function Lo(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[A,k]of Object.entries(p)){const F=a[A];if(!F)throw new Error(`Key ${A} is not an existing external route`);if(!k&&!F.optional)throw new Error(`External route ${A} is required but was undefined`);k&&n.set(F,k)}}}),n}function so(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function Oo(i,n,s){var a;const p=Boolean(i),A=(0,xe.default)(i||(()=>Promise.resolve([])));let k;if(p&&A.loading){const{Progress:je}=n;k=(0,h.jsx)(je,{})}else if(A.error){const{BootErrorPage:je}=n;k=(0,h.jsx)(je,{step:"load-config",error:A.error})}const{ThemeProvider:F=no}=n;if(k)return{node:(0,h.jsx)(st,{apis:xr.with(g.hg,s),children:(0,h.jsx)(F,{children:k})})};let ie;if(!((a=A.value)===null||a===void 0)&&a.length){const je=Se.fromConfigs(A.value),Oe=je.getOptionalString("app.baseUrl"),We=je.getOptionalString("backend.baseUrl");let vt=A.value;const At={data:{},context:"relative-resolver"};if(Oe&&We){const It=new URL(Oe).origin,Ht=new URL(We).origin;if(It===Ht){const Wt=so(We);We!==Wt&&(At.data.backend={baseUrl:Wt})}}if(Oe){const It=so(Oe);Oe!==It&&(At.data.app={baseUrl:It})}Object.keys(At.data).length&&(vt=vt.concat([At])),ie=Se.fromConfigs(vt)}else ie=Se.fromConfigs([]);return{api:ie}}class io{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var br=new WeakMap;class ss{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,b._)(this,br))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,J._)(this,br,!0);const n=new io(this);let s=!1;return({children:p})=>{const A=(0,H.useRef)(!0),k=(0,H.useMemo)(()=>Xe.createWithStorage(this.themes),[]),{routing:F,featureFlags:ie,routeBindings:je}=(0,H.useMemo)(()=>{const At=Ee({root:p,discoverers:[ht,mt],collectors:{routing:Sn()?qr:Eo,collectedPlugins:yn,featureFlags:vr}});return At.collectedPlugins.forEach(It=>this.plugins.add(It)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...At,routeBindings:Lo(this.bindRoutes)}},[p]);s||(s=!0,Vr(F.paths,F.parents),_n(je,this.plugins));const Oe=Oo(this.configLoader,this.components,k),We="api"in Oe;if(We){const{api:At}=Oe;this.configApi=At}if("node"in Oe)return Oe.node;if(We&&A.current){A.current=!1;const At=this.getApiHolder().get(g.W0);if(At){for(const Wt of this.featureFlags)At.registerFlag({...Wt,pluginId:""});for(const Wt of this.plugins.values())if("getFeatureFlags"in Wt)for(const On of Wt.getFeatureFlags())At.registerFlag({name:On.name,pluginId:Wt.getId()});else for(const On of Wt.output())On.type==="feature-flag"&&At.registerFlag({name:On.name,pluginId:Wt.getId()});const It=At.getRegisteredFlags(),Ht=new Set(It.map(Wt=>Wt.name));for(const Wt of ie)Ht.has(Wt)||At.registerFlag({name:Wt,pluginId:""})}}const{ThemeProvider:vt=no}=this.components;return(0,h.jsx)(st,{apis:this.getApiHolder(),children:(0,h.jsx)(Dr,{appContext:n,children:(0,h.jsx)(vt,{children:(0,h.jsx)(Io,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:je,basePath:Zn(Oe.api),children:(0,h.jsx)(dn.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Xe.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 et});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Qe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new Hr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,E._)(this,br,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:ro;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new Tt}}function ao(i){return new ss(i)}let cr=!1;const Ar=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>Sn(),[]),A=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(F=>{let ie=F.props.path;if(ie==="")return[];var je;ie=(je=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&je!==void 0?je:"/";let Oe=a?F:F.props.element;return!a&&!Oe&&(Oe=F,cr||(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] />} />."),cr=!0)),[{path:ie,element:Oe,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,h.jsx)(s,{})}];return(0,W.V$)(A)},ko=(0,g.T0)({id:"plugin.permission.api"});var Qn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Qn||(Qn={}));function Ws(i,n){return i.name===n.name}function Bo(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function is(i){return i.attributes.action==="create"}function as(i){return i.attributes.action==="read"}function ls(i){return i.attributes.action==="update"}function lo(i){return i.attributes.action==="delete"}function cs(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function dr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var co=r(23054),$o=r(96279),Hn=r.n($o),uo=r(9571);const Zr=ft.z.lazy(()=>ft.z.object({rule:ft.z.string(),resourceType:ft.z.string(),params:ft.z.record(ft.z.any()).optional()}).or(ft.z.object({anyOf:ft.z.array(Zr).nonempty()})).or(ft.z.object({allOf:ft.z.array(Zr).nonempty()})).or(ft.z.object({not:Zr}))),ds=ft.z.object({result:ft.z.literal(Qn.ALLOW).or(ft.z.literal(Qn.DENY))}),Do=ft.z.union([ft.z.object({result:ft.z.literal(Qn.ALLOW).or(ft.z.literal(Qn.DENY))}),ft.z.object({result:ft.z.literal(Qn.CONDITIONAL),pluginId:ft.z.string(),resourceType:ft.z.string(),conditions:Zr})]),Zo=(i,n)=>ft.z.object({items:ft.z.array(ft.z.intersection(ft.z.object({id:ft.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class us{async authorize(n,s){return this.makeRequest(n,ds,s)}async authorizeConditional(n,s){return this.makeRequest(n,Do,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Oe=>({result:Qn.ALLOW}));const p={items:n.map(Oe=>({id:uo.Z(),...Oe}))},A=await this.discovery.getBaseUrl("permission"),k=await Hn()(`${A}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await co.VL.fromResponse(k);const F=await k.json(),je=Zo(s,new Set(p.items.map(({id:Oe})=>Oe))).parse(F).items.reduce((Oe,We)=>(Oe[We.id]=We,Oe),{});return p.items.map(Oe=>je[Oe.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class ho{static create(n){const{config:s,discovery:a,identity:p}=n,A=new us({discovery:a,config:s});return new ho(A,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var x=r(69984);function C(i){const n=(0,g.h_)(ko),{data:s,error:a}=(0,x.ZP)(i,async p=>{if(Bo(p.permission)&&!p.resourceRef)return Qn.DENY;const{result:A}=await n.authorize(p);return A});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Qn.ALLOW}}const R=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:F}=k.getComponents();let ie=a===void 0?_jsx(F,{}):a;return A.loading?ie=null:A.allowed&&(ie=i.element),_jsx(Route,{...p,element:ie})};function D(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=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:A}=p.getComponents();return _jsx(A,{})}const ee=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>M.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new Z}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new pe}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new re(i,new q);return Te.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>kt.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>wt({middleware:[rn.resolvePluginProtocol({discoveryApi:s}),rn.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new tn}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>$n.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>Gt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>_t.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>Wn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>In.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>ae.create({configApi:s,discoveryApi:i,oauthRequestApi:n,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:n,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ne.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:ko,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>ho.create({config:i,discovery:n,identity:s})})];var de=r(77277),Q=r(53974),ve=r(71597);function Ae({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const Re=()=>(0,h.jsx)(Q.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Ne=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ae,{children:(0,h.jsx)(Q.mf,{status:"501",statusMessage:s})})},Fe=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(Q.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(de.Z,{variant:"outlined",onClick:n,children:"Retry"})}),rt={Progress:Q.Ex,Router:ve.VK,NotFoundErrorPage:Re,BootErrorPage:Ne,ErrorBoundaryFallback:Fe};var ct=r(43642),Ge=r(80079),$e=r(90941),Je=r(32915),Et=r(40562),an=r(21853),Jt=r(60744),on=r(66569),ln=r(30254),wn=r(13384),Pn=r(15933),Sr=r(58838),Nr=r(86737),Gr=r(4989),Ln=r(44407),Fn=r(18628),Tr=r(84219),Vs=r(98685),hs=r(39781);const Bi={brokenImage:Ge.Z,catalog:Fn.Z,scaffolder:Je.Z,techdocs:Et.Z,search:an.Z,chat:Jt.Z,dashboard:on.Z,docs:ln.Z,email:wn.Z,github:Sr.Z,group:Tr.Z,help:Nr.Z,"kind:api":Pn.Z,"kind:component":Ln.Z,"kind:domain":ct.Z,"kind:group":Tr.Z,"kind:location":Gr.Z,"kind:system":$e.Z,"kind:user":Vs.Z,user:Vs.Z,warning:hs.Z};var ps=r(73689),fs=r(48032);const er={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")`},tr={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 or(i){const{colors:n,shape:s,options:a}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${A}`;var F;const ie=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:ie}}const No={home:or({colors:tr.teal,shape:er.wave}),documentation:or({colors:tr.pinkSea,shape:er.wave2}),tool:or({colors:tr.purpleSky,shape:er.round}),service:or({colors:tr.marineBlue,shape:er.wave}),website:or({colors:tr.veryBlue,shape:er.wave}),library:or({colors:tr.rubyRed,shape:er.wave}),other:or({colors:tr.darkGrey,shape:er.wave}),app:or({colors:tr.toastyOrange,shape:er.wave}),apis:or({colors:tr.teal,shape:er.wave2}),card:or({colors:tr.greens,shape:er.wave})},Fo=16,Hs='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Gs(i){const{palette:n,htmlFontSize:s=Fo,fontFamily:a=Hs,defaultPageTheme:p,pageTheme:A=No}=i;if(!A[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[p],getPageTheme:({themeId:F})=>(k=A[F])!==null&&k!==void 0?k:A[p]}}function Ks(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,fs.darken)(i.palette.link,.3),background:(0,fs.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ys(i){const n=Gs(i),s=(0,ps.Z)(n),a=Ks(s);return{...s,overrides:a}}var gs=r(34505);const Js=Ys({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},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:gs.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:No}),ms=Ys({palette:{type:"dark",background:{default:"#333333"},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:gs.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:No});var Kr=r(98192),Qs=r(15222),Uo=r(41547),vs=r(87561);const ys=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(Qs.Z,{}),Provider:({children:i})=>(0,h.jsx)(Uo.Z,{theme:Js,children:(0,h.jsx)(vs.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(Kr.Z,{}),Provider:({children:i})=>(0,h.jsx)(Uo.Z,{theme:ms,children:(0,h.jsx)(vs.ZP,{children:i})})}];function xs(i){var n,s,a,p;return ao({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...rt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:ee,icons:{...Bi,...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:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:ys})}var po=r(25271),Xs=r(76635);async function _s({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,Xs.isArray)(a))return;var p;const A=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(Xs.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,F,ie,je])=>(0,po.eE)({kind:F,namespace:ie,name:je})).forEach(k=>A.add(k)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class bs{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(be())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),_s(n).then(),this.settingsStore=n.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 p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var $i=r(33414),Rn=r(79692),Di=r(12420),Gn=r(43514),Aa=r(19928);function Ta(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var k;return((k=A.facets.kind)===null||k===void 0?void 0:k.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Ra(i,n,s){let a=i;return n&&(a=a.filter(A=>n.some(k=>k.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((A,k)=>(A[k.toLocaleLowerCase("en-US")]=k,A),{})}const Zi=(0,Rn.Z)(i=>(0,Di.Z)({root:{...i.typography.h4}}));function Ia(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=Zi(),{allKinds:A}=useAllKinds(),{filters:k,updateFilters:F,queryParameters:{kind:ie}}=useEntityList(),je=useMemo(()=>[ie].flat()[0],[ie]);var Oe;const[We,vt]=useState((Oe=je!=null?je:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Oe!==void 0?Oe:s);useEffect(()=>{je&&vt(je)},[je]),useEffect(()=>{var It;if(!((It=k.kind)===null||It===void 0)&&It.value){var Ht;vt((Ht=k.kind)===null||Ht===void 0?void 0:Ht.value)}},[k.kind]),useEffect(()=>{F({kind:We?new EntityKindFilter(We):void 0})},[We,F]);const At=filterKinds(A,a,We);return _jsx(Select,{input:_jsx(InputBase,{}),value:We.toLocaleLowerCase("en-US"),onChange:It=>vt(It.target.value),classes:p,children:Object.keys(At).map(It=>_jsx(MenuItem,{value:It,children:`${pluralize(At[It])}`},It))})}var Pa=r(86359),Fr=r(95544),Ni=r(99688),Mo=r(12231),fo=r(86136),go=r(49378),zo=r(85256),Ss=r(80030),Cs=r(61837),ei=r(79784),Wo=r(50758),ur=r(31654),Vo=r(43054),mo=r(65759),ti=r(49280),ws=r(96641);function hr(i){const{entity:n,loading:s,error:a}=(0,ws.ce)(),{allowed:p,loading:A,error:k}=C({permission:i,resourceRef:n?(0,po.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const Ho="catalog-entity",js=dr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Ho}),ni=dr({name:"catalog.entity.create",attributes:{action:"create"}}),ri=dr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Ho}),sr=dr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Ho}),Es=dr({name:"catalog.location.read",attributes:{action:"read"}}),oi=dr({name:"catalog.location.create",attributes:{action:"create"}}),si=dr({name:"catalog.location.delete",attributes:{action:"delete"}}),Fi=[js,ni,ri,sr,Es,oi,si];var ii=r(49166);function vo(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const F=(k=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ie=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ie=(0,h.jsxs)(Mo.Z,{onClick:()=>{p(),a()},disabled:F,children:[(0,h.jsx)(fo.Z,{children:(0,h.jsx)(ii.Z,{fontSize:"small"})}),(0,h.jsx)(go.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ie})}const As=(0,Rn.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ts(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[A,k]=(0,H.useState)(),F=As(),je=hr(ri).allowed,Oe=Ht=>{k(Ht.currentTarget)},We=()=>{k(void 0)},vt=(0,g.h_)(g.$v),At=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>vt.post({message:"Copied!",severity:"info",display:"transient"}))},[vt]),It=n&&[...n.map(Ht=>(0,h.jsxs)(Mo.Z,{onClick:()=>{We(),Ht.onClick()},children:[(0,h.jsx)(fo.Z,{children:(0,h.jsx)(Ht.Icon,{fontSize:"small"})}),(0,h.jsx)(go.Z,{primary:Ht.title})]},Ht.title)),(0,h.jsx)(zo.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ss.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(Cs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:Oe,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,h.jsx)(Vo.Z,{})})}),(0,h.jsx)(ei.ZP,{open:Boolean(A),onClose:We,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(Wo.Z,{children:[It,(0,h.jsx)(vo,{unregisterEntityOptions:s,isUnregisterAllowed:je,onUnregisterEntity:a,onClose:We}),(0,h.jsxs)(Mo.Z,{onClick:()=>{We(),p()},children:[(0,h.jsx)(fo.Z,{children:(0,h.jsx)(ur.Z,{fontSize:"small"})}),(0,h.jsx)(go.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(Mo.Z,{onClick:()=>{We(),At()},children:[(0,h.jsx)(fo.Z,{children:(0,h.jsx)(mo.Z,{fontSize:"small"})}),(0,h.jsx)(go.Z,{primary:"Copy entity URL"})]})]})})]})}const Go="plugin.catalog.entityLayoutRoute",yo=()=>null;(0,g.R5)(yo,Go,!0),(0,g.R5)(yo,"core.gatherMountPoints",!0);function Ko(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Fr.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Fr.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Gn.LH,{entity:n})]})}function ai(i,n,s,a){var p;const A=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const F=(k=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ie,je,Oe;return{headerTitle:`${(Oe=(je=(ie=a==null?void 0:a.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&je!==void 0?je:a==null?void 0:a.metadata.name)!==null&&Oe!==void 0?Oe:""}${F&&F!==po.zG?` in ${F}`:""}`,headerType:(()=>{let vt=A.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(vt+=" \u2014 ",vt+=a.spec.type.toLocaleLowerCase("en-US")),vt})()}}function Rs(i){var n;const{entity:s}=i,a=(0,Gn.hF)(s,po.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(Gn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(Q.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Is=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:A,NotFoundComponent:k}=i,{kind:F,namespace:ie,name:je}=(0,g.Oi)(Gn.wi),{entity:Oe,loading:We,error:vt}=(0,Gn.ce)(),At=(0,W.TH)(),It=(0,g.vJ)(A,Ai=>Ai.selectByComponentData({key:Go,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Mr})=>{if(Oe){if(Mr.if&&!Mr.if(Oe))return[]}else return[];return[{path:Mr.path,title:Mr.title,children:Mr.children,tabProps:Mr.tabProps}]}),[Oe]),{headerTitle:Ht,headerType:Wt}=ai(F,ie,je,Oe),[On,ar]=(0,H.useState)(!1),[pr,Ur]=(0,H.useState)(!1),ji=(0,W.s0)(),Ei=async()=>{ar(!1),Ur(!1),ji("/")};(0,H.useEffect)(()=>{ar(!1),Ur(!1)},[At.pathname]);var es;return(0,h.jsxs)(Q.T3,{themeId:(es=Oe==null||(n=Oe.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&es!==void 0?es:"home",children:[(0,h.jsx)(Q.h4,{title:(0,h.jsx)(Ko,{title:Ht,entity:Oe}),pageTitleOverride:Ht,type:Wt,children:Oe&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Rs,{entity:Oe}),(0,h.jsx)(Ts,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>ar(!0),onInspectEntity:()=>Ur(!0)})]})}),We&&(0,h.jsx)(Q.Ex,{}),Oe&&(0,h.jsx)(Q.tn,{routes:It}),vt&&(0,h.jsx)(Q.VY,{children:(0,h.jsx)(Ni.Z,{severity:"error",children:vt.toString()})}),!We&&!vt&&!Oe&&(0,h.jsx)(Q.VY,{children:k||(0,h.jsxs)(Q.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,h.jsx)(Q.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Gn.pp,{open:On,entity:Oe,onConfirm:Ei,onClose:()=>ar(!1)}),(0,h.jsx)(Gn.U_,{open:pr,entity:Oe,onClose:()=>Ur(!1)})]})};Is.Route=yo;function li(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[A,k]=useState(!1),F=useApi(catalogApiRef),ie=useApi(alertApiRef),je=async()=>{k(!0);try{const Oe=p.metadata.uid;await F.removeEntityByUid(Oe),a()}catch(Oe){assertError(Oe),ie.post({message:Oe.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,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:A,onClick:je,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var xo=r(19625);function Yo(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ui(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),A=async()=>{a(!1),i(n())};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:p,onConfirm:A,onClose:()=>a(!1)})]})}var ci=r(4791);const Ps=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Jo(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var A,k;return{errors:((k=(A=p.entity.status)===null||A===void 0?void 0:A.items)!==null&&k!==void 0?k:[]).filter(Ps).map(je=>je.error).filter(je=>Boolean(je)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Mi(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Jo(stringifyEntityRef(i),s)).items.length>0}function zi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:A}=useAsync(async()=>Jo(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!A?null:_jsx(_Fragment,{children:A.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,je)=>_jsx(ResponseErrorPanel,{error:ie},je))]},F))})}const Ls="core.backstage.entitySwitch",Qo=i=>null;(0,g.R5)(Qo,Ls,!0);const di=i=>{var n;const{entity:s,loading:a}=(0,Gn.ce)(),p=(0,g.I_)(),A=(0,g.vJ)(i.children,ie=>ie.selectByComponentData({key:Ls,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(je=>{if(a)return[];const{if:Oe,children:We}=je.props;return s?[{if:Oe==null?void 0:Oe(s,{apis:p}),children:We}]:[{if:Oe===void 0,children:We}]}),[p,s,a]);if(A.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,h.jsx)(bo,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ie=A.filter(je=>je.if).map(je=>je.children);return ie.length===0?Yr(A):(0,h.jsx)(h.Fragment,{children:ie})}var F;return(F=(n=A.find(ie=>ie.if))===null||n===void 0?void 0:n.children)!==null&&F!==void 0?F:Yr(A)};function bo({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,xe.default)(async()=>{const p=i.map(async({if:k,children:F})=>{try{if(await k)return F}catch{}return null});if(n==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Yr(i):(0,h.jsx)(h.Fragment,{children:k})}var A;return(A=(await Promise.all(p)).find(Boolean))!==null&&A!==void 0?A:Yr(i)},[i]);return s||!a?null:a}function Yr(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}di.Case=Qo;const Wi=null,ui=Gn._i.Filters,Vi=Gn._i.Content;var hi=r(85877),Os=r(15096);const Qt=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Gn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new ci.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Gn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new bs({storageApi:i})})],routes:{catalogIndex:xo._Z,catalogEntity:Gn.wi},externalRoutes:{createComponent:xo.yw,viewTechDoc:xo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Hi=Qt.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:xo._Z})),pi=Qt.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Gn.wi})),Gi=Qt.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),fi=Qt.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),Ki=Qt.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),La=Qt.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),ks=Qt.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),Yi=Qt.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),Ji=Qt.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),Qi=Qt.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),Xo=Qt.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),Xi=Qt.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),qi=Qt.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),gi=Qt.provide((0,Os.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Bs=r(32838);class _i{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(n,s){const p=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class ea{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const mi=[(0,g.ni)({api:oe.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new _i({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:oe.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new ea({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:Bs.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Bs.ae.fromConfig(i)})],ta={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},na={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function qo(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function _o(){const i=await ro(),n=await qo();return[...i,{context:"detected",data:n?ta:na}]}var vi=r(58845);const So=(0,Rn.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var $s=()=>{const i=So();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.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 yi=(0,Rn.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ds=()=>{const i=yi();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.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 xi=(0,Rn.Z)({root:{width:Q.po.drawerWidthClosed,height:3*Q.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Q.po.drawerWidthClosed,marginLeft:24}}),Zs=()=>{const i=xi(),{isOpen:n}=(0,Q.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(Q.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)($s,{}):(0,h.jsx)(Ds,{})})})},sa=({children:i})=>(0,h.jsxs)(Q.tR,{children:[(0,h.jsxs)(Q.YE,{children:[(0,h.jsx)(Zs,{}),(0,h.jsx)(Q.v7,{}),(0,h.jsx)(Q.R6,{icon:vi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ia=r(32388),aa=r(4142);const bi=(0,Rn.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 ir;(function(i){i.LIGHT="light",i.DARK="dark"})(ir||(ir={}));const la=()=>{const i=(0,g.h_)(g.hg),n=bi(),[s,a]=(0,H.useState)(i.getActiveThemeId()===ir.DARK?ir.DARK:ir.LIGHT),p={[ir.LIGHT]:{icon:aa.Z,title:"Dark theme"},[ir.DARK]:{icon:ia.Z,title:"Light theme"}},{title:A,icon:k}=p[s],F=()=>{a(ie=>{const je=ie===ir.LIGHT?ir.DARK:ir.LIGHT;return i.setActiveThemeId(je),je})};return(0,h.jsx)(Fr.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(Ss.ZP,{title:A,arrow:!0,children:(0,h.jsx)(Cs.Z,{size:"small",onClick:F,children:(0,h.jsx)(k,{className:n.headerIcon})})})})},ca=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(K.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),Si=(0,h.jsx)(ca,{}),Ns=xs({apis:mi,configLoader:_o,plugins:Object.values(t)}),Fs=Ns.getProvider(),Ci=Ns.getRouter(),wi=L.s4.provide((0,oe.KY)({name:"ThemeToggleAddon",component:la,location:oe.oZ.Header})),da=(0,h.jsxs)(Ar,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(pi,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[Si,(0,h.jsx)(oe.DR,{children:(0,h.jsx)(wi,{})})]})]});var Us=()=>(0,h.jsx)(Fs,{children:(0,h.jsx)(Ci,{children:(0,h.jsx)(sa,{children:da})})});f.render((0,h.jsx)(Us,{}),document.getElementById("root"))},51837:function(jt,De,r){"use strict";r.d(De,{CT:function(){return g},EI:function(){return me},uW:function(){return f},Vt:function(){return d}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const K=H(ue);let I=h[K];return I||(I=V(),h[K]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function d(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function me(ue){Object.freeze(ue);const V={atVersion(K){return ue[K]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(jt,De,r){"use strict";r.d(De,{X2:function(){return me},ce:function(){return ue},h$:function(){return d}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),d=V=>{const{children:K,entity:I,loading:w,error:se,refresh:_}=V,te={entity:I,loading:w,error:se,refresh:_};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:te}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:K})})},B=V=>_jsx(d,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function me(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");if(!K.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:K.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");const{entity:I,loading:w,error:se,refresh:_}=K;return{entity:I,loading:w,error:se,refresh:_}}},43514:function(jt,De,r){"use strict";r.d(De,{h$:function(){return bt.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return Kn},df:function(){return Me},UO:function(){return nt},ph:function(){return us},dq:function(){return Ot},nl:function(){return Do},dx:function(){return ce},rI:function(){return Se},u3:function(){return Nt},xE:function(){return Yn},sL:function(){return lr},LH:function(){return b},U_:function(){return ko},pp:function(){return ls},EW:function(){return Hn},Ah:function(){return H},wi:function(){return X},hF:function(){return oe.hF},CV:function(){return oe.CV},$3:function(){return Z},p3:function(){return f},ce:function(){return bt.ce},X2:function(){return bt.X2},wp:function(){return yt},ZW:function(){return en},eK:function(){return _t},CR:function(){return Bn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const R of this.subscribers)R.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 d=r(52322),B=r(2784),me=r(41156),ue=r(60364),V=r(77277),K=r(4190),I=r(95544),w=r(90436),se=r(60905),_=r(36444);const te=x=>{const C=(0,me.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[D,ee]=(0,B.useState)(!1);return C?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>ee(!0),startIcon:(0,d.jsx)(_.Z,{}),children:"Filters"}),(0,d.jsx)(K.ZP,{open:D,onClose:()=>ee(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,d.jsxs)(I.Z,{m:2,children:[(0,d.jsx)(w.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),x.children]})})]}):(0,d.jsx)(se.Z,{item:!0,lg:2,children:x.children})},$=x=>(0,d.jsx)(se.Z,{item:!0,xs:12,lg:10,children:x.children}),T=x=>(0,d.jsx)(se.Z,{container:!0,style:{position:"relative"},children:x.children});T.Filters=te,T.Content=$;var P=r(53974),L=r(87612),O=r(25271),oe=r(49280);class Le{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class Ve{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class z{filterEntity(C){var R;return this.values.every(D=>((R=C.metadata.tags)!==null&&R!==void 0?R:[]).includes(D))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class xt{filterEntity(C){const R=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([C.metadata.tags]),ee=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const de of R)if(D.every(Q=>Q!==de)&&ee.every(Q=>!Q.includes(de)))return!1;return!0}toUpperArray(C){return C.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class ot{filterEntity(C){return this.values.some(R=>(0,oe.hF)(C,O.S4).some(D=>(0,O.eE)(D)===R))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C.reduce((R,D)=>{try{return R.push((0,O.eE)((0,O.of)(D,{defaultKind:"Group"}))),R}catch{return R}},[])}}class Ye{filterEntity(C){return this.values.some(R=>{var D;return((D=C.spec)===null||D===void 0?void 0:D.lifecycle)===R})}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class st{filterEntity(C){return this.values.some(R=>C.metadata.namespace===R)}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class Qe{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,R,D){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=R,this.isStarredEntity=D}}class Ct{filterEntity(C){var R;const D=(R=C.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class Tt{filterEntity(C){var R,D;const ee=(C==null||(R=C.status)===null||R===void 0||(D=R.items)===null||D===void 0?void 0:D.length)>0;return ee!==void 0&&this.value===ee}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}var bt=r(96641),it=r(76635),Pt=r(19126),Zt=r.n(Pt),Ke=r(73557),Xt=r(69294),ge=r(48760),be=r(90736);const Ue=(0,B.createContext)(void 0),nt=x=>{const C=(0,be.default)(),R=(0,h.h_)(H),[D,ee]=(0,B.useState)({}),de=(0,Ke.TH)();var Q;const ve=(0,B.useMemo)(()=>(Q=Zt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&Q!==void 0?Q:{},[de]),[Ae,Re]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ne,error:Fe},rt]=(0,Xt.default)(async()=>{const $e=(0,it.compact)(Object.values(D)),Je=(0,oe.Gz)($e),Et=(0,oe.wq)($e),an=(0,oe.wq)((0,it.compact)(Object.values(Ae.appliedFilters))),Jt=Object.keys(D).reduce((ln,wn)=>{const Pn=D[wn];return Pn!=null&&Pn.toQueryValue&&(ln[wn]=Pn.toQueryValue()),ln},{});if((0,it.isEqual)(an,Et))Re({appliedFilters:D,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(Je)});else{const ln=await R.getEntities({filter:Et});Re({appliedFilters:D,backendEntities:ln.items,entities:ln.items.filter(Je)})}if(C()){var on;const ln=Zt().parse(de.search,{ignoreQueryPrefix:!0}),wn=Zt().stringify({...ln,filters:Jt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Pn=`${window.location.pathname}${wn}`;(on=window.history)===null||on===void 0||on.replaceState(null,document.title,Pn)}},[R,ve,D,Ae],{loading:!0});(0,ge.Z)(rt,10,[D]);const ct=(0,B.useCallback)($e=>{ee(Je=>{const Et=typeof $e=="function"?$e(Je):$e;return{...Je,...Et}})},[]),Ge=(0,B.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:ct,queryParameters:ve,loading:Ne,error:Fe}),[Ae,ct,ve,Ne,Fe]);return(0,d.jsx)(Ue.Provider,{value:Ge,children:x.children})};function yt(){const x=(0,B.useContext)(Ue);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var gt=r(64279),pt=r(18149),Bt=r.n(pt),zt=r(829),Kt=r.n(zt);function $t(){const x=(0,h.h_)(H),{filters:{kind:C,type:R},queryParameters:{type:D},updateFilters:ee}=yt(),de=(0,B.useMemo)(()=>[D].flat().filter(Boolean),[D]);var Q;const[ve,Ae]=(0,B.useState)(de.length?de:(Q=R==null?void 0:R.getTypes())!==null&&Q!==void 0?Q:[]);(0,B.useEffect)(()=>{de.length&&Ae(de)},[de]);const[Re,Ne]=(0,B.useState)([]),Fe=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:rt,loading:ct,value:Ge}=(0,gt.default)(async()=>Fe?await x.getEntityFacets({filter:{kind:Fe},facets:["spec.type"]}).then(Et=>Et.facets["spec.type"]||[]):[],[Fe,x]),$e=(0,B.useRef)(Ge);return(0,B.useEffect)(()=>{const Je=$e.current;if($e.current=Ge,ct||!Fe||Je===Ge||!Ge)return;const Et=[...new Set(Kt()(Ge,Jt=>-Jt.count).map(Jt=>Jt.value.toLocaleLowerCase("en-US")))];Ne(Et);const an=ve.filter(Jt=>Et.includes(Jt));Bt()(ve,an)||Ae(an)},[ct,Fe,ve,Ae,Ge]),(0,B.useEffect)(()=>{ee({type:ve.length?new Ve(ve):void 0})},[ve,ee]),{loading:ct,error:rt,availableTypes:Re,selectedTypes:ve,setSelectedTypes:Ae}}const qt=20;function _t(x,C){var R,D;const ee=C==null||(R=C.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=C==null||(D=C.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),Q=(0,h.h_)(H),{loading:ve,value:Ae,error:Re}=(0,gt.default)(async()=>{var Ne;const Fe=(Ne=x.relations)===null||Ne===void 0?void 0:Ne.map($e=>({type:$e.type,target:(0,O.of)($e.targetRef)})).filter($e=>(!ee||$e.type.toLocaleLowerCase("en-US")===ee)&&(!de||$e.target.kind===de));if(!Fe)return[];const rt=Object.values((0,it.groupBy)(Fe,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),ct=[];for(const $e of rt)ct.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,it.chunk)($e.map(Je=>Je.target.name),qt)});return(await Promise.all(ct.flatMap($e=>$e.nameBatches.map(Je=>Q.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":Je}}))))).flatMap($e=>$e.items)},[x,ee,de]);return{entities:Ae,loading:ve,error:Re}}var mn=r(72164);function zn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Bn(){const x=(0,h.h_)(f),C=(0,mn.Z)(x.starredEntitie$(),new Set),R=(0,B.useCallback)(ee=>C.has(zn(ee)),[C]),D=(0,B.useCallback)(ee=>x.toggleStarred(zn(ee)).then(),[x]);return{starredEntities:C,toggleStarredEntity:D,isStarredEntity:R}}function vn(x){return typeof x=="string"?x:(0,O.eE)(x)}function $n(x){const C=(0,h.h_)(f),[R,D]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=C.starredEntitie$().subscribe({next(Q){D(Q.has(vn(x)))}});return()=>{de.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(vn(x)).then(),[x,C]),isStarredEntity:R}}var Dn=r(75435);function en(){const x=(0,h.h_)(h.$4),{loading:C,value:R}=(0,gt.default)(async()=>{const{ownershipEntityRefs:ee}=await x.getBackstageIdentity();return ee},[]),D=(0,B.useMemo)(()=>{const ee=new Set(R!=null?R:[]);return de=>{const Q=(0,Dn.h)(de,O.S4).map(O.eE);for(const ve of Q)if(ee.has(ve))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:D}),[C,D])}function En(){const x=(0,h.h_)(H),{error:C,loading:R,value:D}=(0,gt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(de=>{var Q;return((Q=de.facets.kind)===null||Q===void 0?void 0:Q.map(ve=>ve.value).sort())||[]}),[x]);return{loading:R,error:C,allKinds:D!=null?D:[]}}function Wn(x,C,R){let D=x;return C&&(D=D.filter(de=>C.some(Q=>Q.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!x.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(D=D.concat([R])),D.sort().reduce((de,Q)=>(de[Q.toLocaleLowerCase("en-US")]=Q,de),{})}function ft(x){var C;const{filters:R,queryParameters:{kind:D},updateFilters:ee}=yt(),de=(0,B.useMemo)(()=>[D].flat()[0],[D]);var Q;const[ve,Ae]=(0,B.useState)((Q=de!=null?de:(C=R.kind)===null||C===void 0?void 0:C.value)!==null&&Q!==void 0?Q:x.initialFilter);(0,B.useEffect)(()=>{de&&Ae(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var ct;Ae((ct=R.kind)===null||ct===void 0?void 0:ct.value)}},[R.kind]),(0,B.useEffect)(()=>{ee({kind:ve?new Le(ve):void 0})},[ve,ee]);const{allKinds:Re,loading:Ne,error:Fe}=En();return{loading:Ne,error:Fe,allKinds:Re!=null?Re:[],selectedKind:ve,setSelectedKind:Ae}}const Kn=x=>{const{allowedKinds:C,hidden:R,initialFilter:D="component"}=x,ee=(0,h.h_)(h.$v),{error:de,allKinds:Q,selectedKind:ve,setSelectedKind:Ae}=ft({initialFilter:D});if((0,B.useEffect)(()=>{de&&ee.post({message:"Failed to load entity kinds",severity:"error"})},[de,ee]),de)return null;const Re=Wn(Q,C,ve),Ne=Object.keys(Re).map(Fe=>({value:Fe,label:Re[Fe]}));return R?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Kind",items:Ne,selected:ve.toLocaleLowerCase("en-US"),onChange:Fe=>Ae(String(Fe))})})};var Rt=r(79692),at=r(5806),bn=r(21324),Gt=r(86619),sn=r(19996),An=r(25505),cn=r(38016),In=r(88013);const we=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ae=(0,d.jsx)(An.Z,{fontSize:"small"}),Be=(0,d.jsx)(sn.Z,{fontSize:"small"}),Me=x=>{var C;const{initialFilter:R=[]}=x,D=we(),{updateFilters:ee,backendEntities:de,filters:Q,queryParameters:{lifecycles:ve}}=yt(),Ae=(0,B.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var Re;const[Ne,Fe]=(0,B.useState)(Ae.length?Ae:(Re=(C=Q.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Re!==void 0?Re:R);(0,B.useEffect)(()=>{Ae.length&&Fe(Ae)},[Ae]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(ct=>{var Ge;return(Ge=ct.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{ee({lifecycles:Ne.length&&rt.length?new Ye(Ne):void 0})},[Ne,ee,rt]),rt.length?(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(w.Z,{variant:"button",component:"label",children:["Lifecycle",(0,d.jsx)(In.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:Ne,onChange:(ct,Ge)=>Fe(Ge),renderOption:(ct,{selected:Ge})=>(0,d.jsx)(at.Z,{control:(0,d.jsx)(bn.Z,{icon:ae,checkedIcon:Be,checked:Ge}),onClick:$e=>$e.preventDefault(),label:ct}),size:"small",popupIcon:(0,d.jsx)(cn.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:ct=>(0,d.jsx)(Gt.Z,{...ct,className:D.input,variant:"outlined"})})]})}):null};var _e=r(72579),ne=r.n(_e);function Z(x,C){const R=C==null?void 0:C.defaultKind;let D,ee,de;return"metadata"in x?(D=x.kind,ee=x.metadata.namespace,de=x.metadata.name):(D=x.kind,ee=x.namespace,de=x.name),(ee===void 0||ee==="")&&(ee=O.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===ee&&(ee=void 0):ee===O.zG&&(ee=void 0),D=D.toLocaleLowerCase("en-US"),D=R&&R.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${ee?`${ee}/`:""}${de}`}function pe(x,C){for(const R of["spec.profile.displayName","metadata.title"]){const D=ne()(x,R);if(D&&typeof D=="string")return D}return Z(x,C)}const Ze=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Xe=(0,d.jsx)(An.Z,{fontSize:"small"}),lt=(0,d.jsx)(sn.Z,{fontSize:"small"}),Ot=()=>{var x;const C=Ze(),{updateFilters:R,backendEntities:D,filters:ee,queryParameters:{owners:de}}=yt(),Q=(0,h.h_)(H),ve=(0,h.h_)(h.VE),Ae=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var Re;const[Ne,Fe]=(0,B.useState)(Ae.length?new ot(Ae).values:(Re=(x=ee.owners)===null||x===void 0?void 0:x.values)!==null&&Re!==void 0?Re:[]),{loading:rt,error:ct,value:Ge}=(0,gt.default)(async()=>{const Je=[...new Set(D.flatMap(Jt=>(0,oe.hF)(Jt,O.S4).map(on=>(0,O.eE)(on))).filter(Boolean))],{items:Et}=await Q.getEntitiesByRefs({entityRefs:Je,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return Et.map((Jt,on)=>Jt?{label:pe(Jt,{defaultKind:"Group"}),entityRef:(0,O.eE)(Jt)}:{label:Z((0,O.of)(Je[on]),{defaultKind:"group"}),entityRef:Je[on]}).sort((Jt,on)=>Jt.label.localeCompare(on.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[D]);if((0,B.useEffect)(()=>{ct&&ve.post({...ct,message:`EntityOwnerPicker failed to initialize: ${ct.message}`},{})},[ct,ve]),(0,B.useEffect)(()=>{if(Ae.length){const Je=new ot(Ae);Fe(Je.values)}},[Ae]),(0,B.useEffect)(()=>{!rt&&Ge&&R({owners:Ne.length&&Ge.length?new ot(Ne):void 0})},[Ne,R,Ge,rt]),!rt&&!(Ge!=null&&Ge.length))return null;var $e;return(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(w.Z,{variant:"button",component:"label",children:["Owner",(0,d.jsx)(In.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:Ge||[],value:($e=Ge==null?void 0:Ge.filter(Je=>Ne.some(Et=>Et===Je.entityRef)))!==null&&$e!==void 0?$e:[],onChange:(Je,Et)=>Fe(Et.map(an=>an.entityRef)),getOptionLabel:Je=>Je.label,renderOption:(Je,{selected:Et})=>(0,d.jsx)(at.Z,{control:(0,d.jsx)(bn.Z,{icon:Xe,checkedIcon:lt,checked:Et}),onClick:an=>an.preventDefault(),label:Je.label}),size:"small",popupIcon:(0,d.jsx)(cn.Z,{"data-testid":"owner-picker-expand"}),renderInput:Je=>(0,d.jsx)(Gt.Z,{...Je,className:C.input,variant:"outlined"})})]})})};var Ft=r(51837);const X=(0,Ft.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Y(x){var C,R;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(R=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:x.metadata.name}}var le=r(80030);const ce=(0,B.forwardRef)((x,C)=>{const{entityRef:R,defaultKind:D,title:ee,children:de,...Q}=x,ve=(0,h.tg)(X);let Ae,Re,Ne;if(typeof R=="string"){const $e=(0,O.of)(R);Ae=$e.kind,Re=$e.namespace,Ne=$e.name}else"metadata"in R?(Ae=R.kind,Re=R.metadata.namespace,Ne=R.metadata.name):(Ae=R.kind,Re=R.namespace,Ne=R.name);Ae=Ae.toLocaleLowerCase("en-US");var Fe;Re=(Fe=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&Fe!==void 0?Fe:O.zG;const rt={kind:Ae,namespace:Re,name:Ne},ct=Z({kind:Ae,namespace:Re,name:Ne},{defaultKind:D}),Ge=(0,d.jsxs)(P.rU,{...Q,ref:C,to:ve(rt),children:[de,!de&&(ee!=null?ee:ct)]});return ee?(0,d.jsx)(le.ZP,{title:ct,children:Ge}):Ge});function ye(x){const{entityRefs:C,defaultKind:R,getTitle:D,...ee}=x,de=(0,h.h_)(H),{value:Q=new Array,loading:ve,error:Ae}=(0,gt.default)(async()=>{const Re=C.reduce((Fe,rt)=>typeof rt=="object"&&"metadata"in rt?Fe:[...Fe,(0,O.of)(rt)],new Array),Ne=C.filter(Fe=>typeof Fe=="object"&&"metadata"in Fe);return Re.length>0?[...(await de.getEntities({filter:Re.map(Fe=>({kind:Fe.kind,"metadata.namespace":Fe.namespace,"metadata.name":Fe.name}))})).items,...Ne]:Ne},[C]);return ve?(0,d.jsx)(P.Ex,{}):Ae?(0,d.jsx)(P.yu,{error:Ae}):(0,d.jsx)(d.Fragment,{children:Q.map((Re,Ne)=>(0,d.jsxs)(B.Fragment,{children:[Ne>0&&", ",(0,d.jsx)(ce,{...ee,defaultKind:R,entityRef:Re,title:D(Re)})]},Ne))})}function Se(x){const{entityRefs:C,defaultKind:R,fetchEntities:D,getTitle:ee,...de}=x;return D?(0,d.jsx)(ye,{...de,defaultKind:R,entityRefs:C,getTitle:ee}):(0,d.jsx)(d.Fragment,{children:C.map((Q,ve)=>(0,d.jsxs)(B.Fragment,{children:[ve>0&&", ",(0,d.jsx)(ce,{...de,defaultKind:R,entityRef:Q,title:ee?ee(Q):void 0})]},ve))})}const y=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},M=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),re=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},q=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},Te=(0,Rt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ie=4,et=x=>{var C,R,D;const{entityRef:ee,children:de,delayTime:Q=500}=x,ve=Te(),Ae=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ne,Fe]=useState(!1),rt=useMemo(()=>debounce(()=>Fe(!0),Q),[Q]),[{loading:ct,error:Ge,value:$e},Je]=useAsyncFn(async()=>{const an=Ae.get(catalogApiRef);if(an){const Jt=await an.getEntityByRef(ee);if(!Jt)throw new Error(`${ee} not found`);return Jt}},[Ae,ee]),Et=()=>{Fe(!1),rt.cancel()};return useEffect(()=>{Re.isOpen&&!$e&&!Ge&&!ct&&Je()},[Re.isOpen,Je,$e,Ge,ct]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:de})}),Ne&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Et,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ge&&_jsx(ResponseErrorPanel,{error:Ge}),ct&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(C=$e.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,Ie).map(an=>_jsx(Chip,{size:"small",label:an},an)),((R=$e.metadata.tags)===null||R===void 0?void 0:R.length)&&((D=$e.metadata.tags)===null||D===void 0?void 0:D.length)>Ie&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ge&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},wt=(0,Rt.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),dt=()=>{var x;const C=wt(),{filters:R,updateFilters:D}=useEntityList();var ee;const[de,Q]=useState((ee=(x=R.text)===null||x===void 0?void 0:x.value)!==null&&ee!==void 0?ee:"");return useDebounce(()=>{D({text:de.length?new EntityTextFilter(de):void 0})},250,[de,D]),_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=>Q(ve.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>Q(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},He=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function R(D){var ee;return((ee=D.metadata)===null||ee===void 0?void 0:ee.title)||Z(D,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(D,ee){return R(ee).includes(D)},customSort(D,ee){return R(D).localeCompare(R(ee))},render:D=>{var ee;return(0,d.jsx)(ce,{entityRef:D,defaultKind:C,title:(ee=D.metadata)===null||ee===void 0?void 0:ee.title})}}},createEntityRelationColumn(x){const{title:C,relation:R,defaultKind:D,filter:ee}=x;function de(ve){return(0,oe.hF)(ve,R,ee)}function Q(ve){return de(ve).map(Ae=>Z(Ae,{defaultKind:D})).join(", ")}return{title:C,customFilterAndSearch(ve,Ae){return Q(Ae).includes(ve)},customSort(ve,Ae){return Q(ve).localeCompare(Q(Ae))},render:ve=>(0,d.jsx)(Se,{entityRefs:de(ve),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:O.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:O.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:O.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,d.jsx)(P.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ut=[He.createEntityRefColumn({defaultKind:"system"}),He.createDomainColumn(),He.createOwnerColumn(),He.createMetadataDescriptionColumn()],St=[He.createEntityRefColumn({defaultKind:"component"}),He.createSystemColumn(),He.createOwnerColumn(),He.createSpecTypeColumn(),He.createSpecLifecycleColumn(),He.createMetadataDescriptionColumn()],tt=(0,Rt.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Nt=x=>{const{entities:C,title:R,emptyContent:D,variant:ee="gridItem",columns:de}=x,Q=tt(),ve={minWidth:"0",width:"100%"};return ee==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,d.jsx)(P.iA,{columns:de,title:R,style:ve,emptyContent:D&&(0,d.jsx)("div",{className:Q.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Nt.columns=He,Nt.systemEntityColumns=ut,Nt.componentEntityColumns=St;const rn=(0,d.jsx)(An.Z,{fontSize:"small"}),Yt=(0,d.jsx)(sn.Z,{fontSize:"small"});function Vt({selected:x}){return(0,d.jsx)(bn.Z,{icon:rn,checkedIcon:Yt,checked:x})}const Dt=(0,B.memo)(x=>{const{selected:C,value:R,availableOptions:D,showCounts:ee}=x,de=ee?`${R} (${D==null?void 0:D[R]})`:R;return(0,d.jsx)(at.Z,{control:(0,d.jsx)(Vt,{selected:C}),label:de,onClick:Q=>Q.preventDefault()})});var tn=r(72779),Lt=r.n(tn);const kt=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function dn(x){const C=kt();return(0,d.jsx)(Gt.Z,{variant:"outlined",...x,className:Lt()(C.input,x.className)})}function Sn(x){var C;const{label:R,name:D,path:ee,showCounts:de,Filter:Q,InputProps:ve}=x,{updateFilters:Ae,filters:Re,queryParameters:{[D]:Ne}}=yt(),Fe=(0,h.h_)(H),{value:rt}=(0,gt.default)(async()=>{var on;const ln=ee,{facets:wn}=await Fe.getEntityFacets({facets:[ln],filter:(on=Re.kind)===null||on===void 0?void 0:on.getCatalogFilters()});return Object.fromEntries(wn[ln].map(({value:Pn,count:Sr})=>[Pn,Sr]))},[Re.kind]),ct=(0,B.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var Ge;const[$e,Je]=(0,B.useState)(ct.length?ct:(Ge=(C=Re[D])===null||C===void 0?void 0:C.values)!==null&&Ge!==void 0?Ge:[]);(0,B.useEffect)(()=>{ct.length&&Je(ct)},[ct]);const Et=Object.keys(rt!=null?rt:{}),an=$e.length&&Et.length;(0,B.useEffect)(()=>{Ae({[D]:an?new Q($e):void 0})},[D,an,$e,Q,Ae]);const Jt=Re[D];return Jt&&typeof Jt=="object"&&!("values"in Jt)||!Et.length||Et.length<=1?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(w.Z,{variant:"button",component:"label",children:[R,(0,d.jsx)(In.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Et,value:$e,onChange:(on,ln)=>Je(ln),renderOption:(on,{selected:ln})=>(0,d.jsx)(Dt,{selected:ln,value:on,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,d.jsx)(cn.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:on=>(0,d.jsx)(dn,{...on,...ve})})]})})}const Vn=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Yn=x=>{const C=Vn();return(0,d.jsx)(Sn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:x.showCounts,InputProps:{className:C.input}})},lr=x=>{const{hidden:C,initialFilter:R}=x,D=(0,h.h_)(h.$v),{error:ee,availableTypes:de,selectedTypes:Q,setSelectedTypes:ve}=$t();if((0,B.useEffect)(()=>{ee&&D.post({message:"Failed to load entity types",severity:"error"}),R&&ve([R])},[ee,D,R,ve]),de.length===0||ee)return null;const Ae=[{value:"all",label:"all"},...de.map(Ne=>({value:Ne,label:Ne}))];var Re;return C?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Type",items:Ae,selected:(Re=Ae.length>1?Q[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:Ne=>ve(Ne==="all"?[]:[String(Ne)])})})};var Tn=r(15459),Zn=r(61837),qn=r(11640),S=r(28347);const c=(0,Tn.Z)({root:{color:"#f3ba37"}})(qn.Z),b=x=>{const{toggleStarredEntity:C,isStarredEntity:R}=$n(x.entity);return(0,d.jsx)(Zn.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,d.jsx)(le.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,d.jsx)(c,{}):(0,d.jsx)(S.Z,{})})})};var E=r(8629),J=r(79249),xe=r(38724),Ee=r(99152),ke=r(6487),ht=r(49429),mt=r(55999),yn=r(39412);const Nn=yn.Z;function mr(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,O.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function kr(x,C){const R=(0,h.qD)(),D=mr(x,C);return D&&R.getSystemIcon(`kind:${D}`)||Nn}function Br(x){const{kind:C,entityRef:R,...D}=x,ee=kr(C,R);return(0,d.jsx)(ee,{...D})}const Eo=(0,Rt.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 qr(x){const C=(0,h.h_)(H),R=(0,O.eE)(x),{loading:D,error:ee,value:de}=(0,gt.default)(async()=>{const Q=await C.getEntityAncestors({entityRef:R}),ve=new Array,Ae=new Array;for(const Re of Q.items){const Ne=(0,O.eE)(Re.entity),Fe=Ne===Q.rootEntityRef;ve.push({id:Ne,root:Fe,...Re.entity});for(const rt of Re.parentEntityRefs)Ae.push({from:Ne,to:rt})}return{nodes:ve,edges:Ae}},[R]);return{loading:D,error:ee,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function vr({node:x}){const C=Eo(),R=(0,Ke.s0)(),D=(0,h.tg)(X),[ee,de]=(0,B.useState)(0),[Q,ve]=(0,B.useState)(0),Ae=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ae.current){let{height:Je,width:Et}=Ae.current.getBBox();Je=Math.round(Je),Et=Math.round(Et),(Je!==Q||Et!==ee)&&(de(Et),ve(Je))}},[ee,Q]);const Re=10,Ne=Q,Fe=Ne+Re,rt=Fe+ee+Re*2,ct=Q+Re*2,Ge=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?Z({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),$e=()=>{R(D({kind:x.kind,namespace:x.metadata.namespace||O.zG,name:x.metadata.name}))};return(0,d.jsxs)("g",{onClick:$e,className:C.clickable,children:[(0,d.jsx)("rect",{className:Lt()(C.node,x.root?"secondary":"primary"),width:rt,height:ct,rx:10}),(0,d.jsx)(Br,{kind:x.kind,y:Re,x:Re,width:Ne,height:Ne,className:Lt()(C.text,x.root?"secondary":"primary")}),(0,d.jsx)("text",{ref:Ae,className:Lt()(C.text,x.root?"secondary":"primary"),y:ct/2,x:Fe+(ee+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ge})]})}function wr(x){const{loading:C,error:R,nodes:D,edges:ee}=qr(x.entity);return C?(0,d.jsx)(P.Ex,{}):R?(0,d.jsx)(P.Gk,{error:R}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{variant:"h2",children:"Ancestry"}),(0,d.jsxs)(mt.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,d.jsx)(P.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,d.jsx)(I.Z,{mt:4,children:(0,d.jsx)(P.mn,{nodes:D,edges:ee,renderNode:vr,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var rr=r(11776),Jn=r(38402),jr=r(86136),yr=r(99688),Ao=r(49378),To=r(54506),_r=r(94339),Ro=r(24579),Io=r(27685);const Vr=(0,Rt.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=Vr();return(0,d.jsx)(Ao.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function $r(x){const C=Vr();return(0,d.jsx)(To.Z,{className:C.monospace,children:x.children})}function Dr(x){return(0,d.jsx)(I.Z,{mt:2,children:(0,d.jsx)(_r.Z,{variant:"outlined",children:(0,d.jsxs)(Ro.Z,{children:[(0,d.jsxs)(w.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,d.jsx)(Hr,{to:x.helpLink})]}),x.children]})})})}function eo(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Er(x){const[C,R]=x.entry,D=eo(R);return(0,d.jsxs)(Jn.Z,{children:[x.indent&&(0,d.jsx)(jr.Z,{}),(0,d.jsx)(_n,{primary:C,secondary:D?(0,d.jsx)(P.rU,{to:D,children:R}):R})]})}function Hr(x){const C=Vr();return(0,d.jsx)(P.rU,{to:x.to,className:C.helpIcon,children:(0,d.jsx)(Io.Z,{fontSize:"inherit"})})}const Po=(0,Rt.Z)({root:{display:"flex",flexDirection:"column"}});function to(x){var C,R;const D=(0,h.h_)(H),ee=(0,O.eE)(x),de=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.P1],Q=(R=x.metadata.annotations)===null||R===void 0?void 0:R[O.q1],{loading:ve,error:Ae,value:Re}=(0,gt.default)(async()=>!de&&!Q?[]:(await D.getEntities({filter:[...de?[{[`metadata.annotations.${O.P1}`]:de}]:[],...Q?[{[`metadata.annotations.${O.q1}`]:Q}]:[]]})).items,[de,Q]);return{loading:ve,error:Ae,location:de,originLocation:Q,colocatedEntities:Re==null?void 0:Re.filter(Ne=>(0,O.eE)(Ne)!==ee)}}function Cn(x){return(0,d.jsxs)(rr.Z,{dense:!0,children:[x.header&&(0,d.jsx)(Er,{entry:x.header},"header"),x.entities.map(C=>(0,d.jsxs)(Jn.Z,{children:[(0,d.jsx)(jr.Z,{children:(0,d.jsx)(Br,{kind:C.kind})}),(0,d.jsx)(_n,{primary:(0,d.jsx)(ce,{entityRef:C})})]},(0,O.eE)(C)))]})}function no(x){const{entity:C}=x,{loading:R,error:D,location:ee,originLocation:de,colocatedEntities:Q}=to(C);if(R)return(0,d.jsx)(P.Ex,{});if(D)return(0,d.jsx)(P.Gk,{error:D});if(!ee&&!de)return(0,d.jsx)(yr.Z,{severity:"warning",children:"Entity had no location information."});if(!(Q!=null&&Q.length))return(0,d.jsx)(yr.Z,{severity:"info",children:"There were no other entities on this location."});if(ee===de)return(0,d.jsx)(Cn,{entities:Q});const ve=Q.filter(Re=>{var Ne;return((Ne=Re.metadata.annotations)===null||Ne===void 0?void 0:Ne[O.P1])===ee}),Ae=Q.filter(Re=>{var Ne;return((Ne=Re.metadata.annotations)===null||Ne===void 0?void 0:Ne[O.q1])===de});return(0,d.jsxs)(d.Fragment,{children:[ve.length>0&&(0,d.jsx)(Cn,{entities:ve,header:["At the same location",ee]}),Ae.length>0&&(0,d.jsx)(Cn,{entities:Ae,header:["At the same origin",de]})]})}function ro(x){const C=Po();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{variant:"h2",children:"Colocated"}),(0,d.jsx)(mt.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,d.jsx)("div",{className:C.root,children:(0,d.jsx)(no,{entity:x.entity})})]})}function oo(x){return Object.fromEntries([...Object.entries(x)].sort((C,R)=>C[0]<R[0]?-1:1))}function xr(x){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{variant:"h2",children:"Entity as JSON"}),(0,d.jsx)(mt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,d.jsx)(mt.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:JSON.stringify(oo(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Lo=r(3440),so=r.n(Lo);const Oo=(0,Rt.Z)({root:{display:"flex",flexDirection:"column"}});function io(x){var C,R;const D=Oo(),{apiVersion:ee,kind:de,metadata:Q,spec:ve,relations:Ae=[],status:Re={}}=x.entity,Ne=so()(Kt()(Ae,Fe=>Fe.targetRef),"type");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{variant:"h2",children:"Overview"}),(0,d.jsxs)("div",{className:D.root,children:[(0,d.jsx)(Dr,{title:"Identity",children:(0,d.jsxs)(rr.Z,{dense:!0,children:[(0,d.jsx)(Jn.Z,{children:(0,d.jsx)(_n,{primary:"apiVersion",secondary:ee})}),(0,d.jsx)(Jn.Z,{children:(0,d.jsx)(_n,{primary:"kind",secondary:de})}),(ve==null?void 0:ve.type)&&(0,d.jsx)(Jn.Z,{children:(0,d.jsx)(_n,{primary:"spec.type",secondary:ve.type})}),Q.uid&&(0,d.jsx)(Jn.Z,{children:(0,d.jsx)(_n,{primary:"uid",secondary:Q.uid})}),Q.etag&&(0,d.jsx)(Jn.Z,{children:(0,d.jsx)(_n,{primary:"etag",secondary:Q.etag})})]})}),(0,d.jsxs)(Dr,{title:"Metadata",children:[!!Object.keys(Q.annotations||{}).length&&(0,d.jsx)(rr.Z,{dense:!0,subheader:(0,d.jsxs)($r,{children:["Annotations",(0,d.jsx)(Hr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(Q.annotations).map(Fe=>(0,d.jsx)(Er,{indent:!0,entry:Fe},Fe[0]))}),!!Object.keys(Q.labels||{}).length&&(0,d.jsx)(rr.Z,{dense:!0,subheader:(0,d.jsx)($r,{children:"Labels"}),children:Object.entries(Q.labels).map(Fe=>(0,d.jsx)(Er,{indent:!0,entry:Fe},Fe[0]))}),!!(!((C=Q.tags)===null||C===void 0)&&C.length)&&(0,d.jsx)(rr.Z,{dense:!0,subheader:(0,d.jsx)($r,{children:"Tags"}),children:Q.tags.map((Fe,rt)=>(0,d.jsxs)(Jn.Z,{children:[(0,d.jsx)(jr.Z,{}),(0,d.jsx)(_n,{primary:Fe})]},`${Fe}-${rt}`))})]}),!!Ae.length&&(0,d.jsx)(Dr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([Fe,rt],ct)=>(0,d.jsx)("div",{children:(0,d.jsx)(rr.Z,{dense:!0,subheader:(0,d.jsx)($r,{children:Fe}),children:rt.map(Ge=>(0,d.jsxs)(Jn.Z,{children:[(0,d.jsx)(jr.Z,{children:(0,d.jsx)(Br,{entityRef:Ge.targetRef})}),(0,d.jsx)(_n,{primary:(0,d.jsx)(ce,{entityRef:Ge.targetRef})})]},Ge.targetRef))})},ct))}),!!(!((R=Re.items)===null||R===void 0)&&R.length)&&(0,d.jsx)(Dr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((Fe,rt)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)(w.Z,{children:[Fe.level,": ",Fe.type]}),(0,d.jsx)(I.Z,{ml:2,children:Fe.message})]},rt))})]})]})}var br=r(72847);function ss(x){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{variant:"h2",children:"Entity as YAML"}),(0,d.jsx)(mt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,d.jsx)(mt.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:br.ZP.stringify(oo(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const ao=(0,Rt.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 cr(x){const{children:C,value:R,index:D,...ee}=x,de=ao();return(0,d.jsx)("div",{role:"tabpanel",hidden:R!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:de.tabContents,...ee,children:R===D&&(0,d.jsx)(I.Z,{pl:3,pr:3,children:C})})}function Ar(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function ko(x){const C=ao(),[R,D]=B.useState(0);return(0,B.useEffect)(()=>{D(0)},[x.open]),x.entity?(0,d.jsxs)(E.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,d.jsx)(J.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,d.jsx)(xe.Z,{dividers:!0,children:(0,d.jsxs)("div",{className:C.root,children:[(0,d.jsxs)(Ee.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(ee,de)=>D(de),"aria-label":"Inspector options",className:C.tabs,children:[(0,d.jsx)(ke.Z,{label:"Overview",...Ar(0)}),(0,d.jsx)(ke.Z,{label:"Ancestry",...Ar(1)}),(0,d.jsx)(ke.Z,{label:"Colocated",...Ar(2)}),(0,d.jsx)(ke.Z,{label:"Raw JSON",...Ar(3)}),(0,d.jsx)(ke.Z,{label:"Raw YAML",...Ar(4)})]}),(0,d.jsx)(cr,{value:R,index:0,children:(0,d.jsx)(io,{entity:x.entity})}),(0,d.jsx)(cr,{value:R,index:1,children:(0,d.jsx)(wr,{entity:x.entity})}),(0,d.jsx)(cr,{value:R,index:2,children:(0,d.jsx)(ro,{entity:x.entity})}),(0,d.jsx)(cr,{value:R,index:3,children:(0,d.jsx)(xr,{entity:x.entity})}),(0,d.jsx)(cr,{value:R,index:4,children:(0,d.jsx)(ss,{entity:x.entity})})]})}),(0,d.jsx)(ht.Z,{children:(0,d.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Qn=r(85256);function Ws(x){var C;const R=(0,h.h_)(H),D=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.q1],ee=x.metadata.uid,de=D==="bootstrap:bootstrap",Q=(0,gt.default)(async()=>{const Ge=R.getLocationByRef(D);let $e;if(!D)$e=Promise.resolve([]);else{const Je=`metadata.annotations.${O.q1}`;$e=R.getEntities({filter:{[Je]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Et=>Et.items)}return Promise.all([Ge,$e]).then(([Je,Et])=>({location:Je,colocatedEntities:Et}))},[R,x]),ve=(0,B.useCallback)(async function(){const{location:$e}=Q.value;await R.removeLocationById($e.id)},[R,Q]),Ae=(0,B.useCallback)(async function(){await R.removeEntityByUid(ee)},[R,ee]);if(de)return{type:"bootstrap",location:D,deleteEntity:Ae};const{loading:Re,error:Ne,value:Fe}=Q;if(Re)return{type:"loading"};if(Ne)return{type:"error",error:Ne};const{location:rt,colocatedEntities:ct}=Fe;return rt?{type:"unregister",location:D,colocatedEntities:ct.map(O.iB),unregisterLocation:ve,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var Bo=r(23054);const is=(0,Rt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),as=({entity:x,onConfirm:C,onClose:R})=>{const D=(0,h.h_)(h.$v),ee=(0,h.h_)(h.Ds),de=is(),Q=Ws(x),[ve,Ae]=(0,B.useState)(!1),[Re,Ne]=(0,B.useState)(!1);var Fe;const rt=(Fe=ee.getOptionalString("app.title"))!==null&&Fe!==void 0?Fe:"Backstage",ct=(0,B.useCallback)(async function(){if("unregisterLocation"in Q){Ne(!0);try{await Q.unregisterLocation(),C()}catch(Et){(0,Bo.BD)(Et),D.post({message:Et.message})}finally{Ne(!1)}}},[D,C,Q]),Ge=(0,B.useCallback)(async function(){if("deleteEntity"in Q){Ne(!0);try{await Q.deleteEntity(),C()}catch(Et){(0,Bo.BD)(Et),D.post({message:Et.message})}finally{Ne(!1)}}},[D,C,Q]),$e=()=>(0,d.jsx)(ht.Z,{className:de.dialogActions,children:(0,d.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return Q.type==="loading"?(0,d.jsx)(P.Ex,{}):Q.type==="error"?(0,d.jsx)(P.Gk,{error:Q.error}):Q.type==="bootstrap"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(yr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',Q.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[!ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,d.jsx)($e,{})]}),ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,d.jsx)($e,{})]})]})]}):Q.type==="only-delete"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,d.jsx)($e,{})]}):Q.type==="unregister"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(mt.Z,{children:"This action will unregister the following entities:"}),(0,d.jsx)(mt.Z,{component:"ul",children:Q.colocatedEntities.map(Je=>(0,d.jsx)("li",{children:(0,d.jsx)(ce,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,d.jsx)(mt.Z,{children:"Located at the following location:"}),(0,d.jsx)(mt.Z,{component:"ul",children:(0,d.jsx)("li",{children:Q.location})}),(0,d.jsxs)(mt.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[(0,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:ct,children:"Unregister Location"}),!ve&&(0,d.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,d.jsx)(Qn.Z,{})}),(0,d.jsx)(mt.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"})]})]}):(0,d.jsx)(yr.Z,{severity:"error",children:"Internal error: Unknown state"})},ls=x=>{const{open:C,onConfirm:R,onClose:D,entity:ee}=x;return(0,d.jsxs)(E.Z,{open:C,onClose:D,children:[(0,d.jsx)(J.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,d.jsx)(xe.Z,{children:(0,d.jsx)(as,{entity:ee,onConfirm:R,onClose:D})})]})};var lo=r(12231),cs=r(9520),dr=r(47603);const co=(0,Rt.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 $o(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:dr.Z},{id:"starred",label:"Starred",icon:qn.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const Hn=x=>{const{initialFilter:C,availableFilters:R}=x,D=co(),ee=(0,h.h_)(h.Ds);var de;const Q=(de=ee.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ve,updateFilters:Ae,backendEntities:Re,queryParameters:{kind:Ne,user:Fe},loading:rt}=yt(),ct=["starred","all"],Ge=$o(Q).map(Ln=>({...Ln,items:Ln.items.filter(({id:Fn})=>["group","user"].some(Tr=>Tr===Ne)?ct.includes(Fn):!R||R.includes(Fn))})).filter(({items:Ln})=>!!Ln.length),{isStarredEntity:$e}=Bn(),{isOwnedEntity:Je,loading:Et}=en(),an=rt||Et,Jt=(0,B.useMemo)(()=>new Qe("owned",Je,$e),[Je,$e]),on=(0,B.useMemo)(()=>new Qe("starred",Je,$e),[Je,$e]),ln=(0,B.useMemo)(()=>[Fe].flat()[0],[Fe]),[wn,Pn]=(0,B.useState)(ln!=null?ln:C),Sr=(0,B.useMemo)(()=>Re.filter((0,oe.Gz)((0,it.compact)(Object.values({...ve,user:void 0})))),[ve,Re]),Nr=(0,B.useMemo)(()=>({all:Sr.length,starred:Sr.filter(Ln=>on.filterEntity(Ln)).length,owned:Sr.filter(Ln=>Jt.filterEntity(Ln)).length}),[Sr,on,Jt]);(0,B.useEffect)(()=>{ln&&Pn(ln)},[ln]),(0,B.useEffect)(()=>{!an&&wn&&wn!=="all"&&Nr[wn]===0&&Pn("all")},[an,Nr,wn,Pn]),(0,B.useEffect)(()=>{Ae({user:wn?new Qe(wn,Je,$e):void 0})},[wn,Je,$e,Ae]);var Gr;return(0,d.jsx)(_r.Z,{className:D.root,children:Ge.map(Ln=>(0,d.jsxs)(B.Fragment,{children:[(0,d.jsx)(w.Z,{variant:"subtitle2",component:"span",className:D.title,children:Ln.name}),(0,d.jsx)(_r.Z,{className:D.groupWrapper,children:(0,d.jsx)(rr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Ln.name,children:Ln.items.map(Fn=>{var Tr;return(0,d.jsxs)(lo.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Pn(Fn.id),selected:Fn.id===((Tr=ve.user)===null||Tr===void 0?void 0:Tr.value),className:D.menuItem,disabled:Nr[Fn.id]===0,"data-testid":`user-picker-${Fn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Fn.icon&&(0,d.jsx)(jr.Z,{className:D.listIcon,children:(0,d.jsx)(Fn.icon,{fontSize:"small"})}),(0,d.jsx)(Ao.Z,{children:(0,d.jsxs)(w.Z,{variant:"body1",children:[Fn.label," "]})}),(0,d.jsx)(cs.Z,{children:(Gr=Nr[Fn.id])!==null&&Gr!==void 0?Gr:"-"})]},Fn.id)})})})]},Ln.name))})},uo=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Zr=(0,d.jsx)(An.Z,{fontSize:"small"}),ds=(0,d.jsx)(sn.Z,{fontSize:"small"}),Do=()=>{const x=uo(),{updateFilters:C}=yt(),[R,D]=(0,B.useState)([]);function ee(ve){C({orphan:ve?new Ct(ve):void 0})}function de(ve){C({error:ve?new Tt(ve):void 0})}const Q=["Is Orphan","Has Error"];return(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(w.Z,{variant:"button",component:"label",children:["Processing Status",(0,d.jsx)(In.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Q,value:R,onChange:(ve,Ae)=>{D(Ae),ee(Ae.includes("Is Orphan")),de(Ae.includes("Has Error"))},renderOption:(ve,{selected:Ae})=>(0,d.jsx)(at.Z,{control:(0,d.jsx)(bn.Z,{icon:Zr,checkedIcon:ds,checked:Ae}),onClick:Re=>Re.preventDefault(),label:ve}),size:"small",popupIcon:(0,d.jsx)(cn.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,d.jsx)(Gt.Z,{...ve,className:x.input,variant:"outlined"})})]})})},Zo=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),us=()=>{const x=Zo();return(0,d.jsx)(Sn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:st,InputProps:{className:x.input}})};function ho(x){const{children:C,value:R}=x;var D;const[ee,de]=useState((D=R==null?void 0:R.filters)!==null&&D!==void 0?D:{}),Q=useCallback(Ge=>{de($e=>{const Je=typeof Ge=="function"?Ge($e):Ge;return{...$e,...Je}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,Re,Ne,Fe,rt;const ct=useMemo(()=>({entities:(Ae=R==null?void 0:R.entities)!==null&&Ae!==void 0?Ae:ve.entities,backendEntities:(Re=R==null?void 0:R.backendEntities)!==null&&Re!==void 0?Re:ve.backendEntities,updateFilters:(Ne=R==null?void 0:R.updateFilters)!==null&&Ne!==void 0?Ne:Q,filters:ee,loading:(Fe=R==null?void 0:R.loading)!==null&&Fe!==void 0?Fe:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:ve.queryParameters,error:R==null?void 0:R.error}),[R,ve,ee,Q]);return _jsx(EntityListContext.Provider,{value:ct,children:C})}},75435:function(jt,De,r){"use strict";r.d(De,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let d=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(d=d.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),d}},49280:function(jt,De,r){"use strict";r.d(De,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(d){return d.reduce((B,me)=>({...B,...me.getCatalogFilters?me.getCatalogFilters():{}}),{})}function h(d){return B=>d.every(me=>!me.filterEntity||me.filterEntity(B))}var H=r(75435),f=r(25271);function W(d,B){var me;const ue=(me=d.metadata.annotations)===null||me===void 0?void 0:me[f.M6];if(ue)try{const V=(0,f.Ou)(ue),K=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:K==null?void 0:K.type}}catch{return}}function g(d,B){const me=new Set([...getEntityRelations(d,RELATION_MEMBER_OF,{kind:"group"}),...d?[getCompoundEntityRef(d)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(me.has(V))return!0;return!1}},33414:function(jt,De,r){"use strict";r.r(De),r.d(De,{AboutCard:function(){return ot},AboutContent:function(){return z},AboutField:function(){return O}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(43514),d=r(79692),B=r(94339),me=r(32552),ue=r(61837),V=r(85256),K=r(24579),I=r(52866),w=r(30254),se=r(27604),_=r(2784),te=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,d.Z)(Ye=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ye.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function O(Ye){const{label:st,value:Qe,gridSizes:Ct,children:Tt}=Ye,bt=L(),it=(0,f.vJ)(Tt,Zt=>Zt.getElements()),Pt=it.length>0?it:(0,t.jsx)(P.Z,{variant:"body2",className:bt.value,children:Qe||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...Ct,children:[(0,t.jsx)(P.Z,{variant:"h2",className:bt.label,children:st}),Pt]})}var oe=r(24851);const Le=(0,d.Z)({description:{wordBreak:"break-word"}});function Ve(Ye,st,Qe){if(st==="url"||Ye.includes("://"))return Ye;const Ct=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return st==="file"||Qe.type==="file"?new URL(Ye,Ct).href:Ct}function z(Ye){var st,Qe,Ct,Tt,bt,it,Pt,Zt;const{entity:Ke}=Ye,Xt=Le(),ge=Ke.kind.toLocaleLowerCase("en-US")==="system",be=Ke.kind.toLocaleLowerCase("en-US")==="resource",Ue=Ke.kind.toLocaleLowerCase("en-US")==="component",nt=Ke.kind.toLocaleLowerCase("en-US")==="api",yt=Ke.kind.toLocaleLowerCase("en-US")==="template",gt=Ke.kind.toLocaleLowerCase("en-US")==="location",pt=Ke.kind.toLocaleLowerCase("en-US")==="group",Bt=(0,g.hF)(Ke,h.cz,{kind:"system"}),zt=(0,g.hF)(Ke,h.cz,{kind:"component"}),Kt=(0,g.hF)(Ke,h.cz,{kind:"domain"}),$t=(0,g.hF)(Ke,h.S4);let qt;try{qt=(0,h.CV)(Ke)}catch{qt=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(O,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:Xt.description,content:(Ke==null||(st=Ke.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,t.jsx)(O,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:$t.length>0&&(0,t.jsx)(g.rI,{entityRefs:$t,defaultKind:"group"})}),(ge||Kt.length>0)&&(0,t.jsx)(O,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Kt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Kt,defaultKind:"domain"})}),(nt||Ue||be||Bt.length>0)&&(0,t.jsx)(O,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Bt,defaultKind:"system"})}),Ue&&zt.length>0&&(0,t.jsx)(O,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:zt,defaultKind:"component"})}),(nt||Ue||be||yt||pt||gt||typeof(Ke==null||(Qe=Ke.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,t.jsx)(O,{label:"Type",value:Ke==null||(Ct=Ke.spec)===null||Ct===void 0?void 0:Ct.type,gridSizes:{xs:12,sm:6,lg:4}}),(nt||Ue||typeof(Ke==null||(Tt=Ke.spec)===null||Tt===void 0?void 0:Tt.lifecycle)=="string")&&(0,t.jsx)(O,{label:"Lifecycle",value:Ke==null||(bt=Ke.spec)===null||bt===void 0?void 0:bt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(O,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ke==null||(it=Ke.metadata)===null||it===void 0?void 0:it.tags)||[]).map(_t=>(0,t.jsx)(T.Z,{size:"small",label:_t},_t))}),gt&&((Ke==null||(Pt=Ke.spec)===null||Pt===void 0?void 0:Pt.targets)||(Ke==null||(Zt=Ke.spec)===null||Zt===void 0?void 0:Zt.target))&&(0,t.jsx)(O,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(oe.s,{cols:1,items:(Ke.spec.targets||[Ke.spec.target]).map(_t=>_t).map(_t=>{var mn;return{text:_t,href:Ve(_t,(Ke==null||(mn=Ke.spec)===null||mn===void 0?void 0:mn.type)||"unknown",qt)}})})})]})}const xt=(0,d.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 ot(Ye){var st,Qe,Ct;const{variant:Tt}=Ye,bt=xt(),{entity:it}=(0,g.X2)(),Pt=(0,f.h_)(W.q3),Zt=(0,f.h_)(g.Ah),Ke=(0,f.h_)(f.$v),Xt=(0,f.h_)(f.VE),ge=(0,f.tg)(te.jU),be=(0,g.CV)(it,Pt),Ue=(st=it.metadata.annotations)===null||st===void 0?void 0:st[h.Tf],nt={label:"View Source",disabled:!be,icon:(0,t.jsx)(W.nW,{type:be==null?void 0:be.integrationType}),href:be==null?void 0:be.locationTargetUrl},yt={label:"View TechDocs",disabled:!(!((Qe=it.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(w.Z,{}),href:ge&&ge({namespace:it.metadata.namespace||h.zG,kind:it.kind,name:it.metadata.name})};let gt="";Tt==="gridItem"?gt=bt.gridItemCard:Tt==="fullHeight"&&(gt=bt.fullHeightCard);let pt="";Tt==="gridItem"?pt=bt.gridItemCardContent:Tt==="fullHeight"&&(pt=bt.fullHeightCardContent);const Bt=(Ct=it.metadata.annotations)===null||Ct===void 0?void 0:Ct[h.P1],zt=(Bt==null?void 0:Bt.startsWith("url:"))||(Bt==null?void 0:Bt.startsWith("file:")),Kt=(0,_.useCallback)(async()=>{try{await Zt.refreshEntity((0,h.eE)(it)),Ke.post({message:"Refresh scheduled",severity:"info"})}catch($t){Xt.post($t)}},[Zt,Ke,Xt,it]);return(0,t.jsxs)(B.Z,{className:gt,children:[(0,t.jsx)(me.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[zt&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Kt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Ue,title:"Edit Metadata",to:Ue!=null?Ue:"#",children:(0,t.jsx)(se.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[nt,yt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(K.Z,{className:pt,children:(0,t.jsx)(z,{entity:it})})]})}},86359:function(jt,De,r){"use strict";r.d(De,{E:function(){return te}});var t=r(52322),h=r(25271),H=r(53974),f=r(43514),W=r(90436),g=r(15459),d=r(27604),B=r(2997),me=r(11640),ue=r(28347),V=r(76635),K=r(2784),I=r(7089);const w=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.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:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const O=(L=P.metadata)===null||L===void 0?void 0:L.labels,oe=O&&O[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:oe&&(0,t.jsx)(I.Z,{label:oe,size:"small",variant:"outlined"},oe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),se=(0,g.Z)({root:{color:"#f3ba37"}})(me.Z),_=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},te=$=>{var T,P;const{columns:L,actions:O,tableOptions:oe,subtitle:Le,emptyContent:Ve}=$,{isStarredEntity:z,toggleStarredEntity:xt}=(0,f.CR)(),{loading:ot,error:Ye,entities:st,filters:Qe}=(0,f.wp)(),Ct=(0,K.useMemo)(()=>{var ge;return[w.createTitleColumn({hidden:!0}),w.createNameColumn({defaultKind:(ge=Qe.kind)===null||ge===void 0?void 0:ge.value}),...be(),w.createMetadataDescriptionColumn(),w.createTagsColumn()];function be(){var Ue;const nt=[w.createSystemColumn(),w.createOwnerColumn(),w.createSpecTypeColumn(),w.createSpecLifecycleColumn()];switch((Ue=Qe.kind)===null||Ue===void 0?void 0:Ue.value){case"user":return[];case"domain":case"system":return[w.createOwnerColumn()];case"group":case"template":return[w.createSpecTypeColumn()];case"location":return[w.createSpecTypeColumn(),w.createSpecTargetsColumn()];default:return st.every(yt=>yt.metadata.namespace==="default")?nt:[...nt,w.createNamespaceColumn()]}}},[(T=Qe.kind)===null||T===void 0?void 0:T.value,st]),Tt=Qe.type===void 0;var bt;const it=(0,V.capitalize)((bt=(P=Qe.user)===null||P===void 0?void 0:P.value)!==null&&bt!==void 0?bt:"all");if(Ye)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:Ye.toString()})})});const Pt=[({entity:ge})=>{var be;const Ue=(be=ge.metadata.annotations)===null||be===void 0?void 0:be[h.l2],nt="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:nt}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ue,onClick:()=>{Ue&&window.open(Ue,"_blank")}}},({entity:ge})=>{var be;const Ue=(be=ge.metadata.annotations)===null||be===void 0?void 0:be[h.Tf],nt="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:nt}),(0,t.jsx)(d.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ue,onClick:()=>{Ue&&window.open(Ue,"_blank")}}},({entity:ge})=>{const be=z(ge),Ue=be?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Ue}),be?(0,t.jsx)(se,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Ue,onClick:()=>xt(ge)}}],Zt=st.sort(_).map(ge=>{const be=(0,f.hF)(ge,h.cz,{kind:"system"}),Ue=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Ue.map(nt=>(0,f.$3)(nt,{defaultKind:"group"})).join(", "),ownedByRelations:Ue,partOfSystemRelationTitle:be.map(nt=>(0,f.$3)(nt,{defaultKind:"system"})).join(", "),partOfSystemRelations:be}}}),Ke=(L||Ct).find(ge=>ge.title==="Type");Ke&&(Ke.hidden=!Tt);const Xt=Zt.length>20;return(0,t.jsx)(H.iA,{isLoading:ot,columns:L||Ct,options:{paging:Xt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ot,padding:"dense",pageSizeOptions:[20,50,100],...oe},title:`${it} (${st.length})`,data:Zt,actions:O||Pt,subtitle:Le,emptyContent:Ve})};te.columns=w},85877:function(jt,De,r){"use strict";r.r(De),r.d(De,{EntityLabelsCard:function(){return K},hasLabels:function(){return I}});var t=r(52322),h=r(43514),H=r(2784),f=r(53974),W=r(79692),g=r(90436),d=r(77277);const B=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,me=(0,W.Z)(w=>({code:{borderRadius:6,margin:`${w.spacing(2)}px 0px`,background:w.palette.type==="dark"?"#444":w.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const w=me();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,t.jsx)("div",{className:w.code,children:(0,t.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(d.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(w=>({key:{fontWeight:"bold"}})),K=w=>{var se;const{variant:_,title:te}=w,{entity:$}=(0,h.X2)(),T=V(),P=[{render:O=>(0,t.jsx)(g.Z,{className:T.key,variant:"body2",children:O.key})},{field:"value"}],L=$==null||(se=$.metadata)===null||se===void 0?void 0:se.labels;return(0,t.jsx)(f.rJ,{title:te||"Labels",variant:_,children:!L||Object.keys(L).length===0?(0,t.jsx)(ue,{}):(0,t.jsx)(f.iA,{columns:P,data:Object.keys(L).map(O=>({key:O,value:L[O]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(w){var se,_;return!(w==null||(se=w.metadata)===null||se===void 0)&&se.labels?Object.keys(w==null||(_=w.metadata)===null||_===void 0?void 0:_.labels).some(Boolean):!1}},24851:function(jt,De,r){"use strict";r.d(De,{s:function(){return se}});var t=r(52322),h=r(90348),H=r(11861),f=r(2784),W=r(79692),g=r(95544),d=r(90436),B=r(52160),me=r(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(_){const{href:te,text:$,Icon:T}=_,P=ue();return(0,t.jsxs)(g.Z,{display:"flex",children:[(0,t.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,t.jsx)(d.Z,{component:"div",children:T?(0,t.jsx)(T,{}):(0,t.jsx)(B.Z,{})})}),(0,t.jsx)(g.Z,{flexGrow:"1",children:(0,t.jsx)(me.rU,{to:te,target:"_blank",rel:"noopener",children:$||te})})]})}var K=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function w(_){const te=[(0,K.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,K.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,K.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,K.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,K.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let $=1;if(typeof _=="number")$=_;else{var T;const L=(T=te.find(O=>O!==null))!==null&&T!==void 0?T:"xs";var P;$=(P=_==null?void 0:_[L])!==null&&P!==void 0?P:I[L]}return $}function se(_){const{items:te,cols:$=void 0}=_,T=w($);return(0,t.jsx)(h.Z,{rowHeight:"auto",cols:T,children:te.map(({text:P,href:L,Icon:O},oe)=>(0,t.jsx)(H.Z,{children:(0,t.jsx)(V,{href:L,text:P!=null?P:L,Icon:O})},oe))})}},19625:function(jt,De,r){"use strict";r.d(De,{_Z:function(){return f},jU:function(){return H},yw:function(){return h}});var t=r(60871);const h=(0,t.x8)({id:"create-component",optional:!0}),H=(0,t.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,t.NT)({id:"catalog"})},15096:function(jt,De,r){"use strict";r.d(De,{FA:function(){return me},qO:function(){return bt},Nd:function(){return z},E5:function(){return lt},Rx:function(){return L}});var t=r(60871);const h=(0,t.T0)({id:"plugin.search.queryservice"});class H{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Y){_define_property(this,"mockedResults",void 0),this.mockedResults=Y}}var f=r(52322),W=r(2784),g=r(38402),d=r(79692);const B=(0,d.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),me=X=>{const{text:Y,preTag:le,postTag:ce}=X,ye=B(),Se=(0,W.useMemo)(()=>Y.split(new RegExp(`(${le}.+?${ce})`)),[ce,le,Y]);return(0,f.jsx)(f.Fragment,{children:Se.map((y,M)=>y.includes(le)?(0,f.jsx)("mark",{className:ye.highlight,children:y.replace(new RegExp(`${le}|${ce}`,"g"),"")},M):y)})};var ue=r(50581),V=r(61837),K=r(86619),I=r(77277),w=r(21853),se=r(48760),_=r(76635),te=r(64279),$=r(1849),T=r(51837);const P=(0,T.CT)("search-context"),L=()=>{const X=(0,W.useContext)(P);if(!X)throw new Error("useSearch must be used within a SearchContextProvider");const Y=X.atVersion(1);if(!Y)throw new Error("No SearchContext v1 found");return Y},O=()=>(0,W.useContext)(P)!==void 0,oe={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(X=oe)=>{var Y,le,ce,ye;const Se=(0,t.h_)(h),[y,M]=(0,W.useState)(X.term),[re,q]=(0,W.useState)(X.types),[Te,Ie]=(0,W.useState)(X.filters),[et,wt]=(0,W.useState)(X.pageLimit),[dt,He]=(0,W.useState)(X.pageCursor),ut=(0,$.Z)(y),St=(0,$.Z)(Te),tt=(0,te.default)(()=>Se.query({term:y,types:re,filters:Te,pageLimit:et,pageCursor:dt}),[y,re,Te,et,dt]),Nt=!tt.loading&&!tt.error&&((Y=tt.value)===null||Y===void 0?void 0:Y.nextPageCursor),rn=!tt.loading&&!tt.error&&((le=tt.value)===null||le===void 0?void 0:le.previousPageCursor),Yt=(0,W.useCallback)(()=>{var tn;He((tn=tt.value)===null||tn===void 0?void 0:tn.nextPageCursor)},[(ce=tt.value)===null||ce===void 0?void 0:ce.nextPageCursor]),Vt=(0,W.useCallback)(()=>{var tn;He((tn=tt.value)===null||tn===void 0?void 0:tn.previousPageCursor)},[(ye=tt.value)===null||ye===void 0?void 0:ye.previousPageCursor]);return(0,W.useEffect)(()=>{ut!==void 0&&y!==ut&&He(void 0)},[y,ut,He]),(0,W.useEffect)(()=>{St!==void 0&&!(0,_.isEqual)(Te,St)&&He(void 0)},[Te,St,He]),{result:tt,term:y,setTerm:M,types:re,setTypes:q,filters:Te,setFilters:Ie,pageLimit:et,setPageLimit:wt,pageCursor:dt,setPageCursor:He,fetchNextPage:Nt?Yt:void 0,fetchPreviousPage:rn?Vt:void 0}},Ve=X=>{const{initialState:Y,children:le}=X,ce=Le(Y);return(0,f.jsx)(t.fC,{attributes:{searchTypes:ce.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,T.EI)({1:ce}),children:le})})},z=X=>{const{initialState:Y,inheritParentContextIfAvailable:le,children:ce}=X;return O()&&le?(0,f.jsx)(f.Fragment,{children:ce}):(0,f.jsx)(Ve,{initialState:Y,children:ce})},xt=({children:X})=>{var Y;const le=Te=>(0,$.Z)(Te)!==Te,ce=(0,t.z$)(),{term:ye,result:Se}=L();var y;const M=(y=(Y=Se.value)===null||Y===void 0?void 0:Y.numberOfResults)!==null&&y!==void 0?y:void 0,q=le(Se.loading)&&!Se.loading;return(0,W.useEffect)(()=>{ye&&q&&ce.captureEvent("search",ye,{value:M})},[ce,ye,M,q]),(0,f.jsx)(f.Fragment,{children:X})};function ot(X){return(0,W.forwardRef)((Y,le)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...Y,ref:le})}))}const Ye=ot((0,W.forwardRef)((X,Y)=>{const{onChange:le,onKeyDown:ce=()=>{},onClear:ye=()=>{},onSubmit:Se=()=>{},debounceTime:y=200,clearButton:M=!0,fullWidth:re=!0,value:q,label:Te,placeholder:Ie,inputProps:et={},endAdornment:wt,...dt}=X,He=(0,t.h_)(t.Ds),[ut,St]=(0,W.useState)("");(0,W.useEffect)(()=>{St(Lt=>Lt!==q?String(q):Lt)},[q]),(0,se.Z)(()=>le(ut),y,[ut]);const tt=(0,W.useCallback)(Lt=>{St(Lt.target.value)},[St]),Nt=(0,W.useCallback)(Lt=>{ce&&ce(Lt),Se&&Lt.key==="Enter"&&Se()},[ce,Se]),rn=(0,W.useCallback)(()=>{le(""),ye&&ye()},[le,ye]),Yt=Te?void 0:"Search",Vt=Ie!=null?Ie:`Search in ${He.getOptionalString("app.title")||"Backstage"}`,Dt=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(w.Z,{})})}),tn=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:rn,onKeyDown:Lt=>{Lt.key==="Enter"&&Lt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(xt,{children:(0,f.jsx)(K.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:Y,value:ut,label:Te,placeholder:Vt,InputProps:{startAdornment:Dt,endAdornment:M?tn:wt},inputProps:{"aria-label":Yt,...et},fullWidth:re,onChange:tt,onKeyDown:Nt,...dt})})})),st=ot((0,W.forwardRef)((X,Y)=>{const{value:le="",onChange:ce,...ye}=X,{term:Se,setTerm:y}=L();(0,W.useEffect)(()=>{le&&y(String(le))},[le,y]);const M=(0,W.useCallback)(re=>{ce?ce(re):y(re)},[ce,y]);return(0,f.jsx)(t.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Ye,{...ye,ref:Y,value:Se,onChange:M})})}));var Qe=r(4614),Ct=r(88013);const bt=(X=>Y=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...Y})}))(function(Y){const{loading:le,value:ce,onChange:ye=()=>{},options:Se=[],getOptionLabel:y=Nt=>String(Nt),inputPlaceholder:M,inputDebounceTime:re,freeSolo:q=!0,fullWidth:Te=!0,clearOnBlur:Ie=!1,"data-testid":et="search-autocomplete",...wt}=Y,{setTerm:dt}=L(),He=(0,W.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:y(Nt):"",[y]),ut=(0,W.useMemo)(()=>He(ce),[ce,He]),St=(0,W.useCallback)((Nt,rn,Yt,Vt)=>{dt(He(rn)),ye(Nt,rn,Yt,Vt)},[He,dt,ye]),tt=(0,W.useCallback)(({InputProps:{ref:Nt,endAdornment:rn},InputLabelProps:Yt,...Vt})=>(0,f.jsx)(st,{...Vt,ref:Nt,clearButton:!1,value:ut,placeholder:M,debounceTime:re,endAdornment:le?(0,f.jsx)(Qe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):rn}),[le,ut,M,re]);return(0,f.jsx)(Ct.ZP,{...wt,"data-testid":et,value:ce,onChange:St,options:Se,getOptionLabel:y,renderInput:tt,freeSolo:q,fullWidth:Te,clearOnBlur:Ie})}),it=X=>{const{icon:Y,primaryText:le,primaryTextTypographyProps:ce,secondaryText:ye,secondaryTextTypographyProps:Se,disableTextTypography:y}=X;return _jsxs(_Fragment,{children:[Y?_jsx(ListItemIcon,{children:Y}):null,_jsx(ListItemText,{primary:le,primaryTypographyProps:ce,secondary:ye,secondaryTypographyProps:Se,disableTypography:y})]})};var Pt=r(42494),Zt=r(84899),Ke=r(5806),Xt=r(21324),ge=r(56939),be=r(73698),Ue=r(12231),nt=r(7089),yt=r(69294);const gt=(X,Y,le=[],ce=250)=>{const ye=(0,W.useRef)({}),Se=X||(()=>Promise.resolve([])),[y,M]=(0,yt.default)(Se,[Y],{loading:!0});if((0,se.Z)(()=>{ye.current[Y]===void 0&&(ye.current[Y]=M(Y).then(q=>(ye.current[Y]=q,q)))},ce,[M,Y]),le.length)return{loading:!1,value:le};const re=ye.current[Y];return Array.isArray(re)?{loading:!1,value:re}:y},pt=(X,Y)=>{const{setFilters:le}=L();(0,W.useEffect)(()=>{Y&&[Y].flat().length>0&&le(ce=>({...ce,[X]:Y}))},[])},Bt=X=>{const{className:Y,defaultValue:le,name:ce,values:ye,valuesDebounceMs:Se,label:y,filterSelectedOptions:M,limitTags:re,multiple:q}=X,[Te,Ie]=(0,W.useState)("");pt(ce,le);const et=typeof ye=="function"?ye:void 0,wt=typeof ye=="function"?void 0:ye,{value:dt,loading:He}=gt(et,Te,wt,Se),{filters:ut,setFilters:St}=L(),tt=ut[ce]||(q?[]:null),Nt=(Vt,Dt)=>{St(tn=>{const{[ce]:Lt,...kt}=tn;return Dt?{...kt,[ce]:Dt}:{...kt}})},rn=Vt=>(0,f.jsx)(K.Z,{...Vt,name:"search",variant:"outlined",label:y,fullWidth:!0}),Yt=(Vt,Dt)=>Vt.map((tn,Lt)=>(0,f.jsx)(nt.Z,{label:tn,color:"primary",...Dt({index:Lt})}));return(0,f.jsx)(Ct.ZP,{filterSelectedOptions:M,limitTags:re,multiple:q,className:Y,id:`${q?"multi-":""}select-filter-${ce}--select`,options:dt||[],loading:He,value:tt,onChange:Nt,onInputChange:(Vt,Dt)=>Ie(Dt),renderInput:rn,renderTags:Yt})},zt=(0,d.Z)({label:{textTransform:"capitalize"}}),Kt=X=>{const{className:Y,defaultValue:le,label:ce,name:ye,values:Se=[],valuesDebounceMs:y}=X,M=zt(),{filters:re,setFilters:q}=L();pt(ye,le);const Te=typeof Se=="function"?Se:void 0,Ie=typeof Se=="function"?void 0:Se,{value:et=[],loading:wt}=gt(Te,"",Ie,y),dt=ut=>{const{target:{value:St,checked:tt}}=ut;q(Nt=>{const{[ye]:rn,...Yt}=Nt,Vt=(rn||[]).filter(tn=>tn!==St),Dt=tt?[...Vt,St]:Vt;return Dt.length?{...Yt,[ye]:Dt}:Yt})};var He;return(0,f.jsxs)(Pt.Z,{className:Y,disabled:wt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[ce?(0,f.jsx)(Zt.Z,{className:M.label,children:ce}):null,et.map(ut=>(0,f.jsx)(Ke.Z,{control:(0,f.jsx)(Xt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ut},value:ut,name:ut,onChange:dt,checked:((He=re[ye])!==null&&He!==void 0?He:[]).includes(ut)}),label:ut},ut))]})},$t=X=>{const{className:Y,defaultValue:le,label:ce,name:ye,values:Se,valuesDebounceMs:y}=X,M=zt();pt(ye,le);const re=typeof Se=="function"?Se:void 0,q=typeof Se=="function"?void 0:Se,{value:Te=[],loading:Ie}=gt(re,"",q,y),{filters:et,setFilters:wt}=L(),dt=He=>{const{target:{value:ut}}=He;wt(St=>{const{[ye]:tt,...Nt}=St;return ut?{...Nt,[ye]:ut}:Nt})};return(0,f.jsxs)(Pt.Z,{disabled:Ie,className:Y,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[ce?(0,f.jsx)(ge.Z,{className:M.label,margin:"dense",children:ce}):null,(0,f.jsxs)(be.Z,{variant:"outlined",value:et[ye]||"",onChange:dt,children:[(0,f.jsx)(Ue.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Te.map(He=>(0,f.jsx)(Ue.Z,{value:He,children:He},He))]})]})},qt=X=>{const{component:Y,...le}=X;return(0,f.jsx)(Y,{...le})};qt.Checkbox=X=>(0,f.jsx)(qt,{...X,component:Kt}),qt.Select=X=>(0,f.jsx)(qt,{...X,component:$t}),qt.Autocomplete=X=>(0,f.jsx)(qt,{...X,component:Bt});var _t=r(48834).lW;const mn=X=>_t.from(X.toString(),"utf-8").toString("base64"),zn=X=>X?Number(_t.from(X,"base64").toString("utf-8")):0,Bn=X=>{const{total:Y=-1,cursor:le,hasNextPage:ce,onCursorChange:ye,limit:Se=25,limitLabel:y="Results per page:",limitText:M=({from:dt,to:He})=>Y>0?`of ${Y}`:`${dt}-${He}`,limitOptions:re,onLimitChange:q,...Te}=X,Ie=useMemo(()=>zn(le),[le]),et=useCallback((dt,He)=>{ye==null||ye(mn(He))},[ye]),wt=useCallback(dt=>{const He=dt.target.value;q==null||q(parseInt(He,10))},[q]);return _jsx(TablePagination,{...Te,component:"div",count:Y,page:Ie,nextIconButtonProps:{...ce!==void 0&&{disabled:!ce}},onPageChange:et,rowsPerPage:Se,labelRowsPerPage:y,labelDisplayedRows:M,rowsPerPageOptions:re,onRowsPerPageChange:wt})},vn=X=>{const{pageLimit:Y,setPageLimit:le,pageCursor:ce,setPageCursor:ye,fetchNextPage:Se}=useSearch();return _jsx(Bn,{...X,hasNextPage:!!Se,limit:Y,onLimitChange:le,cursor:ce,onCursorChange:ye})};var $n=r(53974);const Dn=X=>{const{children:Y}=X,le=useSearch(),{result:ce,...ye}=le;return Y(ce,ye)},en=X=>{const{query:Y,children:le}=X,ce=useApi(searchApiRef),ye=useAsync(()=>{const{term:Se="",types:y=[],filters:M={},...re}=Y;return ce.query({...re,term:Se,types:y,filters:M})},[Y]);return le(ye,Y)},En=X=>{const{query:Y,children:le}=X;return Y?_jsx(en,{query:Y,children:le}):_jsx(Dn,{children:le})},Wn=X=>{const{query:Y,children:le,noResultsComponent:ce=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ye}=X;return _jsx(En,{query:Y,children:({loading:Se,error:y,value:M})=>Se?_jsx(Progress,{}):y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:y}):M!=null&&M.results.length?isFunction(le)?le(M):_jsx(SearchResultListItemExtensions,{...ye,results:M.results,children:le}):ce})},ft=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Wn,{...X})}),Kn=({result:X,highlight:Y,icon:le,secondaryAction:ce,lineClamp:ye=5})=>X?_jsxs(_Fragment,{children:[le&&_jsx(ListItemIcon,{children:le}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:X.location,children:Y!=null&&Y.fields.title?_jsx(HighlightedSearchResultText,{text:(Y==null?void 0:Y.fields.title)||"",preTag:(Y==null?void 0:Y.preTag)||"",postTag:(Y==null?void 0:Y.postTag)||""}):X.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ye,overflow:"hidden"},color:"textSecondary",variant:"body2",children:Y!=null&&Y.fields.text?_jsx(HighlightedSearchResultText,{text:Y.fields.text,preTag:Y.preTag,postTag:Y.postTag}):X.text})}),ce&&_jsx(Box,{alignItems:"flex-end",children:ce})]}):null,Rt=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Kn,{...X})}),at=X=>{const{error:Y,loading:le,resultItems:ce,renderResultItem:ye=re=>_jsx(DefaultResultListItem,{result:re.document},re.document.location),disableRenderingWithNoResults:Se,noResultsComponent:y=Se?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...M}=X;return le?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):ce!=null&&ce.length?_jsx(List,{...M,children:ce.map(ye)}):_jsx(_Fragment,{children:y})},bn=X=>{const{query:Y,renderResultItem:le,children:ce,...ye}=X,Se=useSearchResultListItemExtensions(ce);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Y,children:({loading:y,error:M,value:re})=>_jsx(at,{...ye,error:M,loading:y,resultItems:re==null?void 0:re.results,renderResultItem:le!=null?le:Se})})})};var Gt=r(19126);const sn=(0,d.Z)(X=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:X.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:X.spacing(.5)}})),An=X=>{const Y=sn(),{label:le,children:ce,...ye}=X;return _jsx(Chip,{...ye,className:Y.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[le,": ",ce]})})},cn=()=>null,In=(0,d.Z)(X=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:X.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),we=X=>{const Y=In(),{label:le,value:ce="None",onChange:ye,onDelete:Se}=X,y=useCallback(M=>{ye(M.target.value)},[ye]);return _jsx(An,{label:le,onDelete:Se,children:_jsx(Typography,{role:"textbox",component:"span",className:Y.root,onChange:y,contentEditable:!0,suppressContentEditableWarning:!0,children:ce})})},ae=(0,d.Z)(X=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Be=X=>{const Y=ae(),{label:le,value:ce="none",onChange:ye,onDelete:Se,children:y}=X,M=useCallback(re=>{ye(re.target.value)},[ye]);return _jsx(An,{label:le,onDelete:Se,children:_jsxs(Select,{className:Y.root,value:ce,onChange:M,input:_jsx(InputBase,{}),IconComponent:cn,children:[_jsx(MenuItem,{value:"none",children:"None"}),y]})})};function Me(X){const Y=sn(),[le,ce]=useState(null),{error:ye,loading:Se,icon:y,title:M,titleProps:re={},link:q=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Y.listSubheaderLinkIcon})]}),linkProps:Te={},filterOptions:Ie,renderFilterOption:et=Dt=>_jsx(MenuItem,{value:String(Dt),children:Dt},String(Dt)),filterFields:wt,renderFilterField:dt,resultItems:He,renderResultItem:ut=Dt=>_jsx(DefaultResultListItem,{result:Dt.document},Dt.document.location),disableRenderingWithNoResults:St,noResultsComponent:tt=St?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Nt}=X,rn=useCallback(Dt=>{ce(Dt.currentTarget)},[]),Yt=useCallback(()=>{ce(null)},[]);if(Se)return _jsx(Progress,{});if(ye)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ye});if(!(He!=null&&He.length))return _jsx(_Fragment,{children:tt});var Vt;return _jsxs(List,{...Nt,children:[_jsxs(ListSubheader,{className:Y.listSubheader,children:[y,_jsx(Typography,{className:Y.listSubheaderName,component:"strong",...re,children:M}),Ie?_jsx(Chip,{className:Y.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:rn}):null,Ie?_jsx(Menu,{id:"filters-menu",anchorEl:le,open:Boolean(le),onClose:Yt,onClick:Yt,keepMounted:!0,children:Ie.map(et)}):null,wt==null?void 0:wt.map(Dt=>(Vt=dt==null?void 0:dt(Dt))!==null&&Vt!==void 0?Vt:null),_jsx(Link,{className:Y.listSubheaderLink,to:"/search",...Te,children:q})]}),He.map(ut)]})}function _e(X){const{query:Y,children:le,renderResultItem:ce,linkProps:ye={},...Se}=X,y=useSearchResultListItemExtensions(le);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Y,children:({loading:M,error:re,value:q},{term:Te,types:Ie,pageCursor:et,filters:wt={}})=>{const dt=`/search?${qs.stringify({term:Te,types:Ie,filters:wt,pageCursor:et,query:Te},{arrayFormat:"brackets"})}`;return _jsx(Me,{...Se,error:re,loading:M,linkProps:{to:dt,...ye},filterFields:Object.keys(wt),resultItems:q==null?void 0:q.results,renderResultItem:ce!=null?ce:y})}})})}const ne=(0,d.Z)(X=>({root:{display:"flex",justifyContent:"space-between",gap:X.spacing(2),margin:X.spacing(2,0)}})),Z=()=>{const{fetchNextPage:X,fetchPreviousPage:Y}=useSearch(),le=ne();return!X&&!Y?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:le.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Y,onClick:Y,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!X,onClick:X,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},pe="search.results.list.items.extensions.v1",Ze=(X,Y)=>{for(const le of X){if(!isValidElement(le))continue;const ce=getComponentData(le,pe);if(ce!=null&&ce(Y))return cloneElement(le,{rank:Y.rank,highlight:Y.highlight,result:Y.document,...le.props})}return null},Xe=X=>{const{rank:Y,result:le,noTrack:ce,children:ye,alignItems:Se="flex-start",...y}=X,M=(0,t.z$)(),re=(0,W.useCallback)(()=>{ce||le&&M.captureEvent("discover",le.title,{attributes:{to:le.location},value:Y})},[Y,le,ce,M]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:Se,onClickCapture:re,...y,children:ye})},lt=X=>{const{name:Y,component:le,predicate:ce=()=>!0}=X;return(0,t.YO)({name:Y,component:{lazy:()=>le().then(ye=>Se=>(0,f.jsx)(Xe,{rank:Se.rank,result:Se.result,noTrack:Se.noTrack,children:(0,W.createElement)(ye,Se)}))},data:{[pe]:ce}})},Ot=X=>{const Y=useElementFilter(X,le=>le.selectByComponentData({key:pe}).getElements(),[X]);return useCallback((le,ce)=>{const ye=Ze(Y,le);return _jsx(Fragment,{children:ye!=null?ye:_jsx(Xe,{rank:le.rank,result:le.document,children:_jsx(DefaultResultListItem,{rank:le.rank,highlight:le.highlight,result:le.document})})},ce)},[Y])},Ft=X=>{const{results:Y,children:le,...ce}=X,ye=Ot(le);return _jsx(List,{...ce,children:Y.map(ye)})}},61886:function(jt,De,r){"use strict";r.d(De,{Ox:function(){return Qe},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return d},ZS:function(){return Le},VA:function(){return bt},KY:function(){return me},gT:function(){return w},Dl:function(){return se},ux:function(){return Tt},$L:function(){return I},x1:function(){return Ve}});var t=r(52322),h=r(2784),H=r(73557),f=r(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",d=()=>null;(0,f.R5)(d,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function me(ge){const{name:be,component:Ue}=ge;return(0,f.YO)({name:be,component:{sync:nt=>(0,t.jsx)(Ue,{...nt})},data:{[W]:ge,[B(be)]:!0}})}const ue=(ge,be)=>ge.selectByComponentData({key:be}).getElements()[0],V=ge=>ge.selectByComponentData({key:g}).selectByComponentData({key:W}),K=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),be=(0,f.vJ)(ge,V),Ue=(0,f.vJ)(ge,K),nt=(0,h.useCallback)(pt=>{if(!be||!pt)return null;const Bt=B(pt.name);var zt;return(zt=ue(be,Bt))!==null&&zt!==void 0?zt:null},[be]),yt=(0,h.useCallback)(pt=>{const Bt=Ue.find(zt=>zt.name===pt);return Bt?nt(Bt):null},[Ue,nt]),gt=(0,h.useCallback)(pt=>{const Bt=Ue.filter(zt=>zt.location===pt);return Bt.length?Bt.map(nt):null},[Ue,nt]);return{renderComponentByName:yt,renderComponentsByLocation:gt}},w=(0,f.T0)({id:"plugin.techdocs.service"}),se=(0,f.T0)({id:"plugin.techdocs.storageservice"});var _=r(64279),te=r(77446),$=r(25271),T=r(51837);function P(ge,be){return be.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ge.kind=ge.kind.toLocaleLowerCase(),ge.name=ge.name.toLocaleLowerCase(),ge.namespace=ge.namespace.toLocaleLowerCase()),ge}const L=(ge,be)=>(0,$.eE)(ge)===(0,$.eE)(be),O={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},oe=(0,T.CT)("techdocs-reader-page-context"),Le=(0,h.memo)(ge=>{const{entityRef:be,children:Ue}=ge,nt=(0,f.h_)(w),yt=(0,f.h_)(f.Ds),gt=(0,_.default)(async()=>nt.getEntityMetadata(be),[be]),pt=(0,te.Z)(async()=>nt.getTechDocsMetadata(be),[be]),[Bt,zt]=(0,h.useState)(O.title),[Kt,$t]=(0,h.useState)(O.subtitle),[qt,_t]=(0,h.useState)(O.shadowRoot);(0,h.useEffect)(()=>{qt&&!pt.value&&!pt.loading&&pt.retry()},[pt.value,pt.loading,qt,pt.retry,pt]);const mn={metadata:pt,entityRef:P(be,yt),entityMetadata:gt,shadowRoot:qt,setShadowRoot:_t,title:Bt,setTitle:zt,subtitle:Kt,setSubtitle:$t},zn=(0,T.EI)({1:mn});return(0,t.jsx)(f.fC,{attributes:{entityRef:(0,$.eE)(be)},children:(0,t.jsx)(oe.Provider,{value:zn,children:Ue instanceof Function?Ue(mn):Ue})})},(ge,be)=>L(ge.entityRef,be.entityRef)),Ve=()=>{const ge=(0,h.useContext)(oe);if(ge===void 0)return O;const be=ge.atVersion(1);if(be===void 0)throw new Error("No context found for version 1.");return be},z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var xt=r(70882),ot=r(50236),Ye=r(19219),st=r(53974);const Qe="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Ct=ge=>{(0,h.useEffect)(()=>{if(!ge)return()=>{};const be=ge.querySelectorAll('head > link[rel="stylesheet"]');var Ue;let nt=(Ue=be==null?void 0:be.length)!==null&&Ue!==void 0?Ue:0;const yt=new CustomEvent(Qe);if(!nt)return ge.dispatchEvent(yt),()=>{};const gt=()=>{--nt===0&&ge.dispatchEvent(yt)};return be==null||be.forEach(pt=>{pt.addEventListener("load",gt)}),()=>{be==null||be.forEach(pt=>{pt.removeEventListener("load",gt)})}},[ge])},Tt=ge=>{const[be,Ue]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!ge)return()=>{};Ue(!0);const nt=ge.style;nt.setProperty("opacity","0");const yt=()=>{Ue(!1),nt.setProperty("opacity","1")};return ge.addEventListener(Qe,yt),()=>{ge.removeEventListener(Qe,yt)}},[ge]),be},bt=ge=>{const{element:be,onAppend:Ue,children:nt}=ge,[yt,gt]=(0,h.useState)((0,xt.Ue)({...(0,ot.Z)(),insertionPoint:void 0}));Ct(be);const pt=Tt(be),Bt=(0,h.useCallback)(zt=>{if(!be||!zt)return;gt((0,xt.Ue)({...(0,ot.Z)(),insertionPoint:be.querySelector("head")||void 0}));let Kt=zt.shadowRoot;Kt||(Kt=zt.attachShadow({mode:"open"})),Kt.replaceChildren(be),typeof Ue=="function"&&Ue(Kt)},[be,Ue]);return(0,t.jsxs)(t.Fragment,{children:[pt&&(0,t.jsx)(st.Ex,{}),(0,t.jsxs)(Ye.ZP,{jss:yt,sheetsManager:new Map,children:[(0,t.jsx)("div",{ref:Bt,"data-testid":"techdocs-native-shadowroot"}),nt]})]})};var it=r(54073);const Pt=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},Zt=ge=>{const be=Pt();return be?ge.map(Ue=>be==null?void 0:be.querySelectorAll(Ue)).filter(Ue=>Ue.length).map(Ue=>Array.from(Ue)).flat():[]},Ke=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,Xt=(ge=0)=>{const be=Pt(),[Ue,nt]=useState(null),yt=useMemo(()=>debounce(()=>{const gt=be,pt=gt.getSelection?gt.getSelection():document.getSelection();pt&&Ke(pt)?nt(pt):nt(null)},ge),[be,nt,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>{yt.cancel(),window.document.removeEventListener("selectionchange",yt)}),[yt]),Ue}},52943:function(jt,De,r){"use strict";r.r(De),r.d(De,{EmbeddedDocsRouter:function(){return _},Router:function(){return se},isTechDocsAvailable:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(43514),W=r(53974),g=r(25271),d=r(89258),B=r(65124),me=r(86317);const ue=({entity:te})=>{const $=(0,g.iB)(te);return(0,t.jsxs)(d.I6,{entityRef:$,children:[(0,t.jsx)(B.b,{}),(0,t.jsx)(me.F,{withSearch:!1})]})};var V=r(18662),K=r(7476);const I="backstage.io/techdocs-ref",w=te=>{var $,T;return Boolean(te==null||($=te.metadata)===null||$===void 0||(T=$.annotations)===null||T===void 0?void 0:T[I])},se=()=>(0,t.jsxs)(H.Z5,{children:[(0,t.jsx)(H.AW,{path:"/",element:(0,t.jsx)(V.TechDocsIndexPage,{})}),(0,t.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,t.jsx)(K.TechDocsReaderPage,{})})]}),_=te=>{var $;const{children:T}=te,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,t.jsx)(ue,{entity:P}),children:[{path:"*",element:T}]}]);return(($=P.metadata.annotations)===null||$===void 0?void 0:$[I])?L:(0,t.jsx)(W.sk,{annotation:I})}},92077:function(jt,De,r){"use strict";r.d(De,{k:function(){return g},p:function(){return W}});var t=r(87612),h=r(23054),H=r(76372),f=r.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:me,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${me}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}async getEntityMetadata(B){const{kind:me,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${me}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,me){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getStorageUrl()}/${V}/${ue}/${K}/${me}`,se=await this.fetchApi.fetch(`${w.endsWith("/")?w:`${w}/`}index.html`);let _="";switch(se.status){case 404:throw _="Page not found. ",me||(_+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(_);case 500:throw _="Could not generate documentation or an error in the TechDocs backend. ",new Error(_);default:break}return se.text()}async syncEntityDocs(B,me=()=>{}){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getApiOrigin()}/sync/${V}/${ue}/${K}`,{token:se}=await this.identityApi.getCredentials();return new Promise((_,te)=>{const $=new H.EventSourcePolyfill(w,{withCredentials:!0,headers:se?{Authorization:`Bearer ${se}`}:{}});$.addEventListener("log",T=>{T.data&&me(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let P=!1;T.data&&({updated:P}=JSON.parse(T.data)),_(P?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:te(new h.dR(T.message));return;default:te(new Error(T.data));return}}})}async getBaseUrl(B,me,ue){const{kind:V,namespace:K,name:I}=me,se=`${await this.getApiOrigin()}/static/docs/${K}/${V}/${I}/${ue}`;return new URL(B,se.endsWith("/")?se:`${se}/`).toString()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"identityApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(jt,De,r){"use strict";r.d(De,{D:function(){return t}});function t(h,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(jt,De,r){"use strict";r.d(De,{u:function(){return B}});var t=r(52322),h=r(2784),H=r(53974),f=r(43514),W=r(42081),g=r(48431),d=r(68435);const B=me=>{const{initialFilter:ue="owned",columns:V,actions:K}=me;return(0,t.jsx)(W.j,{children:(0,t.jsxs)(H.VY,{children:[(0,t.jsx)(H.yW,{title:"",children:(0,t.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,t.jsx)(f.UO,{children:(0,t.jsxs)(f._i,{children:[(0,t.jsxs)(f._i.Filters,{children:[(0,t.jsx)(g.f,{}),(0,t.jsx)(f.EW,{initialFilter:ue}),(0,t.jsx)(f.dq,{}),(0,t.jsx)(f.xE,{})]}),(0,t.jsx)(f._i.Content,{children:(0,t.jsx)(d.n,{actions:K,columns:V})})]})})]})})}},85478:function(jt,De,r){"use strict";r.d(De,{f:function(){return V}});var t=r(52322),h=r(95573),H=r(51953),f=r(60871),W=r(53974),g=r(94339),d=r(16111),B=r(24579),me=r(14503),ue=r(2784);const V=_=>{const{entities:te}=_,$=(0,f.tg)(h.Fw),T=(0,f.h_)(f.Ds);if(!te)return null;var P,L;return(0,t.jsx)(W.Oh,{"data-testid":"docs-explore",children:te!=null&&te.length?te.map((O,oe)=>(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(d.Z,{children:(0,t.jsx)(W.hu,{title:(P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name})}),(0,t.jsx)(B.Z,{children:O.metadata.description}),(0,t.jsx)(me.Z,{children:(0,t.jsx)(W.Qj,{to:$({namespace:(0,H.D)((L=O.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,H.D)(O.kind,T),name:(0,H.D)(O.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},oe)):null})};var K=r(43514);const I={title:"All Documentation",filterPredicate:()=>!0},w=_=>{const{entities:te,group:$}=_,{loading:T,isOwnedEntity:P}=useEntityOwnership(),L=te.filter(oe=>$.filterPredicate==="ownedByUser"?T?!1:P(oe):typeof $.filterPredicate=="function"&&$.filterPredicate(oe)),O=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return L.length===0?null:_jsxs(Content,{children:[O,_jsx(DocsCardGrid,{entities:L})]})},se=_=>{const{loading:te,error:$,entities:T}=useEntityList();if($)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:$.toString()})});if(te)return _jsx(Progress,{});if(T.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var P,L;return T.sort((O,oe)=>((P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name).localeCompare((L=oe.metadata.title)!==null&&L!==void 0?L:oe.metadata.name)),_jsx(Content,{children:(_.groups||[I]).map((O,oe)=>_jsx(w,{entities:T,group:O},`${O.title}-${oe}`))})}},68435:function(jt,De,r){"use strict";r.d(De,{H:function(){return T},n:function(){return P}});var t=r(52322),h=r(2784),H=r(95074),f=r(76635),W=r(53974),g=r(43514),d=r(60871),B=r(25271),me=r(95573),ue=r(39981),V=r(2337),K=r(11640),I=r(28347);const w=(0,V.Z)({root:{color:"#f3ba37"}})(K.Z),se={createCopyDocsUrlAction(L){return O=>({icon:()=>(0,t.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${O.resolved.docsUrl}`)})},createStarEntityAction(L,O){return oe=>{const Le=oe.entity,Ve=L(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ve?(0,t.jsx)(w,{}):(0,t.jsx)(I.Z,{}),tooltip:Ve?"Remove from favorites":"Add to favorites",onClick:()=>O(Le)}}}};function _(L){return L.metadata.title||L.metadata.name}const te={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,t.jsx)(W.uw,{value:(0,t.jsx)(W.rU,{to:L.resolved.docsUrl,children:_(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,t.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var $=r(51953);const T=L=>{const{entities:O,title:oe,loading:Le,columns:Ve,actions:z,options:xt}=L,[,ot]=(0,H.Z)(),Ye=(0,d.tg)(me.Fw),st=(0,d.h_)(d.Ds);if(!O)return null;const Qe=O.map(bt=>{const it=(0,g.hF)(bt,B.S4);var Pt;return{entity:bt,resolved:{docsUrl:Ye({namespace:(0,$.D)((Pt=bt.metadata.namespace)!==null&&Pt!==void 0?Pt:"default",st),kind:(0,$.D)(bt.kind,st),name:(0,$.D)(bt.metadata.name,st)}),ownedByRelations:it,ownedByRelationsTitle:it.map(Zt=>(0,g.$3)(Zt,{defaultKind:"group"})).join(", ")}}}),Ct=[te.createNameColumn(),te.createOwnerColumn(),te.createTypeColumn()],Tt=[se.createCopyDocsUrlAction(ot)];return(0,t.jsx)(t.Fragment,{children:Le||Qe&&Qe.length>0?(0,t.jsx)(W.iA,{isLoading:Le,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...xt},data:Qe,columns:Ve||Ct,actions:z||Tt,title:oe?`${oe} (${Qe.length})`:`All (${Qe.length})`}):(0,t.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,t.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=te,T.actions=se;const P=L=>{var O;const{columns:oe,actions:Le,options:Ve}=L,{loading:z,error:xt,entities:ot,filters:Ye}=(0,g.wp)(),{isStarredEntity:st,toggleStarredEntity:Qe}=(0,g.CR)(),[,Ct]=(0,H.Z)();var Tt;const bt=(0,f.capitalize)((Tt=(O=Ye.user)===null||O===void 0?void 0:O.value)!==null&&Tt!==void 0?Tt:"all"),it=[se.createCopyDocsUrlAction(Ct),se.createStarEntityAction(st,Qe)];return xt?(0,t.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(W.Oi,{language:"text",text:xt.toString()})}):(0,t.jsx)(T,{title:bt,entities:ot,loading:z,actions:Le||it,columns:oe,options:Ve})};P.columns=te,P.actions=se},18662:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsIndexPage:function(){return W}});var t=r(52322),h=r(2784),H=r(73557),f=r(3482);const W=g=>(0,H.pC)()||(0,t.jsx)(f.u,{...g})},42081:function(jt,De,r){"use strict";r.d(De,{j:function(){return W}});var t=r(52322),h=r(2784),H=r(53974),f=r(60871);const W=g=>{const{children:d}=g,B=(0,f.h_)(f.Ds);var me;const ue=`Documentation available in ${(me=B.getOptionalString("organization.name"))!==null&&me!==void 0?me:"Backstage"}`;return(0,t.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:d})}},48431:function(jt,De,r){"use strict";r.d(De,{f:function(){return f}});var t=r(2784),h=r(43514);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:W}=(0,h.wp)();return(0,t.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(jt,De,r){"use strict";r.d(De,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var t=r(61886),h=r(92077),H=r(95573),f=r(60871),W=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:t.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,identityApi:se,fetchApi:_})=>new h.k({configApi:I,discoveryApi:w,identityApi:se,fetchApi:_})}),(0,f.ni)({api:t.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,fetchApi:se})=>new h.p({configApi:I,discoveryApi:w,fetchApi:se})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),d=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),me=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),K=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return K}});var t=r(52322),h=r(2784),H=r(73557),f=r(53974),W=r(61886),g=r(86317),d=r(93225),B=r(65124),me=r(95573),ue=r(60871);const V=I=>{const{withSearch:w,withHeader:se=!0}=I;return(0,t.jsxs)(f.T3,{themeId:"documentation",children:[se&&(0,t.jsx)(d.S,{}),(0,t.jsx)(B.b,{}),(0,t.jsx)(g.F,{withSearch:w})]})},K=I=>{const{kind:w,name:se,namespace:_}=(0,ue.Oi)(me.Fw),{children:te,entityRef:$={kind:w,name:se,namespace:_}}=I,T=(0,H.pC)();if(!te){const L=T?h.Children.toArray(T.props.children):[];var P;const oe=L.flatMap(Le=>{var Ve;return(P=Le==null||(Ve=Le.props)===null||Ve===void 0?void 0:Ve.children)!==null&&P!==void 0?P:[]}).find(Le=>!(0,ue.IY)(Le,W.Zz)&&!(0,ue.IY)(Le,W.jM));return(0,t.jsx)(W.ZS,{entityRef:$,children:oe||(0,t.jsx)(V,{})})}return(0,t.jsx)(W.ZS,{entityRef:$,children:({metadata:L,entityMetadata:O,onReady:oe})=>(0,t.jsx)("div",{className:"techdocs-reader-page",children:(0,t.jsx)(f.T3,{themeId:"documentation",children:te instanceof Function?te({entityRef:$,techdocsMetadataValue:L.value,entityMetadataValue:O.value,onReady:oe}):te})})})}},86317:function(jt,De,r){"use strict";r.d(De,{F:function(){return ye}});var t=r(52322),h=r(2784),H=r(79692),f=r(60905),W=r(61886),g=r(53974),d=r(22478),B=r(4614),me=r(77277),ue=r(99688),V=r(12420),K=r(90436),I=r(61837),w=r(4190),se=r(87685);const _=(0,H.Z)(y=>(0,V.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),te=({buildLog:y,onClose:M})=>{const re=_(),q=y.length===0?"Waiting for logs...":y.join(`
|
|
37
|
-
`);return(0,t.jsxs)(f.Z,{container:!0,direction:"column",className:re.root,spacing:0,wrap:"nowrap",children:[(0,t.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,t.jsx)(K.Z,{variant:"h5",children:"Build Details"}),(0,t.jsx)(I.Z,{title:"Close the drawer",onClick:M,color:"inherit",children:(0,t.jsx)(se.Z,{})},"dismiss")]}),(0,t.jsx)(f.Z,{item:!0,xs:!0,children:(0,t.jsx)(g.nU,{text:q,classes:{root:re.logs}})})]})},$=({buildLog:y})=>{const M=_(),[re,q]=(0,h.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(me.Z,{color:"inherit",onClick:()=>q(!0),children:"Show Build Logs"}),(0,t.jsx)(w.ZP,{classes:{paper:M.paper},anchor:"right",open:re,onClose:()=>q(!1),children:(0,t.jsx)(te,{buildLog:y,onClose:()=>q(!1)})})]})};var T=r(60871);const P=({errorMessage:y})=>{const M=(0,T.h_)(T.Ds).getOptionalString("techdocs.builder");let re="";return M!=="local"&&(re="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,t.jsx)(g.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:re})};var L=r(95481);const O=(0,H.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),oe=()=>{let y=null;const M=O(),{state:re,contentReload:q,contentErrorMessage:Te,syncErrorMessage:Ie,buildLog:et}=(0,L.DK)();return re==="INITIAL_BUILD"&&(y=(0,t.jsx)(ue.Z,{classes:{root:M.root},variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:et}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),re==="CONTENT_STALE_REFRESHING"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:et}),classes:{root:M.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),re==="CONTENT_STALE_READY"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,t.jsx)(me.Z,{color:"inherit",onClick:()=>q(),children:"Refresh"}),classes:{root:M.root},children:"A newer version of this documentation is now available, please refresh to view."})),re==="CONTENT_STALE_ERROR"&&(y=(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:et}),classes:{root:M.root,message:M.message},children:["Building a newer version of this documentation failed."," ",Ie]})),re==="CONTENT_NOT_FOUND"&&(y=(0,t.jsxs)(t.Fragment,{children:[Ie&&(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:et}),classes:{root:M.root,message:M.message},children:["Building a newer version of this documentation failed."," ",Ie]}),(0,t.jsx)(P,{errorMessage:Te})]})),y};var Le=r(60364),Ve=r(41156),z=r(32838),xt=r(35368),ot=r.n(xt);const Ye=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,Qe=/^https:\/\/fonts\.gstatic\.com/,Ct=y=>y.nodeName==="LINK",Tt=y=>{const M=(y==null?void 0:y.getAttribute("href"))||"",re=M.match(Ye),q=M.match(st),Te=M.match(Qe);return re||q||Te},bt=y=>(Ct(y)&&!Tt(y)&&y.remove(),y),it=y=>y.nodeName==="IFRAME",Pt=(y,M)=>{const re=y.getAttribute("src")||"";try{const{host:q}=new URL(re);return M.includes(q)}catch{return!1}},Zt=y=>M=>(it(M)&&!Pt(M,y)&&M.remove(),M),Ke=()=>{const y=(0,T.h_)(T.Ds);return(0,h.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},Xt=()=>{const y=Ke();return(0,h.useCallback)(async M=>{const re=y==null?void 0:y.getOptionalStringArray("allowedIframeHosts");ot().addHook("beforeSanitizeElements",bt);const q=["link"];return re&&(q.push("iframe"),ot().addHook("beforeSanitizeElements",Zt(re))),ot().sanitize(M.outerHTML,{ADD_TAGS:q,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var ge=r(41128),be=({theme:y})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${y.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${y.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,ge.$n)(y.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,ge.$n)(y.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${y.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${y.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,ge.$n)(y.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,ge.$n)(y.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${y.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${y.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${y.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${y.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,ge.$n)(y.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${y.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${y.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${y.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${y.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${y.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,ge.Fq)(y.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${y.palette.type==="dark"?y.palette.primary.light:y.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${y.palette.type==="dark"?y.palette.secondary.light:y.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${y.palette.type==="dark"?y.palette.success.light:y.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${y.palette.type==="dark"?y.palette.error.light:y.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${y.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${y.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.error.dark,.5):(0,ge.Fq)(y.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.success.dark,.5):(0,ge.Fq)(y.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.warning.dark,.5):(0,ge.Fq)(y.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Ue=({theme:y})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${y.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const nt="224px";var yt=({theme:y,sidebar:M})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${y.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${y.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${M.isPinned?`calc(-12.1rem + ${nt})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
`;const gt=["h1","h2","h3","h4","h5","h6"];var pt=({theme:y})=>`
|
|
361
|
-
/*================== Typeset ==================*/
|
|
362
|
-
|
|
363
|
-
.md-typeset {
|
|
364
|
-
font-size: var(--md-typeset-font-size);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
${gt.reduce((M,re)=>{var q;const Te=(q=y.typography.htmlFontSize)!==null&&q!==void 0?q:16,Ie=y.typography[re],{lineHeight:et,fontFamily:wt,fontWeight:dt,fontSize:He}=Ie,ut=St=>{let tt=1;return typeof St=="number"&&(tt=St/Te*.6),typeof St=="string"&&(tt=St.replace("rem","")),`calc(${tt} * var(--md-typeset-font-size))`};return M.concat(`
|
|
368
|
-
.md-typeset ${re} {
|
|
369
|
-
color: var(--md-default-fg-color);
|
|
370
|
-
line-height: ${et};
|
|
371
|
-
font-family: ${wt};
|
|
372
|
-
font-weight: ${dt};
|
|
373
|
-
font-size: ${ut(He)};
|
|
374
|
-
}
|
|
375
|
-
`)},"")}
|
|
376
|
-
|
|
377
|
-
.md-typeset .md-content__button {
|
|
378
|
-
color: var(--md-default-fg-color);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.md-typeset hr {
|
|
382
|
-
border-bottom: 0.05rem dotted ${y.palette.divider};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.md-typeset details {
|
|
386
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
387
|
-
}
|
|
388
|
-
.md-typeset details summary {
|
|
389
|
-
padding-left: 2.5rem !important;
|
|
390
|
-
}
|
|
391
|
-
.md-typeset details summary:before,
|
|
392
|
-
.md-typeset details summary:after {
|
|
393
|
-
top: 50% !important;
|
|
394
|
-
width: 20px !important;
|
|
395
|
-
height: 20px !important;
|
|
396
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
397
|
-
}
|
|
398
|
-
.md-typeset details[open] > summary:after {
|
|
399
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.md-typeset blockquote {
|
|
403
|
-
color: var(--md-default-fg-color--light);
|
|
404
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.md-typeset table:not([class]) {
|
|
408
|
-
font-size: var(--md-typeset-font-size);
|
|
409
|
-
border: 1px solid var(--md-default-fg-color);
|
|
410
|
-
border-bottom: none;
|
|
411
|
-
border-collapse: collapse;
|
|
412
|
-
}
|
|
413
|
-
.md-typeset table:not([class]) th {
|
|
414
|
-
font-weight: bold;
|
|
415
|
-
}
|
|
416
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
417
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
421
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
422
|
-
}
|
|
423
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
424
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
425
|
-
}
|
|
426
|
-
`,Bt=()=>`
|
|
427
|
-
/*================== Animations ==================*/
|
|
428
|
-
/*
|
|
429
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
430
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
431
|
-
*/
|
|
432
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
433
|
-
transition: none;
|
|
434
|
-
}
|
|
435
|
-
`,zt=({theme:y})=>`
|
|
436
|
-
/*================== Extensions ==================*/
|
|
437
|
-
|
|
438
|
-
/* HIGHLIGHT */
|
|
439
|
-
.highlight .md-clipboard:after {
|
|
440
|
-
content: unset;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.highlight .nx {
|
|
444
|
-
color: ${y.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/* CODE HILITE */
|
|
448
|
-
.codehilite .gd {
|
|
449
|
-
background-color: ${y.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.codehilite .gi {
|
|
453
|
-
background-color: ${y.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/* TABBED */
|
|
457
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
458
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
459
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
460
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
461
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
462
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
463
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
464
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
465
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
466
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
467
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
468
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
469
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
470
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
471
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
472
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
473
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
474
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
475
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
476
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
477
|
-
color: var(--md-accent-fg-color);
|
|
478
|
-
border-color: var(--md-accent-fg-color);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/* TASK-LIST */
|
|
482
|
-
.task-list-control .task-list-indicator::before {
|
|
483
|
-
background-color: ${y.palette.action.disabledBackground};
|
|
484
|
-
}
|
|
485
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
486
|
-
background-color: ${y.palette.success.main};
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/* ADMONITION */
|
|
490
|
-
.admonition {
|
|
491
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
492
|
-
}
|
|
493
|
-
.admonition .admonition-title {
|
|
494
|
-
padding-left: 2.5rem !important;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.admonition .admonition-title:before {
|
|
498
|
-
top: 50% !important;
|
|
499
|
-
width: 20px !important;
|
|
500
|
-
height: 20px !important;
|
|
501
|
-
transform: translateY(-50%) !important;
|
|
502
|
-
}
|
|
503
|
-
`;const Kt=[be,Ue,yt,pt,Bt,zt],$t=()=>(0,g.Pf)(),qt=()=>{const y=$t(),M=(0,Le.Z)();return(0,h.useMemo)(()=>{const re={theme:M,sidebar:y};return Kt.reduce((q,Te)=>q+Te(re),"")},[M,y])},_t=()=>{const y=qt();return(0,h.useCallback)(M=>(M.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),M),[y])},mn=(y,M,re)=>{const q=y==="src"&&M.endsWith(".svg"),Te=!M.match(/^([a-z]*:)?\/\//i),Ie=M.startsWith(re);return q&&(Te||Ie)},zn=({techdocsStorageApi:y,entityId:M,path:re})=>async q=>{const Te=await y.getApiOrigin(),Ie=async(et,wt)=>{for(const dt of et)if(dt.hasAttribute(wt)){const He=dt.getAttribute(wt);if(!He)return;const ut=await y.getBaseUrl(He,M,re);if(mn(wt,He,Te))try{const tt=await(await fetch(ut,{credentials:"include"})).text();dt.setAttribute(wt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(tt)))}`)}catch{dt.setAttribute("alt",`Error: ${He}`)}else dt.setAttribute(wt,ut)}};return await Promise.all([Ie(q.querySelectorAll("img"),"src"),Ie(q.querySelectorAll("script"),"src"),Ie(q.querySelectorAll("source"),"src"),Ie(q.querySelectorAll("link"),"href"),Ie(q.querySelectorAll("a[download]"),"href")]),q};var Bn=r(79158),vn=r(67097),$n=r(28316),Dn=r(82717),en=r.n(Dn);const En=y=>M=>{var re;const q=M.querySelector('[title="Edit this page"]');if(!q||!q.href)return M;const Te=new URL(q.href),Ie=y.byUrl(Te);if((Ie==null?void 0:Ie.type)!=="github"&&(Ie==null?void 0:Ie.type)!=="gitlab")return M;const et=((re=M.querySelector("article>h1"))===null||re===void 0?void 0:re.childNodes[0].textContent)||"",wt=encodeURIComponent(`Documentation Feedback: ${et}`),dt=encodeURIComponent(`Page source:
|
|
504
|
-
${q.href}
|
|
505
|
-
|
|
506
|
-
Feedback:`),He=(Ie==null?void 0:Ie.type)==="github"?(0,Bn.BT)(Te.href,"blob"):Te.href,ut=en()(He),St=`/${ut.organization}/${ut.name}`,tt=q.cloneNode();switch(Ie==null?void 0:Ie.type){case"gitlab":tt.href=`${Te.origin}${St}/issues/new?issue[title]=${wt}&issue[description]=${dt}`;break;case"github":tt.href=`${Te.origin}${St}/issues/new?title=${wt}&body=${dt}`;break;default:return M}return $n.render(h.createElement(vn.Z),tt),tt.style.paddingLeft="5px",tt.title="Leave feedback for this page",tt.id="git-feedback-link",q==null||q.insertAdjacentElement("beforebegin",tt),M};var Wn=r(44882);const ft=()=>y=>{const M=y.querySelector('.md-header label[for="__drawer"]'),re=y.querySelector("article");if(!M||!re)return y;const q=M.cloneNode();return $n.render(h.createElement(Wn.Z),q),q.id="toggle-sidebar",q.title="Toggle Sidebar",q.classList.add("md-content__button"),q.style.setProperty("padding","0 0 0 5px"),q.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),re==null||re.prepend(q),y},Kn=()=>y=>(((re,q)=>{Array.from(re).filter(Te=>Te.hasAttribute(q)).forEach(Te=>{const Ie=Te.getAttribute(q);if(Ie){Ie.match(/^https?:\/\//i)&&Te.setAttribute("target","_blank");try{const et=Rt(window.location.href);Te.setAttribute(q,new URL(Ie,et).toString())}catch{Te.replaceWith(Te.textContent||Ie)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function Rt(y){const M=new URL(y);return!M.pathname.endsWith("/")&&!M.pathname.endsWith(".html")&&(M.pathname+="/"),M.toString()}const at=({baseUrl:y,onClick:M})=>re=>(Array.from(re.getElementsByTagName("a")).forEach(q=>{q.addEventListener("click",Te=>{const et=q.getAttribute("href");et&&et.startsWith(y)&&!q.hasAttribute("download")&&(Te.preventDefault(),M(Te,et))})}),re);var bn=r(15459),Gt=r(80030),sn=r(72379),An=r(41547),cn=r(95074);const In=(0,bn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Gt.ZP),we=()=>(0,t.jsx)(sn.Z,{children:(0,t.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"})}),ae=({text:y})=>{const[M,re]=(0,h.useState)(!1),[,q]=(0,cn.Z)(),Te=(0,h.useCallback)(()=>{q(y),re(!0)},[y,q]),Ie=(0,h.useCallback)(()=>{re(!1)},[re]);return(0,t.jsx)(In,{title:"Copied to clipboard",placement:"left",open:M,onClose:Ie,leaveDelay:1e3,children:(0,t.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:Te,children:(0,t.jsx)(we,{})})})},Be=y=>M=>{const re=M.querySelectorAll("pre > code");for(const Te of re){var q;const Ie=Te.textContent||"",et=document.createElement("div");Te==null||(q=Te.parentElement)===null||q===void 0||q.prepend(et),$n.render((0,t.jsx)(An.Z,{theme:y,children:(0,t.jsx)(ae,{text:Ie})}),et)}return M},Me=()=>y=>{var M;return(M=y.querySelector(".md-header"))===null||M===void 0||M.remove(),y},_e=()=>y=>{var M,re;return(M=y.querySelector(".md-footer .md-copyright"))===null||M===void 0||M.remove(),(re=y.querySelector(".md-footer-copyright"))===null||re===void 0||re.remove(),y},ne=({onLoading:y,onLoaded:M})=>re=>(y(),re.addEventListener(W.Ox,function q(){M(),re.removeEventListener(W.Ox,q)}),re),Z=()=>y=>(y.addEventListener(W.Ox,function M(){if(window.location.hash){var re;const q=window.location.hash.slice(1);(re=y==null?void 0:y.querySelector(`[id="${q}"]`))===null||re===void 0||re.scrollIntoView()}y.removeEventListener(W.Ox,M)}),y),pe=()=>y=>(setTimeout(()=>{const M=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(q=>{const Te=q==null?void 0:q.querySelector("input");Te!=null&&Te.checked||Te==null||Te.click()}),M[M.length-1].scrollIntoView())},200),y),Ze=async(y,M)=>{let re;if(typeof y=="string")re=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)re=y;else throw new Error("dom is not a recognized type");for(const q of M)re=await q(re);return re};var Xe=r(73557);function lt(y,M){const re=new URL(M),q=`${re.origin}${re.pathname.replace(/\/$/,"")}`,Te=y.replace(q,"").replace(/^\/+/,""),Ie=new URL(`http://localhost/${Te}`);return`${Ie.pathname}${Ie.search}${Ie.hash}`}function Ot(){const y=(0,Xe.s0)(),re=(0,T.h_)(T.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(Te=>{let Ie=Te;if(re)try{Ie=lt(Te,re)}catch{}y(Ie)},[y,re])}const Ft="screen and (max-width: 76.1875em)",X=y=>{const M=Ot(),re=(0,Le.Z)(),q=(0,Ve.Z)(Ft),Te=Xt(),Ie=_t(),et=(0,T.z$)(),wt=(0,T.h_)(W.Dl),dt=(0,T.h_)(z.q3),{state:He,path:ut,content:St}=(0,L.DK)(),[tt,Nt]=(0,h.useState)(null),rn=(0,W.ux)(tt),Yt=(0,h.useCallback)(()=>{if(!tt)return;tt.querySelectorAll(".md-sidebar").forEach(kt=>{if(q)kt.style.top="0px";else{const Yn=document==null?void 0:document.querySelector(".techdocs-reader-page");var dn;const lr=(dn=Yn==null?void 0:Yn.getBoundingClientRect().top)!==null&&dn!==void 0?dn:0;var Sn;let Tn=(Sn=tt.getBoundingClientRect().top)!==null&&Sn!==void 0?Sn:0;const Zn=tt.querySelector(".md-container > .md-tabs");var Vn;const qn=(Vn=Zn==null?void 0:Zn.getBoundingClientRect().height)!==null&&Vn!==void 0?Vn:0;Tn<lr&&(Tn=lr),kt.style.top=`${Math.max(Tn,0)+qn}px`}kt.style.setProperty("opacity","1")})},[tt,q]);(0,h.useEffect)(()=>(window.addEventListener("resize",Yt),window.addEventListener("scroll",Yt,!0),()=>{window.removeEventListener("resize",Yt),window.removeEventListener("scroll",Yt,!0)}),[tt,Yt]);const Vt=(0,h.useCallback)(()=>{if(!tt)return;const Lt=tt.querySelector(".md-footer");Lt&&(Lt.style.width=`${tt.getBoundingClientRect().width}px`)},[tt]);(0,h.useEffect)(()=>(window.addEventListener("resize",Vt),()=>{window.removeEventListener("resize",Vt)}),[tt,Vt]),(0,h.useEffect)(()=>{rn||(Vt(),Yt())},[He,rn,Vt,Yt]);const Dt=(0,h.useCallback)((Lt,kt)=>Ze(Lt,[Te,zn({techdocsStorageApi:wt,entityId:y,path:kt}),Kn(),ft(),Me(),_e(),En(dt),Ie]),[y,dt,wt,Te,Ie]),tn=(0,h.useCallback)(async Lt=>Ze(Lt,[Z(),pe(),Be(re),at({baseUrl:window.location.origin,onClick:(kt,dn)=>{var Sn;const Vn=kt.ctrlKey||kt.metaKey,Yn=new URL(dn),lr=((Sn=kt.target)===null||Sn===void 0?void 0:Sn.innerText)||dn,Tn=dn.replace(window.location.origin,"");if(et.captureEvent("click",lr,{attributes:{to:Tn}}),Yn.hash)if(Vn)window.open(dn,"_blank");else{var Zn;M(dn),(Zn=Lt==null?void 0:Lt.querySelector(`[id="${Yn.hash.slice(1)}"]`))===null||Zn===void 0||Zn.scrollIntoView()}else Vn?window.open(dn,"_blank"):M(dn)}}),ne({onLoading:()=>{},onLoaded:()=>{var kt;(kt=Lt.querySelector(".md-nav__title"))===null||kt===void 0||kt.removeAttribute("for")}}),ne({onLoading:()=>{Array.from(Lt.querySelectorAll(".md-sidebar")).forEach(dn=>{dn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[re,M,et]);return(0,h.useEffect)(()=>{if(!St)return()=>{};let Lt=!0;return Dt(St,ut).then(async kt=>{if(!(kt!=null&&kt.innerHTML)||!Lt)return;window.scroll({top:0});const dn=await tn(kt);Nt(dn)}),()=>{Lt=!1}},[St,ut,Dt,tn]),tt};var Y=r(8560);const le=()=>{const y=(0,W.$L)(),{shadowRoot:M}=(0,W.x1)(),re=M==null?void 0:M.querySelector('[data-md-component="content"]'),q=M==null?void 0:M.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Te=q==null?void 0:q.querySelector('[data-techdocs-addons-location="primary sidebar"]');Te||(Te=document.createElement("div"),Te.setAttribute("data-techdocs-addons-location","primary sidebar"),q==null||q.prepend(Te));const Ie=M==null?void 0:M.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let et=Ie==null?void 0:Ie.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return et||(et=document.createElement("div"),et.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ie==null||Ie.prepend(et)),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.Z,{container:Te,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,t.jsx)(Y.Z,{container:re,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,t.jsx)(Y.Z,{container:et,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ce=(0,H.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),ye=(0,L.m1)(y=>{var M;const{withSearch:re=!0,onReady:q}=y,Te=ce(),{entityMetadata:{value:Ie,loading:et},entityRef:wt,setShadowRoot:dt}=(0,W.x1)(),He=X(wt),ut=(0,h.useCallback)(St=>{dt(St),q instanceof Function&&q()},[dt,q]);return et===!1&&!Ie?(0,t.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):He?(0,t.jsx)(g.VY,{children:(0,t.jsxs)(f.Z,{container:!0,children:[(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})}),re&&(0,t.jsx)(f.Z,{className:Te.search,xs:"auto",item:!0,children:(0,t.jsx)(d.S,{entityId:wt,entityTitle:Ie==null||(M=Ie.metadata)===null||M===void 0?void 0:M.title})}),(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(W.VA,{element:He,onAppend:ut,children:(0,t.jsx)(le,{})})})]})}):(0,t.jsx)(g.VY,{children:(0,t.jsx)(f.Z,{container:!0,children:(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})})})})}),Se=null},93225:function(jt,De,r){"use strict";r.d(De,{S:function(){return _}});var t=r(52322),h=r(2784),H=r(18671),f=r(60905),W=r(98069),g=r(60364),d=r(73250),B=r(61886),me=r(43514),ue=r(25271),V=r(53974),K=r(60871),I=r(76635),w=r(95573);const se=(0,t.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),_=te=>{const{palette:{common:{white:$}}}=(0,g.Z)(),{children:T}=te,P=(0,B.$L)(),L=(0,K.h_)(K.Ds),{title:O,setTitle:oe,subtitle:Le,setSubtitle:Ve,entityRef:z,metadata:{value:xt,loading:ot},entityMetadata:{value:Ye,loading:st}}=(0,B.x1)();(0,h.useEffect)(()=>{xt&&(oe(xt.site_name),Ve(()=>{let{site_description:be}=xt;return(!be||be==="None")&&(be=""),be}))},[xt,oe,Ve]);const Qe=L.getOptional("app.title")||"Backstage",Ct=[O,Le,Qe].filter(Boolean).join(" | "),{locationMetadata:Tt,spec:bt}=Ye||{},it=bt==null?void 0:bt.lifecycle,Pt=Ye?(0,me.hF)(Ye,ue.S4):[],Zt=(0,K.tg)(w._Z)(),Ke=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.i9,{label:(0,I.capitalize)((Ye==null?void 0:Ye.kind)||"entity"),value:(0,t.jsx)(me.dx,{color:"inherit",entityRef:z,title:Ye==null?void 0:Ye.metadata.title,defaultKind:"Component"})}),Pt.length>0&&(0,t.jsx)(V.i9,{label:"Owner",value:(0,t.jsx)(me.rI,{color:"inherit",entityRefs:Pt,defaultKind:"group"})}),it?(0,t.jsx)(V.i9,{label:"Lifecycle",value:it}):null,Tt&&Tt.type!=="dir"&&Tt.type!=="file"?(0,t.jsx)(V.i9,{label:"",value:(0,t.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:$},children:[(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,t.jsx)(d.Z,{style:{marginTop:"-25px"}})}),(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Tt.target}):null]});return!st&&Ye===void 0||!ot&&xt===void 0?null:(0,t.jsxs)(V.h4,{type:"Documentation",typeLink:Zt,title:O||se,subtitle:Le===""?void 0:Le||se,children:[(0,t.jsx)(H.Z,{titleTemplate:"%s",children:(0,t.jsx)("title",{children:Ct})}),Ke,T,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(jt,De,r){"use strict";r.d(De,{b:function(){return K}});var t=r(52322),h=r(2784),H=r(79692),f=r(15223),W=r(95544),g=r(80030),d=r(61837),B=r(48348),me=r(47603),ue=r(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),K=I=>{const w=V(),[se,_]=(0,h.useState)(null),te=(0,h.useCallback)(Le=>{_(Le.currentTarget)},[]),$=(0,h.useCallback)(()=>{_(null)},[]),{entityMetadata:{value:T,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),O=L.renderComponentsByLocation(ue.oZ.Subheader),oe=L.renderComponentsByLocation(ue.oZ.Settings);return!O&&!oe||P===!1&&!T?null:(0,t.jsx)(f.Z,{classes:w,...I.toolbarProps,children:(0,t.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[O,oe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.ZP,{title:"Settings",children:(0,t.jsx)(d.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:te,children:(0,t.jsx)(me.Z,{})})}),(0,t.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:$,keepMounted:!0,children:(0,t.jsx)("div",{children:oe})})]}):null]})})}},95481:function(jt,De,r){"use strict";r.d(De,{DK:function(){return K},m1:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(61886),W=r(60871),g=r(64279),d=r(77446);function B({contentLoading:se,content:_,activeSyncState:te}){return se||te==="BUILD_READY_RELOAD"||!_&&te==="CHECKING"?"CHECKING":!_&&te==="BUILDING"?"INITIAL_BUILD":_?te==="BUILDING"?"CONTENT_STALE_REFRESHING":te==="BUILD_READY"?"CONTENT_STALE_READY":te==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function me(se,_){const te={...se};switch(_.type){case"sync":_.state==="CHECKING"&&(te.buildLog=[]),te.activeSyncState=_.state,te.syncError=_.syncError;break;case"contentLoading":te.contentLoading=!0,te.contentError=void 0;break;case"content":typeof _.path=="string"&&(te.path=_.path),te.contentLoading=!1,te.content=_.content,te.contentError=_.contentError;break;case"buildLog":te.buildLog=te.buildLog.concat(_.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(te.activeSyncState)&&["contentLoading","content"].includes(_.type)&&(te.activeSyncState="UP_TO_DATE",te.buildLog=[]),te}function ue(se,_,te,$){var T,P;const[L,O]=(0,h.useReducer)(me,{activeSyncState:"CHECKING",path:$,contentLoading:!0,buildLog:[]}),oe=(0,W.h_)(f.Dl),{retry:Le}=(0,d.Z)(async()=>{O({type:"contentLoading"});try{const xt=await oe.getEntityDocs({kind:se,namespace:_,name:te},$);return O({type:"content",content:xt,path:$}),xt}catch(xt){O({type:"content",contentError:xt,path:$})}},[oe,se,_,te,$]),Ve=(0,h.useRef)({content:void 0,reload:()=>{}});return Ve.current={content:L.content,reload:Le},(0,g.default)(async()=>{O({type:"sync",state:"CHECKING"});const xt=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await oe.syncEntityDocs({kind:se,namespace:_,name:te},Ye=>{O({type:"buildLog",log:Ye})})){case"updated":Ve.current.content?O({type:"sync",state:"BUILD_READY"}):(Ve.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ot){O({type:"sync",state:"ERROR",syncError:ot})}finally{clearTimeout(xt)}},[se,te,_,oe,O,Ve]),{state:(0,h.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:Le,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,h.createContext)({}),K=()=>(0,h.useContext)(V),I=se=>{const{children:_}=se,{"*":te=""}=(0,H.UO)(),{entityRef:$}=(0,f.x1)(),{kind:T,namespace:P,name:L}=$,O=ue(T,P,L,te);return(0,t.jsx)(V.Provider,{value:O,children:_ instanceof Function?_(O):_})},w=se=>_=>(0,t.jsx)(I,{children:(0,t.jsx)(se,{..._})})},95573:function(jt,De,r){"use strict";r.d(De,{Fw:function(){return H},_Z:function(){return h},pd:function(){return f}});var t=r(60871);const h=(0,t.NT)({id:"techdocs:index-page"}),H=(0,t.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,t.NT)({id:"techdocs:catalog-reader-view"})},55511:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsSearchResultListItem:function(){return ue}});var t=r(52322),h=r(2784),H=r(79692),f=r(49378),W=r(86136),g=r(90436),d=r(53974),B=r(15096);const me=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:K,highlight:I,lineClamp:w=5,asListItem:se=!0,asLink:_=!0,title:te,icon:$}=V,T=me(),P=({children:oe})=>_?(0,t.jsx)(d.rU,{noTrack:!0,to:K.location,children:oe}):(0,t.jsx)(t.Fragment,{children:oe}),L=()=>{const oe=I!=null&&I.fields.title?(0,t.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):K.title,Le=I!=null&&I.fields.entityTitle?(0,t.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):K.entityTitle,Ve=I!=null&&I.fields.name?(0,t.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):K.name;return K?(0,t.jsx)(f.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,t.jsx)(P,{children:te||(0,t.jsxs)(t.Fragment,{children:[oe," | ",Le!=null?Le:Ve," docs"]})}),secondary:(0,t.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:w,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,t.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):K.text})}):null},O=({children:oe})=>se?(0,t.jsxs)(t.Fragment,{children:[$&&(0,t.jsx)(W.Z,{children:typeof $=="function"?$(K):$}),(0,t.jsx)("div",{className:T.flexContainer,children:oe})]}):(0,t.jsx)(t.Fragment,{children:oe});return(0,t.jsx)(O,{children:(0,t.jsx)(L,{})})}},22478:function(jt,De,r){"use strict";r.d(De,{S:function(){return V}});var t=r(52322),h=r(15096),H=r(79692),f=r(27556),W=r(2784),g=r(73557),d=r(55511);const B=(0,H.Z)(K=>({root:{width:"100%"},bar:{padding:K.spacing(1)}})),me=K=>K==null?void 0:K.document,ue=K=>{const{entityId:I,entityTitle:w,debounceTime:se=150}=K,[_,te]=(0,W.useState)(!1),$=(0,g.s0)(),{setFilters:T,result:{loading:P,value:L}}=(0,h.Rx)(),O=B(),[oe,Le]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Ye=!0;if(Ye&&L){const st=L.results.slice(0,10);Le(st)}return()=>{Ye=!1}},[P,L]);const{kind:Ve,name:z,namespace:xt}=I;(0,W.useEffect)(()=>{T(Ye=>({...Ye,kind:Ve,namespace:xt,name:z}))},[Ve,xt,z,T]);const ot=(Ye,st)=>{if(me(st)){const{location:Qe}=st.document;$(Qe)}};return(0,t.jsx)(f.Z,{className:O.bar,variant:"outlined",children:(0,t.jsx)(h.qO,{classes:{root:O.root},"data-testid":"techdocs-search-bar",size:"small",open:_,getOptionLabel:()=>"",filterOptions:Ye=>Ye,onClose:()=>{te(!1)},onFocus:()=>{te(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:oe,renderOption:({document:Ye,highlight:st})=>(0,t.jsx)(d.TechDocsSearchResultListItem,{result:Ye,lineClamp:3,asListItem:!1,asLink:!1,title:Ye.title,highlight:st}),loading:P,inputDebounceTime:se,inputPlaceholder:`Search ${w||I.name} docs`,freeSolo:!1})})},V=K=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:K.entityId};return(0,t.jsx)(h.Nd,{initialState:I,children:(0,t.jsx)(ue,{...K})})}},53260:function(){}},function(jt){var De=function(t){return jt(jt.s=t)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return De(6290)});var r=jt.O()}]);})();
|
|
507
|
-
|
|
508
|
-
//# sourceMappingURL=main.8fd0fc33.js.map
|