@techdocs/cli 1.2.1-next.2 → 1.2.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 +12 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1032.3a714ba6.chunk.js +3 -0
- package/dist/embedded-app/static/{1032.6bf895d9.chunk.js.map → 1032.3a714ba6.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1105.5baa95de.chunk.js +3 -0
- package/dist/embedded-app/static/{1105.c6322959.chunk.js.map → 1105.5baa95de.chunk.js.map} +1 -1
- package/dist/embedded-app/static/184.7b1e0f39.chunk.js +3 -0
- package/dist/embedded-app/static/{184.ca141892.chunk.js.map → 184.7b1e0f39.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2440.62a2d2d2.chunk.js +3 -0
- package/dist/embedded-app/static/{2440.1a4b182a.chunk.js.map → 2440.62a2d2d2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5458.a2ccf643.chunk.js +3 -0
- package/dist/embedded-app/static/{5458.ace70612.chunk.js.map → 5458.a2ccf643.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5837.c555f098.chunk.js +3 -0
- package/dist/embedded-app/static/{5837.00a42df7.chunk.js.map → 5837.c555f098.chunk.js.map} +1 -1
- package/dist/embedded-app/static/732.f5f2fd41.chunk.js +3 -0
- package/dist/embedded-app/static/{732.069998a1.chunk.js.map → 732.f5f2fd41.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7560.738e4ce1.chunk.js +3 -0
- package/dist/embedded-app/static/{7560.2275e900.chunk.js.map → 7560.738e4ce1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.7df70188.chunk.js → 7750.ef28fccf.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.7df70188.chunk.js.map → 7750.ef28fccf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9545.717b3501.chunk.js +3 -0
- package/dist/embedded-app/static/{9545.2c04e8ca.chunk.js.map → 9545.717b3501.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9770.2cfe00ea.chunk.js +3 -0
- package/dist/embedded-app/static/{9770.b0a8132c.chunk.js.map → 9770.2cfe00ea.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.3a6c5dd0.js +492 -0
- package/dist/embedded-app/static/main.3a6c5dd0.js.map +1 -0
- package/dist/embedded-app/static/{runtime.a427fd55.js → runtime.3a6c5dd0.js} +2 -2
- package/dist/embedded-app/static/{runtime.a427fd55.js.map → runtime.3a6c5dd0.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.a427fd55.js → vendor.3a6c5dd0.js} +3 -3
- package/dist/embedded-app/static/vendor.3a6c5dd0.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +9 -9
- package/dist/embedded-app/static/1032.6bf895d9.chunk.js +0 -3
- package/dist/embedded-app/static/1105.c6322959.chunk.js +0 -3
- package/dist/embedded-app/static/184.ca141892.chunk.js +0 -3
- package/dist/embedded-app/static/2440.1a4b182a.chunk.js +0 -3
- package/dist/embedded-app/static/5458.ace70612.chunk.js +0 -3
- package/dist/embedded-app/static/5837.00a42df7.chunk.js +0 -3
- package/dist/embedded-app/static/732.069998a1.chunk.js +0 -3
- package/dist/embedded-app/static/7560.2275e900.chunk.js +0 -3
- package/dist/embedded-app/static/9545.2c04e8ca.chunk.js +0 -3
- package/dist/embedded-app/static/9770.b0a8132c.chunk.js +0 -3
- package/dist/embedded-app/static/main.a427fd55.js +0 -492
- package/dist/embedded-app/static/main.a427fd55.js.map +0 -1
- package/dist/embedded-app/static/vendor.a427fd55.js.map +0 -1
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(bt,Pe,t){"use strict";t.d(Pe,{n3:function(){return z},MS:function(){return b}});var h=t(25271),n=t(23054),m=t(96279),T=t.n(m);const z=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors($,ee){const{kind:Y,namespace:J,name:D}=(0,h.of)($.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Y)}/${encodeURIComponent(J)}/${encodeURIComponent(D)}/ancestry`,ee)}async getLocationById($,ee){return await this.requestOptional("GET",`/locations/${encodeURIComponent($)}`,ee)}async getEntities($,ee){const{filter:Y=[],fields:J=[],offset:D,limit:K,after:W}=$!=null?$:{},ae=[];for(const k of[Y].flat()){const O=[];for(const[A,te]of Object.entries(k))for(const fe of[te].flat())fe===z?O.push(encodeURIComponent(A)):typeof fe=="string"&&O.push(`${encodeURIComponent(A)}=${encodeURIComponent(fe)}`);O.length&&ae.push(`filter=${O.join(",")}`)}J.length&&ae.push(`fields=${J.map(encodeURIComponent).join(",")}`),D!==void 0&&ae.push(`offset=${D}`),K!==void 0&&ae.push(`limit=${K}`),W!==void 0&&ae.push(`after=${encodeURIComponent(W)}`);const ie=ae.length?`?${ae.join("&")}`:"",R=await this.requestRequired("GET",`/entities${ie}`,ee),I=(k,O)=>{var A,te;if(((A=k.metadata)===null||A===void 0?void 0:A.name)===void 0||k.kind===void 0||((te=O.metadata)===null||te===void 0?void 0:te.name)===void 0||O.kind===void 0)return 0;const fe=(0,h.eE)(k),Ye=(0,h.eE)(O);return fe<Ye?-1:fe>Ye?1:0};return{items:R.sort(I)}}async getEntityByRef($,ee){const{kind:Y,namespace:J,name:D}=(0,h.of)($);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Y)}/${encodeURIComponent(J)}/${encodeURIComponent(D)}`,ee)}async getEntityByName($,ee){const{kind:Y,namespace:J="default",name:D}=$;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Y)}/${encodeURIComponent(J)}/${encodeURIComponent(D)}`,ee)}async refreshEntity($,ee){const Y=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ee==null?void 0:ee.token)&&{Authorization:`Bearer ${ee==null?void 0:ee.token}`}},method:"POST",body:JSON.stringify({entityRef:$})});if(Y.status!==200)throw new Error(await Y.text())}async getEntityFacets($,ee){const{filter:Y=[],facets:J}=$,D=[];for(const W of[Y].flat()){const ae=[];for(const[ie,R]of Object.entries(W))for(const I of[R].flat())I===z?ae.push(encodeURIComponent(ie)):typeof I=="string"&&ae.push(`${encodeURIComponent(ie)}=${encodeURIComponent(I)}`);ae.length&&D.push(`filter=${ae.join(",")}`)}for(const W of J)D.push(`facet=${encodeURIComponent(W)}`);const K=D.length?`?${D.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${K}`,ee)}async addLocation($,ee){const{type:Y="url",target:J,dryRun:D}=$,K=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${D?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ee==null?void 0:ee.token)&&{Authorization:`Bearer ${ee==null?void 0:ee.token}`}},method:"POST",body:JSON.stringify({type:Y,target:J})});if(K.status!==201)throw new Error(await K.text());const{location:W,entities:ae,exists:ie}=await K.json();if(!W)throw new Error(`Location wasn't added: ${J}`);return{location:W,entities:ae,exists:ie}}async getLocationByRef($,ee){return(await this.requestRequired("GET","/locations",ee)).map(J=>J.data).find(J=>$===(0,h.NZ)(J))}async removeLocationById($,ee){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent($)}`,ee)}async removeEntityByUid($,ee){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent($)}`,ee)}async validateEntity($,ee,Y){const J=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(Y==null?void 0:Y.token)&&{Authorization:`Bearer ${Y==null?void 0:Y.token}`}},method:"POST",body:JSON.stringify({entity:$,location:ee})});if(J.ok)return{valid:!0};if(J.status!==400)throw await n.VL.fromResponse(J);const{errors:D=[]}=await J.json();return{valid:!1,errors:D}}async requestIgnored($,ee,Y){const J=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,D=Y!=null&&Y.token?{Authorization:`Bearer ${Y.token}`}:{},K=await this.fetchApi.fetch(J,{method:$,headers:D});if(!K.ok)throw await n.VL.fromResponse(K)}async requestRequired($,ee,Y){const J=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,D=Y!=null&&Y.token?{Authorization:`Bearer ${Y.token}`}:{},K=await this.fetchApi.fetch(J,{method:$,headers:D});if(!K.ok)throw await n.VL.fromResponse(K);return await K.json()}async requestOptional($,ee,Y){const J=`${await this.discoveryApi.getBaseUrl("catalog")}${ee}`,D=Y!=null&&Y.token?{Authorization:`Bearer ${Y.token}`}:{},K=await this.fetchApi.fetch(J,{method:$,headers:D});if(!K.ok){if(K.status===404)return;throw await n.VL.fromResponse(K)}return await K.json()}constructor($){this.discoveryApi=$.discoveryApi,this.fetchApi=$.fetchApi||{fetch:T()}}}},25271:function(bt,Pe,t){"use strict";t.d(Pe,{Tf:function(){return m},P1:function(){return oe},q1:function(){return G},M6:function(){return pe},l2:function(){return n},zG:function(){return h},w$:function(){return fn},nP:function(){return Ln},aS:function(){return _e},S4:function(){return zt},cz:function(){return We},iB:function(){return lt},CV:function(){return Ge},of:function(){return ct},Ou:function(){return ve},eE:function(){return nt},NZ:function(){return be}});const h="default",n="backstage.io/view-url",m="backstage.io/edit-url",T="kubernetes.io/api-server",z="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var l=t(76635),$=t.n(l);class ee{async enforce(w){return w.metadata.namespace?w:lodash.merge({metadata:{namespace:this.namespace}},w)}constructor(w=DEFAULT_NAMESPACE){this.namespace=w}}class Y{static isValidPrefixAndOrSuffix(w,Q,Ee,Oe){if(typeof w!="string")return!1;const Ve=w.split(Q);return Ve.length===1?Oe(Ve[0]):Ve.length===2?Ee(Ve[0])&&Oe(Ve[1]):!1}static isJsonSafe(w){try{return $().isEqual(w,JSON.parse(JSON.stringify(w)))}catch{return!1}}static isValidDnsSubdomain(w){return typeof w=="string"&&w.length>=1&&w.length<=253&&w.split(".").every(Y.isValidDnsLabel)}static isValidDnsLabel(w){return typeof w=="string"&&w.length>=1&&w.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(w)}static isValidTag(w){return typeof w=="string"&&w.length>=1&&w.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(w)}static isValidUrl(w){if(typeof w!="string")return!1;try{return new URL(w),!0}catch{return!1}}static isValidString(w){var Q;return typeof w=="string"&&((Q=w==null?void 0:w.trim())===null||Q===void 0?void 0:Q.length)>=1}static isNonEmptyString(w){var Q;return typeof w=="string"&&((Q=w==null?void 0:w.trim())===null||Q===void 0?void 0:Q.length)>=1}}var J=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}}}}}'),D=t(27991),K=t.n(D),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"}}}`),ae=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}}}}}}'),ie=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 R=new Map,I=[J,W,ae,ie];function k(V){if(!(V!=null&&V.length))throw new TypeError("Unknown error");const w=V[0];throw new TypeError(`${w.instancePath||"<root>"} ${w.message}${w.params?` - ${Object.entries(w.params).map(([Q,Ee])=>`${Q}: ${Ee}`).join(", ")}`:""}`)}function O(V,w={}){var Q;const Ee=(Q=w==null?void 0:w.disableCache)!==null&&Q!==void 0?Q:!1,Oe=Ee?"":JSON.stringify(V);if(!Ee){const Zt=R.get(Oe);if(Zt)return Zt}const Ve=A(V),ot=new(K())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Ve.length&&ot.addSchema(Ve,void 0,void 0,!0);const Ft=ot.compile(V);return Ee||R.set(Oe,Ft),Ft}function A(V){if(typeof V!="object")return[];const w=new Set;V.$id&&w.add(V.$id);const Q=new Array,Ee=[V];for(;Ee.length;){const Oe=Ee.pop();for(const Ve of te(Oe))if(!w.has(Ve)){w.add(Ve);const ot=I.find(Ft=>Ft.$id===Ve);ot&&(Q.push(ot),Ee.push(ot))}}return Q}function*te(V){const w=[V];for(;w.length;){const Q=w.pop();if(typeof Q=="object"&&Q)for(const[Ee,Oe]of Object.entries(Q))Ee==="$ref"&&typeof Oe=="string"?yield Oe.split("#")[0]:w.push(Oe)}}function fe(V){const w=compileAjvSchema(V||entityEnvelopeSchema);return Q=>{if(w(Q)===!0)return Q;throw throwAjvError(w.errors)}}function Ye(V){const w=O(V);return Q=>{var Ee;if(w(Q)===!0)return Q;const Ve=(Ee=w.errors)===null||Ee===void 0?void 0:Ee.filter(ot=>["/kind","/apiVersion"].includes(ot.instancePath));if((Ve==null?void 0:Ve.length)&&Ve.every(ot=>ot.keyword==="enum"))return!1;throw k(w.errors)}}function qe(V){const w=compileAjvSchema(V||entitySchema);return Q=>{if(w(Q)===!0)return Q;throw throwAjvError(w.errors)}}class He{static isValidApiVersion(w){return Y.isValidPrefixAndOrSuffix(w,"/",Y.isValidDnsSubdomain,Q=>Q.length>=1&&Q.length<=63&&/^[a-z0-9A-Z]+$/.test(Q))}static isValidKind(w){return typeof w=="string"&&w.length>=1&&w.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(w)}static isValidObjectName(w){return typeof w=="string"&&w.length>=1&&w.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(w)}static isValidNamespace(w){return Y.isValidDnsLabel(w)}static isValidLabelKey(w){return Y.isValidPrefixAndOrSuffix(w,"/",Y.isValidDnsSubdomain,He.isValidObjectName)}static isValidLabelValue(w){return w===""||He.isValidObjectName(w)}static isValidAnnotationKey(w){return Y.isValidPrefixAndOrSuffix(w,"/",Y.isValidDnsSubdomain,He.isValidObjectName)}static isValidAnnotationValue(w){return typeof w=="string"}}const Xe={isValidApiVersion:He.isValidApiVersion,isValidKind:He.isValidKind,isValidEntityName:He.isValidObjectName,isValidNamespace:He.isValidNamespace,isValidLabelKey:He.isValidLabelKey,isValidLabelValue:He.isValidLabelValue,isValidAnnotationKey:He.isValidAnnotationKey,isValidAnnotationValue:He.isValidAnnotationValue,isValidTag:V=>typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(V)};function Qe(V={}){return{...Xe,...V}}class Ue{async enforce(w){function Q(E,_,ye){if(_==null)throw new Error(`${E} must have a value`);let ge;try{ge=ye(_)}catch(ke){throw new Error(`${E} could not be validated, ${ke}`)}if(!ge){let ke;switch(ye.name){case"isValidLabelValue":case"isValidObjectName":ke="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":ke="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":ke="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":ke="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":ke="a string";break;case"isValidKind":ke="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":ke="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":ke="a non empty string";break;default:ke=void 0;break}const De=ke?` expected ${ke} but found "${_}".`:"";throw new Error(`"${E}" is not valid;${De} 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 Ee(E,_,ye){return _===void 0||Q(E,_,ye)}Q("apiVersion",w.apiVersion,this.validators.isValidApiVersion),Q("kind",w.kind,this.validators.isValidKind),Q("metadata.name",w.metadata.name,this.validators.isValidEntityName),Ee("metadata.namespace",w.metadata.namespace,this.validators.isValidNamespace);var Oe;for(const[E,_]of Object.entries((Oe=w.metadata.labels)!==null&&Oe!==void 0?Oe:[]))Q(`labels.${E}`,E,this.validators.isValidLabelKey),Q(`labels.${E}`,_,this.validators.isValidLabelValue);var Ve;for(const[E,_]of Object.entries((Ve=w.metadata.annotations)!==null&&Ve!==void 0?Ve:[]))Q(`annotations.${E}`,E,this.validators.isValidAnnotationKey),Q(`annotations.${E}`,_,this.validators.isValidAnnotationValue);var ot;const Ft=(ot=w.metadata.tags)!==null&&ot!==void 0?ot:[];for(let E=0;E<Ft.length;++E)Q(`tags.${E}`,Ft[E],this.validators.isValidTag);var Zt;const qt=(Zt=w.metadata.links)!==null&&Zt!==void 0?Zt:[];for(let E=0;E<qt.length;++E){var Vt,Ht,jn;Q(`links.${E}.url`,(Vt=qt[E])===null||Vt===void 0?void 0:Vt.url,CommonValidatorFunctions.isValidUrl),Ee(`links.${E}.title`,(Ht=qt[E])===null||Ht===void 0?void 0:Ht.title,CommonValidatorFunctions.isNonEmptyString),Ee(`links.${E}.icon`,(jn=qt[E])===null||jn===void 0?void 0:jn.icon,KubernetesValidatorFunctions.isValidObjectName)}return w}constructor(w=makeValidator()){this.validators=w}}class ze{async enforce(w){if(!this.validate){const Oe=new Ajv({allowUnionTypes:!0});this.validate=Oe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(w)===!0)return w;const[Ee]=this.validate.errors||[];throw Ee?new Error(`Malformed envelope, ${Ee.instancePath||"<root>"} ${Ee.message}`):new Error("Malformed envelope, Unknown error")}}function tt(V){let w=V.indexOf(":");const Q=V.indexOf("/");Q!==-1&&Q<w&&(w=-1);const Ee=w===-1?void 0:V.slice(0,w),Oe=Q===-1?void 0:V.slice(w+1,Q),Ve=V.slice(Math.max(w+1,Q+1));if(Ee===""||Oe===""||Ve==="")throw new TypeError(`Entity reference "${V}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ee,namespace:Oe,name:Ve}}function lt(V){return{kind:V.kind,namespace:V.metadata.namespace||h,name:V.metadata.name}}function ct(V,w){if(!V)throw new Error("Entity reference must not be empty");const Q=w==null?void 0:w.defaultKind,Ee=(w==null?void 0:w.defaultNamespace)||h;let Oe,Ve,ot;if(typeof V=="string"){const Ht=tt(V);var Ft;Oe=(Ft=Ht.kind)!==null&&Ft!==void 0?Ft:Q;var Zt;Ve=(Zt=Ht.namespace)!==null&&Zt!==void 0?Zt:Ee,ot=Ht.name}else{var qt;Oe=(qt=V.kind)!==null&&qt!==void 0?qt:Q;var Vt;Ve=(Vt=V.namespace)!==null&&Vt!==void 0?Vt:Ee,ot=V.name}if(Oe)if(Ve){if(!ot){const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty name`)}}else{const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty namespace`)}else{const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Oe,namespace:Ve,name:ot}}function nt(V){let w,Q,Ee;if("metadata"in V){w=V.kind;var Oe;Q=(Oe=V.metadata.namespace)!==null&&Oe!==void 0?Oe:h,Ee=V.metadata.name}else{w=V.kind;var Ve;Q=(Ve=V.namespace)!==null&&Ve!==void 0?Ve:h,Ee=V.name}return`${w.toLocaleLowerCase("en-US")}:${Q.toLocaleLowerCase("en-US")}/${Ee.toLocaleLowerCase("en-US")}`}class Ce{async enforce(w){let Q=w;for(const Ee of this.policies){const Oe=await Ee.enforce(Q);if(!Oe)throw new Error(`Policy ${Ee.constructor.name} did not return a result`);Q=Oe}return Q}constructor(w){this.policies=w}}class rt{async enforce(w){for(const Q of this.policies){const Ee=await Q.enforce(w);if(Ee)return Ee}throw new Error("The entity did not match any known policy")}constructor(w){this.policies=w}}const gt={allOf(V){return new Ce(V)},oneOf(V){return new rt(V)}};var Re=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"],"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 se(V){const w=Ye(V);return{async check(Q){return w(Q)===Q}}}const xe=se(Re);var Te=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 st=se(Te);var ft=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 Ct=se(ft);var dt=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 jt=se(dt);var St=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 Pt=se(St),zt="ownedBy",mt="ownerOf",ln="consumesApi",Nt="apiConsumedBy",dn="providesApi",un="apiProvidedBy",Ln="dependsOn",fn="dependencyOf",On="parentOf",je="childOf",Ae="memberOf",Be="hasMember",We="partOf",_e="hasPart";var at=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 pt=se(at);var wt=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 Tt=se(wt);var kt=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 It=se(kt),oe="backstage.io/managed-by-location",G="backstage.io/managed-by-origin-location",pe="backstage.io/source-location";function ve(V){if(typeof V!="string")throw new TypeError(`Unable to parse location ref '${V}', unexpected argument ${typeof V}`);const w=V.indexOf(":");if(w<0)throw new TypeError(`Unable to parse location ref '${V}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const Q=V.substring(0,w).trim(),Ee=V.substring(w+1).trim();if(!Q||!Ee)throw new TypeError(`Unable to parse location ref '${V}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(Q==="http"||Q==="https")throw new TypeError(`Invalid location ref '${V}', please prefix it with 'url:', e.g. 'url:${V}'`);return{type:Q,target:Ee}}function be(V){const{type:w,target:Q}=V;if(w){if(!Q)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${w}:${Q}`}function Ge(V){var w,Q,Ee,Oe,Ve;const ot=(Ve=(w=V.metadata)===null||w===void 0||(Q=w.annotations)===null||Q===void 0?void 0:Q[pe])!==null&&Ve!==void 0?Ve:(Ee=V.metadata)===null||Ee===void 0||(Oe=Ee.annotations)===null||Oe===void 0?void 0:Oe[oe];if(!ot)throw new Error(`Entity '${nt(V)}' is missing location`);return ve(ot)}},1515:function(bt,Pe,t){"use strict";t.d(Pe,{zx:function(){return qe},Oi:function(){return Ce},VY:function(){return ji},yW:function(){return Ua},XF:function(){return Re},mn:function(){return pe},NX:function(){return h},ub:function(){return qt},mf:function(){return Wa},yu:function(){return x},h4:function(){return Oi},M6:function(){return ts},i9:function(){return tl},aR:function(){return Ei},rJ:function(){return xr},Oh:function(){return ll},hu:function(){return ol},rU:function(){return fe},nU:function(){return os},sk:function(){return jn},Or:function(){return ls},T3:function(){return Bi},g9:function(){return ul},Ex:function(){return ds},Gk:function(){return j},tn:function(){return Ai},Ph:function(){return Qt},YE:function(){return Jo},v7:function(){return Xi},R6:function(){return wi},tR:function(){return Zo},uw:function(){return da},qt:function(){return vi},iA:function(){return Pa},GB:function(){return Bn},po:function(){return rr},mZ:function(){return As},Pf:function(){return kr}});var h={};t.r(h),t.d(h,{Nm:function(){return se},ht:function(){return st},LJ:function(){return Te}});var n=t(52322),m=t(2784),T=t(25248),z=t(19928);function b(e){const[s,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const B=d.alert$().subscribe(M=>i(Z=>Z.concat(M)));return()=>{B.unsubscribe()}},[d]),s.length===0)return null;const[g]=s,C=()=>{i(B=>B.filter(M=>M!==g))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:C,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:g.severity,children:_jsxs("span",{children:[g.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),$=t(12420);const ee=(0,l.Z)(e=>(0,$.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Y(e){const{displayName:s,picture:i,customStyles:d}=e,p=ee();let g={...d};return i||(g={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:g,children:s&&extractInitials(s)})}var J=t(77277),D=t(72779),K=t.n(D),W=t(86689),ae=t(62833),ie=t(76635);const R=(0,l.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"}),I=e=>/^([a-z+.-]+):/.test(e),k=()=>{try{return(0,T.h_)(T.Ds).getOptionalString("app.baseUrl")}catch{return}},O=()=>{const e="http://dummy.dev";var s;const i=(s=k())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(i,e);return(0,ie.trimEnd)(d,"/")},A=e=>{let s=String(e);const i=O(),d=I(s),p=s.startsWith(i);return!d&&!p&&(s=i.concat(s)),s},te=e=>{if(e instanceof Array)return e.map(te).join(" ").trim();if(typeof e=="object"&&e){var s,i;return te((s=e)===null||s===void 0||(i=s.props)===null||i===void 0?void 0:i.children)}return["string","number"].includes(typeof e)?String(e):""},fe=m.forwardRef(({onClick:e,noTrack:s,...i},d)=>{const p=R(),g=(0,T.z$)(),C=A(i.to),B=te(i.children)||C,M=I(C),Z=M&&!!/^https?:/.exec(C),ue=re=>{e==null||e(re),s||g.captureEvent("click",B,{attributes:{to:C}})};return M?(0,n.jsxs)(W.Z,{...Z?{target:"_blank",rel:"noopener"}:{},...i,ref:d,href:C,onClick:ue,className:K()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(W.Z,{...i,ref:d,component:ae.rU,to:C,onClick:ue})}),Ye=m.forwardRef((e,s)=>(0,n.jsx)(fe,{ref:s,...e,color:"initial"})),qe=m.forwardRef((e,s)=>(0,n.jsx)(J.Z,{ref:s,component:Ye,...e}));var He=t(60364),Xe=t(61837),Qe=t(80030),Ue=t(19353),ze=t(95074);function tt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,g=(0,T.h_)(T.VE),[C,B]=(0,m.useState)(!1),[{error:M},Z]=(0,ze.Z)();(0,m.useEffect)(()=>{M&&g.post(M)},[M,g]);const ue=re=>{re.stopPropagation(),B(!0),Z(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Qe.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>B(!1),open:C,children:(0,n.jsx)(Xe.Z,{onClick:ue,"aria-label":p,children:(0,n.jsx)(Ue.Z,{})})})})}var lt=t(83229),ct=t(26639),nt=t(39595);function Ce(e){const{text:s,language:i,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:g,showCopyCodeButton:C=!1}=e,B=(0,He.Z)(),M=B.palette.type==="dark"?ct.Z:nt.Z,Z=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(lt.Z,{customStyle:g,language:i,style:M,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:B.palette.textVerySubtle},lineProps:ue=>p!=null&&p.includes(ue)?{style:{backgroundColor:Z}}:{},children:s}),C&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(tt,{text:s})})]})}var rt=t(41156),gt=t(88188);function Re(e){const{title:s,to:i}=e,d=(0,rt.Z)(p=>p.breakpoints.down("xs"));return i?d?(0,n.jsx)(Xe.Z,{component:ae.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(gt.Z,{})}):(0,n.jsx)(J.Z,{component:ae.rU,variant:"contained",color:"primary",to:i,children:s}):null}var se;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(se||(se={}));var xe;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(xe||(xe={}));var Te;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Te||(Te={}));var st;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(st||(st={}));var ft=t(27397),Ct=t(11105),dt=t(97963),jt=t(46506),St=t.n(jt),Pt=t(54073),zt=t.n(Pt),mt=t(10368);const ln=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Nt({node:{id:e}}){const s=ln(),[i,d]=m.useState(0),[p,g]=m.useState(0),C=m.useRef(null);m.useLayoutEffect(()=>{if(C.current){let{height:ue,width:re}=C.current.getBBox();ue=Math.round(ue),re=Math.round(re),(ue!==p||re!==i)&&(d(re),g(ue))}},[i,p]);const B=10,M=i+B*2,Z=p+B*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:M,height:Z,rx:10}),(0,n.jsx)("text",{ref:C,className:s.text,y:Z/2,x:M/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const dn="arrow-marker",un="node",Ln="edge",fn="label",On=(0,mt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),je=e=>(0,n.jsx)(Nt,{...e});function Ae({render:e=je,setNode:s,node:i}){const{width:d,height:p,x:g=0,y:C=0}=i,B=i,M=On(),Z=m.useRef(null);return m.useLayoutEffect(()=>{if(Z.current){let{height:ue,width:re}=Z.current.getBBox();ue=Math.round(ue),re=Math.round(re),(ue!==p||re!==d)&&s(i.id,{...i,height:ue,width:re})}},[i,d,p,s]),(0,n.jsx)("g",{ref:Z,"data-testid":un,className:M.node,transform:`translate(${g-d/2},${C-p/2})`,children:e({node:B})})}var Be=t(55876),We=t(66481),_e=t(19574),at=t.n(_e);const pt=(0,mt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function wt({edge:{label:e}}){const s=pt();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Tt=(0,mt.Z)(e=>({path:{strokeWidth:2,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),kt=e=>(0,n.jsx)(wt,{...e}),It=Be.Z().x(e=>e.x).y(e=>e.y).curve(We.Z);function oe({render:e=kt,setEdge:s,id:i,edge:d}){const{x:p=0,y:g=0,width:C,height:B,points:M}=d,Z=d,ue=Tt(),re=m.useRef(null);m.useLayoutEffect(()=>{if(re.current){let{height:we,width:Fe}=re.current.getBBox();we=Math.round(we),Fe=Math.round(Fe),(we!==B||Fe!==C)&&s(i,{...d,height:we,width:Fe})}},[d,B,C,s,i]);let ce="";if(M){const we=M.filter(Fe=>at()(Fe.x)&&at()(Fe.y));ce=It(we)||""}return(0,n.jsxs)(n.Fragment,{children:[ce&&(0,n.jsx)("path",{"data-testid":Ln,className:ue.path,markerEnd:`url(#${dn})`,d:ce}),Z.label?(0,n.jsx)("g",{ref:re,"data-testid":fn,className:ue.label,transform:`translate(${p},${g})`,children:e({edge:Z})}):null]})}const G="workspace";function pe(e){var s,i;const{edges:d,nodes:p,renderNode:g,direction:C=se.TOP_BOTTOM,align:B,nodeMargin:M=50,edgeMargin:Z=10,rankMargin:ue=50,paddingX:re=0,paddingY:ce=0,acyclicer:we,ranker:Fe=Te.NETWORK_SIMPLEX,labelPosition:ht=st.RIGHT,labelOffset:Mt=10,edgeRanks:Yt=1,edgeWeight:en=1,renderLabel:tn,defs:At,zoom:Xt="enabled",...Jt}=e,dr=(0,dt.Z)(),[Yn,ur]=m.useState(100),[hr,si]=m.useState(100),Gt=m.useRef(new(St()).graphlib.Graph),[qr,lo]=m.useState(((s=Gt.current.graph())===null||s===void 0?void 0:s.width)||0),[_r,co]=m.useState(((i=Gt.current.graph())===null||i===void 0?void 0:i.height)||0),[uo,oi]=m.useState([]),[wn,or]=m.useState([]),Jn=Math.max(qr,Yn),Wn=Math.max(_r,hr),mn=m.useMemo(()=>zt()(cn=>{if(!cn)return;const Cn=Ct.Z(cn),an=Ct.Z(cn.getElementById(G));function Qn(){Cn.call(ft.sP().scaleExtent([1,10]).on("zoom",pr=>{pr.transform.x=Math.min(0,Math.max(pr.transform.x,Jn-Jn*pr.transform.k)),pr.transform.y=Math.min(0,Math.max(pr.transform.y,Wn-Wn*pr.transform.k)),an.attr("transform",pr.transform)}))}Xt==="enabled"?Qn():Xt==="enable-on-click"&&Cn.on("click",()=>Qn());const{width:Xn,height:ho}=cn.getBoundingClientRect();Yn!==Xn&&ur(Xn),hr!==ho&&si(ho)},100),[hr,Yn,Jn,Wn,Xt]),Rn=m.useCallback(()=>{const cn=Gt.current.nodes(),Cn=Gt.current.edges();cn.forEach(an=>{p.some(Xn=>Xn.id===an)||Gt.current.removeNode(an)}),Cn.forEach(an=>{d.some(Xn=>Xn.from===an.v&&Xn.to===an.w)||Gt.current.removeEdge(an.v,an.w)}),p.forEach(an=>{const Qn=Gt.current.nodes().find(Xn=>an.id===Xn);if(Qn&&Gt.current.node(Qn)){const{width:Xn,height:ho,x:pr,y:Il}=Gt.current.node(Qn);Gt.current.setNode(Qn,{...an,width:Xn,height:ho,x:pr,y:Il})}else Gt.current.setNode(an.id,{...an,width:0,height:0})}),d.forEach(an=>{Gt.current.setEdge(an.from,an.to,{...an,label:an.label,width:0,height:0,labelpos:ht,labeloffset:Mt,weight:en,minlen:Yt})})},[d,p,ht,Mt,en,Yt]),ir=m.useMemo(()=>zt()(()=>{St().layout(Gt.current);const{height:cn,width:Cn}=Gt.current.graph(),an=Math.max(0,cn||0),Qn=Math.max(0,Cn||0);lo(Qn),co(an),oi(Gt.current.nodes()),or(Gt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Gt.current.setGraph({rankdir:C,align:B,nodesep:M,edgesep:Z,ranksep:ue,marginx:re,marginy:ce,acyclicer:we,ranker:Fe}),Rn(),ir(),ir.cancel),[we,B,C,Z,re,ce,M,ue,Fe,Rn,ir]);function Or(cn,Cn){return Gt.current.setNode(cn,Cn),ir(),Gt.current}function Is(cn,Cn){return Gt.current.setEdge(cn,Cn),ir(),Gt.current}return(0,n.jsxs)("svg",{ref:mn,...Jt,width:"100%",height:Wn,viewBox:`0 0 ${Jn} ${Wn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:dn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:dr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),At]}),(0,n.jsx)("g",{id:G,children:(0,n.jsxs)("svg",{width:qr,height:_r,y:Wn/2-_r/2,x:Jn/2-qr/2,viewBox:`0 0 ${qr} ${_r}`,children:[wn.map(cn=>{const Cn=Gt.current.edge(cn);return Cn?(0,n.jsx)(oe,{id:cn,setEdge:Is,render:tn,edge:Cn},`${cn.v}-${cn.w}`):null}),uo.map(cn=>{const Cn=Gt.current.node(cn);return Cn?(0,n.jsx)(Ae,{setNode:Or,render:g,node:Cn},cn):null})]})})]})}var ve;const be=(0,l.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:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(ve=e.palette.banner.warning)!==null&&ve!==void 0?ve:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Ge=e=>{const{variant:s,message:i,id:d,fixed:p=!1}=e,g=be(),B=useApi(storageApiRef).forBucket("notifications");var M;const Z=(M=B.snapshot("dismissedBanners").value)!==null&&M!==void 0?M:[],[ue,re]=useState(new Set(Z)),ce=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(ce!=null&&ce.value){var Fe;const ht=(Fe=ce==null?void 0:ce.value)!==null&&Fe!==void 0?Fe:[];re(new Set(ht))}},[ce==null?void 0:ce.value]);const we=()=>{B.set("dismissedBanners",[...ue,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ue.has(d),classes:{root:classNames(g.root,!p&&g.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(g.content,g[s]),message:g.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:we,children:_jsx(Close,{className:g.icon})},"dismiss")]})})};var V=t(60905),w=t(90436),Q=t.p+"static/missingAnnotation.67f79e98..svg",Ee=t.p+"static/noInformation.4b426325..svg",Oe=t.p+"static/createComponent.975d1e1e..svg",Ve=t.p+"static/noBuild.1715fa71..svg";const ot=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Ft=({missing:e})=>{const s=ot();switch(e){case"field":return(0,n.jsx)("img",{src:Q,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:Ee,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:Oe,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:Ve,alt:"no Build",className:s.generalImg});default:return null}},Zt=(0,l.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 qt(e){const{title:s,description:i,missing:d,action:p}=e,g=Zt();return(0,n.jsxs)(V.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:g.root,spacing:2,children:[(0,n.jsx)(V.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(V.Z,{container:!0,direction:"column",children:[(0,n.jsx)(V.Z,{item:!0,xs:!0,children:(0,n.jsx)(w.Z,{variant:"h5",children:s})}),(0,n.jsx)(V.Z,{item:!0,xs:!0,children:(0,n.jsx)(w.Z,{variant:"body1",children:i})}),(0,n.jsx)(V.Z,{item:!0,xs:!0,className:g.action,children:p})]})}),(0,n.jsx)(V.Z,{item:!0,xs:12,md:6,className:g.imageContainer,children:typeof d=="string"?(0,n.jsx)(Ft,{missing:d}):d.customImage})]})}const Vt=`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`,Ht=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function jn(e){const{annotation:s,readMoreUrl:i}=e,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=Ht(),g=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)(qt,{missing:"field",title:"Missing Annotation",description:g,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(Ce,{text:Vt.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(J.Z,{color:"primary",component:fe,to:d,children:"Read more"})]})})}var E=t(11776),_=t(38402),ye=t(49378),ge=t(41128),ke=t(27616),De=t(8284),yt=t(70660),Dt=t(91750),_t=t(38016);const Ut=(e,s)=>(s.palette.type==="light"?ge._j:ge.$n)(s.palette[e].light,.6),nn=(e,s)=>(s.palette.type==="light"?ge.$n:ge._j)(s.palette[e].light,.9),Ot=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Ut(s,e)}})),rn=({severity:e})=>{const s=Ot({severity:e});return(0,n.jsx)(Dt.Z,{classes:s})},Gn=({severity:e})=>{const s=Ot({severity:e});return(0,n.jsx)(_t.Z,{classes:s})},En=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>nn(s,e),color:({severity:s})=>Ut(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Ut(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>Ut(s,e),backgroundColor:({severity:s})=>nn(s,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"}),$n=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Bn(e){const{severity:s="warning",title:i,message:d,children:p,defaultExpanded:g}=e,C=En({severity:s}),B=$n(s)+(i?`: ${i}`:"");return(0,n.jsxs)(ke.Z,{defaultExpanded:g!=null?g:!1,className:C.panel,role:"alert",children:[(0,n.jsxs)(De.Z,{expandIcon:(0,n.jsx)(Gn,{severity:s}),className:C.summary,children:[(0,n.jsx)(rn,{severity:s}),(0,n.jsx)(w.Z,{className:C.summaryText,variant:"subtitle1",children:B})]}),(d||p)&&(0,n.jsx)(yt.Z,{children:(0,n.jsxs)(V.Z,{container:!0,children:[d&&(0,n.jsx)(V.Z,{item:!0,xs:12,children:(0,n.jsx)(w.Z,{className:C.message,variant:"body1",children:d})}),p&&(0,n.jsx)(V.Z,{item:!0,xs:12,className:C.details,children:p})]})})]})}const qn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Wt=({error:e,message:s,stack:i,children:d})=>{const p=qn();return(0,n.jsxs)(E.Z,{dense:!0,children:[(0,n.jsxs)(_.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(tt,{text:e})]}),(0,n.jsxs)(_.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(tt,{text:s})]}),i&&(0,n.jsxs)(_.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(tt,{text:i})]}),d]})};function x(e){const{title:s,error:i,defaultExpanded:d,children:p}=e;return(0,n.jsx)(Bn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:d,children:(0,n.jsx)(Wt,{error:i.name,message:i.message,stack:i.stack,children:p})})}var u=t(85256);const y=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function j(e){var s;const{title:i,error:d,defaultExpanded:p}=e,g=y();if(d.name!=="ResponseError")return(0,n.jsx)(x,{title:i!=null?i:d.message,defaultExpanded:p,error:d});const{body:C,cause:B}=d,{request:M,response:Z}=C,ue=`${Z.statusCode}: ${B.name}`,re=M&&`${M.method} ${M.url}`,ce=B.message.replace(/\\n/g,`
|
|
12
|
-
`),we=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
13
|
-
`),Fe=JSON.stringify(C,void 0,2);return(0,n.jsxs)(x,{title:i!=null?i:d.message,defaultExpanded:p,error:{name:ue,message:ce,stack:we},children:[re&&(0,n.jsxs)(_.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:g.text},primary:"Request",secondary:M?`${re}`:void 0}),(0,n.jsx)(tt,{text:re})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{component:"li",className:g.divider}),(0,n.jsx)(_.Z,{alignItems:"flex-start",children:(0,n.jsx)(ye.Z,{classes:{secondary:g.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Ce,{language:"json",text:Fe,showCopyCodeButton:!0})]})]})}var H=t(28316);function de(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function he(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Ie(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),g=p||de(e);return p||he(g),g.appendChild(s.current),function(){s.current.remove(),g.childNodes.length===-1&&g.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var et=null;const $t="core.calloutSeen";function Rt(){const[e,s]=useState(()=>{const d=localStorage.getItem($t);return d?JSON.parse(d):{}}),i=useCallback((d,p)=>{const g=localStorage.getItem($t),B={...g?JSON.parse(g):{},[d]:p};s(B),localStorage.setItem($t,JSON.stringify(B))},[]);return{states:e,setState:i}}function _n(e){const{states:s,setState:i}=Rt(),d=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:d}}function fr(e){const{seen:s,markSeen:i}=_n(e);return{show:s===!1,hide:i}}const es=(0,l.Z)({"@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 white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function ar(e){const{featureId:s,title:i,description:d,children:p}=e,{show:g,hide:C}=useShowCallout(s),B=usePortal("core.callout"),M=useRef(null),[Z,ue]=useState(),re=es(),ce=useCallback(()=>{if(M.current){const we=M.current.getBoundingClientRect(),Fe=Math.max(we.width,we.height),ht=800,Mt=we.x-(Fe-we.width)/2-ht,Yt=we.y-(Fe-we.height)/2-ht,en=Fe+2*ht,tn=450,At=we.x+we.width/2-tn,Xt=we.y-(Fe-we.height)/2+Fe+20;ue({dotLeft:Mt,dotTop:Yt,dotSize:en,borderWidth:ht,textTop:Xt,textLeft:At,textWidth:tn})}},[]);return useEffect(()=>(window.addEventListener("resize",ce),window.addEventListener("scroll",ce),()=>{window.removeEventListener("resize",ce),window.removeEventListener("scroll",ce)}),[ce]),useLayoutEffect(ce,[M.current,ce]),g?_jsxs(_Fragment,{children:[_jsx("div",{className:re.featureWrapper,ref:M,children:p}),createPortal(_jsx("div",{className:re.backdrop,children:_jsx(ClickAwayListener,{onClickAway:C,children:_jsxs(_Fragment,{children:[_jsx("div",{className:re.dot,"data-testid":"dot",style:{left:Z==null?void 0:Z.dotLeft,top:Z==null?void 0:Z.dotTop,width:Z==null?void 0:Z.dotSize,height:Z==null?void 0:Z.dotSize,borderWidth:Z==null?void 0:Z.borderWidth},onClick:C,onKeyDown:C,role:"button",tabIndex:0,children:_jsx("div",{className:re.pulseCircle})}),_jsxs("div",{className:re.text,"data-testid":"text",style:{left:Z==null?void 0:Z.textLeft,top:Z==null?void 0:Z.textTop,width:Z==null?void 0:Z.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:d})]})]})})}),B)]}):_jsx(_Fragment,{children:p})}var $r=t(35292);const Br=(0,l.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:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function jr({color:e="primary",disabled:s=!1,href:i="#",icon:d=(0,n.jsx)($r.Z,{}),label:p,onClick:g,title:C}){const B=Br();return s?(0,n.jsxs)(W.Z,{title:C,className:K()(B.link,B.disabled),underline:"none",children:[d,(0,n.jsx)("span",{className:B.label,children:p})]}):(0,n.jsxs)(W.Z,{title:C,className:K()(B.link,B[e]),to:i,component:fe,onClick:g,children:[d,(0,n.jsx)("span",{className:B.label,children:p})]})}const gr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ts(e){const{links:s}=e,i=gr();return(0,n.jsx)("nav",{className:i.links,children:s.map((d,p)=>(0,n.jsx)(jr,{...d},p+1))})}const Zr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
14
|
-
hsl(0, 0%, ${s}) 0%,
|
|
15
|
-
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
16
|
-
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
17
|
-
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
18
|
-
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
19
|
-
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
20
|
-
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
21
|
-
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
22
|
-
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
23
|
-
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
24
|
-
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
25
|
-
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
26
|
-
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
27
|
-
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
28
|
-
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
29
|
-
hsla(0, 0%, ${s}, 0) 100%
|
|
30
|
-
`},ns=100,Zn=10,Dn=(0,l.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:ns,height:`calc(100% + ${Zn}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Zn,background:`linear-gradient(90deg, ${Zr(e.palette.type)})`},fadeRight:{right:-Zn,background:`linear-gradient(270deg, ${Zr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function lr(e){const[[s,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const g=()=>{const C=p.scrollLeft,B=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([C,B])};return g(),p.addEventListener("scroll",g),window.addEventListener("resize",g),()=>{p.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},[e]),[s,i]}function mr(e,s,i){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const g=performance.now(),C=requestAnimationFrame(B=>{if(!e.current)return;const M=B-g,Z=Math.abs(d)*M/s,re=Math.max(i,Z)*Math.sign(d);e.current.scrollBy({left:re});const ce=d-re;Math.sign(d)!==Math.sign(ce)?p(0):p(ce)});return()=>cancelAnimationFrame(C)},[e,d,s,i]),p}function Dr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:d=5,children:p,...g}=e,C=Dn(e),B=React.useRef(),[M,Z]=lr(B),ue=mr(B,i,d),re=ce=>{!B.current||ue(ce?s:-s)};return _jsxs("div",{...g,className:C.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:C.container,ref:B,children:p}),_jsx("div",{className:classNames(C.fade,C.fadeLeft,{[C.fadeHidden]:M===0})}),_jsx("div",{className:classNames(C.fade,C.fadeRight,{[C.fadeHidden]:Z===0})}),M>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>re(!1),className:classNames(C.button,C.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>re(!0),className:classNames(C.button,C.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const rs=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Nr(e){const s=rs(e),{shorthand:i,alpha:d}=e;return i?_jsx("span",{className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const ss=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function os(e){const{Progress:s}=(0,T.qD)().getComponents();return(0,n.jsx)(m.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(ss,{...e})})}const vr=(0,l.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"}),vn=(e,s)=>s?typeof s=="string"?e+s:m.Children.toArray(s.props.children).reduce(vn,e):e,Nn=({level:e,children:s})=>{const p=m.Children.toArray(s).reduce(vn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},s)},yr={code:({inline:e,className:s,children:i,...d})=>{const p=String(i).replace(/\n+$/,""),g=/language-(\w+)/.exec(s||"");return!e&&g?(0,n.jsx)(Ce,{language:g[1],text:p}):(0,n.jsx)("code",{className:s,...d,children:i})},h1:Nn,h2:Nn,h3:Nn,h4:Nn,h5:Nn,h6:Nn};function Rs(e){const{content:s,dialect:i="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:g,className:C}=e,B=vr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${C}`,children:s,components:yr,linkTarget:d,transformLinkUri:p,transformImageUri:g})}var Er=t(23054);const Ar=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),is=({request:e,busy:s,setBusy:i})=>{const d=Ar(),[p,g]=useState(),C=async()=>{i(!0);try{await e.trigger()}catch(M){g(isError(M)?M.message:"An unspecified error occurred")}finally{i(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:C,children:"Log in"})]})};var Ls=null;const Hn=(0,l.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 Ps(e){const s=Hn(),[i,d]=useState(!1),p=useApi(oauthRequestApiRef),g=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),C=()=>{g.forEach(B=>B.reject())};return _jsxs(Dialog,{open:Boolean(g.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:g.map(B=>_jsx(LoginRequestListItem,{request:B,busy:i,setBusy:d},B.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:C,children:"Reject All"})})]})}var Fr=t(15277),Tr=t.n(Fr),Ir=t(29862);const as=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function ls(e){const[s,i]=(0,m.useState)(!1),d=(0,Ir.t)(),p=as(),g=B=>{d()&&i(B)};var C;return(0,n.jsx)(Qe.ZP,{title:(C=e.title)!==null&&C!==void 0?C:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Tr(),{text:e.text,line:e.line,onToggled:g,containerClassName:p.container})})}var cs=t(67358);function ds(e){const[s,i]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),s?(0,n.jsx)(cs.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Ur=t(94339),Mr=t(14503),Rr=t(24579),er=t(32552),sn=t(15459),Bt=t(95544),zr=t(27597);const us=(0,l.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 Vr(e){const{link:s,title:i,onClick:d}=e,p=us();return(0,n.jsxs)("div",{children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)(fe,{to:s,onClick:d,underline:"none",children:(0,n.jsxs)(Bt.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Bt.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(w.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(zr.Z,{className:p.arrow})]})})]})}const hs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(qe,{to:s.href,variant:"contained",children:s.name})},ps=class extends m.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:d}=this.state;return d?(0,n.jsx)(x,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(hs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},fs=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),gs=(0,sn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Mr.Z),Hr={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 xr(e){const{title:s,subheader:i,divider:d=!0,deepLink:p,slackChannel:g,errorBoundaryProps:C,variant:B,children:M,headerStyle:Z,headerProps:ue,icon:re,action:ce,actionsClassName:we,actions:Fe,cardClassName:ht,actionsTopRight:Mt,className:Yt,noPadding:en,titleTypographyProps:tn}=e,At=fs();let Xt={},Jt={};B&&B.split(/[\s]+/g).forEach(hr=>{Xt={...Xt,...Hr.card[hr]},Jt={...Jt,...Hr.cardContent[hr]}});const dr=()=>(0,n.jsxs)("div",{className:At.headerSubheader,children:[i&&(0,n.jsx)("div",{className:At.subheader,children:i}),re]}),Yn=C||(g?{slackChannel:g}:{});return(0,n.jsx)(Ur.Z,{style:Xt,className:Yt,children:(0,n.jsxs)(ps,{...Yn,children:[s&&(0,n.jsx)(er.Z,{classes:{root:At.header,title:At.headerTitle,subheader:At.headerSubheader,avatar:At.headerAvatar,action:At.headerAction,content:At.headerContent},title:s,subheader:dr(),action:ce,style:{...Z},titleTypographyProps:tn,...ue}),Mt&&(0,n.jsx)(gs,{children:Mt}),d&&(0,n.jsx)(u.Z,{}),(0,n.jsx)(Rr.Z,{className:K()(ht,{[At.noPadding]:en}),style:Jt,children:M}),Fe&&(0,n.jsx)(Mr.Z,{className:we,children:Fe}),p&&(0,n.jsx)(Vr,{...p})]})})}var ks=t(39307);const ms=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",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"}),Wr={fractional:!0,inverse:!1,unit:"%",max:100},vs=({palette:e,value:s,inverse:i,max:d})=>{if(isNaN(s))return"#ddd";const p=d||Wr.max,g=i?p-s:s;return g<p/3?e.status.error:g<p*(2/3)?e.status.warning:e.status.ok};function Os(e){const[s,i]=useState(null),{getColor:d=vs}=e,p=ms(e),{palette:g}=useTheme(),{value:C,fractional:B,inverse:M,unit:Z,max:ue,description:re}={...Wr,...e},ce=B?Math.round(C*ue):C,we=ue!==100?Math.round(C):ce,[Fe,ht]=useState(!1);return useEffect(()=>{const Mt=s,Yt=()=>ht(!0),en=()=>ht(!1);return Mt&&re?(Mt.addEventListener("mouseenter",Yt),Mt.addEventListener("mouseleave",en),()=>{Mt.removeEventListener("mouseenter",Yt),Mt.removeEventListener("mouseleave",en)}):()=>{ht(!1)}},[re,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ce,strokeWidth:12,trailWidth:12,strokeColor:d({palette:g,value:we,inverse:M,max:ue}),className:p.circle}),re&&Fe?_jsx("div",{className:p.description,children:re}):_jsx("div",{className:p.overlay,children:isNaN(C)?"N/A":`${we}${Z}`})]})}const ys=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function $s(e){const s=ys(e),{title:i,subheader:d,progress:p,inverse:g,deepLink:C,description:B,icon:M,variant:Z,getColor:ue}=e,re={inverse:g,description:B,getColor:ue,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:d,deepLink:C,variant:Z,icon:M,children:_jsx(Gauge,{...re})})})}function po(e){const{value:s,getColor:i=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const g=i({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:g})})})}var v=t(21324),S=t(7089),L=t(1292),N=t(42494),X=t(74603),q=t(56939),le=t(12231),me=t(73698),Se=t(72379);const Ne=(0,l.Z)(()=>(0,$.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Le=()=>{const e=Ne();return(0,n.jsx)(Se.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Ke=(0,l.Z)(()=>(0,$.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var vt=()=>{const e=Ke();return(0,n.jsx)(Se.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Je=(0,sn.Z)(e=>(0,$.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(X.Z),Lt=(0,l.Z)(e=>(0,$.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,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 Qt(e){const{multiple:s,items:i,label:d,placeholder:p,selected:g,onChange:C,triggerReset:B,native:M=!1,disabled:Z=!1,margin:ue}=e,re=Lt(),[ce,we]=(0,m.useState)(g||(s?[]:"")),[Fe,ht]=(0,m.useState)(!1);(0,m.useEffect)(()=>{we(s?[]:"")},[B,s]),(0,m.useEffect)(()=>{g!==void 0&&we(g)},[g]);const Mt=At=>{we(At.target.value),C(At.target.value)},Yt=At=>{if(Z){At.preventDefault();return}ht(Xt=>s&&!(At.target instanceof HTMLElement)?!0:!Xt)},en=()=>{ht(!1)},tn=At=>()=>{const Xt=ce.filter(Jt=>Jt!==At);we(Xt),C(Xt)};return(0,n.jsx)("div",{className:re.root,children:(0,n.jsx)(L.Z,{onClickAway:en,children:(0,n.jsxs)(N.Z,{className:re.formControl,children:[(0,n.jsx)(q.Z,{className:re.formLabel,children:d}),(0,n.jsxs)(me.Z,{"aria-label":d,value:ce,native:M,disabled:Z,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ue,onChange:Mt,onClick:Yt,open:Fe,input:(0,n.jsx)(Je,{}),label:d,tabIndex:0,renderValue:At=>{var Xt;return s&&ce.length!==0?(0,n.jsx)("div",{className:re.chips,children:At.map(Jt=>{var dr,Yn;return(0,n.jsx)(S.Z,{label:(dr=i.find(ur=>ur.value===Jt))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:tn(Jt),className:re.chip},(Yn=i.find(ur=>ur.value===Jt))===null||Yn===void 0?void 0:Yn.value)})}):(0,n.jsx)(w.Z,{children:ce.length===0?p||"":(Xt=i.find(Jt=>Jt.value===At))===null||Xt===void 0?void 0:Xt.label})},IconComponent:()=>Fe?(0,n.jsx)(vt,{}):(0,n.jsx)(Le,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(le.Z,{value:[],children:p}),M?i&&i.map(At=>(0,n.jsx)("option",{value:At.value,children:At.label},At.value)):i&&i.map(At=>(0,n.jsxs)(le.Z,{value:At.value,children:[s&&(0,n.jsx)(v.Z,{color:"primary",checked:ce.includes(At.value)||!1,className:re.checkbox}),At.label]},At.value))]})]})})})}const Fn=()=>{},An=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:Fn,stepHistory:[],setStepHistory:Fn,onStepChange:Fn});function tr(e){const{children:s,elevated:i,onStepChange:d,activeStep:p=0}=e,[g,C]=useState(p),[B,M]=useState([0]);useEffect(()=>{C(p)},[p]);const Z=[];let ue;return Children.forEach(s,re=>{isValidElement(re)&&(re.props.end?ue=re:Z.push(re))}),_jsxs(_Fragment,{children:[_jsx(An.Provider,{value:{stepIndex:g,setStepIndex:C,stepHistory:B,setStepHistory:M,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:g,orientation:"vertical",elevation:i?2:0,children:Z})}),g>=Children.count(s)-1&&ue]})}const hn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),yn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),Tn=({text:e,handleClick:s,disabled:i,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),br=({text:e,handleClick:s,disabled:i,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:i,children:e||"Back"}),Sr=({actions:e={},children:s})=>{const i=hn(),{stepperLength:d,stepIndex:p,setStepIndex:g,stepHistory:C,setStepHistory:B,onStepChange:M}=useContext(VerticalStepperContext),Z=(we,Fe)=>{Fe&&Fe(),M&&M(p,we),g(we)},ue=()=>{const we=e.nextStep?e.nextStep(p,d-1):p+1;Z(we,e.onNext),B([...C,we])},re=()=>{C.pop(),Z(C[C.length-1],e.onBack),B([...C])},ce=()=>{Z(0,e.onRestart),B([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(br,{text:e.backText,handleClick:re,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Tn,{text:e.nextText,handleClick:ue,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(yn,{text:e.restartText,handleClick:ce,stepIndex:p}),s]})},wr=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function xn(e){const{title:s,children:i,end:d,actions:p,...g}=e,C=wr();return d?_jsxs("div",{className:C.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...g,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const on=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,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 nr(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function fo(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ii(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ai(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function zi(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Vi(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Lr=t(74600),go=t(15584);const mo=e=>(0,$.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),li={root:{border:"0",verticalAlign:"top"}},ci=e=>(0,$.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),gn=e=>(0,$.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),xs=(0,sn.Z)(mo,{name:"BackstageMetadataTableTitleCell"})(go.Z),vo=(0,sn.Z)(li,{name:"BackstageMetadataTableCell"})(go.Z),Bs=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Zs=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(xs,{children:e}),_jsx(vo,{colSpan:e?1:2,...i,children:s})]}),Gr=(0,sn.Z)(ci,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),di=(0,sn.Z)(gn,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),bs=(0,$.Z)({root:{margin:"0 0",listStyleType:"none"}}),yo=e=>(0,$.Z)({root:{...bs.root,paddingLeft:e.spacing(1)}}),Ds=(0,sn.Z)(bs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Gr,{classes:e,children:s})),Ns=(0,sn.Z)(yo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Gr,{classes:e,children:s}));function xo(e,s){const i=e.map((d,p)=>_jsx(MetadataListItem,{children:Pr(d)},p));return s?_jsx(Ns,{children:i}):_jsx(Ds,{children:i})}function cr(e,s,i){const d=Object.keys(e).map(p=>{const g=Pr(e[p],!0),C=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${C}: `,g]},p)});return s?_jsx(Ns,{children:d}):_jsx(Ds,{children:d})}function Pr(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?cr(e,s,i):Array.isArray(e)?xo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const bo=({value:e,options:s})=>_jsx(Fragment,{children:Pr(e,s)}),So=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(bo,{value:s,options:i})});function Fs(e,s){return Object.keys(e).map(i=>_jsx(So,{title:i,value:e[i],options:s},i))}function ui(e){const{metadata:s,dense:i=!0,options:d}=e,p=Fs(s,d||{});return _jsx(MetadataTable,{dense:i,children:p})}var wo=t(49429),Co=t(86136),Us=t(79784),hi=t(19126),Ms=t.n(hi);function jo(e){return qs.stringify(e,{strictNullHandling:!0})}function zs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Vs(e,s){return zs(e)[s]}function Hs(e,s,i){const d={...zs(e),[s]:i};return jo(d)}function Ws(e,s=250){const[i,d]=useSearchParams(),p=i.toString(),[g,C]=useState(Vs(p,e));return useEffect(()=>{const B=Vs(p,e);C(M=>isEqual(B,M)?M:B)},[p,C,e]),useDebouncedEffect(()=>{const B=Hs(p,e,g);p!==B&&d(B,{replace:!0})},[d,g,p,e],s),[g,C]}const Eo={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 Gs(){const s=(0,T.I_)().get(T.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return Eo;var d;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(g=>({url:g.getString("url"),title:g.getString("title")}))}))}}var Ao=t(80079);function Un(e,s){const d=(0,T.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...s}):(0,n.jsx)(Ao.Z,{...s})}function Hi(e){return Un("brokenImage",e)}function Wi(e){return Un("catalog",e)}function Ss(e){return Un("chat",e)}function Gi(e){return Un("dashboard",e)}function Ki(e){return Un("docs",e)}function pi(e){return Un("email",e)}function fi(e){return Un("github",e)}function To(e){return Un("group",e)}function ws(e){return Un("help",e)}function Yi(e){return Un("user",e)}function Io(e){return Un("warning",e)}const Ks=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Ro=({icon:e})=>{const s=(0,T.qD)();var i;const d=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:ws;return(0,n.jsx)(d,{})};var Cs;const gi=({link:e})=>(0,n.jsx)(fe,{to:e.url,children:(Cs=e.title)!==null&&Cs!==void 0?Cs:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(_.Z,{children:[(0,n.jsx)(Co.Z,{children:(0,n.jsx)(Ro,{icon:e.icon})}),(0,n.jsx)(ye.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,d,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(gi,{link:d},d.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:d}=Gs(),[p,g]=(0,m.useState)(!1),[C,B]=(0,m.useState)(null),M=Ks(),Z=(0,rt.Z)(ce=>ce.breakpoints.down("sm")),ue=ce=>{B(ce.currentTarget),g(!0)},re=()=>{g(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bt.Z,{display:"flex",ml:1,children:Z?(0,n.jsx)(Xe.Z,{color:"primary",size:"small",onClick:ue,"data-testid":"support-button",children:(0,n.jsx)(ws,{})}):(0,n.jsx)(J.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ue,startIcon:(0,n.jsx)(ws,{}),children:"Support"})}),(0,n.jsxs)(Us.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:re,children:[(0,n.jsxs)(E.Z,{className:M.popoverList,children:[s&&(0,n.jsx)(_.Z,{alignItems:"flex-start",children:(0,n.jsx)(w.Z,{variant:"subtitle1",children:s})}),m.Children.map(i,(ce,we)=>(0,n.jsx)(_.Z,{alignItems:"flex-start",children:ce},`child-${we}`)),d&&d.map((ce,we)=>(0,n.jsx)(mi,{item:ce},`item-${we}`))]}),(0,n.jsx)(wo.Z,{children:(0,n.jsx)(J.Z,{color:"primary",onClick:re,children:"Close"})})]})]})}var bn=t(18671),Mn=t(10289);const Kr=72,Lo=24,Po=18,rr={drawerWidthClosed:Kr,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Kr,iconSize:Kr-Lo*2,iconPadding:Lo,selectedIndicatorWidth:3,userBadgePadding:Po,userBadgeDiameter:Kr-Po*2,mobileSidebarHeight:56},yi=e=>({...rr,...e,iconContainerWidth:rr.drawerWidthClosed,iconSize:rr.drawerWidthClosed-rr.iconPadding*2,userBadgeDiameter:rr.drawerWidthClosed-rr.userBadgePadding*2}),ko={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:rr.defaultOpenDelayMs+200},xi=e=>({...ko,...e}),Ji="@backstage/core/sidebar-intro-dismissed",Kn=(0,m.createContext)({sidebarConfig:rr,submenuConfig:ko}),Oo=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var js;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(js||(js={}));const Es={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(js.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(js.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Yr=t(51837);const Ys={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Js=(0,m.createContext)(Ys),Qs=(0,Yr.CT)("sidebar-pin-state-context");function $o(e){const{children:s,value:i}=e;return(0,n.jsx)(Js.Provider,{value:i,children:(0,n.jsx)(Qs.Provider,{value:(0,Yr.EI)({1:i}),children:s})})}const kr=()=>{const e=(0,m.useContext)(Qs),s=(0,m.useContext)(Js);if(e===void 0)return s||Ys;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Bo=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Xs=(0,m.createContext)({content:{contentRef:void 0}});function Zo(e){const[s,i]=(0,m.useState)(()=>Es.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(Kn),p=(0,m.useRef)(null),g=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{Es.setSidebarPinState(s)},[s]);const C=(0,rt.Z)(Z=>Z.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),M=Bo({isPinned:s,sidebarConfig:d});return(0,n.jsx)($o,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:C},children:(0,n.jsx)(Xs.Provider,{value:g,children:(0,n.jsx)("div",{className:M.root,children:e.children})})})}function _s(){const{content:e}=(0,m.useContext)(Xs);return{focusContent:(0,m.useCallback)(()=>{var i,d;e==null||(i=e.contentRef)===null||i===void 0||(d=i.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Do={isOpen:!1,setOpen:()=>{}},eo=(0,m.createContext)(Do),to=(0,Yr.CT)("sidebar-open-state-context");function No(e){const{children:s,value:i}=e;return(0,n.jsx)(eo.Provider,{value:i,children:(0,n.jsx)(to.Provider,{value:(0,Yr.EI)({1:i}),children:s})})}const As=()=>{const e=(0,m.useContext)(to),s=(0,m.useContext)(eo);if(e===void 0)return s||Do;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Fo=t(50023),Uo=t(4190),Mo=t(87685),zo=t(44882),Vo=t(57998);const Ho=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Wo=e=>{const{to:s,label:i,icon:d,value:p}=e,{sidebarConfig:g}=(0,m.useContext)(Kn),C=Ho({sidebarConfig:g}),B=(0,Mn.TH)(),{selectedMenuItemIndex:M,setSelectedMenuItemIndex:Z}=(0,m.useContext)(so),ue=(ce,we)=>{Z(we===M?-1:we)},re=p===M&&M>=0||p!==M&&!(M>=0)&&s===B.pathname;return(0,n.jsx)(Vo.Z,{label:i,icon:d,component:fe,to:s||B.pathname,onChange:ue,value:p,selected:re,classes:C})},zn=e=>{const{children:s,to:i,label:d,icon:p,value:g}=e,{isMobile:C}=kr();return C?(0,n.jsx)(Wo,{to:i,label:d,icon:p,value:g}):(0,n.jsx)(n.Fragment,{children:s})},no=(0,l.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:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.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:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Go=e=>(0,ie.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=m.createElement(zn).type,ro=({children:e,label:s="Menu",open:i,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(Kn),g=no({sidebarConfig:p});return(0,n.jsxs)(Uo.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:g.marginMobileSidebar}}},classes:{root:g.marginMobileSidebar,paperAnchorBottom:g.overlay},children:[(0,n.jsxs)(Bt.Z,{className:g.overlayHeader,children:[(0,n.jsx)(w.Z,{variant:"h3",children:s}),(0,n.jsx)(Xe.Z,{onClick:d,classes:{root:g.overlayHeaderClose},children:(0,n.jsx)(Mo.Z,{})})]}),(0,n.jsx)(Bt.Z,{component:"nav",children:e})]})},so=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Yo=e=>{const{sidebarConfig:s}=(0,m.useContext)(Kn),{children:i}=e,d=no({sidebarConfig:s}),p=(0,Mn.TH)(),[g,C]=(0,m.useState)(-1);(0,m.useEffect)(()=>{C(-1)},[p.pathname]);let B=(0,T.vJ)(i,Z=>Z.getElements().filter(ue=>ue.type===Ko));if(i)B.length?B=Go(B):B.push((0,n.jsx)(zn,{icon:(0,n.jsx)(zo.Z,{}),children:i},"default_menu"));else return null;const M=g>=0&&!B[g].props.to;return(0,n.jsx)(No,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(so.Provider,{value:{selectedMenuItemIndex:g,setSelectedMenuItemIndex:C},children:[(0,n.jsx)(ro,{label:B[g]&&B[g].props.label,open:M,onClose:()=>C(-1),children:B[g]&&B[g].props.children}),(0,n.jsx)(Fo.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})},oo=(0,l.Z)(e=>({drawer:s=>({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",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.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 In;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(In||(In={}));const bi=e=>{const{sidebarConfig:s}=(0,m.useContext)(Kn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:g}=e,C=oo({sidebarConfig:s}),B=(0,rt.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[M,Z]=(0,m.useState)(In.Closed),ue=(0,m.useRef)(),{isPinned:re,toggleSidebarPinState:ce}=kr(),we=()=>{re||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),M!==In.Open&&!B&&(ue.current=window.setTimeout(()=>{ue.current=void 0,Z(In.Open)},i),Z(In.Idle)))},Fe=()=>{re||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),M===In.Idle?Z(In.Closed):M===In.Open&&(ue.current=window.setTimeout(()=>{ue.current=void 0,Z(In.Closed)},d)))},ht=M===In.Open&&!B||re,Mt=Yt=>{Yt?(Z(In.Open),ce()):(Z(In.Closed),ce())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(a,{}),(0,n.jsx)(No,{value:{isOpen:ht,setOpen:Mt},children:(0,n.jsx)("div",{className:C.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:we,onFocus:p?()=>{}:we,onMouseLeave:p?()=>{}:Fe,onBlur:p?()=>{}:Fe,children:(0,n.jsx)("div",{className:K()(C.drawer,{[C.drawerOpen]:ht}),children:g})})})]})},Jo=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=xi((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:g,disableExpandOnHover:C,openDelayMs:B,closeDelayMs:M}=e,{isMobile:Z}=kr();return Z?(0,n.jsx)(Yo,{children:g}):(0,n.jsx)(Kn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(bi,{openDelayMs:B,closeDelayMs:M,disableExpandOnHover:C,children:g})})};function a(){const{sidebarConfig:e}=(0,m.useContext)(Kn),{focusContent:s,contentRef:i}=_s(),d=oo({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(J.Z,{onClick:s,variant:"contained",className:K()(d.visuallyHidden),children:"Skip to content"}):null}function r(e,s){const i=new URLSearchParams(s.search).toString(),d=Ms().parse(i),p=new URLSearchParams(e.search).toString(),g=Ms().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(g,d)}const o=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,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:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),c=e=>{const{title:s,subtitle:i,to:d,icon:p,dropdownItems:g}=e,C=o(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),M=()=>{B(!1)},Z=useResolvedPath(d!=null?d:""),ue=useLocation();let re=isLocationMatch(ue,Z);const[ce,we]=useState(!1),Fe=()=>{we(!ce)};return g!==void 0?(g.some(ht=>{const Mt=resolvePath(ht.to);return re=isLocationMatch(ue,Mt),re}),_jsxs("div",{className:C.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Fe,onTouchStart:ht=>ht.stopPropagation(),className:classnames(C.item,re?C.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:i})]}),ce?_jsx(ArrowDropUpIcon,{className:C.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:C.dropdownArrow})]})}),g&&ce&&_jsx("div",{className:C.dropdown,children:g.map((ht,Mt)=>_jsx(Tooltip,{title:ht.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:ht.to,underline:"none",className:C.dropdownItem,onClick:M,onTouchStart:Yt=>Yt.stopPropagation(),children:_jsx(Typography,{className:C.textContent,children:ht.title})})},Mt))})]})):_jsx("div",{className:C.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(C.item,re?C.selected:void 0),onClick:M,onTouchStart:ht=>ht.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:i})]})]})})})};var f;const P=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(f=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&f!==void 0?f:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),F=e=>{const{isOpen:s}=As(),{sidebarConfig:i,submenuConfig:d}=(0,m.useContext)(Kn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,g=P({left:p,submenuConfig:d}),{isHoveredOn:C}=(0,m.useContext)(Oo),[B,M]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{M(C)},[C]),(0,n.jsxs)("div",{className:K()(g.drawer,{[g.drawerOpen]:B}),children:[(0,n.jsx)(w.Z,{variant:"h5",className:g.title,children:e.title}),e.children]})};var U=t(76600),ne=t(26739),Ze=t(98989),$e=t(59797),xt=t(83543);const it=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Et=()=>{const e=it();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var Kt=null;const pn=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Sn=()=>{const e=pn();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var sr=null,Pn,Vn;const Jr=e=>(0,l.Z)(s=>{var i,d;return{root:{color:s.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"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Pn=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Pn!==void 0?Pn:"#404040"}},highlighted:{background:(Vn=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Vn!==void 0?Vn:"#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:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Qr(e){return(0,m.useMemo)(()=>Jr(e),[e])()}const Qo=(e,s)=>(0,T.vJ)(e.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:g}})=>{if(!d){if(g!=null&&g.length){g.forEach(({to:C})=>d=d||r(s,(0,Mn.i3)(C)));return}p&&(d=r(s,(0,Mn.i3)(p)))}}),d},[s.pathname]);function Xr(e){return e.to===void 0}const Xo=m.createElement(F).type,Cr=m.forwardRef(function({to:s,end:i,style:d,className:p,activeStyle:g,caseSensitive:C,activeClassName:B="active","aria-current":M="page",...Z},ue){let{pathname:re}=(0,Mn.TH)(),{pathname:ce}=(0,Mn.WU)(s);C||(re=re.toLocaleLowerCase("en-US"),ce=ce.toLocaleLowerCase("en-US"));let we=re===ce;!we&&!i&&(we=re.startsWith(`${ce}/`));const Fe=we?M:void 0;return(0,n.jsx)(ae.rU,{...Z,to:s,ref:ue,"aria-current":Fe,style:{...d,...we?g:void 0},className:K()([p,we?B:void 0])})}),Si=(0,m.forwardRef)((e,s)=>{const{icon:i,text:d,hasNotifications:p=!1,hasSubmenu:g=!1,disableHighlight:C=!1,onClick:B,children:M,className:Z,...ue}=e,{sidebarConfig:re}=(0,m.useContext)(Kn),ce=Qr(re),{isOpen:we}=As(),Fe=!we&&g?{display:"flex",marginLeft:"24px"}:{},ht=(0,n.jsxs)("div",{style:Fe,children:[(0,n.jsx)(i,{fontSize:"small"}),!we&&g?(0,n.jsx)(Ze.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Mt=(0,n.jsx)(ne.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:K()({[ce.closedItemIcon]:!we}),children:ht}),Yt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:ce.iconContainer,children:Mt}),d&&(0,n.jsx)(w.Z,{variant:"subtitle2",className:ce.label,children:d}),(0,n.jsx)("div",{className:ce.secondaryAction,children:M})]}),en=we?Yt:Mt,tn={onClick:B,className:K()(Z,ce.root,we?ce.open:ce.closed,Xr(e)&&ce.buttonItem,{[ce.highlightable]:!C})};return Xr(e)?(0,n.jsx)("button",{"aria-label":d,...tn,ref:s,children:en}):(0,n.jsx)(Cr,{...tn,activeClassName:ce.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...ue,children:en})}),Qi=({children:e,...s})=>{const{sidebarConfig:i}=(0,m.useContext)(Kn),d=Qr(i),[p,g]=(0,m.useState)(!1),C=(0,Mn.TH)(),B=Qo(e,C),M=(0,rt.Z)(ce=>ce.breakpoints.down("sm")),Z=()=>{g(!0)},ue=()=>{g(!1)},re=()=>M?p?(0,n.jsx)($e.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(xt.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(Ze.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Oo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:g},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ue,onTouchStart:p?ue:Z,onMouseEnter:Z,className:K()(p&&d.highlighted),children:[(0,n.jsx)(Si,{hasSubmenu:!0,className:B?d.selected:"",...s,children:re()}),p&&e]})})},wi=(0,m.forwardRef)((e,s)=>{const[i]=(0,T.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Xo));return i?(0,n.jsx)(Qi,{...e,children:i}):(0,n.jsx)(Si,{...e,ref:s})});function Rl(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,d]=useState(""),p=Qr(s),g=e.icon?e.icon:SearchIcon,C=()=>{e.onSearch(i),d("")},B=re=>{re.key==="Enter"&&(re.preventDefault(),C())},M=re=>{d(re.target.value)},Z=re=>{re.preventDefault(),re.stopPropagation()},ue=re=>{C(),re.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(wi,{icon:g,to:e.to,onClick:ue,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:Z,onChange:M,onKeyDown:B,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Ll=(0,U.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Pl=(0,U.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Xi=(0,U.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),qi=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),kl=(0,U.Z)("div")(({theme:e})=>{const s=qi(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Ol=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=Qr(e),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(C=>C.breakpoints.down("md"),{noSsr:!0}))return null;const g=()=>{d(!i)};return _jsx("button",{onClick:g,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},_i=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&: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:12}}),{name:"BackstageSidebarIntro"});function ea(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=_i({sidebarConfig:s}),{text:d,onClose:p}=e,g=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx("div",{className:i.introDismiss,children:_jsxs(Link,{component:"button",onClick:g,underline:"none",className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ci=e=>{const{text:s,onDismiss:i}=e,[d,p]=useState(!1),g=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:i,children:_jsx(ea,{text:s,onClose:g})})},ta=null,na="And your recently viewed plugins will pop up here!";function $l(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:g,recentlyViewedItemsDismissed:C}=d!=null?d:{},B=()=>{p(Z=>({...i,...Z,starredItemsDismissed:!0}))},M=()=>{p(Z=>({...i,...Z,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!g&&_jsxs(_Fragment,{children:[_jsx(Ci,{text:ta,onDismiss:B}),_jsx(SidebarDivider,{})]}),!C&&_jsx(Ci,{text:na,onDismiss:M})]}):null}const ra=(0,l.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 ji(e){const{className:s,stretch:i,noPadding:d,children:p,...g}=e,{contentRef:C}=_s(),B=ra();return(0,n.jsx)("article",{ref:C,tabIndex:-1,...g,className:K()(B.root,s,{[B.stretch]:i,[B.noPadding]:d}),children:p})}var sa=t(6487),oa=t(99152);const ia=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",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 Ei(e){const{tabs:s,onChange:i,selectedIndex:d}=e,[p,g]=(0,m.useState)(d!=null?d:0),C=ia(),B=(0,m.useCallback)((M,Z)=>{d===void 0&&g(Z),i&&d!==Z&&i(Z)},[d,i]);return(0,m.useEffect)(()=>{d!==void 0&&g(d)},[d]),(0,n.jsx)("div",{className:C.tabsWrapper,children:(0,n.jsx)(oa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:B,value:p,children:s.map((M,Z)=>(0,m.createElement)(sa.Z,{...M.tabProps,"data-testid":`header-tab-${Z}`,label:M.label,key:M.id,value:Z,className:C.defaultTab,classes:{selected:C.selected,root:C.tabRoot}}))})})}function aa(e){const s=(0,Mn.UO)(),d=e.map(({path:ce,children:we})=>({caseSensitive:!1,path:`${ce}/*`,element:we})).sort((ce,we)=>we.path.replace(/\/\*$/,"").localeCompare(ce.path.replace(/\/\*$/,"")));var p;const g=(p=(0,Mn.V$)(d))!==null&&p!==void 0?p:e[0].children;var C;let B=(C=s["*"])!==null&&C!==void 0?C:"";B.startsWith("/")||(B=`/${B}`);var M;const[Z]=(M=(0,Mn.fp)(d,B))!==null&&M!==void 0?M:[],ue=Z?e.findIndex(ce=>`${ce.path}/*`===Z.route.path):0;var re;return{index:ue===-1?0:ue,element:g,route:(re=e[ue])!==null&&re!==void 0?re:e[0]}}function Ai(e){const{routes:s}=e,i=(0,Mn.s0)(),{index:d,route:p,element:g}=aa(s),C=(0,m.useMemo)(()=>s.map(M=>({id:M.path,label:M.title,tabProps:M.tabProps})),[s]),B=M=>{let{path:Z}=s[M];Z=Z.replace(/\/\*$/,""),Z=Z.replace(/^\//,""),i(Z)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ei,{tabs:C,selectedIndex:d,onChange:B}),(0,n.jsxs)(ji,{children:[(0,n.jsx)(bn.q,{title:p.title}),g]})]})}const qo=()=>null;(0,T.R5)(qo,"core.gatherMountPoints",!0);function Ti(e){const s=(0,n.jsx)(qo,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(i=>{if(!(0,m.isValidElement)(i))return[];if(i.type===m.Fragment)return Ti(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:g,tabProps:C}=i.props;return[{path:d,title:p,children:g,tabProps:C}]})}function la(e){const s=Ti(e.children);return(0,n.jsx)(Ai,{routes:s})}la.Route=qo;const ca=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function da(e){const{value:s,subvalue:i}=e,d=ca();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d.value,children:s}),(0,n.jsx)("div",{className:d.subvalue,children:i})]})}var ua=t(21070),ha=t(90324),pa=t(98281),fa=t(48049),Ii=t(51209),Ri=t(33375),ga=t(44233),ma=t(27604),_o=t(36444),va=t(37971),ya=t(59709),xa=t(17373),ba=t(3702),Sa=t(93111),io=t(67222);const wa=(0,l.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:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ca=e=>{var s;const i=wa(),{onChangeFilters:d}=e,[p,g]=(0,m.useState)({...e.selectedFilters}),[C,B]=(0,m.useState)(!1),M=()=>{g({}),B(Z=>!Z)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(J.Z,{color:"primary",onClick:M,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(Z=>(0,n.jsx)(Qt,{triggerReset:C,...Z.element,selected:p[Z.element.label],onChange:ue=>g({...p,[Z.element.label]:ue})},Z.element.label))})]})},ja={Add:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ua.Z,{...e,ref:s})),Check:(0,m.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),Clear:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Delete:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),DetailPanel:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Edit:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),Export:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),Filter:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),FirstPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),LastPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),NextPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),PreviousPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),ResetSearch:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Search:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),SortArrow:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ha.Z,{...e,ref:s})),ThirdStateCheck:(0,m.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),ViewColumn:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s}))};function Li(e,s){const i=s.split(".");let d=e[i[0]];for(let p=1;p<i.length;++p){if(d===void 0)return d;const g=i[p];d=d[g]}return d}const Ea=(0,sn.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"})(io.W$),Pi=(0,sn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(io.UW),Aa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ia(e,s){return e.map(i=>{const d={};let p=i.cellStyle||{};if(i.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const g=p;p=(C,B,M)=>({...g(C,B,M),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:p}})}function Ra(e,s){return(0,ie.transform)(e,(i,d,p)=>{(0,ie.isEqual)(d,s[p])||(i[p]=d)})}const ki={search:"",filtersOpen:!1,filters:{}};function La(e){const{toolbarRef:s,setSearch:i,hasFilters:d,selectedFiltersLength:p,toggleFilters:g}=e,C=Aa(),B=(0,m.useCallback)(M=>{e.onSearchChanged(M),i(M)},[e,i]);return d?(0,n.jsxs)("div",{className:C.root,children:[(0,n.jsxs)("div",{className:C.root,children:[(0,n.jsx)(Xe.Z,{onClick:g,"aria-label":"filter list",children:(0,n.jsx)(_o.Z,{})}),(0,n.jsxs)(w.Z,{className:C.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:B})}function Pa(e){const{data:s,columns:i,options:d,title:p,subtitle:g,filters:C,initialState:B,emptyContent:M,onStateChange:Z,components:ue,...re}=e,ce=Ta(),we=(0,He.Z)(),Fe={...ki,...B},[ht,Mt]=(0,m.useState)(Fe.filtersOpen),Yt=(0,m.useCallback)(()=>Mt(wn=>!wn),[Mt]),[en,tn]=(0,m.useState)(0),[At,Xt]=(0,m.useState)(s),[Jt,dr]=(0,m.useState)(Fe.filters),Yn=Ia(i,we),[ur,hr]=(0,m.useState)(Fe.search);(0,m.useEffect)(()=>{if(Z){const wn=Ra({search:ur,filtersOpen:ht,filters:Jt},ki);Z(wn)}},[ur,ht,Jt,Z]);const si={headerStyle:{textTransform:"uppercase"}},Gt=(0,m.useCallback)(wn=>{var or;return(or=i.find(Jn=>Jn.title===wn))===null||or===void 0?void 0:or.field},[i]);(0,m.useEffect)(()=>{if(typeof s=="function")return;if(!Jt){Xt(s);return}const wn=Object.values(Jt);if(s&&wn.flat().length){const or=s.filter(Jn=>!!Object.entries(Jt).filter(([,Wn])=>!!Wn.length).every(([Wn,mn])=>{const Rn=Li(Jn,Gt(Wn));return Array.isArray(Rn)&&Array.isArray(mn)?Rn.some(ir=>mn.includes(ir)):Array.isArray(Rn)?Rn.includes(mn):Array.isArray(mn)?mn.includes(Rn):Rn===mn}));Xt(or)}else Xt(s);tn(wn.flat().length)},[s,Jt,Gt]);const qr=(wn,or)=>{const Jn=mn=>{const Rn=new Set,ir=Or=>{Or!=null&&Rn.add(Or)};return or&&or.forEach(Or=>{const Is=Li(Or,Gt(mn));Array.isArray(Is)?Is.forEach(ir):ir(Is)}),Rn},Wn=mn=>({placeholder:"All results",label:mn.column,multiple:mn.type==="multiple-select",items:[...Jn(mn.column)].sort().map(Rn=>({label:Rn,value:Rn}))});return wn.map(mn=>({type:mn.type,element:Wn(mn)}))},lo=!!(C!=null&&C.length),_r=(0,m.useCallback)(wn=>(0,n.jsx)(La,{setSearch:hr,hasFilters:lo,selectedFiltersLength:en,toggleFilters:Yt,...wn}),[Yt,lo,en,hr]),co=typeof s!="function"&&s.length===0,uo=i.length,oi=(0,m.useCallback)(wn=>M&&co?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:uo,children:M})})}):(0,n.jsx)(io.os,{...wn}),[co,M,uo]);return(0,n.jsxs)("div",{className:ce.root,children:[ht&&s&&typeof s!="function"&&(C==null?void 0:C.length)&&(0,n.jsx)(Ca,{filters:qr(C,s),selectedFilters:Jt,onChangeFilters:dr}),(0,n.jsx)(io.ZP,{components:{Header:Ea,Toolbar:_r,Body:oi,...ue},options:{...si,...d},columns:Yn,icons:ja,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.Z,{variant:"h5",component:"h2",children:p}),g&&(0,n.jsx)(w.Z,{color:"textSecondary",variant:"body1",children:g})]}),data:typeof s=="function"?s:At,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},...re})]})}const Bl=e=>{const{children:s,value:i,index:d,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:i===d&&_jsx(Box,{p:3,children:s})})},ka=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Zl=e=>{const s=ka(e),{ariaLabel:i,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Oa=(e,s)=>s?e?"20px":"0":"40px",$a=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Oa(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Dl=e=>{const s=$a(e),{isFirstNav:i,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ba=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Nl=e=>{const s=Ba(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Za=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Fl(e){const{tabs:s}=e,i=Za(),[d,p]=useState([0,0]),[g,C]=useState(0),[B,M]=useState(0),[Z,ue]=useState([[]]),re=useRef(),{width:ce}=useWindowSize(),we=(en,tn)=>{p([g,tn])},Fe=()=>{C(g-1)},ht=()=>{C(g+1)},Mt=()=>g+1<Z.length;useEffect(()=>{const tn=g===0?1:2,At=re.current.offsetWidth-20-tn*30,Xt=d[0]*B+d[1],Jt=Math.floor(At/170);M(Jt),ue(chunkArray(s,Jt)),p([Math.floor(Xt/Jt),Xt%Jt])},[ce,s]);const Yt=g===d[0]?d[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:re,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Yt,onChange:we,selectionFollowsFocus:!0,children:[g!==0&&_jsx(StyledIcon,{onClick:Fe,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),Z[g].map((en,tn)=>_jsx(StyledTab,{value:tn,isFirstIndex:tn===0,isFirstNav:g===0,icon:en.icon||void 0,label:en.label||void 0},tn)),Mt()&&_jsx(StyledIcon,{isNext:!0,onClick:ht,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Yt!==!1?Z[g].map((en,tn)=>_jsx(TabPanel,{value:tn,index:Yt,children:en.content},tn)):_jsx(TabPanel,{value:d[1],index:d[1],children:Z[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Ul=t(44311);function Da(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function Ml(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Da(e.data,s)})]})}const Na=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.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:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Fa=({title:e="Unknown page",className:s})=>(0,n.jsx)(w.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ua(e){const{description:s,title:i,titleComponent:d=void 0,children:p,textAlign:g="left"}=e,C=Na({textAlign:g})(),B=d||(0,n.jsx)(Fa,{title:i,className:C.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bn.q,{title:i}),(0,n.jsxs)("div",{className:C.container,children:[(0,n.jsxs)("div",{className:C.leftItemsBox,children:[B,s&&(0,n.jsx)(w.Z,{className:C.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:C.rightItemsBox,children:p})]})]})}var Ma=t.p+"static/mic-drop.fe3ef4d0..svg";const za=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",position:"absolute",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",position:"relative",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Va=()=>{const e=za();return(0,n.jsx)("img",{src:Ma,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ha=(0,l.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:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:i,additionalInfo:d,supportUrl:p}=e,g=Ha(),C=(0,Mn.s0)(),B=Gs();return(0,n.jsxs)(V.Z,{container:!0,spacing:0,className:g.container,children:[(0,n.jsx)(Va,{}),(0,n.jsxs)(V.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(w.Z,{"data-testid":"error",variant:"body1",className:g.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(w.Z,{variant:"body1",className:g.subtitle,children:d}),(0,n.jsx)(w.Z,{variant:"h2",className:g.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(w.Z,{variant:"h6",children:[(0,n.jsx)(fe,{to:"#","data-testid":"go-back-link",onClick:()=>C(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(fe,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]})]})}var Ga=t(16173);const Ka=(0,sn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(w.Z),ei=(0,sn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Bt.Z);function Ya(e){const{children:s,...i}=e,[d,p]=m.useState(null),g=m.Children.toArray(s),[C,B,...M]=g,Z=M.length?M.pop():g[g.length-1],ue=g.length>3,re=Fe=>{p(Fe.currentTarget)},ce=()=>{p(null)},we=Boolean(d);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsxs)(Ga.Z,{"aria-label":"breadcrumb",...i,children:[g.length>1&&(0,n.jsx)(ei,{clone:!0,children:C}),g.length>2&&(0,n.jsx)(ei,{clone:!0,children:B}),ue&&(0,n.jsx)(Ka,{onClick:re,children:"..."}),(0,n.jsx)(Bt.Z,{style:{fontStyle:"italic"},children:Z})]}),(0,n.jsx)(Us.ZP,{open:we,anchorEl:d,onClose:ce,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(E.Z,{children:M.map((Fe,ht)=>(0,n.jsx)(_.Z,{button:!0,children:(0,n.jsx)(ei,{clone:!0,children:Fe})},ht))})})]})}const Ja=(0,l.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"}),Qa=({type:e,typeLink:s,classes:i,pageTitle:d})=>e?s?(0,n.jsxs)(Ya,{className:i.breadcrumb,children:[(0,n.jsx)(fe,{to:s,children:e}),(0,n.jsx)(w.Z,{children:d})]}):(0,n.jsx)(w.Z,{className:i.type,children:e}):null,Xa=({pageTitle:e,classes:s,tooltip:i})=>{const d=(0,n.jsx)(w.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Qe.ZP,{title:i,placement:"top-start",children:d}):d},qa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(w.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Oi(e){const{children:s,pageTitleOverride:i,style:d,subtitle:p,title:g,tooltip:C,type:B,typeLink:M}=e,Z=Ja(),re=(0,T.h_)(T.Ds).getOptionalString("app.title")||"Backstage",ce=i||g,we=g||i,Fe=`${ce} | %s | ${re}`,ht=`${ce} | ${re}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bn.q,{titleTemplate:Fe,defaultTitle:ht}),(0,n.jsxs)("header",{style:d,className:Z.header,children:[(0,n.jsxs)(Bt.Z,{className:Z.leftItemsBox,children:[(0,n.jsx)(Qa,{classes:Z,type:B,typeLink:M,pageTitle:we}),(0,n.jsx)(Xa,{classes:Z,pageTitle:we,tooltip:C}),(0,n.jsx)(qa,{classes:Z,subtitle:p})]}),(0,n.jsx)(V.Z,{container:!0,className:Z.rightItemsBox,spacing:4,children:s})]})]})}const _a=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),el=({value:e,className:s})=>(0,n.jsx)(w.Z,{className:s,children:e});function tl(e){const{label:s,value:i,url:d}=e,p=_a(),g=(0,n.jsx)(el,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(V.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(w.Z,{className:p.label,children:s}),d?(0,n.jsx)(fe,{to:d,children:g}):g]})})}const nl={hour:"2-digit",minute:"2-digit"};function $i(e){const s=new Date,i=window.navigator.language,d=[];if(!e.has("homepage.clocks"))return d;const p=e.getConfigArray("homepage.clocks");for(const g of p)if(g.has("label")&&g.has("timezone")){let C=g.getString("label");const B={timeZone:g.getString("timezone"),...nl};try{new Date().toLocaleString(i,B)}catch{console.warn(`The timezone ${B.timeZone} is invalid. Defaulting to GMT`),B.timeZone="GMT",C="GMT"}const M=s.toLocaleTimeString(i,B);d.push({time:M,label:C})}return d}function zl(e){const s=useApi(configApiRef),i=[],[d,p]=React.useState(i);return React.useEffect(()=>{p($i(s));const g=setInterval(()=>{p($i(s))},1e3);return()=>{clearInterval(g)}},[s]),d.length!==0?_jsx(_Fragment,{children:d.map(g=>_jsx(HeaderLabel,{label:g.label,value:g.time},g.label))}):null}const rl=e=>(0,$.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),sl=(0,l.Z)(rl,{name:"BackstageItemCardHeader"});function ol(e){const{title:s,subtitle:i,children:d}=e,p=sl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(w.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(w.Z,{variant:"h6",component:"h4",children:s}),d]})}function Vl(e){const{description:s,tags:i,title:d,type:p,subtitle:g,label:C,onClick:B,href:M}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:g||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((Z,ue)=>_jsx(Chip,{size:"small",label:Z},ue))}):null,s]}),_jsxs(CardActions,{children:[!M&&_jsx(Button,{to:"#",onClick:B,color:"primary",children:C}),M&&_jsx(Button,{to:M,color:"primary",children:C})]})]})}const il=e=>(0,$.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),al=(0,l.Z)(il,{name:"BackstageItemCardGrid"});function ll(e){const{children:s,...i}=e,d=al(i);return(0,n.jsx)("div",{className:d.root,...i,children:s})}var cl=t(41547);const dl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Bi(e){const{themeId:s,children:i}=e,{isMobile:d}=kr(),p=dl({isMobile:d});return(0,n.jsx)(cl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function ul(e){const{themeId:s,children:i,...d}=e;return(0,n.jsxs)(Bi,{themeId:s,children:[(0,n.jsx)(Oi,{...d}),i]})}var kn=t(30195);const Hl=kn.z.object({providerInfo:kn.z.object({}).catchall(kn.z.unknown()).optional(),profile:kn.z.object({email:kn.z.string().optional(),displayName:kn.z.string().optional(),picture:kn.z.string().optional()}),backstageIdentity:kn.z.object({token:kn.z.string(),identity:kn.z.object({type:kn.z.literal("user"),userEntityRef:kn.z.string(),ownershipEntityRefs:kn.z.array(kn.z.string())})})}),Zi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function hl(e){const s=new Date(Date.now()+Zi.defaultTokenExpiryMillis);if(!e)return s;const[i,d,p]=e.split("."),g=JSON.parse(atob(d));return typeof g.exp!="number"?s:new Date(g.exp*1e3-Zi.tokenExpiryMarginMillis)}class Wl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:hl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Gl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:d},{execute:p}]=useAsync(async()=>{const g=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await g.start(),e.onSignInSuccess(g)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},pl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ti=({children:e})=>{const s=pl();return(0,n.jsx)(V.Z,{component:"li",item:!0,classes:s,children:e})};class ni{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 s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function fl(e){const[s,i,d]=e.split(".");return JSON.parse(atob(i))}class ri{getUserId(){return this.result.userId}static fromResult(s){return new ri(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:d}=fl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Ts{static createGuest(){return new ni}static fromLegacy(s){return ri.fromResult(s)}static create(s){return new Ts(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[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(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,d){this.identity=s,this.authApi=i,this.profile=d}}const gl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:d,message:p}=e,g=(0,T.h_)(i),C=(0,T.h_)(T.VE),B=async()=>{try{const M=await g.getBackstageIdentity({instantPopup:!0});if(!M)throw new Error(`The ${d} provider is not configured to support sign-in`);const Z=await g.getProfile();s(Ts.create({identity:M.identity,profile:Z,authApi:g}))}catch(M){C.post(new Er.SP("Login failed",M))}};return(0,n.jsx)(ti,{children:(0,n.jsx)(xr,{variant:"fullHeight",title:d,actions:(0,n.jsx)(J.Z,{color:"primary",variant:"outlined",onClick:B,children:"Sign In"}),children:(0,n.jsx)(w.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const p=await i.getProfile();return Ts.create({identity:d.identity,profile:p,authApi:i})}},ml={Component:({onSignInSuccess:e})=>(0,n.jsx)(ti,{children:(0,n.jsx)(xr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(J.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ni),children:"Enter"}),children:(0,n.jsxs)(w.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ni};var vl=t(63955),Di=t(86619),Ni=t(74828),yl=t(45455),xl=t.n(yl);const bl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Sl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Fi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},wl={Component:({onSignInSuccess:e})=>{const s=Sl(),{register:i,handleSubmit:d,formState:p}=(0,vl.cI)({mode:"onChange"}),{errors:g}=p,C=({userId:B})=>{e(Ts.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(ti,{children:(0,n.jsxs)(xr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(w.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:d(C),children:[(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(g.userId)}),g.userId&&(0,n.jsx)(Ni.Z,{error:!0,children:g.userId.message})]}),(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("idToken",{required:!1,validate:B=>!B||bl.test(B)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(g.idToken)}),g.idToken&&(0,n.jsx)(Ni.Z,{error:!0,children:g.idToken.message})]}),(0,n.jsx)(J.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!xl()(g),children:"Continue"})]})]})})},loader:async()=>{}},ao="@backstage/core:SignInPage:provider",Ui={guest:ml,custom:wl,common:gl};function Mi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function _l(e){return e.reduce((i,d)=>{if(typeof d=="string")return Mi(d,i),i[d]={components:Ui[d],id:d},i;const{id:p}=d;return Mi(p,i),i[p]={components:Ui.common,id:p,config:d},i},{})}const ec=(e,s)=>{const i=useApi(errorApiRef),d=useApiHolder(),[p,g]=useState(!0),C=useCallback(M=>{s(IdentityApiSignOutProxy.from({identityApi:M,signOut:async()=>{var Z;localStorage.removeItem(ao),await((Z=M.signOut)===null||Z===void 0?void 0:Z.call(M))}}))},[s]);useLayoutEffect(()=>{var M;if(!p)return;const Z=localStorage.getItem(ao);if(Z===null){g(!1);return}const ue=e[Z];if(!ue){g(!1);return}let re=!1;return ue.components.loader(d,(M=ue.config)===null||M===void 0?void 0:M.apiRef).then(ce=>{re||(ce?C(ce):g(!1))}).catch(ce=>{re||(localStorage.removeItem(ao),i.post(ce),g(!1))}),()=>{re=!0}},[p,i,s,d,e,C]);const B=useMemo(()=>Object.keys(e).map(M=>{const Z=e[M],{Component:ue}=Z.components,re=ce=>{localStorage.setItem(ao,Z.id),C(ce)};return _jsx(ue,{config:Z.config,onSignInSuccess:re},Z.id)}),[e,C]);return[p,B]},Cl=({onSignInSuccess:e,providers:s=[],title:i,align:d="left"})=>{const p=useApi(configApiRef),g=useStyles(),C=getSignInProviders(s),[B,M]=useSignInProviders(C,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:g,children:M})]})]})},jl=({provider:e,auto:s,onSignInSuccess:i})=>{const d=useStyles(),p=useApi(e.apiRef),g=useApi(configApiRef),[C,B]=useState(),[M,Z]=useState(!1),ue=async({checkExisting:re,showPopup:ce})=>{try{let we;if(re&&(we=await p.getBackstageIdentity({optional:!0})),!we&&(ce||s)&&(Z(!0),we=await p.getBackstageIdentity({instantPopup:!0}),!we))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!we){Z(!0);return}const Fe=await p.getProfile();i(UserIdentity.create({identity:we.identity,authApi:p,profile:Fe}))}catch(we){B(we),Z(!0)}};return useMountEffect(()=>ue({checkExisting:!0})),M?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ue({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),C&&C.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:C.message})]})})})})]}):_jsx(Progress,{})};function tc(e){return"provider"in e?_jsx(jl,{...e}):_jsx(Cl,{...e})}const El=(0,l.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"}),Al=(0,sn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(er.Z);function nc(e){const{slackChannel:s,errorBoundaryProps:i,children:d,title:p,deepLink:g,value:C,onChange:B}=e,M=El(),[Z,ue]=useState(0),re=B||((Fe,ht)=>ue(ht));let ce;C?React.Children.map(d,Fe=>{React.isValidElement(Fe)&&(Fe==null?void 0:Fe.props.value)===C&&(ce=Fe==null?void 0:Fe.props.children)}):React.Children.map(d,(Fe,ht)=>{React.isValidElement(Fe)&&ht===Z&&(ce=Fe==null?void 0:Fe.props.children)});const we=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...we,children:[p&&_jsx(Al,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:M,value:C||Z,onChange:re,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ce}),g&&_jsx(BottomLink,{...g})]})})}const Tl=(0,l.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:"bold"}}),{name:"BackstageCardTab"});function rc(e){const{children:s,...i}=e,d=Tl();return _jsx(Tab,{disableRipple:!0,classes:d,...i})}},25248:function(bt,Pe,t){"use strict";t.d(Pe,{fC:function(){return b},CL:function(){return Ue},sM:function(){return W},$v:function(){return fe},v_:function(){return Ye},hg:function(){return qe},uB:function(){return te},R5:function(){return Ct},bq:function(){return A},Ds:function(){return He},ni:function(){return K},T0:function(){return D},CO:function(){return _e},x8:function(){return fn},rx:function(){return It},YO:function(){return at},P4:function(){return We},NT:function(){return zt},NW:function(){return Xe},VE:function(){return Qe},W0:function(){return ze},gP:function(){return tt},IY:function(){return dt},F4:function(){return ie},ux:function(){return I},Kp:function(){return ae},$4:function(){return lt},p_:function(){return k},ZM:function(){return ct},D:function(){return R},gW:function(){return O},E6:function(){return nt},z$:function(){return gt},h_:function(){return ee},I_:function(){return $},qD:function(){return Te},vJ:function(){return Tt},yx:function(){return xe},tg:function(){return je},Oi:function(){return Ae}});var h=t(52322),n=t(51837),m=t(2784);const T=(0,n.CT)("analytics-context"),z=()=>{const oe=(0,m.useContext)(T);if(oe===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const G=oe.atVersion(1);if(G===void 0)throw new Error("No context found for version 1.");return G},b=oe=>{const{attributes:G,children:pe}=oe,be={...z(),...G},Ge=(0,n.EI)({1:be});return(0,h.jsx)(T.Provider,{value:Ge,children:pe})};function l(oe,G){const pe=ve=>_jsx(b,{attributes:G,children:_jsx(oe,{...ve})});return pe.displayName=`WithAnalyticsContext(${oe.displayName||oe.name||"Component"})`,pe}function $(){const oe=(0,n.Vt)("api-context");if(!oe)throw new Error("API context is not available");const G=oe.atVersion(1);if(!G)throw new Error("ApiContext v1 not available");return G}function ee(oe){const pe=$().get(oe);if(!pe)throw new Error(`No implementation available for ${oe}`);return pe}function Y(oe){return function(pe){const ve=Ge=>{const V=$(),w={};for(const Q in oe)if(oe.hasOwnProperty(Q)){const Ee=oe[Q],Oe=V.get(Ee);if(!Oe)throw new Error(`No implementation available for ${Ee}`);w[Q]=Oe}return _jsx(pe,{...Ge,...w})},be=pe.displayName||pe.name||"Component";return ve.displayName=`withApis(${be})`,ve}}class J{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(G){if(this.config=G,!G.id.split(".").flatMap(ve=>ve.split("-")).every(ve=>ve.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${G.id}'`)}}function D(oe){return new J(oe)}function K(oe,G){return"id"in oe?{api:oe,deps:{},factory:()=>G}:oe}var W;(function(oe){oe.SignedIn="SignedIn",oe.SignedOut="SignedOut"})(W||(W={}));const ae=D({id:"core.auth.google"}),ie=D({id:"core.auth.github"}),R=D({id:"core.auth.okta"}),I=D({id:"core.auth.gitlab"}),k=D({id:"core.auth.microsoft"}),O=D({id:"core.auth.onelogin"}),A=D({id:"core.auth.bitbucket"}),te=D({id:"core.auth.atlassian"}),fe=D({id:"core.alert"}),Ye=D({id:"core.analytics"}),qe=D({id:"core.apptheme"}),He=D({id:"core.config"}),Xe=D({id:"core.discovery"}),Qe=D({id:"core.error"});var Ue;(function(oe){oe[oe.None=0]="None",oe[oe.Active=1]="Active"})(Ue||(Ue={}));const ze=D({id:"core.featureflags"}),tt=D({id:"core.fetch"}),lt=D({id:"core.identity"}),ct=D({id:"core.oauthrequest"}),nt=D({id:"core.storage"});class Ce{setContext(G){this.context=G}captureEvent(G,pe,{value:ve,attributes:be}={}){try{this.analyticsApi.captureEvent({action:G,subject:pe,value:ve,attributes:be,context:this.context})}catch(Ge){console.warn("Error during analytics event capture. %o",Ge)}}constructor(G,pe={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=G,this.context=pe}}function rt(){try{return ee(Ye)}catch{return{captureEvent:()=>{}}}}function gt(){const oe=(0,m.useRef)(null),G=z(),pe=rt();function ve(){return oe.current===null&&(oe.current=new Ce(pe)),oe.current}const be=ve();return be.setContext(G),be}const Re="plugin-context",se=oe=>{const{children:G,plugin:pe}=oe,{Provider:ve}=(0,n.CT)(Re);return(0,h.jsx)(ve,{value:(0,n.EI)({1:{plugin:pe}}),children:G})};function xe(){const oe=(0,n.Vt)(Re);if(!oe)throw new Error("Plugin Options context is not available");const G=oe.atVersion(1);if(!G)throw new Error("Plugin Options v1 is not available");return G.plugin.getPluginOptions()}const Te=()=>{const oe=(0,n.Vt)("app-context");if(!oe)throw new Error("App context is not available");const G=oe.atVersion(1);if(!G)throw new Error("AppContext v1 not available");return G},st=(0,n.uW)("component-data-store",()=>new WeakMap),ft="__backstage_data";function Ct(oe,G,pe){const ve=oe;var be;let Ge=(be=ve[ft])!==null&&be!==void 0?be:st.get(oe);if(Ge||(Ge={map:new Map},Object.defineProperty(ve,ft,{enumerable:!1,configurable:!0,writable:!1,value:Ge}),st.set(oe,Ge)),Ge.map.has(G)){const V=oe.displayName||oe.name;throw new Error(`Attempted to attach duplicate data "${G}" to component "${V}"`)}Ge.map.set(G,pe)}function dt(oe,G){if(!oe)return;const pe=oe.type;if(!pe)return;var ve;const be=(ve=pe[ft])!==null&&ve!==void 0?ve:st.get(pe);if(!!be)return be.map.get(G)}const jt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let St=jt;class Pt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(G,pe){this.id=G,this.params=pe,this[St]="absolute"}}function zt(oe){var G;return new Pt(oe.id,(G=oe.params)!==null&&G!==void 0?G:[])}const mt=/^\w+$/;let ln=null;class Nt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(G,pe,ve,be){this.id=G,this.path=pe,this.parent=ve,this.params=be,this[ln]="sub"}}function dn(oe){const{id:G,path:pe,parent:ve}=oe,be=pe.split("/").filter(w=>w.startsWith(":")).map(w=>w.substring(1)),Ge=[...ve.params,...be];if(ve.params.some(w=>be.includes(w)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!pe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${pe}'`);if(pe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${pe}'`);for(const w of be)if(!mt.test(w))throw new Error(`SubRouteRef path has invalid param, got '${w}'`);return new Nt(G,pe,ve,Ge)}let un=jt;class Ln{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(G,pe,ve){this.id=G,this.params=pe,this.optional=ve,this[un]="external"}}function fn(oe){var G;return new Ln(oe.id,(G=oe.params)!==null&&G!==void 0?G:[],Boolean(oe.optional))}var On=t(10289);function je(oe){const G=(0,On.TH)(),pe=(0,n.Vt)("routing-context");if(!pe)throw new Error("Routing context is not available");const ve=pe.atVersion(1),be=(0,m.useMemo)(()=>ve&&ve.resolve(oe,G),[ve,oe,G]);if(!pe)throw new Error("useRouteRef used outside of routing context");if(!ve)throw new Error("RoutingContext v1 not available");const Ge="optional"in oe&&oe.optional;if(!be&&!Ge)throw new Error(`No path for ${oe}`);return be}function Ae(oe){return(0,On.UO)()}class Be extends m.Component{static getDerivedStateFromError(G){return{error:G}}render(){const{error:G}=this.state,{app:pe,plugin:ve}=this.props,{ErrorBoundaryFallback:be}=pe.getComponents();return G?(0,h.jsx)(be,{error:G,resetError:this.handleErrorReset,plugin:ve}):this.props.children}constructor(...G){super(...G),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function We(oe){const{component:G,mountPoint:pe,name:ve}=oe;return at({component:{lazy:()=>G().then(be=>{const Ge=w=>{try{je(pe)}catch(Q){if(typeof Q=="object"&&Q!==null){const{message:Ee}=Q;if(typeof Ee=="string"&&Ee.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${pe} 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 Q}return(0,h.jsx)(be,{...w})},V=ve||be.displayName||be.name||"LazyComponent";return Ge.displayName=`RoutableExtension(${V})`,Ge},be=>V=>{const w=Te(),{BootErrorPage:Q}=w.getComponents();return(0,h.jsx)(Q,{step:"load-chunk",error:be})})},data:{"core.mountPoint":pe},name:ve})}function _e(oe){const{component:G,name:pe}=oe;return at({component:G,name:pe})}function at(oe){const{data:G={},name:pe}=oe;pe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let ve;if("lazy"in oe.component){const Ge=oe.component.lazy;ve=(0,m.lazy)(()=>Ge().then(V=>({default:V})))}else ve=oe.component.sync;const be=pe||ve.displayName||ve.name||"Component";return{expose(Ge){const V=w=>{const Q=Te(),{Progress:Ee}=Q.getComponents(),Oe=G==null?void 0:G["core.mountPoint"];return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(Ee,{}),children:(0,h.jsx)(Be,{app:Q,plugin:Ge,children:(0,h.jsx)(b,{attributes:{pluginId:Ge.getId(),...pe&&{extension:pe},...Oe&&{routeRef:Oe.id}},children:(0,h.jsx)(se,{plugin:Ge,children:(0,h.jsx)(ve,{...w})})})})})};Ct(V,"core.plugin",Ge);for(const[w,Q]of Object.entries(G))Ct(V,w,Q);return V.displayName=`Extension(${be})`,V}}}function pt(oe,G,pe,ve){return m.Children.toArray(oe).flatMap(be=>{if(!(0,m.isValidElement)(be))return[];if(be.type===m.Fragment)return pt(be.props.children,G,pe,ve);if(dt(be,"core.featureFlagged")){const Ge=be.props;return("with"in Ge?G.isActive(Ge.with):!G.isActive(Ge.without))?pt(be.props.children,G,pe,ve):[]}if(pe===void 0||pe(be))return[be];if(ve)throw new Error(ve);return pt(be.props.children,G,pe,ve)})}class wt{selectByComponentData(G){const pe=pt(this.node,this.featureFlagsApi,ve=>dt(ve,G.key)!==void 0,G.withStrictError);return new wt(pe,this.featureFlagsApi)}findComponentData(G){return pt(this.node,this.featureFlagsApi,ve=>dt(ve,G.key)!==void 0).map(ve=>dt(ve,G.key)).filter(ve=>ve!==void 0)}getElements(){return pt(this.node,this.featureFlagsApi)}constructor(G,pe){this.node=G,this.featureFlagsApi=pe}}function Tt(oe,G,pe=[]){const ve=ee(ze),be=new wt(oe,ve);return(0,m.useMemo)(()=>G(be),[oe,...pe])}class kt{getId(){return this.config.id}getApis(){var G;return(G=this.config.apis)!==null&&G!==void 0?G:[]}getFeatureFlags(){var G,pe;return(pe=(G=this.config.featureFlags)===null||G===void 0?void 0:G.slice())!==null&&pe!==void 0?pe:[]}get routes(){var G;return(G=this.config.routes)!==null&&G!==void 0?G:{}}get externalRoutes(){var G;return(G=this.config.externalRoutes)!==null&&G!==void 0?G:{}}provide(G){return G.expose(this)}__experimentalReconfigure(G){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(G))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var G;return(G=this.options)!==null&&G!==void 0?G:{}}toString(){return`plugin{${this.config.id}}`}constructor(G){this.config=G,this.options=void 0}}function It(oe){return new kt(oe)}},23054:function(bt,Pe,t){"use strict";t.d(Pe,{SP:function(){return W},dR:function(){return J},VL:function(){return ie},BD:function(){return n}});function h(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const I=R;return!(typeof I.name!="string"||I.name===""||typeof I.message!="string")}function n(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const I=R;if(typeof I.name!="string"||I.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof I.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var m=t(24852);function T(R,I){const k=serializeErrorInternal(R),O={name:"Unknown",message:"<no reason given>",...k};return I!=null&&I.includeStack||delete O.stack,O}function z(R){const I=(0,m.deserializeError)(R);return R.stack||(I.stack=void 0),I}function b(R){if(h(R)){const I=String(R);return I!=="[object Object]"?I:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class l extends Error{constructor(I,k){var O;let A=I;if(k!==void 0){const te=b(k);A?A+=`; caused by ${te}`:A=`caused by ${te}`}super(A),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(k)?k:void 0}}class $ extends null{}class ee extends null{}class Y extends null{}class J extends l{}class D extends null{}class K extends null{}class W extends l{constructor(I,k){super(I,k),this.name=h(k)?k.name:"Error"}}async function ae(R){try{const k=await R.text();if(k){var I;if(!((I=R.headers.get("content-type"))===null||I===void 0)&&I.startsWith("application/json"))try{const O=JSON.parse(k);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${k}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class ie extends Error{static async fromResponse(I){const k=await ae(I),O=k.response.statusCode||I.status,A=k.error.name||I.statusText,te=`Request failed with ${O} ${A}`,fe=z(k.error);return new ie({message:te,response:I,data:k,cause:fe})}constructor(I){super(I.message),this.name="ResponseError",this.response=I.response,this.body=I.data,this.cause=I.cause}}},32838:function(bt,Pe,t){"use strict";t.d(Pe,{nW:function(){return ie},ae:function(){return J},q3:function(){return D}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var m=new WeakMap;class T{async getCredentials(I){const k=new URL(I.url),O=_class_private_field_get(this,m).find(A=>A.isUrlSupported(k));if(!O)throw new Error(`No auth provider available for '${I.url}', see https://backstage.io/link?scm-auth`);return O.getCredentials(I)}constructor(I){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_set(this,m,I)}}var z=new WeakMap,b=new WeakMap,l=new WeakMap,$=new WeakMap;class ee{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:I,gitlab:k,azure:O,bitbucket:A})=>ee.merge(ee.forGithub(I),ee.forGitlab(k),ee.forAzure(O),ee.forBitbucket(A))})}static forAuthApi(I,k){return new ee("generic",I,k.host,k.scopeMapping)}static forGithub(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"github.com";return new ee("github",I,A,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"gitlab.com";return new ee("gitlab",I,A,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"dev.azure.com";return new ee("azure",I,A,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"bitbucket.org";return new ee("bitbucket",I,A,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...I){return new T(I)}isUrlSupported(I){return I.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(I){var k;if(!(I!=null&&I.customScopes)||_class_private_field_get(this,$)==="generic")return[];var O;return(O=(k=I.customScopes)===null||k===void 0?void 0:k[_class_private_field_get(this,$)])!==null&&O!==void 0?O:[]}async getCredentials(I){const{url:k,additionalScope:O,...A}=I,te=_class_private_field_get(this,l).default.slice();O!=null&&O.repoWrite&&te.push(..._class_private_field_get(this,l).repoWrite);const fe=this.getAdditionalScopesForProvider(O);fe.length&&te.push(...fe);const Ye=[...new Set(te)],qe=await _class_private_field_get(this,z).getAccessToken(Ye,A);return{token:qe,headers:{Authorization:`Bearer ${qe}`}}}constructor(I,k,O,A){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,$,{writable:!0,value:void 0}),_class_private_field_set(this,z,k),_class_private_field_set(this,b,O),_class_private_field_set(this,l,A),_class_private_field_set(this,$,I)}}var Y=t(39619);class J{static fromConfig(I){return Y.Lx.fromConfig(I)}}const D=(0,h.T0)({id:"integration.scmintegrations"});var K=t(52322),W=t(73250),ae=t(2784);const ie=R=>{const{type:I}=R,k=(0,h.qD)(),O=W.Z;var A;const te=I&&(A=k.getSystemIcon(I))!==null&&A!==void 0?A:O;return(0,K.jsx)(te,{})}},39619:function(bt,Pe,t){"use strict";t.d(Pe,{Lx:function(){return Wt},Pb:function(){return yt}});var h=t(82717),n=t.n(h),m=t(76635);function T(x){const u=new URL("http://example.com");return u.host=x,u.host===x}function z(x){try{return new URL(x),!0}catch{return!1}}function b(x,u){return{list(){return x},byUrl(y){try{const j=typeof y=="string"?new URL(y):y;return x.find(H=>u(H)===j.host)}catch{return}},byHost(y){return x.find(j=>u(j)===y)}}}function l(x){const{url:u,base:y,lineNumber:j}=x;try{return new URL(u),u}catch{}let H;if(u.startsWith("/")){const{filepath:de}=n()(y);H=new URL(y);const he=(0,m.trimEnd)(H.pathname.substring(0,H.pathname.length-de.length),"/");H.pathname=`${he}${u}`}else H=new URL(u,y);return H.search=new URL(y).search,j&&(H.hash=`L${j}`),H.toString()}const $="amazonaws.com";function ee(x){const u=x.getOptionalString("endpoint");var y;const j=(y=x.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let H,de;if(u){try{const Rt=new URL(u);H=Rt.host,de=Rt.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(de!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else H=$;const he=x.getOptionalString("accessKeyId"),Ie=x.getOptionalString("secretAccessKey"),et=x.getOptionalString("roleArn"),$t=x.getOptionalString("externalId");return{host:H,endpoint:u,s3ForcePathStyle:j,accessKeyId:he,secretAccessKey:Ie,roleArn:et,externalId:$t}}function Y(x){const u=x.map(ee);return u.some(y=>y.host===$)||u.push({host:$}),u}class J{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}J.factory=({config:x})=>{var u;const y=Y((u=x.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new J(j)),j=>j.config.host)};var D=t(90383),K=t(22504),W=t(69866);const ae="GB";var ie=new WeakMap,R=new WeakMap,I=new WeakMap,k=new WeakMap,O=new WeakMap,A=new WeakMap,te=new WeakMap;class fe{static fromRepoUrl(u){const y=new URL(u);let j,H,de;const he=y.pathname.split("/").map(_n=>decodeURIComponent(_n));if(he[2]==="_git"?(j=he[1],H=de=he[3]):he[3]==="_git"?(j=he[1],H=he[2],de=he[4]):he[4]==="_git"&&(j=`${he[1]}/${he[2]}`,H=he[3],de=he[5]),!j||!H||!de)throw new Error("Azure URL must point to a git repository");var Ie;const et=(Ie=y.searchParams.get("path"))!==null&&Ie!==void 0?Ie:void 0;let $t;const Rt=y.searchParams.get("version");if(Rt){if(Rt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");$t=Rt.slice(2)}return new fe(y.origin,j,H,de,et,$t)}toRepoUrl(){let u;return(0,D.Z)(this,I)===(0,D.Z)(this,k)?u=(0,D.Z)(this,te).call(this,(0,D.Z)(this,R),"_git",(0,D.Z)(this,k)):u=(0,D.Z)(this,te).call(this,(0,D.Z)(this,R),(0,D.Z)(this,I),"_git",(0,D.Z)(this,k)),(0,D.Z)(this,O)&&u.searchParams.set("path",(0,D.Z)(this,O)),(0,D.Z)(this,A)&&u.searchParams.set("version",ae+(0,D.Z)(this,A)),u.toString()}toFileUrl(){if(!(0,D.Z)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,D.Z)(this,te).call(this,(0,D.Z)(this,R),(0,D.Z)(this,I),"_apis","git","repositories",(0,D.Z)(this,k),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,D.Z)(this,O)),(0,D.Z)(this,A)&&u.searchParams.set("version",(0,D.Z)(this,A)),u.toString()}toArchiveUrl(){const u=(0,D.Z)(this,te).call(this,(0,D.Z)(this,R),(0,D.Z)(this,I),"_apis","git","repositories",(0,D.Z)(this,k),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,D.Z)(this,O)&&u.searchParams.set("scopePath",(0,D.Z)(this,O)),(0,D.Z)(this,A)&&u.searchParams.set("version",(0,D.Z)(this,A)),u.toString()}toCommitsUrl(){const u=(0,D.Z)(this,te).call(this,(0,D.Z)(this,R),(0,D.Z)(this,I),"_apis","git","repositories",(0,D.Z)(this,k),"commits");return u.searchParams.set("api-version","6.0"),(0,D.Z)(this,A)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,D.Z)(this,A)),u.toString()}getOwner(){return(0,D.Z)(this,R)}getProject(){return(0,D.Z)(this,I)}getRepo(){return(0,D.Z)(this,k)}getPath(){return(0,D.Z)(this,O)}getRef(){return(0,D.Z)(this,A)}constructor(u,y,j,H,de,he){(0,K.Z)(this,ie,{writable:!0,value:void 0}),(0,K.Z)(this,R,{writable:!0,value:void 0}),(0,K.Z)(this,I,{writable:!0,value:void 0}),(0,K.Z)(this,k,{writable:!0,value:void 0}),(0,K.Z)(this,O,{writable:!0,value:void 0}),(0,K.Z)(this,A,{writable:!0,value:void 0}),(0,K.Z)(this,te,{writable:!0,value:(...Ie)=>{const et=new URL((0,D.Z)(this,ie));return et.pathname=Ie.map($t=>encodeURIComponent($t)).join("/"),et}}),(0,W.Z)(this,ie,u),(0,W.Z)(this,R,y),(0,W.Z)(this,I,j),(0,W.Z)(this,k,H),(0,W.Z)(this,O,de),(0,W.Z)(this,A,he)}}const Ye="dev.azure.com";function qe(x){var u;const y=(u=x.getOptionalString("host"))!==null&&u!==void 0?u:Ye,j=x.getOptionalString("token");if(!T(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:j}}function He(x){const u=x.map(qe);return u.some(y=>y.host===Ye)||u.push({host:Ye}),u}class Xe{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:j}=u;if(z(y))return y;try{const de=fe.fromRepoUrl(j),he=new URL(j);var H;const Ie=new URL(`https://a.com${(H=de.getPath())!==null&&H!==void 0?H:""}`),et=new URL(y,Ie).pathname;return he.searchParams.set("path",et),u.lineNumber&&(he.searchParams.set("line",String(u.lineNumber)),he.searchParams.set("lineEnd",String(u.lineNumber+1)),he.searchParams.set("lineStartColumn","1"),he.searchParams.set("lineEndColumn","1")),he.toString()}catch{return new URL(y,j).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Xe.factory=({config:x})=>{var u;const y=He((u=x.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new Xe(j)),j=>j.config.host)};var Qe=t(48834).lW;function Ue(x){return AzureUrl.fromRepoUrl(x).toFileUrl()}function ze(x){return AzureUrl.fromRepoUrl(x).toArchiveUrl()}function tt(x){return AzureUrl.fromRepoUrl(x).toCommitsUrl()}function lt(x,u){const y=u?{...u}:{};if(x.token){const j=Qe.from(`:${x.token}`,"utf8");y.Authorization=`Basic ${j.toString("base64")}`}return{headers:y}}const ct="bitbucket.org",nt="https://api.bitbucket.org/2.0";function Ce(x){var u;const y=(u=x.getOptionalString("host"))!==null&&u!==void 0?u:ct;let j=x.getOptionalString("apiBaseUrl");const H=x.getOptionalString("token"),de=x.getOptionalString("username"),he=x.getOptionalString("appPassword");if(!T(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return j?j=(0,m.trimEnd)(j,"/"):y===ct?j=nt:j=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:j,token:H,username:de,appPassword:he}}function rt(x){const u=x.map(Ce);return u.some(y=>y.host===ct)||u.push({host:ct,apiBaseUrl:nt}),u}class gt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(!u.lineNumber)return y;const j=new URL(y);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${u.lineNumber}`:j.hash=`${u.lineNumber}`,j.toString()}resolveEditUrl(u){const y=n()(u),j=new URL(u);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",y.ref),j.toString()}constructor(u){this.integrationConfig=u}}gt.factory=({config:x})=>{var u,y,j;const H=rt((j=x.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(u=x.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(y=x.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return b(H.map(de=>new gt(de)),de=>de.config.host)};var Re=t(96279),se=t(48834).lW;async function xe(x,u){const{name:y,owner:j,resource:H}=parseGitUrl(x),de=H==="bitbucket.org";let he=de?`${u.apiBaseUrl}/repositories/${j}/${y}`:`${u.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,Ie=await fetch(he,ft(u));if(Ie.status===404&&!de&&(he=`${u.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,Ie=await fetch(he,ft(u))),!Ie.ok){const $t=`Failed to retrieve default branch from ${he}, ${Ie.status} ${Ie.statusText}`;throw new Error($t)}let et;if(de)et=(await Ie.json()).mainbranch.name;else{const{displayId:$t}=await Ie.json();et=$t}if(!et)throw new Error(`Failed to read default branch from ${he}. Response ${Ie.status} ${Ie.json()}`);return et}async function Te(x,u){const{name:y,owner:j,ref:H,protocol:de,resource:he,filepath:Ie}=parseGitUrl(x),et=he==="bitbucket.org";let $t=H;$t||($t=await xe(x,u));const Rt=Ie?`&path=${encodeURIComponent(decodeURIComponent(Ie))}`:"";return et?`${de}://${he}/${j}/${y}/get/${$t}.tar.gz`:`${u.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${$t}&prefix=${j}-${y}${Rt}`}function st(x,u){try{const{owner:y,name:j,ref:H,filepathtype:de,filepath:he}=parseGitUrl(x);if(!y||!j||de!=="browse"&&de!=="raw"&&de!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ie=he.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!H)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${j}/src/${H}/${Ie}`}return`${u.apiBaseUrl}/projects/${y}/repos/${j}/raw/${Ie}?at=${H}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function ft(x){const u={};if(x.token)u.Authorization=`Bearer ${x.token}`;else if(x.username&&x.appPassword){const y=se.from(`${x.username}:${x.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}const Ct="bitbucket.org",dt="https://api.bitbucket.org/2.0";function jt(x){const u=Ct,y=dt,j=x.getString("username"),H=x.getString("appPassword");return{host:u,apiBaseUrl:y,username:j,appPassword:H}}function St(x){const u=x.map(jt);return u.length===0&&u.push({host:Ct,apiBaseUrl:dt}),u}class Pt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(u.lineNumber){const j=new URL(y);return j.hash=`lines-${u.lineNumber}`,j.toString()}return y}resolveEditUrl(u){const y=n()(u),j=new URL(u);return j.searchParams.set("mode","edit"),j.searchParams.set("at",y.ref),j.toString()}constructor(u){this.integrationConfig=u}}Pt.factory=({config:x})=>{var u;const y=St((u=x.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new Pt(j)),j=>j.config.host)};var zt=t(48834).lW;async function mt(x,u){const{name:y,owner:j}=parseGitUrl(x),H=`${u.apiBaseUrl}/repositories/${j}/${y}`,de=await fetch(H,dn(u));if(!de.ok){const et=`Failed to retrieve default branch from ${H}, ${de.status} ${de.statusText}`;throw new Error(et)}const Ie=(await de.json()).mainbranch.name;if(!Ie)throw new Error(`Failed to read default branch from ${H}. Response ${de.status} ${de.json()}`);return Ie}async function ln(x,u){const{name:y,owner:j,ref:H,protocol:de,resource:he}=parseGitUrl(x);let Ie=H;return Ie||(Ie=await mt(x,u)),`${de}://${he}/${j}/${y}/get/${Ie}.tar.gz`}function Nt(x,u){try{const{owner:y,name:j,ref:H,filepathtype:de,filepath:he}=parseGitUrl(x);if(!y||!j||de!=="src"&&de!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ie=he.replace(/^\//,"");if(!H)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${j}/src/${H}/${Ie}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function dn(x){const u={};if(x.username&&x.appPassword){const y=zt.from(`${x.username}:${x.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function un(x){const u=x.getString("host");let y=x.getOptionalString("apiBaseUrl");const j=x.getOptionalString("token"),H=x.getOptionalString("username"),de=x.getOptionalString("password");if(!T(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return y?y=(0,m.trimEnd)(y,"/"):y=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:y,token:j,username:H,password:de}}function Ln(x){return x.map(un)}class fn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(u.lineNumber){const j=new URL(y);return j.hash=u.lineNumber.toString(),j.toString()}return y}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}fn.factory=({config:x})=>{var u;const y=Ln((u=x.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new fn(j)),j=>j.config.host)};var On=t(48834).lW;async function je(x,u){const{name:y,owner:j}=parseGitUrl(x);let H=`${u.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,de=await fetch(H,We(u));if(de.status===404&&(H=`${u.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,de=await fetch(H,We(u))),!de.ok){const et=`Failed to retrieve default branch from ${H}, ${de.status} ${de.statusText}`;throw new Error(et)}const{displayId:he}=await de.json(),Ie=he;if(!Ie)throw new Error(`Failed to read default branch from ${H}. Response ${de.status} ${de.json()}`);return Ie}async function Ae(x,u){const{name:y,owner:j,ref:H,filepath:de}=parseGitUrl(x);let he=H;he||(he=await je(x,u));const Ie=de?`&path=${encodeURIComponent(decodeURIComponent(de))}`:"";return`${u.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${he}&prefix=${j}-${y}${Ie}`}function Be(x,u){try{const{owner:y,name:j,ref:H,filepathtype:de,filepath:he}=parseGitUrl(x);if(!y||!j||de!=="browse"&&de!=="raw"&&de!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ie=he.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${y}/repos/${j}/raw/${Ie}?at=${H}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function We(x){const u={};if(x.token)u.Authorization=`Bearer ${x.token}`;else if(x.username&&x.password){const y=On.from(`${x.username}:${x.password}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function _e(x){const u=x.getString("host");let y=x.getOptionalString("baseUrl"),j=x.getOptionalString("cloneUrl"),H=x.getOptionalString("gitilesBaseUrl");const de=x.getOptionalString("username"),he=x.getOptionalString("password");if(T(u)){if(y&&!z(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(j&&!z(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(H&&!z(H))throw new Error(`Invalid Gerrit integration config, '${H}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return y?y=(0,m.trimEnd)(y,"/"):y=`https://${u}`,H?H=(0,m.trimEnd)(H,"/"):H=`https://${u}`,j?j=(0,m.trimEnd)(j,"/"):j=y,{host:u,baseUrl:y,cloneUrl:j,gitilesBaseUrl:H,username:de,password:he}}function at(x){return x.map(_e)}var pt=t(48834).lW;const wt=")]}'";function Tt(x,u){const j=u.replace(x.gitilesBaseUrl,"").split("/").filter($t=>!!$t),H=j.indexOf("+");if(H<=0)throw new Error(`Unable to parse project from url: ${u}`);const de=(0,m.trimStart)(j.slice(0,H).join("/"),"/"),he=j.indexOf("heads");if(he<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Ie=j[he+1],et=j.slice(he+2).join("/");return{branch:Ie,filePath:et===""?"/":et,project:de}}function kt(x,u,y,j){return`${x.gitilesBaseUrl}/${u}/+/refs/heads/${y}/${(0,m.trimStart)(j,"/")}`}function It(x){return x.password?"/a/":"/"}function oe(x,u){const{branch:y,project:j}=Tt(x,u);return`${x.baseUrl}${It(x)}projects/${encodeURIComponent(j)}/branches/${y}`}function G(x,u){const{project:y}=Tt(x,u);return`${x.cloneUrl}${It(x)}${y}`}function pe(x,u){const{branch:y,filePath:j,project:H}=Tt(x,u);return`${x.baseUrl}${It(x)}projects/${encodeURIComponent(H)}/branches/${y}/files/${encodeURIComponent(j)}/content`}function ve(x){return`${x.baseUrl}${It(x)}projects/`}function be(x){const u={};if(!x.password)return u;const y=pt.from(`${x.username}:${x.password}`,"utf8");return u.Authorization=`Basic ${y.toString("base64")}`,{headers:u}}async function Ge(x){const u=await x.text();if(u.startsWith(wt))try{return JSON.parse(u.slice(wt.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class V{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:j,lineNumber:H}=u;let de;if(y.startsWith("/")){const{branch:he,project:Ie}=Tt(this.config,j);return kt(this.config,Ie,he,y)}return y?de=new URL(y,j):de=new URL(j),H&&(de.hash=H.toString()),de.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}V.factory=({config:x})=>{var u;const y=at((u=x.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new V(j)),j=>j.config.host)};const w="github.com",Q="https://api.github.com",Ee="https://raw.githubusercontent.com";function Oe(x){var u,y;const j=(y=x.getOptionalString("host"))!==null&&y!==void 0?y:w;let H=x.getOptionalString("apiBaseUrl"),de=x.getOptionalString("rawBaseUrl");const he=x.getOptionalString("token"),Ie=(u=x.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(et=>({appId:et.getNumber("appId"),clientId:et.getString("clientId"),clientSecret:et.getString("clientSecret"),webhookSecret:et.getString("webhookSecret"),privateKey:et.getString("privateKey"),allowedInstallationOwners:et.getOptionalStringArray("allowedInstallationOwners")}));if(!T(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return H?H=(0,m.trimEnd)(H,"/"):j===w&&(H=Q),de?de=(0,m.trimEnd)(de,"/"):j===w&&(de=Ee),{host:j,apiBaseUrl:H,rawBaseUrl:de,token:he,apps:Ie}}function Ve(x){const u=x.map(Oe);return u.some(y=>y.host===w)||u.push({host:w,apiBaseUrl:Q,rawBaseUrl:Ee}),u}function ot(x,u,y){try{const{owner:j,name:H,ref:de,filepathtype:he,filepath:Ie}=parseGitUrl(x);if(!j||!H||!de||he!=="blob"&&he!=="raw"&&he!=="tree")throw new Error("Invalid GitHub URL or file path");const et=Ie.replace(/^\//,"");return Zt(u,y)==="api"?`${u.apiBaseUrl}/repos/${j}/${H}/contents/${et}?ref=${de}`:`${u.rawBaseUrl}/${j}/${H}/${de}/${et}`}catch(j){throw new Error(`Incorrect URL: ${x}, ${j}`)}}function Ft(x,u){const y={};return Zt(x,u)==="api"&&(y.Accept="application/vnd.github.v3.raw"),u.token&&(y.Authorization=`token ${u.token}`),{headers:y}}function Zt(x,u){return x.apiBaseUrl&&(u.token||!x.rawBaseUrl)?"api":"raw"}var qt=t(42822),Vt=t(89393),Ht=t(26228);class jn{async getOrCreateToken(u,y,j){let H=this.tokenCache.get(u);if((!H||this.isExpired(H.expiresAt))&&(H=await j(),H.expiresAt=H.expiresAt.minus({minutes:10}),this.tokenCache.set(u,H)),!this.appliesToRepo(H,y))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${y}`);return{accessToken:H.token}}appliesToRepo(u,y){return y===void 0?!0:u.repositories!==void 0?u.repositories.includes(y):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>Ht.ou.local()>u}}const E={Accept:"application/vnd.github.machine-man-preview+json"};class _{async getInstallationCredentials(u,y){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,y,async()=>{const{installationId:H,suspended:de}=await this.getInstallationData(u);if(de)throw new Error(`The GitHub application for ${u} is suspended`);const he=await this.appClient.apps.createInstallationAccessToken({installation_id:H,headers:E});let Ie;if(he.data.repository_selection==="selected"){const $t=new Vt.v({baseUrl:this.baseUrl,auth:he.data.token}),Rt=await $t.paginate($t.apps.listReposAccessibleToInstallation);var et;Ie=((et=Rt.repositories)!==null&&et!==void 0?et:Rt).map(fr=>fr.name)}return{token:he.data.token,expiresAt:Ht.ou.fromISO(he.data.expires_at),repositories:Ie}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const j=(await this.getInstallations()).find(de=>{var he,Ie;return((he=de.account)===null||he===void 0||(Ie=he.login)===null||Ie===void 0?void 0:Ie.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const H=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw H.name="NotFoundError",H}constructor(u,y){this.cache=new jn,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
31
|
-
`)},this.appClient=new Vt.v({baseUrl:y,headers:E,authStrategy:qt.i,auth:this.baseAuthConfig})}}class ye{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(u,y){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Ie=>Ie.getInstallationCredentials(u,y).then(et=>({credentials:et,error:void 0}),et=>({credentials:void 0,error:et})))),H=j.find(Ie=>Ie.credentials);if(H)return H.credentials.accessToken;const he=j.map(Ie=>Ie.error).find(Ie=>Ie.name!=="NotFoundError");if(he)throw he}constructor(u){var y,j;this.apps=(j=(y=u.apps)===null||y===void 0?void 0:y.map(H=>new _(H,u.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class ge{async getCredentials(u){const y=n()(u.url),j=y.owner||y.name,H=y.owner?y.name:void 0;let de="app",he=await this.githubAppCredentialsMux.getAppToken(j,H);return he||(de="token",he=this.token),{headers:he?{Authorization:`Bearer ${he}`}:void 0,token:he,type:de}}constructor(u,y){this.githubAppCredentialsMux=u,this.token=y}}ge.create=x=>new ge(new ye(x),x.token);class ke{static fromIntegrations(u){const y=new Map;return u.github.list().forEach(j=>{const H=SingleInstanceGithubCredentialsProvider.create(j.config);y.set(j.config.host,H)}),new ke(y)}async getCredentials(u){const y=new URL(u.url),j=this.providers.get(y.host);if(!j)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return j.getCredentials(u)}constructor(u){this.providers=u}}class De{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return yt(l(u),"tree")}resolveEditUrl(u){return yt(u,"edit")}constructor(u){this.integrationConfig=u}}De.factory=({config:x})=>{var u;const y=Ve((u=x.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new De(j)),j=>j.config.host)};function yt(x,u){return x.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,j,H,de)=>`//${j}/${H}/${de}/${u}/`)}const Dt="gitlab.com",_t="https://gitlab.com/api/v4";function Ut(x){const u=x.getString("host");let y=x.getOptionalString("apiBaseUrl");const j=x.getOptionalString("token");let H=x.getOptionalString("baseUrl");if(y?y=(0,m.trimEnd)(y,"/"):u===Dt&&(y=_t),H?H=(0,m.trimEnd)(H,"/"):H=`https://${u}`,T(u)){if(!y||!z(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!z(H))throw new Error(`Invalid GitLab integration config, '${H}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:j,apiBaseUrl:y,baseUrl:H}}function nn(x){const u=x.map(Ut);return u.some(y=>y.host===Dt)||u.push({host:Dt,apiBaseUrl:_t,baseUrl:`https://${Dt}`}),u}function Ot(x){let u="";return x.host!==Dt&&(u=new URL(x.baseUrl).pathname),trimEnd(u,"/")}async function rn(x,u){const y=await $n(x,u);return En(x,y,u).toString()}function Gn(x){const{token:u=""}=x;return{headers:{"PRIVATE-TOKEN":u}}}function En(x,u,y){try{const j=new URL(x),H=j.pathname.split("/blob/").slice(1).join("/blob/"),[de,...he]=H.split("/"),Ie=getGitLabIntegrationRelativePath(y);return j.pathname=[...Ie?[Ie]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(he.join("/"))),"raw"].join("/"),j.search=`?ref=${de}`,j}catch(j){throw new Error(`Incorrect url: ${x}, ${j}`)}}async function $n(x,u){const y=new URL(x);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const H=getGitLabIntegrationRelativePath(u);H&&(j=j.replace(H,""));const de=new URL(`${y.origin}${H}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),he=await fetch(de.toString(),Gn(u)),Ie=await he.json();if(!he.ok)throw new Error(`GitLab Error '${Ie.error}', ${Ie.error_description}`);return Number(Ie.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${x}, ${j}`)}}class Bn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return qn(u,"edit")}constructor(u){this.integrationConfig=u}}Bn.factory=({config:x})=>{var u;const y=nn((u=x.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return b(y.map(j=>new Bn(j)),j=>j.config.host)};function qn(x,u){return x.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class Wt{static fromConfig(u){return new Wt({awsS3:J.factory({config:u}),azure:Xe.factory({config:u}),bitbucket:gt.factory({config:u}),bitbucketCloud:Pt.factory({config:u}),bitbucketServer:fn.factory({config:u}),gerrit:V.factory({config:u}),github:De.factory({config:u}),gitlab:Bn.factory({config:u})})}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}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let y=Object.values(this.byType).map(j=>j.byUrl(u)).filter(Boolean);if(y.length>1){const j=y.filter(H=>!(H instanceof gt));j.length!==0&&(y=j)}return y[0]}byHost(u){return Object.values(this.byType).map(y=>y.byHost(u)).find(Boolean)}resolveUrl(u){const y=this.byUrl(u.base);return y?y.resolveUrl(u):l(u)}resolveEditUrl(u){const y=this.byUrl(u);return y?y.resolveEditUrl(u):u}constructor(u){this.byType=u}}},96215:function(bt,Pe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return A.s4}});var n=t(52322),m=t(2784),T=t(28316),z=t(10289),b=t(25248);const l=(0,b.T0)({id:"plugin.techdocs.storageservice"}),$=(0,b.T0)({id:"plugin.techdocs.service"});var ee=t(92077),Y=t(95481),J=t(7476),D=t(93225),K=t(67896),W=t(65124),ae=t(17339),ie=t(85478),R=t(68435),I=t(3482),k=t(42081),O=t(48431),A=t(89258),te=t(52943),fe=t(61886),Ye=t(13980),qe=t.n(Ye);class He{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var Xe=t(51837);const Qe=(0,Xe.CT)("api-context"),Ue=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,m.useContext)(Qe))===null||r===void 0?void 0:r.atVersion(1),P=f?new He(o,f):o;return(0,n.jsx)(Qe.Provider,{value:(0,Xe.EI)({1:P}),children:c})};Ue.propTypes={apis:qe().shape({get:qe().func.isRequired}).isRequired,children:qe().node};class ze{static validateFactories(r,o){for(const c of o){const f=[c],P=new Set;for(;f.length;){const F=f.shift(),U=r.get(F);if(!!U)for(const ne of Object.values(U.deps)){if(ne.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);P.has(ne)||(P.add(ne),f.push(ne))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const P=this.loadDeps(r,f.deps,[...o,f.api]),F=f.factory(P);return this.apis.set(r.id,F),F}loadDeps(r,o,c){const f={};for(const P in o)if(o.hasOwnProperty(P)){const F=o[P],U=this.load(F,c);if(!U)throw new Error(`No API factory available for dependency ${F} of dependent ${r}`);f[P]=U}return f}constructor(r){this.factories=r,this.apis=new Map}}var tt;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(tt||(tt={}));class lt{register(r,o){const c=tt[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function ct(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,P=window.screen.width/2-c/2,F=window.screen.height/2-f/2,U=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${F},left=${P}`);let ne="";if(!U||typeof U.closed=="undefined"||U.closed){const it=new Error("Failed to open auth popup.");it.name="PopupRejectedError",o(it);return}const Ze=it=>{if(it.source!==U||it.origin!==a.origin)return;const{data:Et}=it;if(Et.type==="config_info"){ne=Et.targetOrigin;return}if(Et.type!=="authorization_response")return;const Kt=Et;if("error"in Kt){const pn=new Error(Kt.error.message);pn.name=Kt.error.name,o(pn)}else r(Kt.response);xt()},$e=setInterval(()=>{if(U.closed){const it=`Login failed, ${ne&&ne!==window.location.origin?`Incorrect app origin, expected ${ne}`:"popup was closed"}`,Et=new Error(it);Et.name="PopupClosedError",o(Et),xt()}},100);function xt(){window.removeEventListener("message",Ze),clearInterval($e)}window.addEventListener("message",Ze)})}function nt(a){return[...a].join(" ")}class Ce{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await ct({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:P=nt,oauthRequestApi:F,sessionTransform:U=ne=>ne}=r;this.authRequester=F.createAuthRequester({provider:f,onAuthRequest:ne=>this.showPopup(ne)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=P,this.sessionTransform=U}}function rt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class gt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return rt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const P of f)c.add(P)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Re=t(82394),se=t.n(Re);let xe=Symbol.observable;class Te{[xe](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(se())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let st=Symbol.observable;class ft{[st](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(se())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Ct{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new ft(b.sM.SignedOut),this.signedIn=!1}}class dt{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),P=this.sessionScopesFunc(c);return rt(P,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.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(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Ct;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:P}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=P,this.helper=new gt({sessionScopes:f,defaultScopes:c})}}class jt{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const St={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Pt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=St,oauthRequestApi:P,defaultScopes:F=[],scopeTransform:U=$e=>$e}=r,ne=new Ce({discoveryApi:o,environment:c,provider:f,oauthRequestApi:P,sessionTransform($e){return{...$e,providerInfo:{idToken:$e.providerInfo.idToken,accessToken:$e.providerInfo.accessToken,scopes:Pt.normalizeScopes(U,$e.providerInfo.scope),expiresAt:new Date(Date.now()+$e.providerInfo.expiresInSeconds*1e3)}}}}),Ze=new dt({connector:ne,defaultScopes:new Set(F),sessionScopes:$e=>$e.providerInfo.scopes,sessionShouldRefresh:$e=>($e.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Pt({sessionManager:Ze,scopeTransform:U})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=Pt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var P;return(P=f==null?void 0:f.providerInfo.accessToken)!==null&&P!==void 0?P:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const zt={id:"github",title:"GitHub",icon:()=>null};class mt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=zt,oauthRequestApi:P,defaultScopes:F=["read:user"]}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const ln={id:"gitlab",title:"GitLab",icon:()=>null};class Nt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:P,defaultScopes:F=["read_user"]}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const dn={id:"google",title:"Google",icon:()=>null},un="https://www.googleapis.com/auth/";class Ln{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:P=dn,defaultScopes:F=["openid",`${un}userinfo.email`,`${un}userinfo.profile`]}=r;return Pt.create({discoveryApi:o,oauthRequestApi:c,provider:P,environment:f,defaultScopes:F,scopeTransform(U){return U.map(ne=>ne==="openid"?ne:ne==="profile"||ne==="email"?`${un}userinfo.${ne}`:ne.startsWith(un)?ne:`${un}${ne}`)}})}}const fn={id:"okta",title:"Okta",icon:()=>null},On=new Set(["openid","profile","email","phone","address","groups","offline_access"]),je="okta.";class Ae{static create(r){const{discoveryApi:o,environment:c="development",provider:f=fn,oauthRequestApi:P,defaultScopes:F=["openid","email","profile","offline_access"]}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F,scopeTransform(U){return U.map(ne=>On.has(ne)||ne.startsWith(je)?ne:`${je}${ne}`)}})}}var Be=t(30195);const We=Be.z.object({profile:Be.z.object({email:Be.z.string().optional(),displayName:Be.z.string().optional(),picture:Be.z.string().optional()}),backstageIdentity:Be.z.object({token:Be.z.string(),identity:Be.z.object({type:Be.z.literal("user"),userEntityRef:Be.z.string(),ownershipEntityRefs:Be.z.array(Be.z.string())})})}),_e={id:"saml",title:"SAML",icon:()=>null};class at{static create(r){const{discoveryApi:o,environment:c="development",provider:f=_e}=r,P=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),F=new StaticAuthSessionManager({connector:P}),U=new AuthSessionStore({manager:F,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new at(U)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const pt={id:"microsoft",title:"Microsoft",icon:()=>null};class wt{static create(r){const{environment:o="development",provider:c=pt,oauthRequestApi:f,discoveryApi:P,defaultScopes:F=["openid","offline_access","profile","email","User.Read"]}=r;return Pt.create({discoveryApi:P,oauthRequestApi:f,provider:c,environment:o,defaultScopes:F})}}const Tt={id:"onelogin",title:"onelogin",icon:()=>null},kt=new Set(["openid","profile","email","phone","address","groups","offline_access"]),It="onelogin.";class oe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Tt,oauthRequestApi:P}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(U=>kt.has(U)||U.startsWith(It)?U:`${It}${U}`)}})}}const G={id:"bitbucket",title:"Bitbucket",icon:()=>null};class pe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=G,oauthRequestApi:P,defaultScopes:F=["team"]}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const ve={id:"atlassian",title:"Atlassian",icon:()=>null};class be{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ve,oauthRequestApi:P}=r;return Pt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c})}}class Ge{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Te}}class V{captureEvent(r){}}const w="theme";class Q{static createWithStorage(r){const o=new Q(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(w))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(P=>{P?window.localStorage.setItem(w,P):window.localStorage.removeItem(w)}),window.addEventListener("storage",P=>{if(P.key===w){var F;const U=(F=localStorage.getItem(w))!==null&&F!==void 0?F:void 0;o.setActiveThemeId(U)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new ft(void 0)}}var Ee=t(9850),Oe=t.n(Ee),Ve=t(12782),ot=t.n(Ve);const Ft=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Zt(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function qt(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const Vt={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class Ht{static fromConfigs(r){return r.length===0?new Ht(void 0):r.reduce((o,{data:c,context:f,filteredKeys:P,deprecatedKeys:F})=>{const U=new Ht(c,f,o);if(U.filteredKeys=P,F)for(const{key:ne,description:Ze}of F)console.warn(`The configuration key '${ne}' of ${f} is deprecated and may be removed soon. ${Ze||""}`);return U},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=Oe()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var P;return f}else if(f===void 0)return c;return ot()({},{value:f},{value:c},(F,U)=>!Zt(U)||!Zt(F)?U:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(Zt(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Vt.type(this.fullKey(r),this.context,qt(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[P,F]of f.entries())if(!Zt(F))return{expected:"object-array",value:F,key:`${r}[${P}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,P)=>this.copy(f,`${r}[${P}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(Vt.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new Ht(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var P;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const F=o(c);if(F!==!0){const{key:U=r,value:ne=c,expected:Ze}=F;throw new TypeError(Vt.type(this.fullKey(U),this.context,qt(ne),Ze))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!Ft.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,P]of o.entries())if(Zt(c))c=c[P];else if(c!==void 0){const F=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Vt.type(F,this.context,qt(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const jn="Invalid discovery URL pattern,";class E{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${jn} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${jn} URL must not have a hash`);if(f.search)throw new Error(`${jn} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${jn} URL must not end with a slash`);return new E(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class _{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class ye{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Te}}class ge{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function ke(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class De{registerFlag(r){ke(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===b.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===b.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,P])=>(ke(f),P===b.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function yt(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class Dt{static create(r){var o,c;const f=_t(r),P=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",F=((c=r.header)===null||c===void 0?void 0:c.value)||(U=>`Bearer ${U}`);return new Dt(r.identityApi,f,P,F)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:P}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof P!="string"||!P||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(P)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function _t(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?Ut(a.urlPrefixAllowlist):a.config?Ut([a.config.getString("backend.baseUrl")]):()=>!1}function Ut(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function nn(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class Ot{apply(r){return async(o,c)=>{const f=new Request(o,c),P="plugin://";if(!f.url.startsWith(P))return r(o,c);const{hostname:F,pathname:U,search:ne,hash:Ze,username:$e,password:xt}=new URL(`http://${f.url.substring(P.length)}`);let it=await this.discoveryApi.getBaseUrl(F);if($e||xt){const Kt=new URL(it),pn=`${$e}${xt?`:${xt}`:""}@`;it=`${Kt.protocol}//${pn}${Kt.host}${Kt.pathname}`}const Et=`${nn(it,U)}${ne}${Ze}`;return r(Et,typeof o=="string"||rn(o)?c:o)}}constructor(r){this.discoveryApi=r}}function rn(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Gn{static resolvePluginProtocol(r){return new Ot(r.discoveryApi)}static injectIdentityAuth(r){return Dt.create(r)}constructor(){}}function En(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function $n(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class Bn{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>En(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>$n(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new ft(this.getCurrentPending())}}class qn{createAuthRequester(r){const o=new Bn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const P=this.currentRequests.slice(),F=this.makeAuthRequest(f,r);F?P[c]=F:delete P[c],this.currentRequests=P,this.subject.next(P.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new ft([]),this.currentRequests=[],this.handlerCount=0}}const Wt=new Map;class x{static create(r){var o;return new x((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(P,F)=>(typeof F=="object"&&F!==null&&Object.freeze(F),F)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Wt.has(o)||Wt.set(o,new x(o,this.errorApi)),Wt.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(se())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var u=t(64279);function y(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:m.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:P}=o.shift();m.Children.forEach(c,F=>{if(!(0,m.isValidElement)(F))return;const U={};for(const ne in r)if(r.hasOwnProperty(ne)){const Ze=r[ne];U[ne]=Ze.visit(Ze.accumulator,F,f,P[ne])}for(const ne of a.discoverers){const Ze=ne(F);Ze&&o.push({node:Ze,parent:F,contexts:U})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function j(a,r){return()=>({accumulator:a(),visit:r})}function H(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function de(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const he=j(()=>new Set,(a,r)=>{const o=(0,b.IY)(r,"core.plugin");o&&a.add(o)}),Ie=a=>{const{children:r}=a,o=(0,b.h_)(b.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,b.R5)(Ie,"core.featureFlagged",!0);const et={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function $t(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function Rt(a,r=new Array){return m.Children.forEach(a,o=>{if(!(0,m.isValidElement)(o))return;const c=(0,b.IY)(o,"core.mountPoint");if(c){const f=(0,b.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}Rt(o.props.children,r)}),r}const _n=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,P;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const F=(f=r.props)===null||f===void 0?void 0:f.path,U=(0,b.IY)(r,"core.mountPoint");if(U&&F)throw new Error(`Path property may not be set directly on a routable extension "${$t(r)}"`);var ne;const Ze=(ne=c==null||(P=c.obj)===null||P===void 0?void 0:P.children)!==null&&ne!==void 0?ne:a.objects;if(F!==void 0){if(typeof F!="string")throw new Error(`Element path must be a string at "${$t(r)}"`);const Et=F.startsWith("/")?F.slice(1):F,Kt=r.props.element;if((0,b.IY)(r,"core.gatherMountPoints")){var $e;if(Kt)throw new Error(`Mount point gatherers may not have an element prop "${$t(r)}"`);const pn={path:Et,element:"gathered",routeRefs:new Set,caseSensitive:Boolean(($e=r.props)===null||$e===void 0?void 0:$e.caseSensitive),children:[et],plugin:void 0};return Ze.push(pn),{obj:pn,gatherPath:Et,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Kt){var xt;const[pn,...Sn]=Rt(Kt);if(Sn.length>0)throw new Error(`Route element with path "${F}" may not contain multiple routable extensions`);if(!pn)return c;const{routeRef:sr,plugin:Pn}=pn,Vn={path:Et,element:"mounted",routeRefs:new Set([sr]),caseSensitive:Boolean((xt=r.props)===null||xt===void 0?void 0:xt.caseSensitive),children:[et],plugin:Pn};return Ze.push(Vn),a.paths.set(sr,Et),a.parents.set(sr,c==null?void 0:c.routeRef),{obj:Vn,routeRef:sr!=null?sr:c==null?void 0:c.routeRef,gatherPath:Et,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(U){var it;if(!(c!=null&&c.gatherPath))throw new Error(`Routable extension "${$t(r)}" with mount point "${U}" must be assigned a path`);return c==null||(it=c.obj)===null||it===void 0||it.routeRefs.add(U),a.paths.set(U,c.gatherPath),a.parents.set(U,c==null?void 0:c.gatherRouteRef),{...c,routeRef:U}}return c}),fr=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,P,F;if((o==null?void 0:o.props.element)===r)return c;let U=c==null?void 0:c.obj,ne=c==null?void 0:c.routeRef,Ze=c==null?void 0:c.sticky;const $e=(f=r.props)===null||f===void 0?void 0:f.path;var xt;const it=(xt=U==null?void 0:U.children)!==null&&xt!==void 0?xt:a.objects,Et=Boolean((P=r.props)===null||P===void 0?void 0:P.caseSensitive);let Kt=c==null?void 0:c.path;if((0,b.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");Kt=$e}const pn=(F=r.props)===null||F===void 0?void 0:F.element;let Sn=(0,b.IY)(r,"core.mountPoint");if(!Sn&&(0,m.isValidElement)(pn)&&(Sn=(0,b.IY)(pn,"core.mountPoint")),Sn){let Vn=$e;if(Kt&&(Vn?Kt=void 0:Vn=Kt),!Vn)throw new Error("Mounted routable extension must have a path");a.paths.set(Sn,Vn),ne&&Ze?(a.parents.set(Sn,ne),$e&&(ne=Sn,Ze=!1)):(a.parents.set(Sn,ne),ne=Sn),$e?(U={caseSensitive:Et,path:$e,element:"mounted",routeRefs:new Set([Sn]),children:[et],plugin:(0,b.IY)(r.props.element,"core.plugin")},it.push(U)):U==null||U.routeRefs.add(Sn)}if((0,b.IY)(r,"core.gatherMountPoints")&&(Ze=!0),(0,b.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");if(!Sn){var Pn;U={caseSensitive:Et,path:$e,element:"gathered",routeRefs:new Set,children:[et],plugin:c==null||(Pn=c.obj)===null||Pn===void 0?void 0:Pn.plugin},it.push(U)}}return{obj:U,path:Kt,routeRef:ne,sticky:Ze}}),es=j(()=>new Set,(a,r)=>{if(r.type===Ie){const o=r.props;a.add("with"in o?o.with:o.without)}}),ar=(0,Xe.uW)("route-ref-type",()=>Symbol("route-ref-type"));function $r(a){return a[ar]==="absolute"}function Br(a){return a[ar]==="sub"}function jr(a){return a[ar]==="external"}function gr(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function ts(a,r,o){let c,f="";if($r(a))c=a;else if(Br(a))c=a.parent,f=a.path;else if(jr(a)){const U=o.get(a);if(!U)return[void 0,""];if($r(U))c=U;else if(Br(U))c=U.parent,f=U.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${U}`)}else throw a[ar]?new Error(`Unknown or invalid route ref type, ${a[ar]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const P=r.get(c);if(P===void 0)return[void 0,""];const F=gr(P,f);return[c,F]}function Zr(a,r,o,c,f){var P;const F=(P=(0,z.fp)(f,r))!==null&&P!==void 0?P:[],U=Array();let ne=-1;for(let xt=a;xt&&(ne=F.findIndex(it=>it.route.routeRefs.has(xt)),ne===-1);xt=c.get(xt))U.unshift(xt);U.length===0&&(ne-=1);const Ze=ne===-1?"":F[ne].pathname,$e=U.slice(0,-1).map(xt=>{const it=o.get(xt);if(it===void 0)throw new Error(`No path for ${xt}`);if(it.includes(":"))throw new Error(`Cannot route to ${a} with parent ${xt} as it has parameters`);return it});return`${gr(Ze,...$e)}/`}class ns{resolve(r,o){const[c,f]=ts(r,this.routePaths,this.routeBindings);if(!c)return;let P;typeof o=="string"?P=this.trimPath(o):o.pathname?P={...o,pathname:this.trimPath(o.pathname)}:P=o;const F=this.appBasePath+Zr(c,P,this.routePaths,this.routeParents,this.routeObjects);return(...[ne])=>gr(F,(0,z.Gn)(f,ne))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,P){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=P}}const Zn=(0,Xe.CT)("routing-context"),Dn=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:P})=>{const F=new ns(a,r,o,c,f),U=(0,Xe.EI)({1:F});return(0,n.jsx)(Zn.Provider,{value:U,children:P})},lr=(a,r)=>{try{var o,c;const f=(0,z.fp)(r,{pathname:a}),P=(o=f==null?void 0:f.filter(U=>{var ne;return((ne=U==null?void 0:U.route.routeRefs)===null||ne===void 0?void 0:ne.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!P)return{};let F;return P.routeRefs.size===1&&(F=P.routeRefs.values().next().value),{extension:"App",pluginId:((c=P.plugin)===null||c===void 0?void 0:c.getId())||"root",...F?{routeRef:F.id}:{}}}catch{return{}}},mr=({pathname:a,search:r,hash:o})=>{const c=(0,b.z$)();return(0,m.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Dr=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,z.TH)();return(0,n.jsx)(b.fC,{attributes:lr(r,a),children:(0,n.jsx)(mr,{pathname:r,search:o,hash:c})})};function rs(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,P="";for(;f;){const U=a.get(f);if(U===void 0)throw new Error(`No path for ${f}`);P=gr(U,P),f=r.get(f)}const F=P.match(/:(\w+)/g);if(F){for(let U=0;U<F.length;U++)for(let ne=U+1;ne<F.length;ne++)if(F[ne]===F[U])throw new Error(`Parameter ${F[ne]} is duplicated in path ${P}`)}}}function Nr(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const ss=(0,Xe.CT)("app-context"),os=({appContext:a,children:r})=>{const o=(0,Xe.EI)({1:a});return(0,n.jsx)(ss.Provider,{value:o,children:r})};function vr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function vn(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Nn{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw vr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return vn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw vr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return vn("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return vn("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var yr=t(72164);function Rs(a,r,o){if(a!==void 0){const f=o.find(P=>P.id===a);if(f)return f}if(r){const f=o.find(P=>P.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Er=()=>{const a=(0,m.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,m.useState)(a.matches);return(0,m.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Ar({children:a}){const r=(0,b.h_)(b.hg),o=(0,yr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Er():!1,f=Rs(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const is=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Ls{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Hn(new Map(this.apis))}constructor(){this.apis=[]}}class Hn{static builder(){return new Ls}static from(r){return new Hn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Hn(new Map([[r.id,o]]))}with(r,o){return new Hn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Ps(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[P,F]of Object.entries(f)){const U=c[P];if(!U)throw new Error(`Key ${P} is not an existing external route`);if(!F&&!U.optional)throw new Error(`External route ${P} is required but was undefined`);F&&r.set(U,F)}}}),r}function Fr(){const[a]=(0,z.is)((0,n.jsx)(z.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Tr=(0,m.createContext)({routeObjects:[]});function Ir(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function as(a,r,o){const c=Boolean(a),f=(0,u.default)(a||(()=>Promise.resolve([])));let P;if(c&&f.loading){const{Progress:Ze}=r;P=(0,n.jsx)(Ze,{})}else if(f.error){const{BootErrorPage:Ze}=r;P=(0,n.jsx)(Ze,{step:"load-config",error:f.error})}const{ThemeProvider:F=Ar}=r;if(P)return{node:(0,n.jsx)(Ue,{apis:Hn.with(b.hg,o),children:(0,n.jsx)(F,{children:P})})};var U;return{api:Ht.fromConfigs((U=f.value)!==null&&U!==void 0?U:[])}}class ls{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class cs{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new ls(this);let o=!1;return({children:f})=>{const P=(0,m.useMemo)(()=>Q.createWithStorage(this.themes),[]),{routing:F,featureFlags:U,routeBindings:ne}=(0,m.useMemo)(()=>{const it=y({root:f,discoverers:[H,de],collectors:{routing:Fr()?fr:_n,collectedPlugins:he,featureFlags:es}});return it.collectedPlugins.forEach(Et=>this.plugins.add(Et)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...it,routeBindings:Ps(this.bindRoutes)}},[f]);o||(o=!0,rs(F.paths,F.parents),Nr(ne,this.plugins));const Ze=as(this.configLoader,this.components,P),$e="api"in Ze;if($e){const{api:it}=Ze;this.configApi=it}if((0,m.useEffect)(()=>{if($e){const it=this.getApiHolder().get(b.W0);for(const Et of this.plugins.values())if("getFeatureFlags"in Et)for(const Kt of Et.getFeatureFlags())it.registerFlag({name:Kt.name,pluginId:Et.getId()});else for(const Kt of Et.output())Kt.type==="feature-flag"&&it.registerFlag({name:Kt.name,pluginId:Et.getId()});for(const Et of U)it.registerFlag({name:Et,pluginId:""})}},[$e,Ze,U]),"node"in Ze)return Ze.node;const{ThemeProvider:xt=Ar}=this.components;return(0,n.jsx)(Ue,{apis:this.getApiHolder(),children:(0,n.jsx)(os,{appContext:r,children:(0,n.jsx)(xt,{children:(0,n.jsx)(Dn,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:ne,basePath:Ir(Ze.api),children:(0,n.jsx)(Tr.Provider,{value:{routeObjects:F.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:P,children:F})=>{const[U,ne]=(0,m.useState)(),Ze=(0,b.h_)(b.Ds),$e=Ir(Ze);return U?(this.appIdentityProxy.setTarget(U,{signOutTargetUrl:$e||"/"}),F):(0,n.jsx)(P,{onSignInSuccess:ne})};return({children:P})=>{const F=(0,b.h_)(b.Ds),U=Ir(F),ne=`${U}/*`,{routeObjects:Ze}=(0,m.useContext)(Tr);return o?(0,n.jsxs)(r,{children:[(0,n.jsx)(Dr,{routeObjects:Ze}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:ne,element:(0,n.jsx)(n.Fragment,{children:P})})})})]}):(this.appIdentityProxy.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:U||"/"}),(0,n.jsxs)(r,{children:[(0,n.jsx)(Dr,{routeObjects:Ze}),(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:ne,element:(0,n.jsx)(n.Fragment,{children:P})})})]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return ze.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>Q.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.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:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new De});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return ze.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new ze(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new Nn;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:is;var P;this.defaultApis=(P=r.defaultApis)!==null&&P!==void 0?P:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new lt}}function ds(a){return new cs(a)}let Ur=!1;const Mr=a=>{const r=(0,b.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,m.useMemo)(()=>Fr(),[]),P=[...(0,b.vJ)(a.children,F=>F.getElements().flatMap(U=>{let ne=U.props.path;if(ne==="")return[];var Ze;ne=(Ze=ne==null?void 0:ne.replace(/\/\*$/,""))!==null&&Ze!==void 0?Ze:"/";let $e=c?U:U.props.element;return!c&&!$e&&($e=U,Ur||(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] />} />."),Ur=!0)),[{path:ne,element:$e,children:U.props.children?[{path:ne==="/"?"/":"*",element:U.props.children}]:void 0}]}).sort((U,ne)=>ne.path.localeCompare(U.path)).map(U=>({...U,path:U.path==="/"?"/":`${U.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,z.V$)(P)};var Rr=t(25488);const er=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:a})=>E.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new Ge}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new V}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:a})=>{const r=new _(a,new ye);return ge.forward(r,{hidden:!1}),r}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:a})=>x.create({errorApi:a})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>yt({middleware:[Gn.resolvePluginProtocol({discoveryApi:o}),Gn.injectIdentityAuth({identityApi:r,config:a})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new qn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ln.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>wt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>mt.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ae.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Nt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>oe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>pe.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>be.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Rr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:a,discovery:r,identity:o})=>Rr.iM.create({config:a,discovery:r,identity:o})})];var sn=t(77277),Bt=t(1515),zr=t(62833);function us({children:a}){return(0,z.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(z.VA,{children:a})}const Vr=()=>(0,n.jsx)(Bt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),hs=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(us,{children:(0,n.jsx)(Bt.mf,{status:"501",statusMessage:o})})},ps=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Bt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(sn.Z,{variant:"outlined",onClick:r,children:"Retry"})}),fs={Progress:Bt.Ex,Router:zr.VK,NotFoundErrorPage:Vr,BootErrorPage:hs,ErrorBoundaryFallback:ps};var gs=t(43642),Hr=t(80079),xr=t(90941),ks=t(32915),ms=t(40562),Wr=t(21853),vs=t(60744),Os=t(66569),ys=t(30254),$s=t(13384),po=t(15933),v=t(58838),S=t(86737),L=t(4989),N=t(44407),X=t(18628),q=t(84219),le=t(98685),me=t(39781);const Se={brokenImage:Hr.Z,catalog:X.Z,scaffolder:ks.Z,techdocs:ms.Z,search:Wr.Z,chat:vs.Z,dashboard:Os.Z,docs:ys.Z,email:$s.Z,github:v.Z,group:q.Z,help:S.Z,"kind:api":po.Z,"kind:component":N.Z,"kind:domain":gs.Z,"kind:group":q.Z,"kind:location":L.Z,"kind:system":xr.Z,"kind:user":le.Z,user:le.Z,warning:me.Z};var Ne=t(73689),Me=t(48032);const Le={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")`},Ke={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 ut(a){const{colors:r,shape:o,options:c}=a,P=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,F=`${o}, ${P}`;var U;const ne=(U=c==null?void 0:c.fontColor)!==null&&U!==void 0?U:"#FFFFFF";return{colors:r,shape:o,backgroundImage:F,fontColor:ne}}const vt={home:ut({colors:Ke.teal,shape:Le.wave}),documentation:ut({colors:Ke.pinkSea,shape:Le.wave2}),tool:ut({colors:Ke.purpleSky,shape:Le.round}),service:ut({colors:Ke.marineBlue,shape:Le.wave}),website:ut({colors:Ke.veryBlue,shape:Le.wave}),library:ut({colors:Ke.rubyRed,shape:Le.wave}),other:ut({colors:Ke.darkGrey,shape:Le.wave}),app:ut({colors:Ke.toastyOrange,shape:Le.wave}),apis:ut({colors:Ke.teal,shape:Le.wave2}),card:ut({colors:Ke.greens,shape:Le.wave})},Je=16,Lt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Qt(a){const{palette:r,htmlFontSize:o=Je,fontFamily:c=Lt,defaultPageTheme:f,pageTheme:P=vt}=a;if(!P[f])throw new Error(`${f} is not defined in pageTheme.`);var F;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,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:P[f],getPageTheme:({themeId:U})=>(F=P[U])!==null&&F!==void 0?F:P[f]}}function Fn(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Me.darken)(a.palette.link,.3),background:(0,Me.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.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:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.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 An(a){const r=Qt(a),o=(0,Ne.Z)(r),c=Fn(o);return{...o,overrides:c}}var tr=t(34505);const hn=An({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",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:tr.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:vt}),yn=An({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",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:tr.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:vt});var Tn=t(98192),br=t(15222),Sr=t(41547),wr=t(87561);const xn=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(br.Z,{}),Provider:({children:a})=>(0,n.jsx)(Sr.Z,{theme:hn,children:(0,n.jsx)(wr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(Tn.Z,{}),Provider:({children:a})=>(0,n.jsx)(Sr.Z,{theme:yn,children:(0,n.jsx)(wr.ZP,{children:a})})}];function on(a){var r,o,c;return ds({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...fs,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:er,icons:{...Se,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:xn})}var nr=t(25271),fo=t(76635);async function ii({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,fo.isArray)(c))return;var f;const P=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(fo.isString).map(F=>F.split(":")).filter(F=>F.length===4&&F[0]==="entity").map(([F,U,ne,Ze])=>(0,nr.eE)({kind:U,namespace:ne,name:Ze})).forEach(F=>P.add(F)),await o.set("entityRefs",Array.from(P)),await r.remove("starredEntities")}class ai{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(se())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),ii(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var zi=t(33414),Vi=t(79324),Lr=t(79692),go=t(23362);const mo=(0,Lr.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function li(a){var r,o;const c=a.result,f=mo(),P=useAnalytics(),F=()=>{P.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:F,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var ci=t(86359),gn=t(46285),xs=t(95544),vo=t(99688),Bs=t(12231),Zs=t(86136),Gr=t(49378),di=t(85256),bs=t(61837),yo=t(79784),Ds=t(50758),Ns=t(31654),xo=t(43054),cr=t(51666);const Pr="catalog-entity",bo=(0,cr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Pr}),So=(0,cr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Fs=(0,cr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Pr}),ui=(0,cr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Pr}),wo=(0,cr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Co=(0,cr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Us=(0,cr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),hi=[bo,So,Fs,ui,wo,Co,Us];var Ms=t(49166);function jo(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,P=typeof(r==null?void 0:r.disableUnregister)=="boolean";var F;const U=(F=!o||(P?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&F!==void 0?F:!1;let ne=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(ne=(0,n.jsxs)(Bs.Z,{onClick:()=>{f(),c()},disabled:U,children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ms.Z,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:ne})}const zs=(0,Lr.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Vs(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[P,F]=(0,m.useState)(),U=zs(),Ze=(0,gn.N$)(Fs).allowed,$e=Et=>{F(Et.currentTarget)},xt=()=>{F(void 0)},it=r&&[...r.map(Et=>(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),Et.onClick()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Et.Icon,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:Et.title})]},Et.title)),(0,n.jsx)(di.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!P,role:"button",onClick:$e,"data-testid":"menu-button",className:U.button,id:"long-menu",children:(0,n.jsx)(xo.Z,{})}),(0,n.jsx)(yo.ZP,{open:Boolean(P),onClose:xt,anchorEl:P,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Ds.Z,{children:[it,(0,n.jsx)(jo,{unregisterEntityOptions:o,isUnregisterAllowed:Ze,onUnregisterEntity:c,onClose:xt}),(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),f()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ns.Z,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:"Inspect entity"})]})]})})]})}const Hs="plugin.catalog.entityLayoutRoute",Ws=()=>null;(0,b.R5)(Ws,Hs,!0),(0,b.R5)(Ws,"core.gatherMountPoints",!0);function Eo(a){const{entity:r,title:o}=a;return(0,n.jsxs)(xs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(xs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(gn.LH,{entity:r})]})}function Gs(a,r,o,c){var f;const P=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var F;const U=(F=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&F!==void 0?F:"";var ne,Ze,$e;return{headerTitle:`${($e=(Ze=(ne=c==null?void 0:c.metadata.title)!==null&&ne!==void 0?ne:o)!==null&&Ze!==void 0?Ze:c==null?void 0:c.metadata.name)!==null&&$e!==void 0?$e:""}${U&&U!==nr.zG?` in ${U}`:""}`,headerType:(()=>{let it=P.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(it+=" \u2014 ",it+=c.spec.type.toLocaleLowerCase("en-US")),it})()}}function Ao(a){var r;const{entity:o}=a,c=(0,gn.hF)(o,nr.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Bt.i9,{label:"Owner",value:(0,n.jsx)(gn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Bt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Un=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:P,NotFoundComponent:F}=a,{kind:U,namespace:ne,name:Ze}=(0,b.Oi)(gn.wi),{entity:$e,loading:xt,error:it}=(0,gn.ce)(),Et=(0,z.TH)(),Kt=(0,b.vJ)(P,Xo=>Xo.selectByComponentData({key:Hs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Cr})=>{if($e){if(Cr.if&&!Cr.if($e))return[]}else return[];return[{path:Cr.path,title:Cr.title,children:Cr.children,tabProps:Cr.tabProps}]}),[$e]),{headerTitle:pn,headerType:Sn}=Gs(U,ne,Ze,$e),[sr,Pn]=(0,m.useState)(!1),[Vn,Jr]=(0,m.useState)(!1),Qr=(0,z.s0)(),Qo=async()=>{Pn(!1),Jr(!1),Qr("/")};(0,m.useEffect)(()=>{Pn(!1),Jr(!1)},[Et.pathname]);var Xr;return(0,n.jsxs)(Bt.T3,{themeId:(Xr=$e==null||(r=$e.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Xr!==void 0?Xr:"home",children:[(0,n.jsx)(Bt.h4,{title:(0,n.jsx)(Eo,{title:pn,entity:$e}),pageTitleOverride:pn,type:Sn,children:$e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ao,{entity:$e}),(0,n.jsx)(Vs,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Pn(!0),onInspectEntity:()=>Jr(!0)})]})}),xt&&(0,n.jsx)(Bt.Ex,{}),$e&&(0,n.jsx)(Bt.tn,{routes:Kt}),it&&(0,n.jsx)(Bt.VY,{children:(0,n.jsx)(vo.Z,{severity:"error",children:it.toString()})}),!xt&&!it&&!$e&&(0,n.jsx)(Bt.VY,{children:F||(0,n.jsxs)(Bt.GB,{title:"Entity not found",children:["There is no ",U," with the requested"," ",(0,n.jsx)(Bt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(gn.pp,{open:sr,entity:$e,onConfirm:Qo,onClose:()=>Pn(!1)}),(0,n.jsx)(gn.U_,{open:Vn,entity:$e,onClose:()=>Jr(!1)})]})};Un.Route=Ws;var Hi=t(23054);function Wi(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[P,F]=useState(!1),U=useApi(catalogApiRef),ne=useApi(alertApiRef),Ze=async()=>{F(!0);try{const $e=f.metadata.uid;await U.removeEntityByUid($e),c()}catch($e){assertError($e),ne.post({message:$e.message})}finally{F(!1)}};return _jsxs(Dialog,{open:r,onClose:o,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:P,onClick:Ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Ss=t(19625);function Gi(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ki(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),P=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:P,onClose:()=>c(!1)})]})}var pi=t(29644);const fi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function To(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var P,F;return{errors:((F=(P=f.entity.status)===null||P===void 0?void 0:P.items)!==null&&F!==void 0?F:[]).filter(fi).map(Ze=>Ze.error).filter(Ze=>Boolean(Ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ws(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await To(stringifyEntityRef(a),o)).items.length>0}function Yi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:P}=useAsync(async()=>To(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!P?null:_jsx(_Fragment,{children:P.items.map((F,U)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(F.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:F.entity})]}),F.errors.map((ne,Ze)=>_jsx(ResponseErrorPanel,{error:ne},Ze))]},U))})}const Io="core.backstage.entitySwitch",Ks=a=>null;(0,b.R5)(Ks,Io,!0);const Ro=a=>{var r;const{entity:o,loading:c}=(0,gn.ce)(),f=(0,b.I_)(),P=(0,b.vJ)(a.children,ne=>ne.selectByComponentData({key:Io,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ze=>{if(c)return[];const{if:$e,children:xt}=Ze.props;if(!o)return[{if:$e===void 0,children:xt}];var it;return[{if:(it=$e==null?void 0:$e(o,{apis:f}))!==null&&it!==void 0?it:!0,children:xt}]}),[f,o,c]);if(P.some(ne=>typeof ne.if=="object"&&"then"in ne.if))return(0,n.jsx)(Cs,{results:P});var U;return(U=(r=P.find(ne=>ne.if))===null||r===void 0?void 0:r.children)!==null&&U!==void 0?U:null};function Cs({results:a}){const{loading:r,value:o}=(0,u.default)(async()=>{const c=a.map(async({if:P,children:F})=>{try{if(await P)return F}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}Ro.Case=Ks;const gi=null,mi=gn._i.Filters,vi=gn._i.Content,bn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:gn.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:a,fetchApi:r})=>new pi.MS({discoveryApi:a,fetchApi:r})}),(0,b.ni)({api:gn.p3,deps:{storageApi:b.E6},factory:({storageApi:a})=>new ai({storageApi:a})})],routes:{catalogIndex:Ss._Z,catalogEntity:gn.wi},externalRoutes:{createComponent:Ss.yw,viewTechDoc:Ss.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Mn=bn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Ss._Z})),Kr=bn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:gn.wi})),Lo=bn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),Po=bn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),rr=bn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),yi=bn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),ko=bn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),xi=bn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Ji=bn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Kn=bn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Oo=bn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),js=bn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Es=t(32838);class Yr{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(r,o){const f=`${await this.getApiOrigin()}/${o}`,P=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(P.status===404)throw new Error("Page not found");return P.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class Ys{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Js=[(0,b.ni)({api:fe.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Yr({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:fe.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Ys({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:Es.q3,deps:{configApi:b.Ds},factory:({configApi:a})=>Es.ae.fromConfig(a)})],Qs={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},$o={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function kr(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Bo(){const a=await is(),r=await kr();return[...a,{context:"detected",data:r?Qs:$o}]}var Xs=t(86689),Zo=t(58845);const _s=(0,Lr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var eo=()=>{const a=_s();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.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 to=(0,Lr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var As=()=>{const a=to();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.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 Fo=(0,Lr.Z)({root:{width:Bt.po.drawerWidthClosed,height:3*Bt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Bt.po.drawerWidthClosed,marginLeft:24}}),Uo=()=>{const a=Fo(),{isOpen:r}=(0,Bt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Xs.Z,{component:zr.OL,to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(eo,{}):(0,n.jsx)(As,{})})})},Mo=({children:a})=>(0,n.jsxs)(Bt.tR,{children:[(0,n.jsxs)(Bt.YE,{children:[(0,n.jsx)(Uo,{}),(0,n.jsx)(Bt.v7,{}),(0,n.jsx)(Bt.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var zo=t(80030),Vo=t(32388),Ho=t(4142);const Wo=(0,Lr.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var zn;(function(a){a.LIGHT="light",a.DARK="dark"})(zn||(zn={}));const no=()=>{const a=(0,b.h_)(b.hg),r=Wo(),[o,c]=(0,m.useState)(a.getActiveThemeId()===zn.DARK?zn.DARK:zn.LIGHT),f={[zn.LIGHT]:{icon:Ho.Z,title:"Dark theme"},[zn.DARK]:{icon:Vo.Z,title:"Light theme"}},{title:P,icon:F}=f[o],U=()=>{c(ne=>{const Ze=ne===zn.LIGHT?zn.DARK:zn.LIGHT;return a.setActiveThemeId(Ze),Ze})};return(0,n.jsx)(xs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(zo.ZP,{title:P,arrow:!0,children:(0,n.jsx)(bs.Z,{size:"small",onClick:U,children:(0,n.jsx)(F,{className:r.headerIcon})})})})},Go=()=>(0,n.jsxs)(A.I6,{children:[(0,n.jsx)(D.S,{}),(0,n.jsx)(K.F,{withSearch:!1})]}),Ko=(0,n.jsx)(Go,{}),ro=on({apis:Js,configLoader:Bo,plugins:Object.values(h)}),so=ro.getProvider(),Yo=ro.getRouter(),oo=A.s4.provide((0,fe.KY)({name:"ThemeToggleAddon",component:no,location:fe.oZ.Header})),In=(0,n.jsxs)(Mr,{children:[(0,n.jsx)(z.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(z.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Kr,{})}),(0,n.jsx)(z.AW,{path:"/docs",element:(0,n.jsx)(A.Jl,{}),children:(0,n.jsx)(I.u,{})}),(0,n.jsxs)(z.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(A.I6,{}),children:[Ko,(0,n.jsx)(fe.DR,{children:(0,n.jsx)(oo,{})})]})]});var Jo=()=>(0,n.jsx)(so,{children:(0,n.jsx)(Yo,{children:(0,n.jsx)(Mo,{children:In})})});T.render((0,n.jsx)(Jo,{}),document.getElementById("root"))},51837:function(bt,Pe,t){"use strict";t.d(Pe,{CT:function(){return b},EI:function(){return ee},uW:function(){return T},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),m=Y=>`__@backstage/${Y}__`;function T(Y,J){const D=m(Y);let K=n[D];return K||(K=J(),n[D]=K,K)}var z=t(2784);function b(Y){return T(Y,()=>(0,z.createContext)(void 0))}function l(Y){return(0,z.useContext)(b(Y))}function $(Y){return{set(J){globalThis[`__@backstage/${Y}__`]=createContext(createVersionedValueMap(J))},reset(){delete globalThis[`__@backstage/${Y}__`]}}}function ee(Y){return Object.freeze(Y),{atVersion(J){return Y[J]}}}},46285:function(bt,Pe,t){"use strict";t.d(Pe,{h$:function(){return te},n3:function(){return h.n3},_i:function(){return k},zo:function(){return un},df:function(){return Ht},UO:function(){return xe},dq:function(){return ye},nl:function(){return $s},dx:function(){return Nt},rI:function(){return dn},u3:function(){return Ut},xE:function(){return Gn},sL:function(){return Bn},LH:function(){return j},U_:function(){return Bt},pp:function(){return fs},EW:function(){return Wr},Ah:function(){return m},wi:function(){return St},hF:function(){return rt},CV:function(){return gt},$3:function(){return zt},p3:function(){return T},ce:function(){return qe},X2:function(){return Ye},wp:function(){return Te},ZW:function(){return pe},N$:function(){return be},eK:function(){return wt},CR:function(){return It}});var h=t(29644),n=t(25248);const m=(0,n.T0)({id:"plugin.catalog.service"}),T=(0,n.T0)({id:"catalog-react.starred-entities"});var z=t(82394);class b{async toggleStarred(S){this.starredEntities.delete(S)||this.starredEntities.add(S);for(const L of this.subscribers)L.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(S=>(S.next(new Set(this.starredEntities)),this.subscribers.add(S),()=>{this.subscribers.delete(S)}))}}var l=t(52322),$=t(2784),ee=t(41156),Y=t(60364),J=t(77277),D=t(4190),K=t(95544),W=t(90436),ae=t(60905),ie=t(36444);const R=v=>{const S=(0,ee.Z)(q=>q.breakpoints.down("md")),L=(0,Y.Z)(),[N,X]=(0,$.useState)(!1);return S?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(J.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>X(!0),startIcon:(0,l.jsx)(ie.Z,{}),children:"Filters"}),(0,l.jsx)(D.ZP,{open:N,onClose:()=>X(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(K.Z,{m:2,children:[(0,l.jsx)(W.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),v.children]})})]}):(0,l.jsx)(ae.Z,{item:!0,lg:2,children:v.children})},I=v=>(0,l.jsx)(ae.Z,{item:!0,xs:12,lg:10,children:v.children}),k=v=>(0,l.jsx)(ae.Z,{container:!0,style:{position:"relative"},children:v.children});k.Filters=R,k.Content=I;var O=t(51837);const A=(0,O.CT)("entity-context"),te=({children:v,entity:S,loading:L,error:N,refresh:X})=>{const q={entity:S,loading:L,error:N,refresh:X};return(0,l.jsx)(A.Provider,{value:(0,O.EI)({1:q}),children:v})},fe=v=>_jsx(te,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Ye(){const v=(0,O.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const S=v.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");if(!S.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:S.entity}}function qe(){const v=(0,O.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const S=v.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");const{entity:L,loading:N,error:X,refresh:q}=S;return{entity:L,loading:N,error:X,refresh:q}}var He=t(76635),Xe=t(19126),Qe=t.n(Xe),Ue=t(10289),ze=t(69294),tt=t(48760),lt=t(90736);function ct(v){return v.reduce((S,L)=>({...S,...L.getCatalogFilters?L.getCatalogFilters():{}}),{})}function nt(v){return S=>v.every(L=>!L.filterEntity||L.filterEntity(S))}var Ce=t(25271);function rt(v,S,L){var N;let X=(v==null||(N=v.relations)===null||N===void 0?void 0:N.filter(q=>q.type===S).map(q=>(0,Ce.of)(q.targetRef)))||[];return L!=null&&L.kind&&(X=X.filter(q=>q.kind.toLocaleLowerCase("en-US")===L.kind.toLocaleLowerCase("en-US"))),X}function gt(v,S){var L;const N=(L=v.metadata.annotations)===null||L===void 0?void 0:L[Ce.M6];if(!!N)try{const X=(0,Ce.Ou)(N),q=S.byUrl(X.target);return{locationTargetUrl:X.target,integrationType:q==null?void 0:q.type}}catch{return}}function Re(v,S){const L=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),N=getEntityRelations(S,RELATION_OWNED_BY).map(stringifyEntityRef);for(const X of N)if(L.has(X))return!0;return!1}const se=(0,$.createContext)(void 0),xe=({children:v})=>{const S=(0,lt.default)(),L=(0,n.h_)(m),[N,X]=(0,$.useState)({}),q=(0,Ue.TH)();var le;const me=(0,$.useMemo)(()=>(le=Qe().parse(q.search,{ignoreQueryPrefix:!0}).filters)!==null&&le!==void 0?le:{},[q]),[Se,Ne]=(0,$.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Me,error:Le},Ke]=(0,ze.default)(async()=>{const Je=(0,He.compact)(Object.values(N)),Lt=nt(Je),Qt=ct(Je),Fn=ct((0,He.compact)(Object.values(Se.appliedFilters))),An=Object.keys(N).reduce((hn,yn)=>{const Tn=N[yn];return Tn!=null&&Tn.toQueryValue&&(hn[yn]=Tn.toQueryValue()),hn},{});if((0,He.isEqual)(Fn,Qt))Ne({appliedFilters:N,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(Lt)});else{const hn=await L.getEntities({filter:Qt});Ne({appliedFilters:N,backendEntities:hn.items,entities:hn.items.filter(Lt)})}if(S()){var tr;const hn=Qe().parse(q.search,{ignoreQueryPrefix:!0}),yn=Qe().stringify({...hn,filters:An},{addQueryPrefix:!0,arrayFormat:"repeat"}),Tn=`${window.location.pathname}${yn}`;(tr=window.history)===null||tr===void 0||tr.replaceState(null,document.title,Tn)}},[L,me,N,Se],{loading:!0});(0,tt.Z)(Ke,10,[N]);const ut=(0,$.useCallback)(Je=>{X(Lt=>{const Qt=typeof Je=="function"?Je(Lt):Je;return{...Lt,...Qt}})},[]),vt=(0,$.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:ut,queryParameters:me,loading:Me,error:Le}),[Se,ut,me,Me,Le]);return(0,l.jsx)(se.Provider,{value:vt,children:v})};function Te(){const v=(0,$.useContext)(se);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var st=t(64279),ft=t(18149),Ct=t.n(ft),dt=t(829),jt=t.n(dt);const St=(0,O.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Pt(v){var S,L;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(L=(S=v.metadata.namespace)===null||S===void 0?void 0:S.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:v.metadata.name}}function zt(v,S){const L=S==null?void 0:S.defaultKind;let N,X,q;return"metadata"in v?(N=v.kind,X=v.metadata.namespace,q=v.metadata.name):(N=v.kind,X=v.namespace,q=v.name),(X===void 0||X==="")&&(X=Ce.zG),(S==null?void 0:S.defaultNamespace)!==void 0?(S==null?void 0:S.defaultNamespace)===X&&(X=void 0):X===Ce.zG&&(X=void 0),N=N.toLocaleLowerCase("en-US"),N=L&&L.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${X?`${X}/`:""}${q}`}var mt=t(1515),ln=t(80030);const Nt=(0,$.forwardRef)((v,S)=>{const{entityRef:L,defaultKind:N,title:X,children:q,...le}=v,me=(0,n.tg)(St);let Se,Ne,Me;if(typeof L=="string"){const Je=(0,Ce.of)(L);Se=Je.kind,Ne=Je.namespace,Me=Je.name}else"metadata"in L?(Se=L.kind,Ne=L.metadata.namespace,Me=L.metadata.name):(Se=L.kind,Ne=L.namespace,Me=L.name);Se=Se.toLocaleLowerCase("en-US");var Le;Ne=(Le=Ne==null?void 0:Ne.toLocaleLowerCase("en-US"))!==null&&Le!==void 0?Le:Ce.zG;const Ke={kind:Se,namespace:Ne,name:Me},ut=zt({kind:Se,namespace:Ne,name:Me},{defaultKind:N}),vt=(0,l.jsxs)(mt.rU,{...le,ref:S,to:me(Ke),children:[q,!q&&(X!=null?X:ut)]});return X?(0,l.jsx)(ln.ZP,{title:ut,children:vt}):vt});function dn(v){const{entityRefs:S,defaultKind:L,...N}=v;return(0,l.jsx)(l.Fragment,{children:S.map((X,q)=>(0,l.jsxs)($.Fragment,{children:[q>0&&", ",(0,l.jsx)(Nt,{...N,entityRef:X,defaultKind:L})]},q))})}class un{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(S){this.value=S}}class Ln{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(S){this.value=S}}class fn{filterEntity(S){var L;return this.values.every(N=>((L=S.metadata.tags)!==null&&L!==void 0?L:[]).includes(N))}toQueryValue(){return this.values}constructor(S){this.values=S}}class On{filterEntity(S){const L=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([S.metadata.tags]),X=this.toUpperArray([S.metadata.name,S.metadata.title]);for(const q of L)if(N.every(le=>le!==q)&&X.every(le=>!le.includes(q)))return!1;return!0}toUpperArray(S){return S.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(S){this.value=S}}class je{filterEntity(S){return this.values.some(L=>rt(S,Ce.S4).some(N=>zt(N,{defaultKind:"group"})===L))}toQueryValue(){return this.values}constructor(S){this.values=S}}class Ae{filterEntity(S){return this.values.some(L=>{var N;return((N=S.spec)===null||N===void 0?void 0:N.lifecycle)===L})}toQueryValue(){return this.values}constructor(S){this.values=S}}class Be{filterEntity(S){switch(this.value){case"owned":return this.isOwnedEntity(S);case"starred":return this.isStarredEntity(S);default:return!0}}toQueryValue(){return this.value}constructor(S,L,N){this.value=S,this.isOwnedEntity=L,this.isStarredEntity=N}}class We{filterEntity(S){var L;const N=(L=S.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(S){this.value=S}}class _e{filterEntity(S){var L,N,X;const q=((L=S)===null||L===void 0||(N=L.status)===null||N===void 0||(X=N.items)===null||X===void 0?void 0:X.length)>0;return q!==void 0&&this.value===q}constructor(S){this.value=S}}function at(){const v=(0,n.h_)(m),{filters:{kind:S,type:L},queryParameters:{type:N},updateFilters:X}=Te(),q=(0,$.useMemo)(()=>[N].flat().filter(Boolean),[N]);var le;const[me,Se]=(0,$.useState)(q.length?q:(le=L==null?void 0:L.getTypes())!==null&&le!==void 0?le:[]);(0,$.useEffect)(()=>{q.length&&Se(q)},[q]);const[Ne,Me]=(0,$.useState)([]),Le=(0,$.useMemo)(()=>S==null?void 0:S.value,[S]),{error:Ke,loading:ut,value:vt}=(0,st.default)(async()=>Le?await v.getEntityFacets({filter:{kind:Le},facets:["spec.type"]}).then(Qt=>Qt.facets["spec.type"]||[]):[],[Le,v]),Je=(0,$.useRef)(vt);return(0,$.useEffect)(()=>{const Lt=Je.current;if(Je.current=vt,ut||!Le||Lt===vt||!vt)return;const Qt=[...new Set(jt()(vt,An=>-An.count).map(An=>An.value.toLocaleLowerCase("en-US")))];Me(Qt);const Fn=me.filter(An=>Qt.includes(An));Ct()(me,Fn)||Se(Fn)},[ut,Le,me,Se,vt]),(0,$.useEffect)(()=>{X({type:me.length?new Ln(me):void 0})},[me,X]),{loading:ut,error:Ke,availableTypes:Ne,selectedTypes:me,setSelectedTypes:Se}}const pt=20;function wt(v,S){var L,N;const X=S==null||(L=S.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),q=S==null||(N=S.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),le=(0,n.h_)(m),{loading:me,value:Se,error:Ne}=(0,st.default)(async()=>{var Me;const Le=(Me=v.relations)===null||Me===void 0?void 0:Me.map(Je=>({type:Je.type,target:(0,Ce.of)(Je.targetRef)})).filter(Je=>(!X||Je.type.toLocaleLowerCase("en-US")===X)&&(!q||Je.target.kind===q));if(!Le)return[];const Ke=Object.values((0,He.groupBy)(Le,({target:Je})=>`${Je.kind}:${Je.namespace}`.toLocaleLowerCase("en-US"))),ut=[];for(const Je of Ke)ut.push({kind:Je[0].target.kind,namespace:Je[0].target.namespace,nameBatches:(0,He.chunk)(Je.map(Lt=>Lt.target.name),pt)});return(await Promise.all(ut.flatMap(Je=>Je.nameBatches.map(Lt=>le.getEntities({filter:{kind:Je.kind,"metadata.namespace":Je.namespace,"metadata.name":Lt}}))))).flatMap(Je=>Je.items)},[v,X,q]);return{entities:Se,loading:me,error:Ne}}var Tt=t(72164);function kt(v){return typeof v=="string"?v:(0,Ce.eE)(v)}function It(){const v=(0,n.h_)(T),S=(0,Tt.Z)(v.starredEntitie$(),new Set),L=(0,$.useCallback)(X=>S.has(kt(X)),[S]),N=(0,$.useCallback)(X=>v.toggleStarred(kt(X)).then(),[v]);return{starredEntities:S,toggleStarredEntity:N,isStarredEntity:L}}function oe(v){return typeof v=="string"?v:(0,Ce.eE)(v)}function G(v){const S=(0,n.h_)(T),[L,N]=(0,$.useState)(!1);return(0,$.useEffect)(()=>{const q=S.starredEntitie$().subscribe({next(le){N(le.has(oe(v)))}});return()=>{q.unsubscribe()}},[v,S]),{toggleStarredEntity:(0,$.useCallback)(()=>S.toggleStarred(oe(v)).then(),[v,S]),isStarredEntity:L}}function pe(){const v=(0,n.h_)(n.$4),{loading:S,value:L}=(0,st.default)(async()=>{const{ownershipEntityRefs:X}=await v.getBackstageIdentity();return X},[]),N=(0,$.useMemo)(()=>{const X=new Set(L!=null?L:[]);return q=>{const le=rt(q,Ce.S4).map(Ce.eE);for(const me of le)if(X.has(me))return!0;return!1}},[L]);return(0,$.useMemo)(()=>({loading:S,isOwnedEntity:N}),[S,N])}var ve=t(25488);function be(v){const{entity:S,loading:L,error:N}=qe(),{allowed:X,loading:q,error:le}=(0,ve.gI)({permission:v,resourceRef:S?(0,Ce.eE)(S):void 0});return L||q?{loading:!0,allowed:!1}:N?{loading:!1,allowed:!1,error:N}:{loading:!1,allowed:X,error:le}}const Ge=v=>{const{initialFilter:S,hidden:L}=v,{updateFilters:N,queryParameters:{kind:X}}=useEntityList();var q;const[le]=useState((q=[X].flat()[0])!==null&&q!==void 0?q:S);return useEffect(()=>{N({kind:le?new EntityKindFilter(le):void 0})},[le,N]),L?null:_jsx(Alert,{severity:"warning",children:"Kind filter not yet available"})};var V=t(79692),w=t(5806),Q=t(21324),Ee=t(86619),Oe=t(19996),Ve=t(25505),ot=t(38016),Ft=t(88013);const Zt=(0,V.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),qt=(0,l.jsx)(Ve.Z,{fontSize:"small"}),Vt=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ht=()=>{var v;const S=Zt(),{updateFilters:L,backendEntities:N,filters:X,queryParameters:{lifecycles:q}}=Te(),le=(0,$.useMemo)(()=>[q].flat().filter(Boolean),[q]);var me;const[Se,Ne]=(0,$.useState)(le.length?le:(me=(v=X.lifecycles)===null||v===void 0?void 0:v.values)!==null&&me!==void 0?me:[]);(0,$.useEffect)(()=>{le.length&&Ne(le)},[le]),(0,$.useEffect)(()=>{L({lifecycles:Se.length?new Ae(Se):void 0})},[Se,L]);const Me=(0,$.useMemo)(()=>[...new Set(N.map(Le=>{var Ke;return(Ke=Le.spec)===null||Ke===void 0?void 0:Ke.lifecycle}).filter(Boolean))].sort(),[N]);return Me.length?(0,l.jsx)(K.Z,{pb:1,pt:1,children:(0,l.jsxs)(W.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(Ft.ZP,{multiple:!0,options:Me,value:Se,onChange:(Le,Ke)=>Ne(Ke),renderOption:(Le,{selected:Ke})=>(0,l.jsx)(w.Z,{control:(0,l.jsx)(Q.Z,{icon:qt,checkedIcon:Vt,checked:Ke}),label:Le}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Le=>(0,l.jsx)(Ee.Z,{...Le,className:S.input,variant:"outlined"})})]})}):null},jn=(0,V.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),E=(0,l.jsx)(Ve.Z,{fontSize:"small"}),_=(0,l.jsx)(Oe.Z,{fontSize:"small"}),ye=()=>{var v;const S=jn(),{updateFilters:L,backendEntities:N,filters:X,queryParameters:{owners:q}}=Te(),le=(0,$.useMemo)(()=>[q].flat().filter(Boolean),[q]);var me;const[Se,Ne]=(0,$.useState)(le.length?le:(me=(v=X.owners)===null||v===void 0?void 0:v.values)!==null&&me!==void 0?me:[]);(0,$.useEffect)(()=>{le.length&&Ne(le)},[le]),(0,$.useEffect)(()=>{L({owners:Se.length?new je(Se):void 0})},[Se,L]);const Me=(0,$.useMemo)(()=>[...new Set(N.flatMap(Le=>rt(Le,Ce.S4).map(Ke=>zt(Ke,{defaultKind:"group"}))).filter(Boolean))].sort(),[N]);return Me.length?(0,l.jsx)(K.Z,{pb:1,pt:1,children:(0,l.jsxs)(W.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(Ft.ZP,{multiple:!0,options:Me,value:Se,onChange:(Le,Ke)=>Ne(Ke),renderOption:(Le,{selected:Ke})=>(0,l.jsx)(w.Z,{control:(0,l.jsx)(Q.Z,{icon:E,checkedIcon:_,checked:Ke}),label:Le}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"owner-picker-expand"}),renderInput:Le=>(0,l.jsx)(Ee.Z,{...Le,className:S.input,variant:"outlined"})})]})}):null},ge=(0,V.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ke=()=>{var v;const S=ge(),{filters:L,updateFilters:N}=useEntityList();var X;const[q,le]=useState((X=(v=L.text)===null||v===void 0?void 0:v.value)!==null&&X!==void 0?X:"");return useDebounce(()=>{N({text:q.length?new EntityTextFilter(q):void 0})},250,[q,N]),_jsx(Toolbar,{className:S.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:S.input,placeholder:"Search",autoComplete:"off",onChange:me=>le(me.target.value),value:q,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>le(""),edge:"end",disabled:q.length===0,children:_jsx(Clear,{})})})})})})},De=Object.freeze({createEntityRefColumn(v){const{defaultKind:S}=v;function L(N){var X;return((X=N.metadata)===null||X===void 0?void 0:X.title)||zt(N,{defaultKind:S})}return{title:"Name",highlight:!0,customFilterAndSearch(N,X){return L(X).includes(N)},customSort(N,X){return L(N).localeCompare(L(X))},render:N=>{var X;return(0,l.jsx)(Nt,{entityRef:N,defaultKind:S,title:(X=N.metadata)===null||X===void 0?void 0:X.title})}}},createEntityRelationColumn(v){const{title:S,relation:L,defaultKind:N,filter:X}=v;function q(me){return rt(me,L,X)}function le(me){return q(me).map(Se=>zt(Se,{defaultKind:N})).join(", ")}return{title:S,customFilterAndSearch(me,Se){return le(Se).includes(me)},customSort(me,Se){return le(me).localeCompare(le(Se))},render:me=>(0,l.jsx)(dn,{entityRefs:q(me),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Ce.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Ce.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Ce.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,l.jsx)(mt.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),yt=[De.createEntityRefColumn({defaultKind:"system"}),De.createDomainColumn(),De.createOwnerColumn(),De.createMetadataDescriptionColumn()],Dt=[De.createEntityRefColumn({defaultKind:"component"}),De.createSystemColumn(),De.createOwnerColumn(),De.createSpecTypeColumn(),De.createSpecLifecycleColumn(),De.createMetadataDescriptionColumn()],_t=(0,V.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),Ut=v=>{const{entities:S,title:L,emptyContent:N,variant:X="gridItem",columns:q}=v,le=_t(),me={minWidth:"0",width:"100%"};return X==="gridItem"&&(me.height="calc(100% - 10px)"),(0,l.jsx)(mt.iA,{columns:q,title:L,style:me,emptyContent:N&&(0,l.jsx)("div",{className:le.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:S})};Ut.columns=De,Ut.systemEntityColumns=yt,Ut.componentEntityColumns=Dt;const nn=(0,V.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Ot=(0,l.jsx)(Ve.Z,{fontSize:"small"}),rn=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Gn=v=>{var S;const L=nn(),{updateFilters:N,filters:X,queryParameters:{tags:q}}=Te(),le=(0,n.h_)(m),{value:me}=(0,st.default)(async()=>{var Ke;const ut="metadata.tags",{facets:vt}=await le.getEntityFacets({facets:[ut],filter:(Ke=X.kind)===null||Ke===void 0?void 0:Ke.getCatalogFilters()});return Object.fromEntries(vt[ut].map(({value:Je,count:Lt})=>[Je,Lt]))},[X.kind]),Se=(0,$.useMemo)(()=>[q].flat().filter(Boolean),[q]);var Ne;const[Me,Le]=(0,$.useState)(Se.length?Se:(Ne=(S=X.tags)===null||S===void 0?void 0:S.values)!==null&&Ne!==void 0?Ne:[]);return(0,$.useEffect)(()=>{Se.length&&Le(Se)},[Se]),(0,$.useEffect)(()=>{N({tags:Me.length?new fn(Me):void 0})},[Me,N]),Object.keys(me!=null?me:{}).length?(0,l.jsx)(K.Z,{pb:1,pt:1,children:(0,l.jsxs)(W.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(Ft.ZP,{multiple:!0,options:Object.keys(me!=null?me:{}),value:Me,onChange:(Ke,ut)=>Le(ut),renderOption:(Ke,{selected:ut})=>(0,l.jsx)(w.Z,{control:(0,l.jsx)(Q.Z,{icon:Ot,checkedIcon:rn,checked:ut}),label:v.showCounts?`${Ke} (${me==null?void 0:me[Ke]})`:Ke}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ke=>(0,l.jsx)(Ee.Z,{...Ke,className:L.input,variant:"outlined"})})]})}):null};var En=t(82108),$n=t.n(En);const Bn=v=>{const{hidden:S,initialFilter:L}=v,N=(0,n.h_)(n.$v),{error:X,availableTypes:q,selectedTypes:le,setSelectedTypes:me}=at();if((0,$.useEffect)(()=>{X&&N.post({message:"Failed to load entity types",severity:"error"}),L&&me([L])},[X,N,L,me]),q.length===0||X)return null;const Se=[{value:"all",label:"All"},...q.map(Me=>({value:Me,label:$n()(Me)}))];var Ne;return S?null:(0,l.jsx)(K.Z,{pb:1,pt:1,children:(0,l.jsx)(mt.Ph,{label:"Type",items:Se,selected:(Ne=Se.length>1?le[0]:void 0)!==null&&Ne!==void 0?Ne:"all",onChange:Me=>me(Me==="all"?[]:[String(Me)])})})};var qn=t(15459),Wt=t(61837),x=t(11640),u=t(28347);const y=(0,qn.Z)({root:{color:"#f3ba37"}})(x.Z),j=v=>{const{toggleStarredEntity:S,isStarredEntity:L}=G(v.entity);return(0,l.jsx)(Wt.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>S(),children:(0,l.jsx)(ln.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,l.jsx)(y,{}):(0,l.jsx)(u.Z,{})})})};var H=t(8629),de=t(79249),he=t(38724),Ie=t(99152),et=t(6487),$t=t(49429),Rt=t(55999),_n=t(72779),fr=t.n(_n),es=t(39412);const ar=es.Z;function $r(v,S){if(v)return v.toLocaleLowerCase("en-US");if(S)try{return(0,Ce.of)(S).kind.toLocaleLowerCase("en-US")}catch{return}}function Br(v,S){const L=(0,n.qD)(),N=$r(v,S);return N&&L.getSystemIcon(`kind:${N}`)||ar}function jr(v){const{kind:S,entityRef:L,...N}=v,X=Br(S,L);return(0,l.jsx)(X,{...N})}const gr=(0,V.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function ts(v){const S=(0,n.h_)(m),L=(0,Ce.eE)(v),{loading:N,error:X,value:q}=(0,st.default)(async()=>{const le=await S.getEntityAncestors({entityRef:L}),me=new Array,Se=new Array;for(const Ne of le.items){const Me=(0,Ce.eE)(Ne.entity),Le=Me===le.rootEntityRef;me.push({id:Me,root:Le,...Ne.entity});for(const Ke of Ne.parentEntityRefs)Se.push({from:Me,to:Ke})}return{nodes:me,edges:Se}},[L]);return{loading:N,error:X,nodes:(q==null?void 0:q.nodes)||[],edges:(q==null?void 0:q.edges)||[]}}function Zr({node:v}){const S=gr(),L=(0,Ue.s0)(),N=(0,n.tg)(St),[X,q]=(0,$.useState)(0),[le,me]=(0,$.useState)(0),Se=(0,$.useRef)(null);(0,$.useLayoutEffect)(()=>{if(Se.current){let{height:Lt,width:Qt}=Se.current.getBBox();Lt=Math.round(Lt),Qt=Math.round(Qt),(Lt!==le||Qt!==X)&&(q(Qt),me(Lt))}},[X,le]);const Ne=10,Me=le,Le=Me+Ne,Ke=Le+X+Ne*2,ut=le+Ne*2,vt=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?zt({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),Je=()=>{L(N({kind:v.kind,namespace:v.metadata.namespace||Ce.zG,name:v.metadata.name}))};return(0,l.jsxs)("g",{onClick:Je,className:S.clickable,children:[(0,l.jsx)("rect",{className:fr()(S.node,v.root?"secondary":"primary"),width:Ke,height:ut,rx:10}),(0,l.jsx)(jr,{kind:v.kind,y:Ne,x:Ne,width:Me,height:Me,className:fr()(S.text,v.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:Se,className:fr()(S.text,v.root?"secondary":"primary"),y:ut/2,x:Le+(X+Ne*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:vt})]})}function ns(v){const{loading:S,error:L,nodes:N,edges:X}=ts(v.entity);return S?(0,l.jsx)(mt.Ex,{}):L?(0,l.jsx)(mt.Gk,{error:L}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Rt.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,l.jsx)(mt.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,l.jsx)(K.Z,{mt:4,children:(0,l.jsx)(mt.mn,{nodes:N,edges:X,renderNode:Zr,direction:mt.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Zn=t(11776),Dn=t(38402),lr=t(86136),mr=t(99688),Dr=t(49378),rs=t(54506),Nr=t(94339),ss=t(24579),os=t(27685);const vr=(0,V.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function vn(v){const S=vr();return(0,l.jsx)(Dr.Z,{...v,primaryTypographyProps:{className:S.monospace},secondaryTypographyProps:{className:S.monospace}})}function Nn(v){const S=vr();return(0,l.jsx)(rs.Z,{className:S.monospace,children:v.children})}function yr(v){return(0,l.jsx)(K.Z,{mt:2,children:(0,l.jsx)(Nr.Z,{variant:"outlined",children:(0,l.jsxs)(ss.Z,{children:[(0,l.jsxs)(W.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,l.jsx)(Ar,{to:v.helpLink})]}),v.children]})})})}function Rs(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Er(v){const[S,L]=v.entry,N=Rs(L);return(0,l.jsxs)(Dn.Z,{children:[v.indent&&(0,l.jsx)(lr.Z,{}),(0,l.jsx)(vn,{primary:S,secondary:N?(0,l.jsx)(mt.rU,{to:N,children:L}):L})]})}function Ar(v){const S=vr();return(0,l.jsx)(mt.rU,{to:v.to,className:S.helpIcon,children:(0,l.jsx)(os.Z,{fontSize:"inherit"})})}const is=(0,V.Z)({root:{display:"flex",flexDirection:"column"}});function Ls(v){var S,L;const N=(0,n.h_)(m),X=(0,Ce.eE)(v),q=(S=v.metadata.annotations)===null||S===void 0?void 0:S[Ce.P1],le=(L=v.metadata.annotations)===null||L===void 0?void 0:L[Ce.q1],{loading:me,error:Se,value:Ne}=(0,st.default)(async()=>!q&&!le?[]:(await N.getEntities({filter:[...q?[{[`metadata.annotations.${Ce.P1}`]:q}]:[],...le?[{[`metadata.annotations.${Ce.q1}`]:le}]:[]]})).items,[q,le]);return{loading:me,error:Se,location:q,originLocation:le,colocatedEntities:Ne==null?void 0:Ne.filter(Me=>(0,Ce.eE)(Me)!==X)}}function Hn(v){return(0,l.jsxs)(Zn.Z,{dense:!0,children:[v.header&&(0,l.jsx)(Er,{entry:v.header},"header"),v.entities.map(S=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(jr,{kind:S.kind})}),(0,l.jsx)(vn,{primary:(0,l.jsx)(Nt,{entityRef:S})})]},(0,Ce.eE)(S)))]})}function Ps(v){const{entity:S}=v,{loading:L,error:N,location:X,originLocation:q,colocatedEntities:le}=Ls(S);if(L)return(0,l.jsx)(mt.Ex,{});if(N)return(0,l.jsx)(mt.Gk,{error:N});if(!X&&!q)return(0,l.jsx)(mr.Z,{severity:"warning",children:"Entity had no location information."});if(!(le!=null&&le.length))return(0,l.jsx)(mr.Z,{severity:"info",children:"There were no other entities on this location."});if(X===q)return(0,l.jsx)(Hn,{entities:le});const me=le.filter(Ne=>{var Me;return((Me=Ne.metadata.annotations)===null||Me===void 0?void 0:Me[Ce.P1])===X}),Se=le.filter(Ne=>{var Me;return((Me=Ne.metadata.annotations)===null||Me===void 0?void 0:Me[Ce.q1])===q});return(0,l.jsxs)(l.Fragment,{children:[me.length>0&&(0,l.jsx)(Hn,{entities:me,header:["At the same location",X]}),Se.length>0&&(0,l.jsx)(Hn,{entities:Se,header:["At the same origin",q]})]})}function Fr(v){const S=is();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Rt.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,l.jsx)("div",{className:S.root,children:(0,l.jsx)(Ps,{entity:v.entity})})]})}function Tr(v){return Object.fromEntries([...Object.entries(v)].sort((S,L)=>S[0]<L[0]?-1:1))}function Ir(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(mt.Oi,{text:JSON.stringify(Tr(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var as=t(3440),ls=t.n(as);const cs=(0,V.Z)({root:{display:"flex",flexDirection:"column"}});function ds(v){var S,L;const N=cs(),{apiVersion:X,kind:q,metadata:le,spec:me,relations:Se=[],status:Ne={}}=v.entity,Me=ls()(jt()(Se,Le=>Le.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:N.root,children:[(0,l.jsx)(yr,{title:"Identity",children:(0,l.jsxs)(Zn.Z,{dense:!0,children:[(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"apiVersion",secondary:X})}),(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"kind",secondary:q})}),(me==null?void 0:me.type)&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"spec.type",secondary:me.type})}),le.uid&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"uid",secondary:le.uid})}),le.etag&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"etag",secondary:le.etag})})]})}),(0,l.jsxs)(yr,{title:"Metadata",children:[!!Object.keys(le.annotations||{}).length&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsxs)(Nn,{children:["Annotations",(0,l.jsx)(Ar,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(le.annotations).map(Le=>(0,l.jsx)(Er,{indent:!0,entry:Le},Le[0]))}),!!Object.keys(le.labels||{}).length&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:"Labels"}),children:Object.entries(le.labels).map(Le=>(0,l.jsx)(Er,{indent:!0,entry:Le},Le[0]))}),!!(!((S=le.tags)===null||S===void 0)&&S.length)&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:"Tags"}),children:le.tags.map((Le,Ke)=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{}),(0,l.jsx)(vn,{primary:Le})]},`${Le}-${Ke}`))})]}),!!Se.length&&(0,l.jsx)(yr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Me).map(([Le,Ke],ut)=>(0,l.jsx)("div",{children:(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:Le}),children:Ke.map(vt=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(jr,{entityRef:vt.targetRef})}),(0,l.jsx)(vn,{primary:(0,l.jsx)(Nt,{entityRef:vt.targetRef})})]},vt.targetRef))})},ut))}),!!(!((L=Ne.items)===null||L===void 0)&&L.length)&&(0,l.jsx)(yr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ne.items.map((Le,Ke)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(W.Z,{children:[Le.level,": ",Le.type]}),(0,l.jsx)(K.Z,{ml:2,children:Le.message})]},Ke))})]})]})}var Ur=t(72847);function Mr(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(mt.Oi,{text:Ur.ZP.stringify(Tr(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Rr=(0,V.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function er(v){const{children:S,value:L,index:N,...X}=v,q=Rr();return(0,l.jsx)("div",{role:"tabpanel",hidden:L!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:q.tabContents,...X,children:L===N&&(0,l.jsx)(K.Z,{pl:3,pr:3,children:S})})}function sn(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function Bt(v){const S=Rr(),[L,N]=$.useState(0);return(0,$.useEffect)(()=>{N(0)},[v.open]),v.entity?(0,l.jsxs)(H.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:S.fullHeightDialog},children:[(0,l.jsx)(de.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(he.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:S.root,children:[(0,l.jsxs)(Ie.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(X,q)=>N(q),"aria-label":"Inspector options",className:S.tabs,children:[(0,l.jsx)(et.Z,{label:"Overview",...sn(0)}),(0,l.jsx)(et.Z,{label:"Ancestry",...sn(1)}),(0,l.jsx)(et.Z,{label:"Colocated",...sn(2)}),(0,l.jsx)(et.Z,{label:"Raw JSON",...sn(3)}),(0,l.jsx)(et.Z,{label:"Raw YAML",...sn(4)})]}),(0,l.jsx)(er,{value:L,index:0,children:(0,l.jsx)(ds,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:1,children:(0,l.jsx)(ns,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:2,children:(0,l.jsx)(Fr,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:3,children:(0,l.jsx)(Ir,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:4,children:(0,l.jsx)(Mr,{entity:v.entity})})]})}),(0,l.jsx)($t.Z,{children:(0,l.jsx)(J.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var zr=t(85256);function us(v){var S;const L=(0,n.h_)(m),N=(S=v.metadata.annotations)===null||S===void 0?void 0:S[Ce.q1],X=v.metadata.uid,q=N==="bootstrap:bootstrap",le=(0,st.default)(async()=>{const vt=L.getLocationByRef(N);let Je;if(!N)Je=Promise.resolve([]);else{const Lt=`metadata.annotations.${Ce.q1}`;Je=L.getEntities({filter:{[Lt]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Qt=>Qt.items)}return Promise.all([vt,Je]).then(([Lt,Qt])=>({location:Lt,colocatedEntities:Qt}))},[L,v]),me=(0,$.useCallback)(async function(){const{location:Je}=le.value;await L.removeLocationById(Je.id)},[L,le]),Se=(0,$.useCallback)(async function(){await L.removeEntityByUid(X)},[L,X]);if(q)return{type:"bootstrap",location:N,deleteEntity:Se};const{loading:Ne,error:Me,value:Le}=le;if(Ne)return{type:"loading"};if(Me)return{type:"error",error:Me};const{location:Ke,colocatedEntities:ut}=Le;return Ke?{type:"unregister",location:N,colocatedEntities:ut.map(Ce.iB),unregisterLocation:me,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Vr=t(23054);const hs=(0,V.Z)({advancedButton:{fontSize:"0.7em"}}),ps=({entity:v,onConfirm:S})=>{const L=(0,n.h_)(n.$v),N=(0,n.h_)(n.Ds),X=hs(),q=us(v),[le,me]=(0,$.useState)(!1),[Se,Ne]=(0,$.useState)(!1);var Me;const Le=(Me=N.getOptionalString("app.title"))!==null&&Me!==void 0?Me:"Backstage",Ke=(0,$.useCallback)(async function(){if("unregisterLocation"in q){Ne(!0);try{await q.unregisterLocation(),S()}catch(Je){(0,Vr.BD)(Je),L.post({message:Je.message})}finally{Ne(!1)}}},[L,S,q]),ut=(0,$.useCallback)(async function(){if("deleteEntity"in q){Ne(!0);try{await q.deleteEntity(),S()}catch(Je){(0,Vr.BD)(Je),L.post({message:Je.message})}finally{Ne(!1)}}},[L,S,q]);return q.type==="loading"?(0,l.jsx)(mt.Ex,{}):q.type==="error"?(0,l.jsx)(mt.Gk,{error:q.error}):q.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(mr.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 ',Le," ","integrator."]}),(0,l.jsxs)(K.Z,{marginTop:2,children:[!le&&(0,l.jsx)(J.Z,{variant:"text",size:"small",color:"primary",className:X.advancedButton,onClick:()=>me(!0),children:"Advanced Options"}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.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,l.jsx)(J.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ut,children:"Delete Entity"})]})]})]}):q.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.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,l.jsx)(J.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ut,children:"Delete Entity"})]}):q.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:q.colocatedEntities.map(vt=>(0,l.jsx)("li",{children:(0,l.jsx)(Nt,{entityRef:vt})},`${vt.kind}:${vt.namespace}/${vt.name}`))}),(0,l.jsx)(Rt.Z,{children:"Located at the following location:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:(0,l.jsx)("li",{children:q.location})}),(0,l.jsxs)(Rt.Z,{children:["To undo, just re-register the entity in ",Le,"."]}),(0,l.jsxs)(K.Z,{marginTop:2,children:[(0,l.jsx)(J.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Ke,children:"Unregister Location"}),!le&&(0,l.jsx)(K.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(J.Z,{variant:"text",size:"small",color:"primary",className:X.advancedButton,onClick:()=>me(!0),children:"Advanced Options"})})]}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(zr.Z,{})}),(0,l.jsx)(Rt.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,l.jsx)(J.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ut,children:"Delete Entity"})]})]}):(0,l.jsx)(mr.Z,{severity:"error",children:"Internal error: Unknown state"})},fs=v=>{const{open:S,onConfirm:L,onClose:N,entity:X}=v;return(0,l.jsxs)(H.Z,{open:S,onClose:N,children:[(0,l.jsx)(de.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(he.Z,{children:(0,l.jsx)(ps,{entity:X,onConfirm:L})}),(0,l.jsx)($t.Z,{children:(0,l.jsx)(J.Z,{onClick:N,color:"primary",children:"Cancel"})})]})};var gs=t(12231),Hr=t(9520),xr=t(47603);const ks=(0,V.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ms(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:xr.Z},{id:"starred",label:"Starred",icon:x.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Wr=v=>{const{initialFilter:S,availableFilters:L}=v,N=ks(),X=(0,n.h_)(n.Ds);var q;const le=(q=X.getOptionalString("organization.name"))!==null&&q!==void 0?q:"Company",{filters:me,updateFilters:Se,backendEntities:Ne,queryParameters:{kind:Me,user:Le},loading:Ke}=Te(),ut=["starred","all"],vt=ms(le).map(xn=>({...xn,items:xn.items.filter(({id:on})=>["group","user"].some(nr=>nr===Me)?ut.includes(on):!L||L.includes(on))})).filter(({items:xn})=>!!xn.length),{isStarredEntity:Je}=It(),{isOwnedEntity:Lt,loading:Qt}=pe(),Fn=Ke||Qt,An=(0,$.useMemo)(()=>new Be("owned",Lt,Je),[Lt,Je]),tr=(0,$.useMemo)(()=>new Be("starred",Lt,Je),[Lt,Je]),hn=(0,$.useMemo)(()=>[Le].flat()[0],[Le]),[yn,Tn]=(0,$.useState)(hn!=null?hn:S),br=(0,$.useMemo)(()=>Ne.filter(nt((0,He.compact)(Object.values({...me,user:void 0})))),[me,Ne]),Sr=(0,$.useMemo)(()=>({all:br.length,starred:br.filter(xn=>tr.filterEntity(xn)).length,owned:br.filter(xn=>An.filterEntity(xn)).length}),[br,tr,An]);(0,$.useEffect)(()=>{hn&&Tn(hn)},[hn]),(0,$.useEffect)(()=>{!Fn&&!!yn&&yn!=="all"&&Sr[yn]===0&&Tn("all")},[Fn,Sr,yn,Tn]),(0,$.useEffect)(()=>{Se({user:yn?new Be(yn,Lt,Je):void 0})},[yn,Lt,Je,Se]);var wr;return(0,l.jsx)(Nr.Z,{className:N.root,children:vt.map(xn=>(0,l.jsxs)($.Fragment,{children:[(0,l.jsx)(W.Z,{variant:"subtitle2",component:"span",className:N.title,children:xn.name}),(0,l.jsx)(Nr.Z,{className:N.groupWrapper,children:(0,l.jsx)(Zn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":xn.name,children:xn.items.map(on=>{var nr;return(0,l.jsxs)(gs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Tn(on.id),selected:on.id===((nr=me.user)===null||nr===void 0?void 0:nr.value),className:N.menuItem,disabled:Sr[on.id]===0,"data-testid":`user-picker-${on.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[on.icon&&(0,l.jsx)(lr.Z,{className:N.listIcon,children:(0,l.jsx)(on.icon,{fontSize:"small"})}),(0,l.jsx)(Dr.Z,{children:(0,l.jsxs)(W.Z,{variant:"body1",children:[on.label," "]})}),(0,l.jsx)(Hr.Z,{children:(wr=Sr[on.id])!==null&&wr!==void 0?wr:"-"})]},on.id)})})})]},xn.name))})},vs=(0,V.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Os=(0,l.jsx)(Ve.Z,{fontSize:"small"}),ys=(0,l.jsx)(Oe.Z,{fontSize:"small"}),$s=()=>{const v=vs(),{updateFilters:S}=Te(),[L,N]=(0,$.useState)([]);function X(me){S({orphan:me?new We(me):void 0})}function q(me){S({error:me?new _e(me):void 0})}const le=["Is Orphan","Has Error"];return(0,l.jsx)(K.Z,{pb:1,pt:1,children:(0,l.jsxs)(W.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(Ft.ZP,{multiple:!0,options:le,value:L,onChange:(me,Se)=>{N(Se),X(Se.includes("Is Orphan")),q(Se.includes("Has Error"))},renderOption:(me,{selected:Se})=>(0,l.jsx)(w.Z,{control:(0,l.jsx)(Q.Z,{icon:Os,checkedIcon:ys,checked:Se}),label:me}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:me=>(0,l.jsx)(Ee.Z,{...me,className:v.input,variant:"outlined"})})]})})},po=({children:v,value:S})=>{var L;const[N,X]=useState((L=S==null?void 0:S.filters)!==null&&L!==void 0?L:{}),q=useCallback(ut=>{X(vt=>{const Je=typeof ut=="function"?ut(vt):ut;return{...vt,...Je}})},[]),le=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var me,Se,Ne,Me,Le;const Ke=useMemo(()=>({entities:(me=S==null?void 0:S.entities)!==null&&me!==void 0?me:le.entities,backendEntities:(Se=S==null?void 0:S.backendEntities)!==null&&Se!==void 0?Se:le.backendEntities,updateFilters:(Ne=S==null?void 0:S.updateFilters)!==null&&Ne!==void 0?Ne:q,filters:N,loading:(Me=S==null?void 0:S.loading)!==null&&Me!==void 0?Me:!1,queryParameters:(Le=S==null?void 0:S.queryParameters)!==null&&Le!==void 0?Le:le.queryParameters,error:S==null?void 0:S.error}),[S,le,N,q]);return _jsx(EntityListContext.Provider,{value:Ke,children:v})}},33414:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{AboutCard:function(){return Qe},AboutContent:function(){return He},AboutField:function(){return te}});var h=t(52322),n=t(25271),m=t(1515),T=t(25248),z=t(32838),b=t(46285),l=t(79692),$=t(94339),ee=t(32552),Y=t(61837),J=t(85256),D=t(24579),K=t(52866),W=t(30254),ae=t(27604),ie=t(2784),R=t(19625),I=t(60905),k=t(90436),O=t(7089);const A=(0,l.Z)(Ue=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ue.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function te(Ue){const{label:ze,value:tt,gridSizes:lt,children:ct}=Ue,nt=A(),Ce=(0,T.vJ)(ct,gt=>gt.getElements()),rt=Ce.length>0?Ce:(0,h.jsx)(k.Z,{variant:"body2",className:nt.value,children:tt||"unknown"});return(0,h.jsxs)(I.Z,{item:!0,...lt,children:[(0,h.jsx)(k.Z,{variant:"h2",className:nt.label,children:ze}),rt]})}var fe=t(24851);const Ye=(0,l.Z)({description:{wordBreak:"break-word"}});function qe(Ue,ze,tt){if(ze==="url"||Ue.includes("://"))return Ue;const lt=tt.type==="file"?`file://${tt.target}`:tt.target;return ze==="file"||tt.type==="file"?new URL(Ue,lt).href:lt}function He(Ue){var ze,tt,lt,ct,nt,Ce,rt,gt;const{entity:Re}=Ue,se=Ye(),xe=Re.kind.toLocaleLowerCase("en-US")==="system",Te=Re.kind.toLocaleLowerCase("en-US")==="resource",st=Re.kind.toLocaleLowerCase("en-US")==="component",ft=Re.kind.toLocaleLowerCase("en-US")==="api",Ct=Re.kind.toLocaleLowerCase("en-US")==="template",dt=Re.kind.toLocaleLowerCase("en-US")==="location",jt=Re.kind.toLocaleLowerCase("en-US")==="group",St=(0,b.hF)(Re,n.cz,{kind:"system"}),Pt=(0,b.hF)(Re,n.cz,{kind:"component"}),zt=(0,b.hF)(Re,n.cz,{kind:"domain"}),mt=(0,b.hF)(Re,n.S4);let ln;try{ln=(0,n.CV)(Re)}catch{ln=void 0}return(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(te,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(k.Z,{variant:"body2",paragraph:!0,className:se.description,children:(Re==null||(ze=Re.metadata)===null||ze===void 0?void 0:ze.description)||"No description"})}),(0,h.jsx)(te,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:mt.length>0&&(0,h.jsx)(b.rI,{entityRefs:mt,defaultKind:"group"})}),(xe||zt.length>0)&&(0,h.jsx)(te,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:zt.length>0&&(0,h.jsx)(b.rI,{entityRefs:zt,defaultKind:"domain"})}),(ft||st||Te||St.length>0)&&(0,h.jsx)(te,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:St.length>0&&(0,h.jsx)(b.rI,{entityRefs:St,defaultKind:"system"})}),st&&Pt.length>0&&(0,h.jsx)(te,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Pt,defaultKind:"component"})}),(ft||st||Te||Ct||jt||dt||typeof(Re==null||(tt=Re.spec)===null||tt===void 0?void 0:tt.type)=="string")&&(0,h.jsx)(te,{label:"Type",value:Re==null||(lt=Re.spec)===null||lt===void 0?void 0:lt.type,gridSizes:{xs:12,sm:6,lg:4}}),(ft||st||typeof(Re==null||(ct=Re.spec)===null||ct===void 0?void 0:ct.lifecycle)=="string")&&(0,h.jsx)(te,{label:"Lifecycle",value:Re==null||(nt=Re.spec)===null||nt===void 0?void 0:nt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(te,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Re==null||(Ce=Re.metadata)===null||Ce===void 0?void 0:Ce.tags)||[]).map(Nt=>(0,h.jsx)(O.Z,{size:"small",label:Nt},Nt))}),dt&&((Re==null||(rt=Re.spec)===null||rt===void 0?void 0:rt.targets)||(Re==null||(gt=Re.spec)===null||gt===void 0?void 0:gt.target))&&(0,h.jsx)(te,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(fe.s,{cols:1,items:(Re.spec.targets||[Re.spec.target]).map(Nt=>Nt).map(Nt=>{var dn;return{text:Nt,href:qe(Nt,(Re==null||(dn=Re.spec)===null||dn===void 0?void 0:dn.type)||"unknown",ln)}})})})]})}const Xe=(0,l.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 Qe(Ue){var ze,tt,lt;const{variant:ct}=Ue,nt=Xe(),{entity:Ce}=(0,b.X2)(),rt=(0,T.h_)(z.q3),gt=(0,T.h_)(b.Ah),Re=(0,T.h_)(T.$v),se=(0,T.tg)(R.jU),xe=(0,b.CV)(Ce,rt),Te=(ze=Ce.metadata.annotations)===null||ze===void 0?void 0:ze[n.Tf],st={label:"View Source",disabled:!xe,icon:(0,h.jsx)(z.nW,{type:xe==null?void 0:xe.integrationType}),href:xe==null?void 0:xe.locationTargetUrl},ft={label:"View TechDocs",disabled:!(!((tt=Ce.metadata.annotations)===null||tt===void 0)&&tt["backstage.io/techdocs-ref"])||!se,icon:(0,h.jsx)(W.Z,{}),href:se&&se({namespace:Ce.metadata.namespace||n.zG,kind:Ce.kind,name:Ce.metadata.name})};let Ct="";ct==="gridItem"?Ct=nt.gridItemCard:ct==="fullHeight"&&(Ct=nt.fullHeightCard);let dt="";ct==="gridItem"?dt=nt.gridItemCardContent:ct==="fullHeight"&&(dt=nt.fullHeightCardContent);const jt=(lt=Ce.metadata.annotations)===null||lt===void 0?void 0:lt[n.P1],St=(jt==null?void 0:jt.startsWith("url:"))||(jt==null?void 0:jt.startsWith("file:")),Pt=(0,ie.useCallback)(async()=>{await gt.refreshEntity((0,n.eE)(Ce)),Re.post({message:"Refresh scheduled",severity:"info"})},[gt,Re,Ce]);return(0,h.jsxs)($.Z,{className:Ct,children:[(0,h.jsx)(ee.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[St&&(0,h.jsx)(Y.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Pt,children:(0,h.jsx)(K.Z,{})}),(0,h.jsx)(Y.Z,{component:m.rU,"aria-label":"Edit",disabled:!Te,title:"Edit Metadata",to:Te!=null?Te:"#",children:(0,h.jsx)(ae.Z,{})})]}),subheader:(0,h.jsx)(m.M6,{links:[st,ft]})}),(0,h.jsx)(J.Z,{}),(0,h.jsx)(D.Z,{className:dt,children:(0,h.jsx)(He,{entity:Ce})})]})}},79324:function(bt,Pe,t){"use strict";t.d(Pe,{K:function(){return K}});var h=t(52322),n=t(2784),m=t(79692),T=t(12420),z=t(97580),b=t(73698),l=t(74603),$=t(12231),ee=t(46285),Y=t(64279),J=t(25248);const D=(0,m.Z)(W=>(0,T.Z)({root:{...W.typography.h4}}));function K(W){const{initialFilter:ae="component",allowedKinds:ie}=W,R=D(),I=(0,J.h_)(ee.Ah),{value:k}=(0,Y.default)(async()=>await I.getEntityFacets({facets:["kind"]}).then(Qe=>{var Ue;return((Ue=Qe.facets.kind)===null||Ue===void 0?void 0:Ue.map(ze=>ze.value).sort())||[]})),{updateFilters:O,queryParameters:{kind:A}}=(0,ee.wp)(),te=(0,n.useMemo)(()=>{var Qe;return(Qe=[A].flat()[0])===null||Qe===void 0?void 0:Qe.toLocaleLowerCase("en-US")},[A]),[fe,Ye]=(0,n.useState)(te!=null?te:ae);(0,n.useEffect)(()=>{O({kind:fe?new ee.zo(fe):void 0})},[fe,O]),(0,n.useEffect)(()=>{te&&Ye(te)},[te]);var qe;const Xe=[(0,z.Z)(fe)].concat((qe=k==null?void 0:k.filter(Qe=>ie?ie.some(Ue=>Ue.toLocaleLowerCase("en-US")===Qe.toLocaleLowerCase("en-US")):!0))!==null&&qe!==void 0?qe:[]).sort().reduce((Qe,Ue)=>(Qe[Ue.toLocaleLowerCase("en-US")]=Ue,Qe),{});return(0,h.jsx)(b.Z,{input:(0,h.jsx)(l.Z,{value:fe}),value:fe,onChange:Qe=>Ye(Qe.target.value),classes:R,children:Object.keys(Xe).map(Qe=>(0,h.jsx)($.Z,{value:Qe,children:`${Xe[Qe]}s`},Qe))})}},86359:function(bt,Pe,t){"use strict";t.d(Pe,{E:function(){return ie}});var h=t(52322),n=t(25271),m=t(1515),T=t(46285),z=t(90436),b=t(15459),l=t(27604),$=t(2997),ee=t(11640),Y=t(28347),J=t(76635),D=t(2784),K=t(7089);const W=Object.freeze({createNameColumn(R){function I(k){var O;return((O=k.metadata)===null||O===void 0?void 0:O.title)||(0,T.$3)(k,{defaultKind:R==null?void 0:R.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:k},{entity:O}){return I(k).localeCompare(I(O))},render:({entity:k})=>{var O;return(0,h.jsx)(T.dx,{entityRef:k,defaultKind:(R==null?void 0:R.defaultKind)||"Component",title:(O=k.metadata)===null||O===void 0?void 0:O.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,h.jsx)(T.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,h.jsx)(T.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var I,k;return(0,h.jsx)(h.Fragment,{children:((R==null||(I=R.spec)===null||I===void 0?void 0:I.targets)||(R==null||(k=R.spec)===null||k===void 0?void 0:k.target))&&(0,h.jsx)(m.Or,{text:(R.spec.targets||[R.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:R})=>(0,h.jsx)(m.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,h.jsx)(h.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(I=>(0,h.jsx)(K.Z,{label:I,size:"small",variant:"outlined",style:{marginBottom:"0px"}},I))}),width:"auto"}},createTitleColumn(R){return{title:"Title",field:"entity.metadata.title",hidden:R==null?void 0:R.hidden,searchable:!0}}}),ae=(0,b.Z)({root:{color:"#f3ba37"}})(ee.Z),ie=R=>{var I,k;const{columns:O,actions:A,tableOptions:te,subtitle:fe}=R,{isStarredEntity:Ye,toggleStarredEntity:qe}=(0,T.CR)(),{loading:He,error:Xe,entities:Qe,filters:Ue}=(0,T.wp)(),ze=(0,D.useMemo)(()=>{var Re;return[W.createTitleColumn({hidden:!0}),W.createNameColumn({defaultKind:(Re=Ue.kind)===null||Re===void 0?void 0:Re.value}),...se(),W.createMetadataDescriptionColumn(),W.createTagsColumn()];function se(){var xe;switch((xe=Ue.kind)===null||xe===void 0?void 0:xe.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[W.createSystemColumn(),W.createOwnerColumn(),W.createSpecTypeColumn(),W.createSpecLifecycleColumn()]}}},[(I=Ue.kind)===null||I===void 0?void 0:I.value]),tt=Ue.type===void 0;var lt;const ct=(0,J.capitalize)((lt=(k=Ue.user)===null||k===void 0?void 0:k.value)!==null&<!==void 0?lt:"all");if(Xe)return(0,h.jsx)("div",{children:(0,h.jsx)(m.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(m.Oi,{language:"text",text:Xe.toString()})})});const nt=[({entity:Re})=>{var se;const xe=(se=Re.metadata.annotations)===null||se===void 0?void 0:se[n.l2],Te="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:Te}),(0,h.jsx)($.Z,{fontSize:"small"})]}),tooltip:Te,disabled:!xe,onClick:()=>{!xe||window.open(xe,"_blank")}}},({entity:Re})=>{var se;const xe=(se=Re.metadata.annotations)===null||se===void 0?void 0:se[n.Tf],Te="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:Te}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Te,disabled:!xe,onClick:()=>{!xe||window.open(xe,"_blank")}}},({entity:Re})=>{const se=Ye(Re),xe=se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:xe}),se?(0,h.jsx)(ae,{}):(0,h.jsx)(Y.Z,{})]}),tooltip:xe,onClick:()=>qe(Re)}}],Ce=Qe.map(Re=>{const se=(0,T.hF)(Re,n.cz,{kind:"system"}),xe=(0,T.hF)(Re,n.S4);return{entity:Re,resolved:{name:(0,T.$3)(Re,{defaultKind:"Component"}),ownedByRelationsTitle:xe.map(Te=>(0,T.$3)(Te,{defaultKind:"group"})).join(", "),ownedByRelations:xe,partOfSystemRelationTitle:se.map(Te=>(0,T.$3)(Te,{defaultKind:"system"})).join(", "),partOfSystemRelations:se}}}),rt=(O||ze).find(Re=>Re.title==="Type");rt&&(rt.hidden=!tt);const gt=Ce.length>20;return(0,h.jsx)(m.iA,{isLoading:He,columns:O||ze,options:{paging:gt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!He,padding:"dense",pageSizeOptions:[20,50,100],...te},title:`${ct} (${Qe.length})`,data:Ce,actions:A||nt,subtitle:fe})};ie.columns=W},24851:function(bt,Pe,t){"use strict";t.d(Pe,{s:function(){return ae}});var h=t(52322),n=t(90348),m=t(11861),T=t(2784),z=t(79692),b=t(95544),l=t(90436),$=t(52160),ee=t(1515);const Y=(0,z.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function J(ie){const{href:R,text:I,Icon:k}=ie,O=Y();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:O.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:k?(0,h.jsx)(k,{}):(0,h.jsx)($.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(ee.rU,{to:R,target:"_blank",rel:"noopener",children:I||R})})]})}var D=t(41156);const K={xs:1,sm:1,md:1,lg:2,xl:3};function W(ie){const R=[(0,D.Z)(A=>A.breakpoints.up("xl"))?"xl":null,(0,D.Z)(A=>A.breakpoints.up("lg"))?"lg":null,(0,D.Z)(A=>A.breakpoints.up("md"))?"md":null,(0,D.Z)(A=>A.breakpoints.up("sm"))?"sm":null,(0,D.Z)(A=>A.breakpoints.up("xs"))?"xs":null];let I=1;if(typeof ie=="number")I=ie;else{var k;const A=(k=R.find(te=>te!==null))!==null&&k!==void 0?k:"xs";var O;I=(O=ie==null?void 0:ie[A])!==null&&O!==void 0?O:K[A]}return I}function ae(ie){const{items:R,cols:I=void 0}=ie,k=W(I);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:k,children:R.map(({text:O,href:A,Icon:te},fe)=>(0,h.jsx)(m.Z,{children:(0,h.jsx)(J,{href:A,text:O!=null?O:A,Icon:te})},fe))})}},19625:function(bt,Pe,t){"use strict";t.d(Pe,{_Z:function(){return T},jU:function(){return m},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),m=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),T=(0,h.NT)({id:"catalog"})},51666:function(bt,Pe,t){"use strict";t.d(Pe,{rG:function(){return h},Y2:function(){return k},J$:function(){return ee},g2:function(){return m}});var h;(function(O){O.DENY="DENY",O.ALLOW="ALLOW",O.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(O,A){return O.name===A.name}function m(O,A){return"resourceType"in O?!A||O.resourceType===A:!1}function T(O){return O.attributes.action==="create"}function z(O){return O.attributes.action==="read"}function b(O){return O.attributes.action==="update"}function l(O){return O.attributes.action==="delete"}function $(O){return{authorize:async(A,te)=>await O.authorize(A,te),authorizeConditional(A,te){const fe=A;return O.authorize(fe,te)}}}function ee({name:O,attributes:A,resourceType:te}){return te?{type:"resource",name:O,attributes:A,resourceType:te}:{type:"basic",name:O,attributes:A}}var Y=t(23054),J=t(96279),D=t.n(J),K=t(9571),W=t(30195);const ae=W.z.lazy(()=>W.z.object({rule:W.z.string(),resourceType:W.z.string(),params:W.z.array(W.z.unknown())}).or(W.z.object({anyOf:W.z.array(ae).nonempty()})).or(W.z.object({allOf:W.z.array(ae).nonempty()})).or(W.z.object({not:ae}))),ie=W.z.object({result:W.z.literal(h.ALLOW).or(W.z.literal(h.DENY))}),R=W.z.union([W.z.object({result:W.z.literal(h.ALLOW).or(W.z.literal(h.DENY))}),W.z.object({result:W.z.literal(h.CONDITIONAL),pluginId:W.z.string(),resourceType:W.z.string(),conditions:ae})]),I=(O,A)=>W.z.object({items:W.z.array(W.z.intersection(W.z.object({id:W.z.string()}),O)).refine(te=>te.length===A.size&&te.every(({id:fe})=>A.has(fe)),{message:"Items in response do not match request"})});class k{async authorize(A,te){return this.makeRequest(A,ie,te)}async authorizeConditional(A,te){return this.makeRequest(A,R,te)}async makeRequest(A,te,fe){if(!this.enabled)return A.map(ze=>({result:h.ALLOW}));const Ye={items:A.map(ze=>({id:K.Z(),...ze}))},qe=await this.discovery.getBaseUrl("permission"),He=await D()(`${qe}/authorize`,{method:"POST",body:JSON.stringify(Ye),headers:{...this.getAuthorizationHeader(fe==null?void 0:fe.token),"content-type":"application/json"}});if(!He.ok)throw await Y.VL.fromResponse(He);const Xe=await He.json(),Ue=I(te,new Set(Ye.items.map(({id:ze})=>ze))).parse(Xe).items.reduce((ze,tt)=>(ze[tt.id]=tt,ze),{});return Ye.items.map(ze=>Ue[ze.id])}getAuthorizationHeader(A){return A?{Authorization:`Bearer ${A}`}:{}}constructor(A){this.discovery=A.discovery;var te;this.enabled=(te=A.config.getOptionalBoolean("permission.enabled"))!==null&&te!==void 0?te:!1}}},25488:function(bt,Pe,t){"use strict";t.d(Pe,{iM:function(){return b},RV:function(){return T},gI:function(){return $}});var h=t(52322),n=t(2784),m=t(25248);const T=(0,m.T0)({id:"plugin.permission.api"});var z=t(51666);class b{static create(D){const{config:K,discovery:W,identity:ae}=D,ie=new z.Y2({discovery:W,config:K});return new b(ie,ae)}async authorize(D){return(await this.permissionClient.authorize([D],await this.identityApi.getCredentials()))[0]}constructor(D,K){this.permissionClient=D,this.identityApi=K}}var l=t(49857);function $(J){const D=(0,m.h_)(T),{data:K,error:W}=(0,l.ZP)(J,async ae=>{if((0,z.g2)(ae.permission)&&!ae.resourceRef)return z.rG.DENY;const{result:ie}=await D.authorize(ae);return ie});return W?{error:W,loading:!1,allowed:!1}:K===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:K===z.rG.ALLOW}}const ee=J=>{const{permission:D,resourceRef:K,errorComponent:W,...ae}=J,ie=usePermission(isResourcePermission(D)?{permission:D,resourceRef:K}:{permission:D}),R=useApp(),{NotFoundErrorPage:I}=R.getComponents();let k=W===void 0?_jsx(I,{}):W;return ie.loading?k=null:ie.allowed&&(k=J.element),_jsx(Route,{...ae,element:k})};function Y(J){const{permission:D,resourceRef:K}=J,W=usePermission(isResourcePermission(D)?{permission:D,resourceRef:K}:{permission:D}),ae=useApp();if(W.loading)return null;if(W.allowed)return _jsx(_Fragment,{children:J.children});if(J.errorPage)return _jsx(_Fragment,{children:J.errorPage});const{NotFoundErrorPage:ie}=ae.getComponents();return _jsx(ie,{})}},23362:function(bt,Pe,t){"use strict";t.d(Pe,{FA:function(){return $},qO:function(){return lt},Nd:function(){return Ye},Rx:function(){return k}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class m{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Ae){this.mockedResults=Ae}}var T=t(52322),z=t(2784),b=t(79692);const l=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),$=({text:je,preTag:Ae,postTag:Be})=>{const We=l(),_e=(0,z.useMemo)(()=>je.split(new RegExp(`(${Ae}.+?${Be})`)),[Be,Ae,je]);return(0,T.jsx)(T.Fragment,{children:_e.map((at,pt)=>at.includes(Ae)?(0,T.jsx)("mark",{className:We.highlight,children:at.replace(new RegExp(`${Ae}|${Be}`,"g"),"")},pt):at)})};var ee=t(48760),Y=t(50581),J=t(61837),D=t(74603),K=t(21853),W=t(33375),ae=t(51837),ie=t(64279),R=t(1849);const I=(0,ae.CT)("search-context"),k=()=>{const je=(0,z.useContext)(I);if(!je)throw new Error("useSearch must be used within a SearchContextProvider");const Ae=je.atVersion(1);if(!Ae)throw new Error("No SearchContext v1 found");return Ae},O=()=>(0,z.useContext)(I)!==void 0,A={term:"",pageCursor:void 0,filters:{},types:[]},te=(je=A)=>{var Ae,Be,We,_e;const at=(0,h.h_)(n),[pt,wt]=(0,z.useState)(je.pageCursor),[Tt,kt]=(0,z.useState)(je.filters),[It,oe]=(0,z.useState)(je.term),[G,pe]=(0,z.useState)(je.types),ve=(0,R.Z)(It),be=(0,ie.default)(()=>at.query({term:It,filters:Tt,pageCursor:pt,types:G}),[It,Tt,G,pt]),Ge=!be.loading&&!be.error&&((Ae=be.value)===null||Ae===void 0?void 0:Ae.nextPageCursor),V=!be.loading&&!be.error&&((Be=be.value)===null||Be===void 0?void 0:Be.previousPageCursor),w=(0,z.useCallback)(()=>{var Oe;wt((Oe=be.value)===null||Oe===void 0?void 0:Oe.nextPageCursor)},[(We=be.value)===null||We===void 0?void 0:We.nextPageCursor]),Q=(0,z.useCallback)(()=>{var Oe;wt((Oe=be.value)===null||Oe===void 0?void 0:Oe.previousPageCursor)},[(_e=be.value)===null||_e===void 0?void 0:_e.previousPageCursor]);return(0,z.useEffect)(()=>{ve!==void 0&&It!==ve&&wt(void 0)},[It,ve,wt]),{result:be,filters:Tt,setFilters:kt,term:It,setTerm:oe,types:G,setTypes:pe,pageCursor:pt,setPageCursor:wt,fetchNextPage:Ge?w:void 0,fetchPreviousPage:V?Q:void 0}},fe=je=>{const{initialState:Ae,children:Be}=je,We=te(Ae);return(0,T.jsx)(h.fC,{attributes:{searchTypes:We.types.sort().join(",")},children:(0,T.jsx)(I.Provider,{value:(0,ae.EI)({1:We}),children:Be})})},Ye=je=>{const{initialState:Ae,inheritParentContextIfAvailable:Be,children:We}=je;return O()&&Be?(0,T.jsx)(T.Fragment,{children:We}):(0,T.jsx)(fe,{initialState:Ae,children:We})},qe=({children:je})=>{const Ae=(0,h.z$)(),{term:Be}=k();return(0,z.useEffect)(()=>{Be&&Ae.captureEvent("search",Be)},[Ae,Be]),(0,T.jsx)(T.Fragment,{children:je})};function He(je){return(0,z.forwardRef)((Ae,Be)=>(0,T.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,T.jsx)(je,{...Ae,ref:Be})}))}const Xe=He((0,z.forwardRef)((je,Ae)=>{const{onChange:Be,onKeyDown:We=()=>{},onClear:_e=()=>{},onSubmit:at=()=>{},debounceTime:pt=200,clearButton:wt=!0,fullWidth:Tt=!0,value:kt,placeholder:It,inputProps:oe={},endAdornment:G,...pe}=je,ve=(0,h.h_)(h.Ds),[be,Ge]=(0,z.useState)("");(0,z.useEffect)(()=>{Ge(ot=>ot!==kt?String(kt):ot)},[kt]),(0,ee.Z)(()=>Be(be),pt,[be]);const V=(0,z.useCallback)(ot=>{Ge(ot.target.value)},[Ge]),w=(0,z.useCallback)(ot=>{We&&We(ot),at&&ot.key==="Enter"&&at()},[We,at]),Q=(0,z.useCallback)(()=>{Be(""),_e&&_e()},[Be,_e]),Ee=It!=null?It:`Search in ${ve.getOptionalString("app.title")||"Backstage"}`,Oe=(0,T.jsx)(Y.Z,{position:"start",children:(0,T.jsx)(J.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,T.jsx)(K.Z,{})})}),Ve=(0,T.jsx)(Y.Z,{position:"end",children:(0,T.jsx)(J.Z,{"aria-label":"Clear",size:"small",onClick:Q,children:(0,T.jsx)(W.Z,{})})});return(0,T.jsx)(qe,{children:(0,T.jsx)(D.Z,{"data-testid":"search-bar-next",ref:Ae,value:be,placeholder:Ee,startAdornment:Oe,endAdornment:wt?Ve:G,inputProps:{"aria-label":"Search",...oe},fullWidth:Tt,onChange:V,onKeyDown:w,...pe})})})),Qe=He((0,z.forwardRef)((je,Ae)=>{const{value:Be="",onChange:We,..._e}=je,{term:at,setTerm:pt}=k();(0,z.useEffect)(()=>{Be&&pt(String(Be))},[Be,pt]);const wt=(0,z.useCallback)(Tt=>{We?We(Tt):pt(Tt)},[We,pt]);return(0,T.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,T.jsx)(Xe,{..._e,ref:Ae,value:at,onChange:wt})})}));var Ue=t(4614),ze=t(88013);const lt=(je=>Ae=>(0,T.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,T.jsx)(je,{...Ae})}))(function(Ae){const{loading:Be,value:We,onChange:_e=()=>{},options:at=[],getOptionLabel:pt=Q=>String(Q),inputPlaceholder:wt,inputDebounceTime:Tt,freeSolo:kt=!0,fullWidth:It=!0,clearOnBlur:oe=!1,"data-testid":G="search-autocomplete",...pe}=Ae,{setTerm:ve}=k(),be=(0,z.useCallback)(Q=>Q?typeof Q=="string"?Q:pt(Q):"",[pt]),Ge=(0,z.useMemo)(()=>be(We),[We,be]),V=(0,z.useCallback)((Q,Ee,Oe,Ve)=>{ve(be(Ee)),_e(Q,Ee,Oe,Ve)},[be,ve,_e]),w=(0,z.useCallback)(({InputProps:{ref:Q,endAdornment:Ee},InputLabelProps:Oe,...Ve})=>(0,T.jsx)(Qe,{...Ve,ref:Q,clearButton:!1,value:Ge,placeholder:wt,debounceTime:Tt,endAdornment:Be?(0,T.jsx)(Ue.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Ee}),[Be,Ge,wt,Tt]);return(0,T.jsx)(ze.ZP,{...pe,"data-testid":G,value:We,onChange:V,options:at,getOptionLabel:pt,renderInput:w,freeSolo:kt,fullWidth:It,clearOnBlur:oe})}),ct=({icon:je,primaryText:Ae,primaryTextTypographyProps:Be,secondaryText:We,secondaryTextTypographyProps:_e,disableTextTypography:at})=>_jsxs(_Fragment,{children:[je?_jsx(ListItemIcon,{children:je}):null,_jsx(ListItemText,{primary:Ae,primaryTypographyProps:Be,secondary:We,secondaryTypographyProps:_e,disableTypography:at})]});var nt=t(42494),Ce=t(84899),rt=t(5806),gt=t(21324),Re=t(56939),se=t(73698),xe=t(12231),Te=t(86619),st=t(7089),ft=t(69294);const Ct=(je,Ae,Be=[],We=250)=>{const _e=(0,z.useRef)({}),at=je||(()=>Promise.resolve([])),[pt,wt]=(0,ft.default)(at,[Ae],{loading:!0});if((0,ee.Z)(()=>{_e.current[Ae]===void 0&&(_e.current[Ae]=wt(Ae).then(kt=>(_e.current[Ae]=kt,kt)))},We,[wt,Ae]),Be.length)return{loading:!1,value:Be};const Tt=_e.current[Ae];return Array.isArray(Tt)?{loading:!1,value:Tt}:pt},dt=(je,Ae)=>{const{setFilters:Be}=k();(0,z.useEffect)(()=>{Ae&&[Ae].flat().length>0&&Be(We=>({...We,[je]:Ae}))},[])},jt=je=>{const{className:Ae,defaultValue:Be,name:We,values:_e,valuesDebounceMs:at,label:pt,filterSelectedOptions:wt,limitTags:Tt,multiple:kt}=je,[It,oe]=(0,z.useState)("");dt(We,Be);const G=typeof _e=="function"?_e:void 0,pe=typeof _e=="function"?void 0:_e,{value:ve,loading:be}=Ct(G,It,pe,at),{filters:Ge,setFilters:V}=k(),w=Ge[We]||(kt?[]:null),Q=(Ve,ot)=>{V(Ft=>{const{[We]:Zt,...qt}=Ft;return ot?{...qt,[We]:ot}:{...qt}})},Ee=Ve=>(0,T.jsx)(Te.Z,{...Ve,name:"search",variant:"outlined",label:pt,fullWidth:!0}),Oe=(Ve,ot)=>Ve.map((Ft,Zt)=>(0,T.jsx)(st.Z,{label:Ft,color:"primary",...ot({index:Zt})}));return(0,T.jsx)(ze.ZP,{filterSelectedOptions:wt,limitTags:Tt,multiple:kt,className:Ae,id:`${kt?"multi-":""}select-filter-${We}--select`,options:ve||[],loading:be,value:w,onChange:Q,onInputChange:(Ve,ot)=>oe(ot),renderInput:Ee,renderTags:Oe})},St=(0,b.Z)({label:{textTransform:"capitalize"}}),Pt=je=>{const{className:Ae,defaultValue:Be,label:We,name:_e,values:at=[],valuesDebounceMs:pt}=je,wt=St(),{filters:Tt,setFilters:kt}=k();dt(_e,Be);const It=typeof at=="function"?at:void 0,oe=typeof at=="function"?void 0:at,{value:G=[],loading:pe}=Ct(It,"",oe,pt),ve=Ge=>{const{target:{value:V,checked:w}}=Ge;kt(Q=>{const{[_e]:Ee,...Oe}=Q,Ve=(Ee||[]).filter(Ft=>Ft!==V),ot=w?[...Ve,V]:Ve;return ot.length?{...Oe,[_e]:ot}:Oe})};var be;return(0,T.jsxs)(nt.Z,{className:Ae,disabled:pe,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[We?(0,T.jsx)(Ce.Z,{className:wt.label,children:We}):null,G.map(Ge=>(0,T.jsx)(rt.Z,{control:(0,T.jsx)(gt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Ge},value:Ge,name:Ge,onChange:ve,checked:((be=Tt[_e])!==null&&be!==void 0?be:[]).includes(Ge)}),label:Ge},Ge))]})},zt=je=>{const{className:Ae,defaultValue:Be,label:We,name:_e,values:at,valuesDebounceMs:pt}=je,wt=St();dt(_e,Be);const Tt=typeof at=="function"?at:void 0,kt=typeof at=="function"?void 0:at,{value:It=[],loading:oe}=Ct(Tt,"",kt,pt),{filters:G,setFilters:pe}=k(),ve=be=>{const{target:{value:Ge}}=be;pe(V=>{const{[_e]:w,...Q}=V;return Ge?{...Q,[_e]:Ge}:Q})};return(0,T.jsxs)(nt.Z,{disabled:oe,className:Ae,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[We?(0,T.jsx)(Re.Z,{className:wt.label,margin:"dense",children:We}):null,(0,T.jsxs)(se.Z,{variant:"outlined",value:G[_e]||"",onChange:ve,children:[(0,T.jsx)(xe.Z,{value:"",children:(0,T.jsx)("em",{children:"All"})}),It.map(be=>(0,T.jsx)(xe.Z,{value:be,children:be},be))]})]})},mt=({component:je,...Ae})=>(0,T.jsx)(je,{...Ae});mt.Checkbox=je=>(0,T.jsx)(mt,{...je,component:Pt}),mt.Select=je=>(0,T.jsx)(mt,{...je,component:zt}),mt.Autocomplete=je=>(0,T.jsx)(mt,{...je,component:jt});var ln=t(1515);const Nt=({children:je})=>{const{result:{loading:Ae,error:Be,value:We}}=useSearch();return Ae?_jsx(Progress,{}):Be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Be}):We!=null&&We.results.length?_jsx(_Fragment,{children:je({results:We.results})}):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})},dn=je=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Nt,{...je})}),un=(0,b.Z)(je=>({root:{display:"flex",justifyContent:"space-between",gap:je.spacing(2),margin:je.spacing(2,0)}})),Ln=()=>{const{fetchNextPage:je,fetchPreviousPage:Ae}=useSearch(),Be=un();return!je&&!Ae?_jsx(_Fragment,{}):_jsxs("nav",{"arial-label":"pagination navigation",className:Be.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Ae,onClick:Ae,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!je,onClick:je,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},fn=({result:je,highlight:Ae,rank:Be,icon:We,secondaryAction:_e,lineClamp:at=5})=>{const pt=useAnalytics(),wt=()=>{pt.captureEvent("discover",je.title,{attributes:{to:je.location},value:Be})};return _jsxs(Link,{noTrack:!0,to:je.location,onClick:wt,children:[_jsxs(ListItem,{alignItems:"center",children:[We&&_jsx(ListItemIcon,{children:We}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:Ae!=null&&Ae.fields.title?_jsx(HighlightedSearchResultText,{text:Ae.fields.title,preTag:Ae.preTag,postTag:Ae.postTag}):je.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:at,overflow:"hidden"},children:Ae!=null&&Ae.fields.text?_jsx(HighlightedSearchResultText,{text:Ae.fields.text,preTag:Ae.preTag,postTag:Ae.postTag}):je.text})}),_e&&_jsx(Box,{alignItems:"flex-end",children:_e})]}),_jsx(Divider,{})]})},On=je=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(fn,{...je})})},61886:function(bt,Pe,t){"use strict";t.d(Pe,{Ox:function(){return ze},Zz:function(){return b},oZ:function(){return qe},DR:function(){return l},ZS:function(){return fe},VA:function(){return ct},KY:function(){return ee},gT:function(){return W},Dl:function(){return ae},ux:function(){return lt},$L:function(){return K},x1:function(){return Ye}});var h=t(52322),n=t(2784),m=t(10289),T=t(25248);const z="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",l=()=>null;(0,T.R5)(l,b,!0);const $=se=>`${z}.${se.toLocaleLowerCase("en-US")}`;function ee(se){const{name:xe,component:Te}=se;return(0,T.YO)({name:xe,component:{sync:st=>(0,h.jsx)(Te,{...st})},data:{[z]:se,[$(xe)]:!0}})}const Y=(se,xe)=>se.selectByComponentData({key:xe}).getElements()[0],J=se=>se.selectByComponentData({key:b}).selectByComponentData({key:z}),D=se=>se.selectByComponentData({key:b}).findComponentData({key:z}),K=()=>{const se=(0,m.pC)(),xe=(0,T.vJ)(se,J),Te=(0,T.vJ)(se,D),st=(0,n.useCallback)(dt=>{if(!xe||!dt)return null;const jt=$(dt.name);var St;return(St=Y(xe,jt))!==null&&St!==void 0?St:null},[xe]),ft=(0,n.useCallback)(dt=>{const jt=Te.find(St=>St.name===dt);return jt?st(jt):null},[Te,st]),Ct=(0,n.useCallback)(dt=>{const jt=Te.filter(St=>St.location===dt);return jt.length?jt.map(st):null},[Te,st]);return{renderComponentByName:ft,renderComponentsByLocation:Ct}},W=(0,T.T0)({id:"plugin.techdocs.service"}),ae=(0,T.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),R=t(25271),I=t(51837);function k(se,xe){return xe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const O=(se,xe)=>(0,R.eE)(se)===(0,R.eE)(xe),A={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},te=(0,I.CT)("techdocs-reader-page-context"),fe=(0,n.memo)(({entityRef:se,children:xe})=>{const Te=(0,T.h_)(W),st=(0,T.h_)(T.Ds),ft=(0,ie.default)(async()=>Te.getTechDocsMetadata(se),[se]),Ct=(0,ie.default)(async()=>Te.getEntityMetadata(se),[se]),[dt,jt]=(0,n.useState)(A.title),[St,Pt]=(0,n.useState)(A.subtitle),[zt,mt]=(0,n.useState)(A.shadowRoot),ln={metadata:ft,entityRef:k(se,st),entityMetadata:Ct,shadowRoot:zt,setShadowRoot:mt,title:dt,setTitle:jt,subtitle:St,setSubtitle:Pt},Nt=(0,I.EI)({1:ln});return(0,h.jsx)(te.Provider,{value:Nt,children:xe instanceof Function?xe(ln):xe})},(se,xe)=>O(se.entityRef,xe.entityRef)),Ye=()=>{const se=(0,n.useContext)(te);if(se===void 0)return A;const xe=se.atVersion(1);if(xe===void 0)throw new Error("No context found for version 1.");return xe},qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var He=t(70882),Xe=t(50236),Qe=t(19219),Ue=t(1515);const ze="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",tt=se=>{(0,n.useEffect)(()=>{if(!se)return()=>{};const xe=se.querySelectorAll('head > link[rel="stylesheet"]');var Te;let st=(Te=xe==null?void 0:xe.length)!==null&&Te!==void 0?Te:0;const ft=new CustomEvent(ze);if(!st)return se.dispatchEvent(ft),()=>{};const Ct=()=>{--st===0&&se.dispatchEvent(ft)};return xe==null||xe.forEach(dt=>{dt.addEventListener("load",Ct)}),()=>{xe==null||xe.forEach(dt=>{dt.removeEventListener("load",Ct)})}},[se])},lt=se=>{const[xe,Te]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!se)return()=>{};Te(!0);const st=se.style;st.setProperty("opacity","0");const ft=()=>{Te(!1),st.setProperty("opacity","1")};return se.addEventListener(ze,ft),()=>{se.removeEventListener(ze,ft)}},[se]),xe},ct=({element:se,onAppend:xe,children:Te})=>{const[st,ft]=(0,n.useState)((0,He.Ue)({...(0,Xe.Z)(),insertionPoint:void 0}));tt(se);const Ct=lt(se),dt=(0,n.useCallback)(jt=>{if(!se||!jt)return;ft((0,He.Ue)({...(0,Xe.Z)(),insertionPoint:se.querySelector("head")||void 0}));let St=jt.shadowRoot;St||(St=jt.attachShadow({mode:"open"})),St.replaceChildren(se),typeof xe=="function"&&xe(St)},[se,xe]);return(0,h.jsxs)(h.Fragment,{children:[Ct&&(0,h.jsx)(Ue.Ex,{}),(0,h.jsxs)(Qe.ZP,{jss:st,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:dt,"data-testid":"techdocs-native-shadowroot"}),Te]})]})};var nt=t(54073);const Ce=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},rt=se=>{const xe=Ce();return xe?se.map(Te=>xe==null?void 0:xe.querySelectorAll(Te)).filter(Te=>Te.length).map(Te=>Array.from(Te)).flat():[]},gt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,Re=(se=0)=>{const xe=Ce(),[Te,st]=useState(null),ft=useMemo(()=>debounce(()=>{const Ct=xe,dt=Ct.getSelection?Ct.getSelection():document.getSelection();dt&>(dt)?st(dt):st(null)},se),[xe,st,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",ft),()=>window.document.removeEventListener("selectionchange",ft)),[ft]),Te}},52943:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{EmbeddedDocsRouter:function(){return ie},Router:function(){return ae},isTechDocsAvailable:function(){return W}});var h=t(52322),n=t(2784),m=t(10289),T=t(46285),z=t(1515),b=t(25271),l=t(89258),$=t(65124),ee=t(67896);const Y=({entity:R})=>{const I=(0,b.iB)(R);return(0,h.jsxs)(l.I6,{entityRef:I,children:[(0,h.jsx)($.b,{}),(0,h.jsx)(ee.F,{withSearch:!1})]})};var J=t(18662),D=t(7476);const K="backstage.io/techdocs-ref",W=R=>{var I,k;return Boolean(R==null||(I=R.metadata)===null||I===void 0||(k=I.annotations)===null||k===void 0?void 0:k[K])},ae=()=>(0,h.jsxs)(m.Z5,{children:[(0,h.jsx)(m.AW,{path:"/",element:(0,h.jsx)(J.TechDocsIndexPage,{})}),(0,h.jsx)(m.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(D.TechDocsReaderPage,{})})]}),ie=R=>{var I;const{children:k}=R,{entity:O}=(0,T.X2)(),A=(0,m.V$)([{path:"/*",element:(0,h.jsx)(Y,{entity:O}),children:[{path:"*",element:k}]}]);return((I=O.metadata.annotations)===null||I===void 0?void 0:I[K])?A:(0,h.jsx)(z.sk,{annotation:K})}},92077:function(bt,Pe,t){"use strict";t.d(Pe,{k:function(){return z},p:function(){return T}});var h=t(23054),n=t(76372),m=t.n(n);class T{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:$,namespace:ee,name:Y}=l,D=`${await this.getApiOrigin()}/metadata/techdocs/${ee}/${$}/${Y}`,K=await this.fetchApi.fetch(`${D}`);if(!K.ok)throw await h.VL.fromResponse(K);return await K.json()}async getEntityMetadata(l){const{kind:$,namespace:ee,name:Y}=l,D=`${await this.getApiOrigin()}/metadata/entity/${ee}/${$}/${Y}`,K=await this.fetchApi.fetch(`${D}`);if(!K.ok)throw await h.VL.fromResponse(K);return await K.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class z{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,$){const{kind:ee,namespace:Y,name:J}=l,K=`${await this.getStorageUrl()}/${Y}/${ee}/${J}/${$}`,W=await this.fetchApi.fetch(`${K.endsWith("/")?K:`${K}/`}index.html`);let ae="";switch(W.status){case 404:throw ae="Page not found. ",$||(ae+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ae);case 500:throw ae="Could not generate documentation or an error in the TechDocs backend. ",new Error(ae);default:break}return W.text()}async syncEntityDocs(l,$=()=>{}){const{kind:ee,namespace:Y,name:J}=l,K=`${await this.getApiOrigin()}/sync/${Y}/${ee}/${J}`,{token:W}=await this.identityApi.getCredentials();return new Promise((ae,ie)=>{const R=new n.EventSourcePolyfill(K,{withCredentials:!0,headers:W?{Authorization:`Bearer ${W}`}:{}});R.addEventListener("log",I=>{I.data&&$(JSON.parse(I.data))}),R.addEventListener("finish",I=>{let k=!1;I.data&&({updated:k}=JSON.parse(I.data)),ae(k?"updated":"cached")}),R.onerror=I=>{switch(R.close(),I.status){case 404:ie(new h.dR(I.message));return;default:ie(new Error(I.data));return}}})}async getBaseUrl(l,$,ee){const{kind:Y,namespace:J,name:D}=$,W=`${await this.getApiOrigin()}/static/docs/${J}/${Y}/${D}/${ee}`;return new URL(l,W.endsWith("/")?W:`${W}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(bt,Pe,t){"use strict";t.d(Pe,{D:function(){return h}});function h(n,m){return m.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(bt,Pe,t){"use strict";t.d(Pe,{u:function(){return $}});var h=t(52322),n=t(2784),m=t(1515),T=t(46285),z=t(42081),b=t(48431),l=t(68435);const $=ee=>{const{initialFilter:Y="owned",columns:J,actions:D}=ee;return(0,h.jsx)(z.j,{children:(0,h.jsxs)(m.VY,{children:[(0,h.jsx)(m.yW,{title:"",children:(0,h.jsx)(m.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(T.UO,{children:(0,h.jsxs)(T._i,{children:[(0,h.jsxs)(T._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(T.EW,{initialFilter:Y}),(0,h.jsx)(T.dq,{}),(0,h.jsx)(T.xE,{})]}),(0,h.jsx)(T._i.Content,{children:(0,h.jsx)(l.n,{actions:D,columns:J})})]})})]})})}},85478:function(bt,Pe,t){"use strict";t.d(Pe,{f:function(){return J}});var h=t(52322),n=t(95573),m=t(51953),T=t(25248),z=t(1515),b=t(94339),l=t(16111),$=t(24579),ee=t(14503),Y=t(2784);const J=W=>{const{entities:ae}=W,ie=(0,T.tg)(n.Fw),R=(0,T.h_)(T.Ds);if(!ae)return null;var I,k;return(0,h.jsx)(z.Oh,{"data-testid":"docs-explore",children:ae!=null&&ae.length?ae.map((O,A)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(z.hu,{title:(I=O.metadata.title)!==null&&I!==void 0?I:O.metadata.name})}),(0,h.jsx)($.Z,{children:O.metadata.description}),(0,h.jsx)(ee.Z,{children:(0,h.jsx)(z.zx,{to:ie({namespace:(0,m.D)((k=O.metadata.namespace)!==null&&k!==void 0?k:"default",R),kind:(0,m.D)(O.kind,R),name:(0,m.D)(O.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},A)):null})};var D=t(46285);const K=()=>{const{loading:W,error:ae,entities:ie}=useEntityList();if(ae)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:ae.toString()})});if(W||!ie)return _jsx(Progress,{});var R,I;return ie.sort((k,O)=>((R=k.metadata.title)!==null&&R!==void 0?R:k.metadata.name).localeCompare((I=O.metadata.title)!==null&&I!==void 0?I:O.metadata.name)),_jsx(DocsCardGrid,{entities:ie})}},68435:function(bt,Pe,t){"use strict";t.d(Pe,{H:function(){return k},n:function(){return O}});var h=t(52322),n=t(2784),m=t(95074),T=t(76635),z=t(1515),b=t(46285),l=t(25248),$=t(25271),ee=t(95573),Y=t(39981),J=t(2337),D=t(11640),K=t(28347);const W=(0,J.Z)({root:{color:"#f3ba37"}})(D.Z),ae={createCopyDocsUrlAction(A){return te=>({icon:()=>(0,h.jsx)(Y.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>A(`${window.location.origin}${te.resolved.docsUrl}`)})},createStarEntityAction(A,te){return({entity:fe})=>{const Ye=A(fe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ye?(0,h.jsx)(W,{}):(0,h.jsx)(K.Z,{}),tooltip:Ye?"Remove from favorites":"Add to favorites",onClick:()=>te(fe)}}}};function ie(A){return A.metadata.title||A.metadata.name}const R={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:A=>(0,h.jsx)(z.uw,{value:(0,h.jsx)(z.rU,{to:A.resolved.docsUrl,children:ie(A.entity)}),subvalue:A.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:A})=>(0,h.jsx)(b.rI,{entityRefs:A.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var I=t(51953);const k=A=>{const{entities:te,title:fe,loading:Ye,columns:qe,actions:He}=A,[,Xe]=(0,m.Z)(),Qe=(0,l.tg)(ee.Fw),Ue=(0,l.h_)(l.Ds);if(!te)return null;const ze=te.map(ct=>{const nt=(0,b.hF)(ct,$.S4);var Ce;return{entity:ct,resolved:{docsUrl:Qe({namespace:(0,I.D)((Ce=ct.metadata.namespace)!==null&&Ce!==void 0?Ce:"default",Ue),kind:(0,I.D)(ct.kind,Ue),name:(0,I.D)(ct.metadata.name,Ue)}),ownedByRelations:nt,ownedByRelationsTitle:nt.map(rt=>(0,b.$3)(rt,{defaultKind:"group"})).join(", ")}}}),tt=[R.createNameColumn(),R.createOwnerColumn(),R.createTypeColumn()],lt=[ae.createCopyDocsUrlAction(Xe)];return(0,h.jsx)(h.Fragment,{children:Ye||ze&&ze.length>0?(0,h.jsx)(z.iA,{isLoading:Ye,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:ze,columns:qe||tt,actions:He||lt,title:fe?`${fe} (${ze.length})`:`All (${ze.length})`}):(0,h.jsx)(z.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(z.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};k.columns=R,k.actions=ae;const O=A=>{var te;const{columns:fe,actions:Ye}=A,{loading:qe,error:He,entities:Xe,filters:Qe}=(0,b.wp)(),{isStarredEntity:Ue,toggleStarredEntity:ze}=(0,b.CR)(),[,tt]=(0,m.Z)();var lt;const ct=(0,T.capitalize)((lt=(te=Qe.user)===null||te===void 0?void 0:te.value)!==null&<!==void 0?lt:"all"),nt=[ae.createCopyDocsUrlAction(tt),ae.createStarEntityAction(Ue,ze)];return He?(0,h.jsx)(z.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(z.Oi,{language:"text",text:He.toString()})}):(0,h.jsx)(k,{title:ct,entities:Xe,loading:qe,actions:Ye||nt,columns:fe})};O.columns=R,O.actions=ae},18662:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{TechDocsIndexPage:function(){return z}});var h=t(52322),n=t(2784),m=t(10289),T=t(3482);const z=b=>(0,m.pC)()||(0,h.jsx)(T.u,{...b})},42081:function(bt,Pe,t){"use strict";t.d(Pe,{j:function(){return z}});var h=t(52322),n=t(2784),m=t(1515),T=t(25248);const z=b=>{const{children:l}=b,$=(0,T.h_)(T.Ds);var ee;const Y=`Documentation available in ${(ee=$.getOptionalString("organization.name"))!==null&&ee!==void 0?ee:"Backstage"}`;return(0,h.jsx)(m.g9,{title:"Documentation",subtitle:Y,themeId:"documentation",children:l})}},48431:function(bt,Pe,t){"use strict";t.d(Pe,{f:function(){return T}});var h=t(2784),n=t(46285);class m{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const T=()=>{const{updateFilters:z}=(0,n.wp)();return(0,h.useEffect)(()=>{z({techdocs:new m})},[z]),null}},89258:function(bt,Pe,t){"use strict";t.d(Pe,{I6:function(){return Y},Jl:function(){return ee},s4:function(){return z}});var h=t(61886),n=t(92077),m=t(95573),T=t(25248);const z=(0,T.rx)({id:"techdocs",apis:[(0,T.ni)({api:h.Dl,deps:{configApi:T.Ds,discoveryApi:T.NW,identityApi:T.$4,fetchApi:T.gP},factory:({configApi:J,discoveryApi:D,identityApi:K,fetchApi:W})=>new n.k({configApi:J,discoveryApi:D,identityApi:K,fetchApi:W})}),(0,T.ni)({api:h.gT,deps:{configApi:T.Ds,discoveryApi:T.NW,fetchApi:T.gP},factory:({configApi:J,discoveryApi:D,fetchApi:K})=>new n.p({configApi:J,discoveryApi:D,fetchApi:K})})],routes:{root:m._Z,docRoot:m.Fw,entityContent:m.pd}}),b=z.provide((0,T.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(J=>J.Router),mountPoint:m._Z})),l=z.provide((0,T.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(J=>J.EmbeddedDocsRouter),mountPoint:m.pd})),$=z.provide((0,T.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(J=>J.TechDocsCustomHome),mountPoint:m._Z})),ee=z.provide((0,T.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(J=>J.TechDocsIndexPage),mountPoint:m._Z})),Y=z.provide((0,T.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(J=>J.TechDocsReaderPage),mountPoint:m.Fw}))},7476:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{TechDocsReaderLayout:function(){return J},TechDocsReaderPage:function(){return D}});var h=t(52322),n=t(2784),m=t(10289),T=t(1515),z=t(61886),b=t(67896),l=t(93225),$=t(65124),ee=t(95573),Y=t(25248);const J=({withSearch:K,withHeader:W=!0})=>(0,h.jsxs)(T.T3,{themeId:"documentation",children:[W&&(0,h.jsx)(l.S,{}),(0,h.jsx)($.b,{}),(0,h.jsx)(b.F,{withSearch:K})]}),D=K=>{const{kind:W,name:ae,namespace:ie}=(0,Y.Oi)(ee.Fw),{children:R,entityRef:I={kind:W,name:ae,namespace:ie}}=K,k=(0,m.pC)();if(!R){const A=(k?n.Children.toArray(k.props.children):[]).find(te=>{var fe,Ye;if((0,Y.IY)(te,z.Zz))return!1;const qe=(fe=te)===null||fe===void 0||(Ye=fe.props)===null||Ye===void 0?void 0:Ye.children;return qe?!n.Children.toArray(qe).some(He=>(0,Y.IY)(He,z.Zz)):!0});return(0,h.jsx)(z.ZS,{entityRef:I,children:A||(0,h.jsx)(J,{})})}return(0,h.jsx)(z.ZS,{entityRef:I,children:({metadata:O,entityMetadata:A,onReady:te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(T.T3,{themeId:"documentation",children:R instanceof Function?R({entityRef:I,techdocsMetadataValue:O.value,entityMetadataValue:A.value,onReady:te}):R})})})}},67896:function(bt,Pe,t){"use strict";t.d(Pe,{F:function(){return Ht}});var h=t(52322),n=t(2784),m=t(79692),T=t(60905),z=t(61886),b=t(1515),l=t(17339),$=t(4614),ee=t(77277),Y=t(99688),J=t(12420),D=t(90436),K=t(61837),W=t(4190),ae=t(87685);const ie=(0,m.Z)(E=>(0,J.Z)({paper:{width:"100%",[E.breakpoints.up("sm")]:{width:"75%"},[E.breakpoints.up("md")]:{width:"50%"},padding:E.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:E.palette.background.default}})),R=({buildLog:E,onClose:_})=>{const ye=ie(),ge=E.length===0?"Waiting for logs...":E.join(`
|
|
32
|
-
`);return(0,h.jsxs)(T.Z,{container:!0,direction:"column",className:ye.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(T.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(D.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(K.Z,{title:"Close the drawer",onClick:_,color:"inherit",children:(0,h.jsx)(ae.Z,{})},"dismiss")]}),(0,h.jsx)(b.nU,{text:ge,classes:{root:ye.logs}})]})},I=({buildLog:E})=>{const _=ie(),[ye,ge]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ee.Z,{color:"inherit",onClick:()=>ge(!0),children:"Show Build Logs"}),(0,h.jsx)(W.ZP,{classes:{paper:_.paper},anchor:"right",open:ye,onClose:()=>ge(!1),children:(0,h.jsx)(R,{buildLog:E,onClose:()=>ge(!1)})})]})};var k=t(25248);const O=({errorMessage:E})=>{const _=(0,k.h_)(k.Ds).getOptionalString("techdocs.builder");let ye="";return _!=="local"&&(ye="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,h.jsx)(b.mf,{status:"404",statusMessage:E||"Documentation not found",additionalInfo:ye})};var A=t(95481);const te=(0,m.Z)(E=>({root:{marginBottom:E.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),fe=()=>{let E=null;const _=te(),{state:ye,contentReload:ge,contentErrorMessage:ke,syncErrorMessage:De,buildLog:yt}=(0,A.DK)();return ye==="INITIAL_BUILD"&&(E=(0,h.jsx)(Y.Z,{classes:{root:_.root},variant:"outlined",severity:"info",icon:(0,h.jsx)($.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:yt}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ye==="CONTENT_STALE_REFRESHING"&&(E=(0,h.jsx)(Y.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)($.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:_.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ye==="CONTENT_STALE_READY"&&(E=(0,h.jsx)(Y.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ee.Z,{color:"inherit",onClick:()=>ge(),children:"Refresh"}),classes:{root:_.root},children:"A newer version of this documentation is now available, please refresh to view."})),ye==="CONTENT_STALE_ERROR"&&(E=(0,h.jsxs)(Y.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:_.root,message:_.message},children:["Building a newer version of this documentation failed."," ",De]})),ye==="CONTENT_NOT_FOUND"&&(E=(0,h.jsxs)(h.Fragment,{children:[De&&(0,h.jsxs)(Y.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:_.root,message:_.message},children:["Building a newer version of this documentation failed."," ",De]}),(0,h.jsx)(O,{errorMessage:ke})]})),E};var Ye=t(10289),qe=t(60364),He=t(41156),Xe=t(32838),Qe=t(35368),Ue=t.n(Qe);const ze=/main\.[A-Fa-f0-9]{8}\.min\.css$/,tt=/^https:\/\/fonts\.googleapis\.com/,lt=/^https:\/\/fonts\.gstatic\.com/,ct=E=>E.nodeName==="LINK",nt=E=>{const _=(E==null?void 0:E.getAttribute("href"))||"",ye=_.match(ze),ge=_.match(tt),ke=_.match(lt);return ye||ge||ke},Ce=E=>(ct(E)&&!nt(E)&&E.remove(),E),rt=E=>E.nodeName==="IFRAME",gt=(E,_)=>{const ye=E.getAttribute("src")||"";try{const{host:ge}=new URL(ye);return _.includes(ge)}catch{return!1}},Re=E=>_=>(rt(_)&&!gt(_,E)&&_.remove(),_),se=()=>{const E=(0,k.h_)(k.Ds);return(0,n.useMemo)(()=>E.getOptionalConfig("techdocs.sanitizer"),[E])},xe=()=>{const E=se();return(0,n.useCallback)(async _=>{const ye=E==null?void 0:E.getOptionalStringArray("allowedIframeHosts");Ue().addHook("beforeSanitizeElements",Ce);const ge=["link"];return ye&&(ge.push("iframe"),Ue().addHook("beforeSanitizeElements",Re(ye))),Ue().sanitize(_.innerHTML,{ADD_TAGS:ge,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[E])};var Te=t(41128),st=({theme:E})=>`
|
|
33
|
-
/*================== Variables ==================*/
|
|
34
|
-
/*
|
|
35
|
-
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.
|
|
36
|
-
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.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
:host {
|
|
40
|
-
/* FONT */
|
|
41
|
-
--md-default-fg-color: ${E.palette.text.primary};
|
|
42
|
-
--md-default-fg-color--light: ${E.palette.text.secondary};
|
|
43
|
-
--md-default-fg-color--lighter: ${(0,Te.$n)(E.palette.text.secondary,.7)};
|
|
44
|
-
--md-default-fg-color--lightest: ${(0,Te.$n)(E.palette.text.secondary,.3)};
|
|
45
|
-
|
|
46
|
-
/* BACKGROUND */
|
|
47
|
-
--md-default-bg-color:${E.palette.background.default};
|
|
48
|
-
--md-default-bg-color--light: ${E.palette.background.paper};
|
|
49
|
-
--md-default-bg-color--lighter: ${(0,Te.$n)(E.palette.background.paper,.7)};
|
|
50
|
-
--md-default-bg-color--lightest: ${(0,Te.$n)(E.palette.background.paper,.3)};
|
|
51
|
-
|
|
52
|
-
/* PRIMARY */
|
|
53
|
-
--md-primary-fg-color: ${E.palette.primary.main};
|
|
54
|
-
--md-primary-fg-color--light: ${E.palette.primary.light};
|
|
55
|
-
--md-primary-fg-color--dark: ${E.palette.primary.dark};
|
|
56
|
-
--md-primary-bg-color: ${E.palette.primary.contrastText};
|
|
57
|
-
--md-primary-bg-color--light: ${(0,Te.$n)(E.palette.primary.contrastText,.7)};
|
|
58
|
-
|
|
59
|
-
/* ACCENT */
|
|
60
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
61
|
-
|
|
62
|
-
/* SHADOW */
|
|
63
|
-
--md-shadow-z1: ${E.shadows[1]};
|
|
64
|
-
--md-shadow-z2: ${E.shadows[2]};
|
|
65
|
-
--md-shadow-z3: ${E.shadows[3]};
|
|
66
|
-
|
|
67
|
-
/* EXTENSIONS */
|
|
68
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
69
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
70
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
71
|
-
--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>');
|
|
72
|
-
--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>');
|
|
73
|
-
--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>');
|
|
74
|
-
--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>');
|
|
75
|
-
--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>');
|
|
76
|
-
--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>');
|
|
77
|
-
--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>');
|
|
78
|
-
--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>');
|
|
79
|
-
--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>');
|
|
80
|
-
--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>');
|
|
81
|
-
--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>');
|
|
82
|
-
--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>');
|
|
83
|
-
--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>');
|
|
84
|
-
--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>');
|
|
85
|
-
--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>');
|
|
86
|
-
--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>');
|
|
87
|
-
--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>');
|
|
88
|
-
--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>');
|
|
89
|
-
--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>');
|
|
90
|
-
--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>');
|
|
91
|
-
--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>');
|
|
92
|
-
--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>');
|
|
93
|
-
--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>');
|
|
94
|
-
--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>');
|
|
95
|
-
--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>');
|
|
96
|
-
--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>');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host > * {
|
|
100
|
-
/* CODE */
|
|
101
|
-
--md-code-fg-color: ${E.palette.text.primary};
|
|
102
|
-
--md-code-bg-color: ${E.palette.background.paper};
|
|
103
|
-
--md-code-hl-color: ${(0,Te.Fq)(E.palette.warning.main,.5)};
|
|
104
|
-
--md-code-hl-keyword-color: ${E.palette.type==="dark"?E.palette.primary.light:E.palette.primary.dark};
|
|
105
|
-
--md-code-hl-function-color: ${E.palette.type==="dark"?E.palette.secondary.light:E.palette.secondary.dark};
|
|
106
|
-
--md-code-hl-string-color: ${E.palette.type==="dark"?E.palette.success.light:E.palette.success.dark};
|
|
107
|
-
--md-code-hl-number-color: ${E.palette.type==="dark"?E.palette.error.light:E.palette.error.dark};
|
|
108
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
109
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
110
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
111
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
112
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
113
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
114
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
115
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
116
|
-
|
|
117
|
-
/* TYPESET */
|
|
118
|
-
--md-typeset-font-size: 1rem;
|
|
119
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
120
|
-
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
121
|
-
--md-typeset-table-color: ${E.palette.text.primary};
|
|
122
|
-
--md-typeset-del-color: ${E.palette.type==="dark"?(0,Te.Fq)(E.palette.error.dark,.5):(0,Te.Fq)(E.palette.error.light,.5)};
|
|
123
|
-
--md-typeset-ins-color: ${E.palette.type==="dark"?(0,Te.Fq)(E.palette.success.dark,.5):(0,Te.Fq)(E.palette.success.light,.5)};
|
|
124
|
-
--md-typeset-mark-color: ${E.palette.type==="dark"?(0,Te.Fq)(E.palette.warning.dark,.5):(0,Te.Fq)(E.palette.warning.light,.5)};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@media screen and (max-width: 76.1875em) {
|
|
128
|
-
:host > * {
|
|
129
|
-
/* TYPESET */
|
|
130
|
-
--md-typeset-font-size: .9rem;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@media screen and (max-width: 600px) {
|
|
135
|
-
:host > * {
|
|
136
|
-
/* TYPESET */
|
|
137
|
-
--md-typeset-font-size: .7rem;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
`,ft=({theme:E})=>`
|
|
141
|
-
/*================== Reset ==================*/
|
|
142
|
-
|
|
143
|
-
body {
|
|
144
|
-
--md-text-color: var(--md-default-fg-color);
|
|
145
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
146
|
-
--md-text-font-family: ${E.typography.fontFamily};
|
|
147
|
-
font-family: var(--md-text-font-family);
|
|
148
|
-
background-color: unset;
|
|
149
|
-
}
|
|
150
|
-
`;const Ct="224px";var dt=({theme:E,sidebar:_})=>`
|
|
151
|
-
/*================== Layout ==================*/
|
|
152
|
-
|
|
153
|
-
.md-grid {
|
|
154
|
-
max-width: 100%;
|
|
155
|
-
margin: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.md-nav {
|
|
159
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
160
|
-
}
|
|
161
|
-
.md-nav__link {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
justify-content: space-between;
|
|
165
|
-
}
|
|
166
|
-
.md-nav__icon {
|
|
167
|
-
height: 20px !important;
|
|
168
|
-
width: 20px !important;
|
|
169
|
-
margin-left:${E.spacing(1)}px;
|
|
170
|
-
}
|
|
171
|
-
.md-nav__icon svg {
|
|
172
|
-
margin: 0;
|
|
173
|
-
width: 20px !important;
|
|
174
|
-
height: 20px !important;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon:after {
|
|
177
|
-
width: 20px !important;
|
|
178
|
-
height: 20px !important;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
182
|
-
text-decoration: underline;
|
|
183
|
-
color: var(--md-typeset-a-color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.md-main__inner {
|
|
187
|
-
margin-top: 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.md-sidebar {
|
|
191
|
-
bottom: 75px;
|
|
192
|
-
position: fixed;
|
|
193
|
-
width: 16rem;
|
|
194
|
-
overflow-y: auto;
|
|
195
|
-
overflow-x: hidden;
|
|
196
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
197
|
-
scrollbar-width: thin;
|
|
198
|
-
}
|
|
199
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
200
|
-
width: calc(12.1rem);
|
|
201
|
-
}
|
|
202
|
-
.md-sidebar--secondary {
|
|
203
|
-
right: ${E.spacing(3)}px;
|
|
204
|
-
}
|
|
205
|
-
.md-sidebar::-webkit-scrollbar {
|
|
206
|
-
width: 5px;
|
|
207
|
-
}
|
|
208
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
209
|
-
width: 5px;
|
|
210
|
-
height: 5px;
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
213
|
-
background: #eee;
|
|
214
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
215
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
216
|
-
border-radius: 3px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
219
|
-
width: 5px;
|
|
220
|
-
background: rgb(193, 193, 193);
|
|
221
|
-
border: transparent;
|
|
222
|
-
border-radius: 3px;
|
|
223
|
-
}
|
|
224
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
225
|
-
background: rgb(125, 125, 125);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.md-content {
|
|
229
|
-
max-width: calc(100% - 16rem * 2);
|
|
230
|
-
margin-left: 16rem;
|
|
231
|
-
margin-bottom: 50px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.md-footer {
|
|
235
|
-
position: fixed;
|
|
236
|
-
bottom: 0px;
|
|
237
|
-
}
|
|
238
|
-
.md-footer__title {
|
|
239
|
-
background-color: unset;
|
|
240
|
-
}
|
|
241
|
-
.md-footer-nav__link {
|
|
242
|
-
width: 16rem;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.md-dialog {
|
|
246
|
-
background-color: unset;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
@media screen and (min-width: 76.25em) {
|
|
250
|
-
.md-sidebar {
|
|
251
|
-
height: auto;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
@media screen and (max-width: 76.1875em) {
|
|
256
|
-
.md-nav {
|
|
257
|
-
transition: none !important;
|
|
258
|
-
background-color: var(--md-default-bg-color)
|
|
259
|
-
}
|
|
260
|
-
.md-nav--primary .md-nav__title {
|
|
261
|
-
cursor: auto;
|
|
262
|
-
color: var(--md-default-fg-color);
|
|
263
|
-
font-weight: 700;
|
|
264
|
-
white-space: normal;
|
|
265
|
-
line-height: 1rem;
|
|
266
|
-
height: auto;
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-flow: column;
|
|
269
|
-
row-gap: 1.6rem;
|
|
270
|
-
padding: 1.2rem .8rem .8rem;
|
|
271
|
-
background-color: var(--md-default-bg-color);
|
|
272
|
-
}
|
|
273
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
277
|
-
border-top: none;
|
|
278
|
-
}
|
|
279
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
280
|
-
display: none;
|
|
281
|
-
}
|
|
282
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
283
|
-
color: var(--md-default-fg-color);
|
|
284
|
-
position: static;
|
|
285
|
-
height: auto;
|
|
286
|
-
margin: 0 0 0 -0.2rem;
|
|
287
|
-
}
|
|
288
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
289
|
-
padding-top: 0;
|
|
290
|
-
}
|
|
291
|
-
.md-nav--primary .md-nav__item {
|
|
292
|
-
border-top: none;
|
|
293
|
-
}
|
|
294
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
295
|
-
font-size : var(--md-typeset-font-size);
|
|
296
|
-
}
|
|
297
|
-
.md-nav .md-source {
|
|
298
|
-
display: none;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.md-sidebar {
|
|
302
|
-
height: 100%;
|
|
303
|
-
}
|
|
304
|
-
.md-sidebar--primary {
|
|
305
|
-
width: 12.1rem !important;
|
|
306
|
-
z-index: 200;
|
|
307
|
-
left: ${_.isPinned?`calc(-12.1rem + ${Ct})`:"calc(-12.1rem + 72px)"} !important;
|
|
308
|
-
}
|
|
309
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
310
|
-
display: none;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.md-content {
|
|
314
|
-
max-width: 100%;
|
|
315
|
-
margin-left: 0;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.md-header__button {
|
|
319
|
-
margin: 0.4rem 0;
|
|
320
|
-
margin-left: 0.4rem;
|
|
321
|
-
padding: 0;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.md-overlay {
|
|
325
|
-
left: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.md-footer {
|
|
329
|
-
position: static;
|
|
330
|
-
padding-left: 0;
|
|
331
|
-
}
|
|
332
|
-
.md-footer-nav__link {
|
|
333
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
334
|
-
width: 50%;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
@media screen and (max-width: 600px) {
|
|
339
|
-
.md-sidebar--primary {
|
|
340
|
-
left: -12.1rem !important;
|
|
341
|
-
width: 12.1rem;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`;const jt=["h1","h2","h3","h4","h5","h6"];var St=({theme:E})=>`
|
|
345
|
-
/*================== Typeset ==================*/
|
|
346
|
-
|
|
347
|
-
.md-typeset {
|
|
348
|
-
font-size: var(--md-typeset-font-size);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
${jt.reduce((_,ye)=>{var ge;const ke=(ge=E.typography.htmlFontSize)!==null&&ge!==void 0?ge:16,De=E.typography[ye],{lineHeight:yt,fontFamily:Dt,fontWeight:_t,fontSize:Ut}=De,nn=Ot=>{let rn=1;return typeof Ot=="number"&&(rn=Ot/ke*.6),typeof Ot=="string"&&(rn=Ot.replace("rem","")),`calc(${rn} * var(--md-typeset-font-size))`};return _.concat(`
|
|
352
|
-
.md-typeset ${ye} {
|
|
353
|
-
color: var(--md-default-fg-color);
|
|
354
|
-
line-height: ${yt};
|
|
355
|
-
font-family: ${Dt};
|
|
356
|
-
font-weight: ${_t};
|
|
357
|
-
font-size: ${nn(Ut)};
|
|
358
|
-
}
|
|
359
|
-
`)},"")}
|
|
360
|
-
|
|
361
|
-
.md-typeset .md-content__button {
|
|
362
|
-
color: var(--md-default-fg-color);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.md-typeset hr {
|
|
366
|
-
border-bottom: 0.05rem dotted ${E.palette.divider};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.md-typeset details {
|
|
370
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
371
|
-
}
|
|
372
|
-
.md-typeset details summary {
|
|
373
|
-
padding-left: 2.5rem !important;
|
|
374
|
-
}
|
|
375
|
-
.md-typeset details summary:before,
|
|
376
|
-
.md-typeset details summary:after {
|
|
377
|
-
top: 50% !important;
|
|
378
|
-
width: 20px !important;
|
|
379
|
-
height: 20px !important;
|
|
380
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
381
|
-
}
|
|
382
|
-
.md-typeset details[open] > summary:after {
|
|
383
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.md-typeset blockquote {
|
|
387
|
-
color: var(--md-default-fg-color--light);
|
|
388
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.md-typeset table:not([class]) {
|
|
392
|
-
font-size: var(--md-typeset-font-size);
|
|
393
|
-
border: 1px solid var(--md-default-fg-color);
|
|
394
|
-
border-bottom: none;
|
|
395
|
-
border-collapse: collapse;
|
|
396
|
-
}
|
|
397
|
-
.md-typeset table:not([class]) th {
|
|
398
|
-
font-weight: bold;
|
|
399
|
-
}
|
|
400
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
401
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
405
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
406
|
-
}
|
|
407
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
408
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
409
|
-
}
|
|
410
|
-
`,Pt=()=>`
|
|
411
|
-
/*================== Animations ==================*/
|
|
412
|
-
/*
|
|
413
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
414
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
415
|
-
*/
|
|
416
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
417
|
-
transition: none;
|
|
418
|
-
}
|
|
419
|
-
`,zt=({theme:E})=>`
|
|
420
|
-
/*================== Extensions ==================*/
|
|
421
|
-
|
|
422
|
-
/* HIGHLIGHT */
|
|
423
|
-
.highlight .md-clipboard:after {
|
|
424
|
-
content: unset;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.highlight .nx {
|
|
428
|
-
color: ${E.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/* CODE HILITE */
|
|
432
|
-
.codehilite .gd {
|
|
433
|
-
background-color: ${E.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.codehilite .gi {
|
|
437
|
-
background-color: ${E.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* TABBED */
|
|
441
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
442
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
443
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
444
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
445
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
446
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
447
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
448
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
449
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
450
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
451
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
452
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
453
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
454
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
455
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
456
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
457
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
458
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
459
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
460
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
461
|
-
color: var(--md-accent-fg-color);
|
|
462
|
-
border-color: var(--md-accent-fg-color);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/* TASK-LIST */
|
|
466
|
-
.task-list-control .task-list-indicator::before {
|
|
467
|
-
background-color: ${E.palette.action.disabledBackground};
|
|
468
|
-
}
|
|
469
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
470
|
-
background-color: ${E.palette.success.main};
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* ADMONITION */
|
|
474
|
-
.admonition {
|
|
475
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
476
|
-
}
|
|
477
|
-
.admonition .admonition-title {
|
|
478
|
-
padding-left: 2.5rem !important;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.admonition .admonition-title:before {
|
|
482
|
-
top: 50% !important;
|
|
483
|
-
width: 20px !important;
|
|
484
|
-
height: 20px !important;
|
|
485
|
-
transform: translateY(-50%) !important;
|
|
486
|
-
}
|
|
487
|
-
`;const mt=[st,ft,dt,St,Pt,zt],ln=()=>(0,b.Pf)(),Nt=()=>{const E=ln(),_=(0,qe.Z)();return(0,n.useMemo)(()=>{const ye={theme:_,sidebar:E};return mt.reduce((ge,ke)=>ge+ke(ye),"")},[_,E])},dn=()=>{const E=Nt();return(0,n.useCallback)(_=>(_.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${E}</style>`),_),[E])},un=(E,_,ye)=>{const ge=E==="src"&&_.endsWith(".svg"),ke=!_.match(/^([a-z]*:)?\/\//i),De=_.startsWith(ye);return ge&&(ke||De)},Ln=({techdocsStorageApi:E,entityId:_,path:ye})=>async ge=>{const ke=await E.getApiOrigin(),De=async(yt,Dt)=>{for(const _t of yt)if(_t.hasAttribute(Dt)){const Ut=_t.getAttribute(Dt);if(!Ut)return;const nn=await E.getBaseUrl(Ut,_,ye);if(un(Dt,Ut,ke))try{const rn=await(await fetch(nn,{credentials:"include"})).text();_t.setAttribute(Dt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(rn)))}`)}catch{_t.setAttribute("alt",`Error: ${Ut}`)}else _t.setAttribute(Dt,nn)}};return await Promise.all([De(ge.querySelectorAll("img"),"src"),De(ge.querySelectorAll("script"),"src"),De(ge.querySelectorAll("source"),"src"),De(ge.querySelectorAll("link"),"href"),De(ge.querySelectorAll("a[download]"),"href")]),ge};var fn=t(39619),On=t(67097),je=t(28316),Ae=t(82717),Be=t.n(Ae);const We=E=>_=>{var ye;const ge=_.querySelector('[title="Edit this page"]');if(!ge||!ge.href)return _;const ke=new URL(ge.href),De=E.byUrl(ke);if((De==null?void 0:De.type)!=="github"&&(De==null?void 0:De.type)!=="gitlab")return _;const yt=((ye=_.querySelector("article>h1"))===null||ye===void 0?void 0:ye.childNodes[0].textContent)||"",Dt=encodeURIComponent(`Documentation Feedback: ${yt}`),_t=encodeURIComponent(`Page source:
|
|
488
|
-
${ge.href}
|
|
489
|
-
|
|
490
|
-
Feedback:`),Ut=(De==null?void 0:De.type)==="github"?(0,fn.Pb)(ke.href,"blob"):ke.href,nn=Be()(Ut),Ot=`/${nn.organization}/${nn.name}`,rn=ge.cloneNode();switch(De==null?void 0:De.type){case"gitlab":rn.href=`${ke.origin}${Ot}/issues/new?issue[title]=${Dt}&issue[description]=${_t}`;break;case"github":rn.href=`${ke.origin}${Ot}/issues/new?title=${Dt}&body=${_t}`;break;default:return _}return je.render(n.createElement(On.Z),rn),rn.style.paddingLeft="5px",rn.title="Leave feedback for this page",rn.id="git-feedback-link",ge==null||ge.insertAdjacentElement("beforebegin",rn),_};var _e=t(44882);const at=()=>E=>{const _=E.querySelector('.md-header label[for="__drawer"]'),ye=E.querySelector("article");if(!_||!ye)return E;const ge=_.cloneNode();return je.render(n.createElement(_e.Z),ge),ge.id="toggle-sidebar",ge.title="Toggle Sidebar",ge.classList.add("md-content__button"),ge.style.setProperty("padding","0 0 0 5px"),ge.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ye==null||ye.prepend(ge),E},pt=()=>E=>(((ye,ge)=>{Array.from(ye).filter(ke=>ke.hasAttribute(ge)).forEach(ke=>{const De=ke.getAttribute(ge);if(De){De.match(/^https?:\/\//i)&&ke.setAttribute("target","_blank");try{const yt=wt(window.location.href);ke.setAttribute(ge,new URL(De,yt).toString())}catch{ke.replaceWith(ke.textContent||De)}}})})(Array.from(E.getElementsByTagName("a")),"href"),E);function wt(E){const _=new URL(E);return!_.pathname.endsWith("/")&&!_.pathname.endsWith(".html")&&(_.pathname+="/"),_.toString()}const Tt=({baseUrl:E,onClick:_})=>ye=>(Array.from(ye.getElementsByTagName("a")).forEach(ge=>{ge.addEventListener("click",ke=>{const yt=ge.getAttribute("href");!yt||yt.startsWith(E)&&!ge.hasAttribute("download")&&(ke.preventDefault(),_(ke,yt))})}),ye);var kt=t(15459),It=t(80030),oe=t(72379),G=t(41547);const pe=(0,kt.Z)(E=>({tooltip:{fontSize:"inherit",color:E.palette.text.primary,margin:0,padding:E.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(It.ZP),ve=()=>(0,h.jsx)(oe.Z,{children:(0,h.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"})}),be=({text:E})=>{const[_,ye]=(0,n.useState)(!1),ge=(0,n.useCallback)(()=>{navigator.clipboard.writeText(E),ye(!0)},[E]),ke=(0,n.useCallback)(()=>{ye(!1)},[ye]);return(0,h.jsx)(pe,{title:"Copied to clipboard",placement:"left",open:_,onClose:ke,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ge,children:(0,h.jsx)(ve,{})})})},Ge=E=>_=>{const ye=_.querySelectorAll("pre > code");for(const ke of ye){var ge;const De=ke.textContent||"",yt=document.createElement("div");ke==null||(ge=ke.parentElement)===null||ge===void 0||ge.prepend(yt),je.render((0,h.jsx)(G.Z,{theme:E,children:(0,h.jsx)(be,{text:De})}),yt)}return _},V=()=>E=>{var _;return(_=E.querySelector(".md-header"))===null||_===void 0||_.remove(),E},w=()=>E=>{var _,ye;return(_=E.querySelector(".md-footer .md-copyright"))===null||_===void 0||_.remove(),(ye=E.querySelector(".md-footer-copyright"))===null||ye===void 0||ye.remove(),E},Q=({onLoading:E,onLoaded:_})=>ye=>(E(),ye.addEventListener(z.Ox,function ge(){_(),ye.removeEventListener(z.Ox,ge)}),ye),Ee=()=>E=>(setTimeout(()=>{if(window.location.hash){var _;const ye=window.location.hash.slice(1);(_=E==null?void 0:E.querySelector(`[id="${ye}"]`))===null||_===void 0||_.scrollIntoView()}},200),E),Oe=()=>E=>(setTimeout(()=>{const _=E==null?void 0:E.querySelectorAll("li.md-nav__item--active");_.length!==0&&(_.forEach(ge=>{const ke=ge==null?void 0:ge.querySelector("input");ke!=null&&ke.checked||ke==null||ke.click()}),_[_.length-1].scrollIntoView())},200),E),Ve=async(E,_)=>{let ye;if(typeof E=="string")ye=new DOMParser().parseFromString(E,"text/html").documentElement;else if(E instanceof Element)ye=E;else throw new Error("dom is not a recognized type");for(const ge of _)ye=await ge(ye);return ye},ot="screen and (max-width: 76.1875em)",Ft=E=>{const _=(0,Ye.s0)(),ye=(0,qe.Z)(),ge=(0,He.Z)(ot),ke=xe(),De=dn(),yt=(0,k.h_)(z.Dl),Dt=(0,k.h_)(Xe.q3),{state:_t,path:Ut,content:nn}=(0,A.DK)(),[Ot,rn]=(0,n.useState)(null),Gn=(0,z.ux)(Ot),En=(0,n.useCallback)(()=>{if(!Ot)return;Ot.querySelectorAll(".md-sidebar").forEach(x=>{if(ge)x.style.top="0px";else{const H=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const de=(u=H==null?void 0:H.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var y;let he=(y=Ot.getBoundingClientRect().top)!==null&&y!==void 0?y:0;const Ie=Ot.querySelector(".md-container > .md-tabs");var j;const et=(j=Ie==null?void 0:Ie.getBoundingClientRect().height)!==null&&j!==void 0?j:0;he<de&&(he=de),x.style.top=`${Math.max(he,0)+et}px`}x.style.setProperty("opacity","1")})},[Ot,ge]);(0,n.useEffect)(()=>(window.addEventListener("resize",En),window.addEventListener("scroll",En,!0),()=>{window.removeEventListener("resize",En),window.removeEventListener("scroll",En,!0)}),[Ot,En]);const $n=(0,n.useCallback)(()=>{if(!Ot)return;const Wt=Ot.querySelector(".md-footer");Wt&&(Wt.style.width=`${Ot.getBoundingClientRect().width}px`)},[Ot]);(0,n.useEffect)(()=>(window.addEventListener("resize",$n),()=>{window.removeEventListener("resize",$n)}),[Ot,$n]),(0,n.useEffect)(()=>{Gn||($n(),En())},[_t,Gn,$n,En]);const Bn=(0,n.useCallback)((Wt,x)=>Ve(Wt,[ke,Ln({techdocsStorageApi:yt,entityId:E,path:x}),pt(),at(),V(),w(),We(Dt),De]),[E,Dt,yt,ke,De]),qn=(0,n.useCallback)(async Wt=>Ve(Wt,[Ee(),Oe(),Ge(ye),Tt({baseUrl:window.location.origin,onClick:(x,u)=>{const y=x.ctrlKey||x.metaKey,j=new URL(u);if(j.hash)if(y)window.open(`${j.pathname}${j.hash}`,"_blank");else{var H;_(`${j.pathname}${j.hash}`),(H=Wt==null?void 0:Wt.querySelector(`[id="${j.hash.slice(1)}"]`))===null||H===void 0||H.scrollIntoView()}else y?window.open(j.pathname,"_blank"):_(j.pathname)}}),Q({onLoading:()=>{},onLoaded:()=>{var x;(x=Wt.querySelector(".md-nav__title"))===null||x===void 0||x.removeAttribute("for")}}),Q({onLoading:()=>{Array.from(Wt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ye,_]);return(0,n.useEffect)(()=>{if(!nn)return()=>{};let Wt=!0;return Bn(nn,Ut).then(async x=>{if(!(x!=null&&x.innerHTML)||!Wt)return;window.scroll({top:0});const u=await qn(x);rn(u)}),()=>{Wt=!1}},[nn,Ut,Bn,qn]),Ot};var Zt=t(8560);const qt=()=>{const E=(0,z.$L)(),{shadowRoot:_}=(0,z.x1)(),ye=_==null?void 0:_.querySelector('[data-md-component="content"]'),ge=_==null?void 0:_.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ke=ge==null?void 0:ge.querySelector('[data-techdocs-addons-location="primary sidebar"]');ke||(ke=document.createElement("div"),ke.setAttribute("data-techdocs-addons-location","primary sidebar"),ge==null||ge.prepend(ke));const De=_==null?void 0:_.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let yt=De==null?void 0:De.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return yt||(yt=document.createElement("div"),yt.setAttribute("data-techdocs-addons-location","secondary sidebar"),De==null||De.prepend(yt)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Zt.Z,{container:ke,children:E.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,h.jsx)(Zt.Z,{container:ye,children:E.renderComponentsByLocation(z.oZ.Content)}),(0,h.jsx)(Zt.Z,{container:yt,children:E.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},Vt=(0,m.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ht=(0,A.m1)(E=>{var _;const{withSearch:ye=!0,onReady:ge}=E,ke=Vt(),{entityMetadata:{value:De,loading:yt},entityRef:Dt,setShadowRoot:_t}=(0,z.x1)(),Ut=Ft(Dt),nn=(0,n.useCallback)(Ot=>{_t(Ot),ge instanceof Function&&ge()},[_t,ge]);return yt===!1&&!De?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ut?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(T.Z,{container:!0,children:[(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(fe,{})}),ye&&(0,h.jsx)(T.Z,{className:ke.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:Dt,entityTitle:De==null||(_=De.metadata)===null||_===void 0?void 0:_.title})}),(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(z.VA,{element:Ut,onAppend:nn,children:(0,h.jsx)(qt,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(T.Z,{container:!0,children:(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(fe,{})})})})}),jn=null},93225:function(bt,Pe,t){"use strict";t.d(Pe,{S:function(){return K}});var h=t(52322),n=t(2784),m=t(18671),T=t(98069),z=t(73250),b=t(61886),l=t(46285),$=t(25271),ee=t(1515),Y=t(25248),J=t(95573);const D=(0,h.jsx)(T.Z,{animation:"wave",variant:"text",height:40}),K=W=>{const{children:ae}=W,ie=(0,b.$L)(),R=(0,Y.h_)(Y.Ds),{title:I,setTitle:k,subtitle:O,setSubtitle:A,entityRef:te,metadata:{value:fe,loading:Ye},entityMetadata:{value:qe,loading:He}}=(0,b.x1)();(0,n.useEffect)(()=>{!fe||(k(fe.site_name),A(()=>{let{site_description:gt}=fe;return(!gt||gt==="None")&&(gt="Home"),gt}))},[fe,k,A]);const Xe=R.getOptional("app.title")||"Backstage",Qe=[I,O,Xe].filter(Boolean).join(" | "),{locationMetadata:Ue,spec:ze}=qe||{},tt=ze==null?void 0:ze.lifecycle,lt=qe?(0,l.hF)(qe,$.S4):[],ct=(0,Y.tg)(J._Z)(),nt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ee.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:te,title:qe==null?void 0:qe.metadata.title,defaultKind:"Component"})}),lt.length>0&&(0,h.jsx)(ee.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:lt,defaultKind:"group"})}),tt?(0,h.jsx)(ee.i9,{label:"Lifecycle",value:tt}):null,Ue&&Ue.type!=="dir"&&Ue.type!=="file"?(0,h.jsx)(ee.i9,{label:"",value:(0,h.jsx)("a",{href:Ue.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(z.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!He&&qe===void 0||!Ye&&fe===void 0?null:(0,h.jsxs)(ee.h4,{type:"Documentation",typeLink:ct,title:I||D,subtitle:O||D,children:[(0,h.jsx)(m.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Qe})}),nt,ae,ie.renderComponentsByLocation(b.oZ.Header)]})}},65124:function(bt,Pe,t){"use strict";t.d(Pe,{b:function(){return D}});var h=t(52322),n=t(2784),m=t(79692),T=t(15223),z=t(95544),b=t(80030),l=t(61837),$=t(48348),ee=t(47603),Y=t(61886);const J=(0,m.Z)(K=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:K.spacing(3,3,0)}})),D=K=>{const W=J(),[ae,ie]=(0,n.useState)(null),R=(0,n.useCallback)(Ye=>{ie(Ye.currentTarget)},[]),I=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:k,loading:O}}=(0,Y.x1)(),A=(0,Y.$L)(),te=A.renderComponentsByLocation(Y.oZ.Subheader),fe=A.renderComponentsByLocation(Y.oZ.Settings);return!te&&!fe||O===!1&&!k?null:(0,h.jsx)(T.Z,{classes:W,...K.toolbarProps,children:(0,h.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[te,fe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:R,children:(0,h.jsx)(ee.Z,{})})}),(0,h.jsx)($.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:I,keepMounted:!0,children:fe})]}):null]})})}},95481:function(bt,Pe,t){"use strict";t.d(Pe,{DK:function(){return D},m1:function(){return W}});var h=t(52322),n=t(2784),m=t(10289),T=t(61886),z=t(25248),b=t(64279),l=t(77446);function $({contentLoading:ae,content:ie,activeSyncState:R}){return ae||R==="BUILD_READY_RELOAD"||!ie&&R==="CHECKING"?"CHECKING":!ie&&R==="BUILDING"?"INITIAL_BUILD":ie?R==="BUILDING"?"CONTENT_STALE_REFRESHING":R==="BUILD_READY"?"CONTENT_STALE_READY":R==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ee(ae,ie){const R={...ae};switch(ie.type){case"sync":ie.state==="CHECKING"&&(R.buildLog=[]),R.activeSyncState=ie.state,R.syncError=ie.syncError;break;case"contentLoading":R.contentLoading=!0,R.contentError=void 0;break;case"content":typeof ie.path=="string"&&(R.path=ie.path),R.contentLoading=!1,R.content=ie.content,R.contentError=ie.contentError;break;case"buildLog":R.buildLog=R.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(R.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(R.activeSyncState="UP_TO_DATE",R.buildLog=[]),R}function Y(ae,ie,R,I){var k,O;const[A,te]=(0,n.useReducer)(ee,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),fe=(0,z.h_)(T.Dl),{retry:Ye}=(0,l.Z)(async()=>{te({type:"contentLoading"});try{const Xe=await fe.getEntityDocs({kind:ae,namespace:ie,name:R},I);return te({type:"content",content:Xe,path:I}),Xe}catch(Xe){te({type:"content",contentError:Xe,path:I})}},[fe,ae,ie,R,I]),qe=(0,n.useRef)({content:void 0,reload:()=>{}});return qe.current={content:A.content,reload:Ye},(0,b.default)(async()=>{te({type:"sync",state:"CHECKING"});const Xe=setTimeout(()=>{te({type:"sync",state:"BUILDING"})},1e3);try{switch(await fe.syncEntityDocs({kind:ae,namespace:ie,name:R},Ue=>{te({type:"buildLog",log:Ue})})){case"updated":qe.current.content?te({type:"sync",state:"BUILD_READY"}):(qe.current.reload(),te({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":te({type:"sync",state:"UP_TO_DATE"});break;default:te({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(Qe){te({type:"sync",state:"ERROR",syncError:Qe})}finally{clearTimeout(Xe)}},[ae,R,ie,fe,te,qe]),{state:(0,n.useMemo)(()=>$({activeSyncState:A.activeSyncState,contentLoading:A.contentLoading,content:A.content}),[A.activeSyncState,A.content,A.contentLoading]),contentReload:Ye,path:A.path,content:A.content,contentErrorMessage:(k=A.contentError)===null||k===void 0?void 0:k.toString(),syncErrorMessage:(O=A.syncError)===null||O===void 0?void 0:O.toString(),buildLog:A.buildLog}}const J=(0,n.createContext)({}),D=()=>(0,n.useContext)(J),K=({children:ae})=>{const{"*":ie=""}=(0,m.UO)(),{entityRef:R}=(0,T.x1)(),{kind:I,namespace:k,name:O}=R,A=Y(I,k,O,ie);return(0,h.jsx)(J.Provider,{value:A,children:ae instanceof Function?ae(A):ae})},W=ae=>ie=>(0,h.jsx)(K,{children:(0,h.jsx)(ae,{...ie})})},95573:function(bt,Pe,t){"use strict";t.d(Pe,{Fw:function(){return m},_Z:function(){return n},pd:function(){return T}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),m=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),T=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(bt,Pe,t){"use strict";t.d(Pe,{S:function(){return I}});var h=t(52322),n=t(2784),m=t(79692),T=t(49378),z=t(38402),b=t(86136),l=t(85256),$=t(1515),ee=t(25248),Y=t(23362);const J=(0,m.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),D=k=>{const{result:O,highlight:A,rank:te,lineClamp:fe=5,asListItem:Ye=!0,asLink:qe=!0,title:He,icon:Xe}=k,Qe=J(),Ue=(0,ee.z$)(),ze=()=>{Ue.captureEvent("discover",O.title,{attributes:{to:O.location},value:te})},tt=()=>{const nt=A!=null&&A.fields.title?(0,h.jsx)(Y.FA,{text:A.fields.title,preTag:A.preTag,postTag:A.postTag}):O.title,Ce=A!=null&&A.fields.entityTitle?(0,h.jsx)(Y.FA,{text:A.fields.entityTitle,preTag:A.preTag,postTag:A.postTag}):O.entityTitle,rt=A!=null&&A.fields.name?(0,h.jsx)(Y.FA,{text:A.fields.name,preTag:A.preTag,postTag:A.postTag}):O.name;return(0,h.jsx)(T.Z,{className:Qe.itemText,primaryTypographyProps:{variant:"h6"},primary:He||(0,h.jsxs)(h.Fragment,{children:[nt," | ",Ce!=null?Ce:rt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:fe,overflow:"hidden"},children:A!=null&&A.fields.text?(0,h.jsx)(Y.FA,{text:A.fields.text,preTag:A.preTag,postTag:A.postTag}):O.text})})},lt=({children:nt})=>qe?(0,h.jsx)($.rU,{noTrack:!0,to:O.location,onClick:ze,children:nt}):(0,h.jsx)(h.Fragment,{children:nt}),ct=({children:nt})=>Ye?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(z.Z,{alignItems:"flex-start",children:[Xe&&(0,h.jsx)(b.Z,{children:Xe}),(0,h.jsx)("div",{className:Qe.flexContainer,children:nt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:nt});return(0,h.jsx)(lt,{children:(0,h.jsx)(ct,{children:(0,h.jsx)(tt,{})})})};var K=t(27556),W=t(10289);const ae=(0,m.Z)(k=>({root:{width:"100%"},bar:{padding:k.spacing(1)}})),ie=k=>k==null?void 0:k.document,R=k=>{const{entityId:O,entityTitle:A,debounceTime:te=150}=k,[fe,Ye]=(0,n.useState)(!1),qe=(0,W.s0)(),{setFilters:He,result:{loading:Xe,value:Qe}}=(0,Y.Rx)(),Ue=ae(),[ze,tt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let rt=!0;if(rt&&Qe){const gt=Qe.results.slice(0,10);tt(gt)}return()=>{rt=!1}},[Xe,Qe]);const{kind:lt,name:ct,namespace:nt}=O;(0,n.useEffect)(()=>{He(rt=>({...rt,kind:lt,namespace:nt,name:ct}))},[lt,nt,ct,He]);const Ce=(rt,gt)=>{if(ie(gt)){const{location:Re}=gt.document;qe(Re)}};return(0,h.jsx)(K.Z,{className:Ue.bar,variant:"outlined",children:(0,h.jsx)(Y.qO,{classes:{root:Ue.root},"data-testid":"techdocs-search-bar",size:"small",open:fe,getOptionLabel:()=>"",filterOptions:rt=>rt,onClose:()=>{Ye(!1)},onFocus:()=>{Ye(!0)},onChange:Ce,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:ze,renderOption:({document:rt,highlight:gt})=>(0,h.jsx)(D,{result:rt,lineClamp:3,asListItem:!1,asLink:!1,title:rt.title,highlight:gt}),loading:Xe,inputDebounceTime:te,inputPlaceholder:`Search ${A||O.name} docs`,freeSolo:!1})})},I=k=>{const O={term:"",types:["techdocs"],pageCursor:"",filters:k.entityId};return(0,h.jsx)(Y.Nd,{initialState:O,children:(0,h.jsx)(R,{...k})})}},53260:function(){}},function(bt){var Pe=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Pe(96215)});var t=bt.O()}]);})();
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=main.a427fd55.js.map
|