@techdocs/cli 1.2.4-next.0 → 1.2.4-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/5837.f53a69b0.chunk.js +3 -0
- package/dist/embedded-app/static/{5837.45e6ec1d.chunk.js.map → 5837.f53a69b0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6051.3f1d6d7c.chunk.js → 6051.d2e9db23.chunk.js} +2 -2
- package/dist/embedded-app/static/{6051.3f1d6d7c.chunk.js.map → 6051.d2e9db23.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.b74cd97a.chunk.js → 8951.131e35ed.chunk.js} +2 -2
- package/dist/embedded-app/static/{8951.b74cd97a.chunk.js.map → 8951.131e35ed.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.8e467e32.js +494 -0
- package/dist/embedded-app/static/main.8e467e32.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.8ea19264.js +3 -0
- package/dist/embedded-app/static/module-luxon.8ea19264.js.map +1 -0
- package/dist/embedded-app/static/module-remix-run.df834241.js +12 -0
- package/dist/embedded-app/static/module-remix-run.df834241.js.map +1 -0
- package/dist/embedded-app/static/{module-yaml.b5c4d531.js → module-yaml.cb32d5ca.js} +58 -58
- package/dist/embedded-app/static/module-yaml.cb32d5ca.js.map +1 -0
- package/dist/embedded-app/static/{runtime.4fdcff32.js → runtime.8e467e32.js} +2 -2
- package/dist/embedded-app/static/{runtime.4fdcff32.js.map → runtime.8e467e32.js.map} +1 -1
- package/dist/embedded-app/static/vendor.8e467e32.js +236 -0
- package/dist/embedded-app/static/vendor.8e467e32.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/5837.45e6ec1d.chunk.js +0 -3
- package/dist/embedded-app/static/main.4fdcff32.js +0 -494
- package/dist/embedded-app/static/main.4fdcff32.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.1ec72e86.js +0 -3
- package/dist/embedded-app/static/module-luxon.1ec72e86.js.map +0 -1
- package/dist/embedded-app/static/module-yaml.b5c4d531.js.map +0 -1
- package/dist/embedded-app/static/vendor.4fdcff32.js +0 -236
- package/dist/embedded-app/static/vendor.4fdcff32.js.map +0 -1
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(jt,Fe,t){"use strict";t.d(Fe,{n3:function(){return W},MS:function(){return x}});var h=t(25271),n=t(23054),g=t(96279),I=t.n(g);const W=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class x{async getEntityAncestors(R,ne){const{kind:J,namespace:Q,name:D}=(0,h.of)(R.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}/ancestry`,ne)}async getLocationById(R,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(R)}`,ne)}async getEntities(R,ne){const{filter:J=[],fields:Q=[],offset:D,limit:X,after:_}=R!=null?R:{},he=[];for(const $ of[J].flat()){const E=[];for(const[T,ee]of Object.entries($))for(const Ie of[ee].flat())Ie===W?E.push(encodeURIComponent(T)):typeof Ie=="string"&&E.push(`${encodeURIComponent(T)}=${encodeURIComponent(Ie)}`);E.length&&he.push(`filter=${E.join(",")}`)}Q.length&&he.push(`fields=${Q.map(encodeURIComponent).join(",")}`),D!==void 0&&he.push(`offset=${D}`),X!==void 0&&he.push(`limit=${X}`),_!==void 0&&he.push(`after=${encodeURIComponent(_)}`);const ie=he.length?`?${he.join("&")}`:"",A=await this.requestRequired("GET",`/entities${ie}`,ne),L=($,E)=>{var T,ee;if(((T=$.metadata)===null||T===void 0?void 0:T.name)===void 0||$.kind===void 0||((ee=E.metadata)===null||ee===void 0?void 0:ee.name)===void 0||E.kind===void 0)return 0;const Ie=(0,h.eE)($),Qe=(0,h.eE)(E);return Ie<Qe?-1:Ie>Qe?1:0};return{items:A.sort(L)}}async getEntitiesByRefs(R,ne){var J;const Q=[];!((J=R.fields)===null||J===void 0)&&J.length&&Q.push(`fields=${R.fields.map(encodeURIComponent).join(",")}`);const D=await this.discoveryApi.getBaseUrl("catalog"),X=Q.length?`?${Q.join("&")}`:"",_=`${D}/entities/by-refs${X}`,he=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRefs:R.entityRefs})});if(!he.ok)throw await n.VL.fromResponse(he);const{items:ie}=await he.json();return{items:ie}}async getEntityByRef(R,ne){const{kind:J,namespace:Q,name:D}=(0,h.of)(R);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}`,ne)}async getEntityByName(R,ne){const{kind:J,namespace:Q="default",name:D}=R;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}`,ne)}async refreshEntity(R,ne){const J=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRef:R})});if(J.status!==200)throw new Error(await J.text())}async getEntityFacets(R,ne){const{filter:J=[],facets:Q}=R,D=[];for(const _ of[J].flat()){const he=[];for(const[ie,A]of Object.entries(_))for(const L of[A].flat())L===W?he.push(encodeURIComponent(ie)):typeof L=="string"&&he.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);he.length&&D.push(`filter=${he.join(",")}`)}for(const _ of Q)D.push(`facet=${encodeURIComponent(_)}`);const X=D.length?`?${D.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${X}`,ne)}async addLocation(R,ne){const{type:J="url",target:Q,dryRun:D}=R,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${D?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({type:J,target:Q})});if(X.status!==201)throw new Error(await X.text());const{location:_,entities:he,exists:ie}=await X.json();if(!_)throw new Error(`Location wasn't added: ${Q}`);return{location:_,entities:he,exists:ie}}async getLocationByRef(R,ne){return(await this.requestRequired("GET","/locations",ne)).map(Q=>Q.data).find(Q=>R===(0,h.NZ)(Q))}async removeLocationById(R,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(R)}`,ne)}async removeEntityByUid(R,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(R)}`,ne)}async validateEntity(R,ne,J){const Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(J==null?void 0:J.token)&&{Authorization:`Bearer ${J==null?void 0:J.token}`}},method:"POST",body:JSON.stringify({entity:R,location:ne})});if(Q.ok)return{valid:!0};if(Q.status!==400)throw await n.VL.fromResponse(Q);const{errors:D=[]}=await Q.json();return{valid:!1,errors:D}}async requestIgnored(R,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:R,headers:D});if(!X.ok)throw await n.VL.fromResponse(X)}async requestRequired(R,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:R,headers:D});if(!X.ok)throw await n.VL.fromResponse(X);return await X.json()}async requestOptional(R,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:R,headers:D});if(!X.ok){if(X.status===404)return;throw await n.VL.fromResponse(X)}return await X.json()}constructor(R){this.discoveryApi=R.discoveryApi,this.fetchApi=R.fetchApi||{fetch:I()}}}},25271:function(jt,Fe,t){"use strict";t.d(Fe,{Tf:function(){return g},P1:function(){return ge},q1:function(){return te},M6:function(){return je},l2:function(){return n},zG:function(){return h},w$:function(){return ln},nP:function(){return On},aS:function(){return Bn},S4:function(){return Qt},cz:function(){return In},iB:function(){return Xe},CV:function(){return bt},of:function(){return rt},Ou:function(){return De},eE:function(){return ct},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",g="backstage.io/edit-url",I="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",x="kubernetes.io/auth-provider";var l=t(76635),R=t.n(l);class ne{async enforce(P){return P.metadata.namespace?P:lodash.merge({metadata:{namespace:this.namespace}},P)}constructor(P=DEFAULT_NAMESPACE){this.namespace=P}}class J{static isValidPrefixAndOrSuffix(P,q,Ye,U){if(typeof P!="string")return!1;const B=P.split(q);return B.length===1?U(B[0]):B.length===2?Ye(B[0])&&U(B[1]):!1}static isJsonSafe(P){try{return R().isEqual(P,JSON.parse(JSON.stringify(P)))}catch{return!1}}static isValidDnsSubdomain(P){return typeof P=="string"&&P.length>=1&&P.length<=253&&P.split(".").every(J.isValidDnsLabel)}static isValidDnsLabel(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(P)}static isValidTag(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(P)}static isValidUrl(P){if(typeof P!="string")return!1;try{return new URL(P),!0}catch{return!1}}static isValidString(P){var q;return typeof P=="string"&&((q=P==null?void 0:P.trim())===null||q===void 0?void 0:q.length)>=1}static isNonEmptyString(P){var q;return typeof P=="string"&&((q=P==null?void 0:P.trim())===null||q===void 0?void 0:q.length)>=1}}var Q=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),X=t.n(D),_=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"}}}`),he=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 A=new Map,L=[Q,_,he,ie];function $(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const P=ae[0];throw new TypeError(`${P.instancePath||"<root>"} ${P.message}${P.params?` - ${Object.entries(P.params).map(([q,Ye])=>`${q}: ${Ye}`).join(", ")}`:""}`)}function E(ae,P={}){var q;const Ye=(q=P==null?void 0:P.disableCache)!==null&&q!==void 0?q:!1,U=Ye?"":JSON.stringify(ae);if(!Ye){const Se=A.get(U);if(Se)return Se}const B=T(ae),ce=new(X())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});B.length&&ce.addSchema(B,void 0,void 0,!0);const pe=ce.compile(ae);return Ye||A.set(U,pe),pe}function T(ae){if(typeof ae!="object")return[];const P=new Set;ae.$id&&P.add(ae.$id);const q=new Array,Ye=[ae];for(;Ye.length;){const U=Ye.pop();for(const B of ee(U))if(!P.has(B)){P.add(B);const ce=L.find(pe=>pe.$id===B);ce&&(q.push(ce),Ye.push(ce))}}return q}function*ee(ae){const P=[ae];for(;P.length;){const q=P.pop();if(typeof q=="object"&&q)for(const[Ye,U]of Object.entries(q))Ye==="$ref"&&typeof U=="string"?yield U.split("#")[0]:P.push(U)}}function Ie(ae){const P=compileAjvSchema(ae||entityEnvelopeSchema);return q=>{if(P(q)===!0)return q;throw throwAjvError(P.errors)}}function Qe(ae){const P=E(ae);return q=>{var Ye;if(P(q)===!0)return q;const B=(Ye=P.errors)===null||Ye===void 0?void 0:Ye.filter(ce=>["/kind","/apiVersion"].includes(ce.instancePath));if((B==null?void 0:B.length)&&B.every(ce=>ce.keyword==="enum"))return!1;throw $(P.errors)}}function Ze(ae){const P=compileAjvSchema(ae||entitySchema);return q=>{if(P(q)===!0)return q;throw throwAjvError(P.errors)}}class we{static isValidApiVersion(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,q=>q.length>=1&&q.length<=63&&/^[a-z0-9A-Z]+$/.test(q))}static isValidKind(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(P)}static isValidObjectName(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(P)}static isValidNamespace(P){return J.isValidDnsLabel(P)}static isValidLabelKey(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,we.isValidObjectName)}static isValidLabelValue(P){return P===""||we.isValidObjectName(P)}static isValidAnnotationKey(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,we.isValidObjectName)}static isValidAnnotationValue(P){return typeof P=="string"}}const We={isValidApiVersion:we.isValidApiVersion,isValidKind:we.isValidKind,isValidEntityName:we.isValidObjectName,isValidNamespace:we.isValidNamespace,isValidLabelKey:we.isValidLabelKey,isValidLabelValue:we.isValidLabelValue,isValidAnnotationKey:we.isValidAnnotationKey,isValidAnnotationValue:we.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function gt(ae={}){return{...We,...ae}}class nt{async enforce(P){function q(S,H,me){if(H==null)throw new Error(`${S} must have a value`);let ue;try{ue=me(H)}catch(Ce){throw new Error(`${S} could not be validated, ${Ce}`)}if(!ue){let Ce;switch(me.name){case"isValidLabelValue":case"isValidObjectName":Ce="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":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const Pe=Ce?` expected ${Ce} but found "${H}".`:"";throw new Error(`"${S}" is not valid;${Pe} 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 Ye(S,H,me){return H===void 0||q(S,H,me)}q("apiVersion",P.apiVersion,this.validators.isValidApiVersion),q("kind",P.kind,this.validators.isValidKind),q("metadata.name",P.metadata.name,this.validators.isValidEntityName),Ye("metadata.namespace",P.metadata.namespace,this.validators.isValidNamespace);var U;for(const[S,H]of Object.entries((U=P.metadata.labels)!==null&&U!==void 0?U:[]))q(`labels.${S}`,S,this.validators.isValidLabelKey),q(`labels.${S}`,H,this.validators.isValidLabelValue);var B;for(const[S,H]of Object.entries((B=P.metadata.annotations)!==null&&B!==void 0?B:[]))q(`annotations.${S}`,S,this.validators.isValidAnnotationKey),q(`annotations.${S}`,H,this.validators.isValidAnnotationValue);var ce;const pe=(ce=P.metadata.tags)!==null&&ce!==void 0?ce:[];for(let S=0;S<pe.length;++S)q(`tags.${S}`,pe[S],this.validators.isValidTag);var Se;const $e=(Se=P.metadata.links)!==null&&Se!==void 0?Se:[];for(let S=0;S<$e.length;++S){var Oe,He,ot;q(`links.${S}.url`,(Oe=$e[S])===null||Oe===void 0?void 0:Oe.url,CommonValidatorFunctions.isValidUrl),Ye(`links.${S}.title`,(He=$e[S])===null||He===void 0?void 0:He.title,CommonValidatorFunctions.isNonEmptyString),Ye(`links.${S}.icon`,(ot=$e[S])===null||ot===void 0?void 0:ot.icon,KubernetesValidatorFunctions.isValidObjectName)}return P}constructor(P=makeValidator()){this.validators=P}}class Me{async enforce(P){if(!this.validate){const U=new Ajv({allowUnionTypes:!0});this.validate=U.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(P)===!0)return P;const[Ye]=this.validate.errors||[];throw Ye?new Error(`Malformed envelope, ${Ye.instancePath||"<root>"} ${Ye.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let P=ae.indexOf(":");const q=ae.indexOf("/");q!==-1&&q<P&&(P=-1);const Ye=P===-1?void 0:ae.slice(0,P),U=q===-1?void 0:ae.slice(P+1,q),B=ae.slice(Math.max(P+1,q+1));if(Ye===""||U===""||B==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ye,namespace:U,name:B}}function Xe(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function rt(ae,P){if(!ae)throw new Error("Entity reference must not be empty");const q=P==null?void 0:P.defaultKind,Ye=(P==null?void 0:P.defaultNamespace)||h;let U,B,ce;if(typeof ae=="string"){const He=ze(ae);var pe;U=(pe=He.kind)!==null&&pe!==void 0?pe:q;var Se;B=(Se=He.namespace)!==null&&Se!==void 0?Se:Ye,ce=He.name}else{var $e;U=($e=ae.kind)!==null&&$e!==void 0?$e:q;var Oe;B=(Oe=ae.namespace)!==null&&Oe!==void 0?Oe:Ye,ce=ae.name}if(U)if(B){if(!ce){const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty name`)}}else{const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty namespace`)}else{const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:U,namespace:B,name:ce}}function ct(ae){let P,q,Ye;if("metadata"in ae){P=ae.kind;var U;q=(U=ae.metadata.namespace)!==null&&U!==void 0?U:h,Ye=ae.metadata.name}else{P=ae.kind;var B;q=(B=ae.namespace)!==null&&B!==void 0?B:h,Ye=ae.name}return`${P.toLocaleLowerCase("en-US")}:${q.toLocaleLowerCase("en-US")}/${Ye.toLocaleLowerCase("en-US")}`}class lt{async enforce(P){let q=P;for(const Ye of this.policies){const U=await Ye.enforce(q);if(!U)throw new Error(`Policy ${Ye.constructor.name} did not return a result`);q=U}return q}constructor(P){this.policies=P}}class mt{async enforce(P){for(const q of this.policies){const Ye=await q.enforce(P);if(Ye)return Ye}throw new Error("The entity did not match any known policy")}constructor(P){this.policies=P}}const vt={allOf(ae){return new lt(ae)},oneOf(ae){return new mt(ae)}};var Ke=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(ae){let P;return{async check(q){return P||(P=Qe(ae)),P(q)===q}}}const ke=se(Ke);var Re=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(Re);var xt=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 Pt=se(xt);var ft=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 Et=se(ft);var wt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const kt=se(wt),Qt="ownedBy",tn="ownerOf",Ht="consumesApi",Gt="apiConsumedBy",pn="providesApi",_t="apiProvidedBy",On="dependsOn",ln="dependencyOf",$n="parentOf",fn="childOf",Kn="memberOf",Kt="hasMember",In="partOf",Bn="hasPart";var Yt=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 gn=se(Yt);var cn=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 Rn=se(cn);var Zn=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 Cn=se(Zn),ge="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",je="backstage.io/source-location";function De(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const P=ae.indexOf(":");if(P<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const q=ae.substring(0,P).trim(),Ye=ae.substring(P+1).trim();if(!q||!Ye)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(q==="http"||q==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:q,target:Ye}}function qe(ae){const{type:P,target:q}=ae;if(P){if(!q)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${P}:${q}`}function bt(ae){var P,q,Ye,U,B;const ce=(B=(P=ae.metadata)===null||P===void 0||(q=P.annotations)===null||q===void 0?void 0:q[je])!==null&&B!==void 0?B:(Ye=ae.metadata)===null||Ye===void 0||(U=Ye.annotations)===null||U===void 0?void 0:U[ge];if(!ce)throw new Error(`Entity '${ct(ae)}' is missing location`);return De(ce)}},93414:function(jt,Fe,t){"use strict";t.d(Fe,{zx:function(){return We},Oi:function(){return vt},VY:function(){return Ii},yW:function(){return Ja},XF:function(){return ke},mn:function(){return De},NX:function(){return h},ub:function(){return Oe},mf:function(){return el},yu:function(){return yn},h4:function(){return Fi},M6:function(){return Hn},i9:function(){return ul},aR:function(){return Ri},rJ:function(){return Ir},Oh:function(){return vl},hu:function(){return fl},rU:function(){return Ze},nU:function(){return Tr},sk:function(){return Ne},Or:function(){return Jr},T3:function(){return Ui},g9:function(){return bl},Ex:function(){return vr},Gk:function(){return ar},tn:function(){return Li},Ph:function(){return un},YE:function(){return O},v7:function(){return la},R6:function(){return Ai},tR:function(){return Uo},uw:function(){return Sa},qt:function(){return yi},iA:function(){return Ni},GB:function(){return Un},po:function(){return hr},mZ:function(){return Rs},Pf:function(){return Fr}});var h={};t.r(h),t.d(h,{Nm:function(){return Re},ht:function(){return Pt},LJ:function(){return xt}});var n=t(52322),g=t(2784),I=t(25248),W=t(19928);function x(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const Z=u.alert$().subscribe(V=>i(F=>F.concat(V)));return()=>{Z.unsubscribe()}},[u]),s.length===0)return null;const[v]=s,j=()=>{i(Z=>Z.filter(V=>V!==v))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:j,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:v.severity,children:_jsxs("span",{children:[v.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),R=t(12420);const ne=(0,l.Z)(e=>(0,R.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function J(e){const{displayName:s,picture:i,customStyles:u}=e,p=ne();let v={...u};return i||(v={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:v,children:s&&extractInitials(s)})}var Q=t(77277),D=t(72779),X=t.n(D),_=t(86689),he=t(39857),ie=t(76635),A=t(73557);function L(){const[e]=(0,A.is)((0,n.jsx)(A.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const $=(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"}),E=e=>/^([a-z+.-]+):/.test(e),T=()=>{try{return(0,I.h_)(I.Ds).getOptionalString("app.baseUrl")}catch{return}},ee=()=>{const e="http://dummy.dev";var s;const i=(s=T())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,ie.trimEnd)(u,"/")},Ie=e=>{let s=String(e);const i=ee(),u=E(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Qe=e=>{if(e instanceof Array)return e.map(Qe).join(" ").trim();if(typeof e=="object"&&e){var s;return Qe(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Ze=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=$(),v=(0,I.z$)(),j=L()?Ie(i.to):i.to,Z=Qe(i.children)||j,V=E(j),F=V&&!!/^https?:/.exec(j),ve=oe=>{e==null||e(oe),s||v.captureEvent("click",Z,{attributes:{to:j}})};return V?(0,n.jsxs)(_.Z,{...F?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:j,onClick:ve,className:X()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(_.Z,{...i,ref:u,component:he.rU,to:j,onClick:ve})}),we=g.forwardRef((e,s)=>(0,n.jsx)(Ze,{ref:s,...e,color:"initial"})),We=g.forwardRef((e,s)=>(0,n.jsx)(Q.Z,{ref:s,component:we,...e}));var gt=t(60364),nt=t(61837),Me=t(80030),ze=t(19353),Xe=t(95074);function rt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,I.h_)(I.VE),[j,Z]=(0,g.useState)(!1),[{error:V},F]=(0,Xe.Z)();(0,g.useEffect)(()=>{V&&v.post(V)},[V,v]);const ve=oe=>{oe.stopPropagation(),Z(!0),F(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Me.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>Z(!1),open:j,children:(0,n.jsx)(nt.Z,{onClick:ve,"aria-label":p,children:(0,n.jsx)(ze.Z,{})})})})}var ct=t(83229),lt=t(26639),mt=t(39595);function vt(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,Z=(0,gt.Z)(),V=Z.palette.type==="dark"?lt.Z:mt.Z,F=Z.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(ct.Z,{customStyle:v,language:i,style:V,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:Z.palette.textVerySubtle},lineProps:ve=>p!=null&&p.includes(ve)?{style:{backgroundColor:F}}:{},children:s}),j&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(rt,{text:s})})]})}var Ke=t(41156),se=t(88188);function ke(e){const{title:s,to:i}=e,u=(0,Ke.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,n.jsx)(nt.Z,{component:he.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(se.Z,{})}):(0,n.jsx)(Q.Z,{component:he.rU,variant:"contained",color:"primary",to:i,children:s}):null}var Re;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Re||(Re={}));var st;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(st||(st={}));var xt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(xt||(xt={}));var Pt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Pt||(Pt={}));var ft=t(27397),Et=t(11105),wt=t(97963),kt=t(46506),Qt=t.n(kt),tn=t(54073),Ht=t.n(tn),Gt=t(10368);const pn=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function _t({node:{id:e}}){const s=pn(),[i,u]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:ve,width:oe}=j.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==i)&&(u(oe),v(ve))}},[i,p]);const Z=10,V=i+Z*2,F=p+Z*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:V,height:F,rx:10}),(0,n.jsx)("text",{ref:j,className:s.text,y:F/2,x:V/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const On="arrow-marker",ln="node",$n="edge",fn="label",Kn=(0,Gt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Kt=e=>(0,n.jsx)(_t,{...e});function In({render:e=Kt,setNode:s,node:i}){const{width:u,height:p,x:v=0,y:j=0}=i,Z=i,V=Kn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:ve,width:oe}=F.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==u)&&s(i.id,{...i,height:ve,width:oe})}},[i,u,p,s]),(0,n.jsx)("g",{ref:F,"data-testid":ln,className:V.node,transform:`translate(${v-u/2},${j-p/2})`,children:e({node:Z})})}var Bn=t(76985),Yt=t(27916),gn=t(19574),cn=t.n(gn);const Rn=(0,Gt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Zn({edge:{label:e}}){const s=Rn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Cn=(0,Gt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),ge=e=>(0,n.jsx)(Zn,{...e});function te({render:e=ge,setEdge:s,id:i,edge:u,curve:p}){const{x:v=0,y:j=0,width:Z,height:V,points:F}=u,ve=u,oe=Cn(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:tt,width:Rt}=xe.current.getBBox();tt=Math.round(tt),Rt=Math.round(Rt),(tt!==V||Rt!==Z)&&s(i,{...u,height:tt,width:Rt})}},[u,V,Z,s,i]);let Te="";const Je=g.useMemo(()=>Bn.Z().x(tt=>tt.x).y(tt=>tt.y).curve(Yt[p]),[p]);if(F){const tt=F.filter(Rt=>cn()(Rt.x)&&cn()(Rt.y));Te=Je(tt)||""}return(0,n.jsxs)(n.Fragment,{children:[Te&&(0,n.jsx)("path",{"data-testid":$n,className:oe.path,d:Te}),ve.label?(0,n.jsx)("g",{ref:xe,"data-testid":fn,className:oe.label,transform:`translate(${v},${j})`,children:e({edge:ve})}):null]})}const je="workspace";function De(e){var s,i;const{edges:u,nodes:p,renderNode:v,direction:j=Re.TOP_BOTTOM,align:Z,nodeMargin:V=50,edgeMargin:F=10,rankMargin:ve=50,paddingX:oe=0,paddingY:xe=0,acyclicer:Te,ranker:Je=xt.NETWORK_SIMPLEX,labelPosition:tt=Pt.RIGHT,labelOffset:Rt=10,edgeRanks:zt=1,edgeWeight:Xt=1,renderLabel:qt,defs:Lt,zoom:Jt="enabled",curve:Vt="curveMonotoneX",fit:xr="grow",...br}=e,Sr=(0,wt.Z)(),[Cr,ti]=g.useState(100),[Lr,ni]=g.useState(100),Wt=g.useRef(new(Qt()).graphlib.Graph),[ls,xo]=g.useState(((s=Wt.current.graph())===null||s===void 0?void 0:s.width)||0),[Pr,ri]=g.useState(((i=Wt.current.graph())===null||i===void 0?void 0:i.height)||0),[Pn,gr]=g.useState([]),[Ur,Mr]=g.useState([]),rn=Math.max(ls,Cr),hn=Math.max(Pr,Lr),cs=Math.min(Pr,Lr),zr=xr==="grow"?hn:cs,Os=g.useMemo(()=>Ht()(an=>{if(!an)return;const kn=Et.Z(an),sn=Et.Z(an.getElementById(je));function or(){kn.call(ft.sP().scaleExtent([1,10]).on("zoom",wr=>{wr.transform.x=Math.min(0,Math.max(wr.transform.x,rn-rn*wr.transform.k)),wr.transform.y=Math.min(0,Math.max(wr.transform.y,hn-hn*wr.transform.k)),sn.attr("transform",wr.transform)}))}Jt==="enabled"?or():Jt==="enable-on-click"&&kn.on("click",()=>or());const{width:ir,height:bo}=an.getBoundingClientRect();Cr!==ir&&ti(ir),Lr!==bo&&ni(bo)},100),[Lr,Cr,rn,hn,Jt]),Ki=g.useCallback(()=>{const an=Wt.current.nodes(),kn=Wt.current.edges();an.forEach(sn=>{p.some(ir=>ir.id===sn)||Wt.current.removeNode(sn)}),kn.forEach(sn=>{u.some(ir=>ir.from===sn.v&&ir.to===sn.w)||Wt.current.removeEdge(sn.v,sn.w)}),p.forEach(sn=>{const or=Wt.current.nodes().find(ir=>sn.id===ir);if(or&&Wt.current.node(or)){const{width:ir,height:bo,x:wr,y:Fl}=Wt.current.node(or);Wt.current.setNode(or,{...sn,width:ir,height:bo,x:wr,y:Fl})}else Wt.current.setNode(sn.id,{...sn,width:0,height:0})}),u.forEach(sn=>{Wt.current.setEdge(sn.from,sn.to,{...sn,label:sn.label,width:0,height:0,labelpos:tt,labeloffset:Rt,weight:Xt,minlen:zt})})},[u,p,tt,Rt,Xt,zt]),$s=g.useMemo(()=>Ht()(()=>{Qt().layout(Wt.current);const{height:an,width:kn}=Wt.current.graph(),sn=Math.max(0,an||0),or=Math.max(0,kn||0);xo(or),ri(sn),gr(Wt.current.nodes()),Mr(Wt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Wt.current.setGraph({rankdir:j,align:Z,nodesep:V,edgesep:F,ranksep:ve,marginx:oe,marginy:xe,acyclicer:Te,ranker:Je}),Ki(),$s(),$s.cancel),[Te,Z,j,F,oe,xe,V,ve,Je,Ki,$s]);function Dl(an,kn){return Wt.current.setNode(an,kn),$s(),Wt.current}function Nl(an,kn){return Wt.current.setEdge(an,kn),$s(),Wt.current}return(0,n.jsxs)("svg",{ref:Os,...br,width:"100%",height:zr,viewBox:`0 0 ${rn} ${hn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:On,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:Sr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Lt]}),(0,n.jsx)("g",{id:je,children:(0,n.jsxs)("svg",{width:ls,height:Pr,y:hn/2-Pr/2,x:rn/2-ls/2,viewBox:`0 0 ${ls} ${Pr}`,children:[Ur.map(an=>{const kn=Wt.current.edge(an);return kn?(0,n.jsx)(te,{id:an,setEdge:Nl,render:qt,edge:kn,curve:Vt},`${an.v}-${an.w}`):null}),Pn.map(an=>{const kn=Wt.current.node(an);return kn?(0,n.jsx)(In,{setNode:Dl,render:v,node:kn},an):null})]})})]})}var qe;const bt=(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:(qe=e.palette.banner.warning)!==null&&qe!==void 0?qe:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ae=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,v=bt(),Z=useApi(storageApiRef).forBucket("notifications");var V;const F=(V=Z.snapshot("dismissedBanners").value)!==null&&V!==void 0?V:[],[ve,oe]=useState(new Set(F)),xe=useObservable(Z.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Je;const tt=(Je=xe==null?void 0:xe.value)!==null&&Je!==void 0?Je:[];oe(new Set(tt))}},[xe==null?void 0:xe.value]);const Te=()=>{Z.set("dismissedBanners",[...ve,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ve.has(u),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Te,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var P=t(60905),q=t(90436),Ye=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",B=t.p+"static/createComponent.975d1e1e..svg",ce=t.p+"static/noBuild.1715fa71..svg";const pe=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Se=({missing:e})=>{const s=pe();switch(e){case"field":return(0,n.jsx)("img",{src:Ye,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:U,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:B,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:ce,alt:"no Build",className:s.generalImg});default:return null}},$e=(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 Oe(e){const{title:s,description:i,missing:u,action:p}=e,v=$e();return(0,n.jsxs)(P.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(P.Z,{container:!0,direction:"column",children:[(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(q.Z,{variant:"h5",children:s})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(q.Z,{variant:"body1",children:i})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,n.jsx)(Se,{missing:u}):u.customImage})]})}const He=`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`,ot=/^.*ANNOTATION.*$/m,S=He.match(ot)[0],H=He.split(`
|
|
12
|
+
`).findIndex(e=>ot.test(e)),me=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function ue(e){return Array.from(Array(e+1).keys(),s=>s+H)}function Ce(e){const s=e.map(i=>S.replace("ANNOTATION",i)).join(`
|
|
13
|
+
`);return He.replace(S,s)}function Pe(e){const s=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,u)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Ne(e){const{annotation:s,readMoreUrl:i}=e,u=Array.isArray(s)?s:[s],p=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=me();return(0,n.jsx)(Oe,{missing:"field",title:"Missing Annotation",description:Pe(u),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:v.code,children:(0,n.jsx)(vt,{text:Ce(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ue(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(Q.Z,{color:"primary",component:Ze,to:p,children:"Read more"})]})})}var it=t(11776),pt=t(38402),ut=t(49378),et=t(41128),St=t(27616),at=t(8284),Tt=t(70660),Bt=t(91750),Nt=t(38016);const mn=(e,s)=>(s.palette.type==="light"?et._j:et.$n)(s.palette[e].light,.6),Wn=(e,s)=>(s.palette.type==="light"?et.$n:et._j)(s.palette[e].light,.9),wn=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>mn(s,e)}})),Ut=({severity:e})=>{const s=wn({severity:e});return(0,n.jsx)(Bt.Z,{classes:s})},Ft=({severity:e})=>{const s=wn({severity:e});return(0,n.jsx)(Nt.Z,{classes:s})},dn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>Wn(s,e),color:({severity:s})=>mn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>mn(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>mn(s,e),backgroundColor:({severity:s})=>Wn(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"}),vn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Un(e){const{severity:s="warning",title:i,message:u,children:p,defaultExpanded:v}=e,j=dn({severity:s}),Z=vn(s)+(i?`: ${i}`:"");return(0,n.jsxs)(St.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,n.jsxs)(at.Z,{expandIcon:(0,n.jsx)(Ft,{severity:s}),className:j.summary,children:[(0,n.jsx)(Ut,{severity:s}),(0,n.jsx)(q.Z,{className:j.summaryText,variant:"subtitle1",children:Z})]}),(u||p)&&(0,n.jsx)(Tt.Z,{children:(0,n.jsxs)(P.Z,{container:!0,children:[u&&(0,n.jsx)(P.Z,{item:!0,xs:12,children:(0,n.jsx)(q.Z,{className:j.message,variant:"body1",children:u})}),p&&(0,n.jsx)(P.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const jn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Dn=({error:e,message:s,stack:i,children:u})=>{const p=jn();return(0,n.jsxs)(it.Z,{dense:!0,children:[(0,n.jsxs)(pt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(rt,{text:e})]}),(0,n.jsxs)(pt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(rt,{text:s})]}),i&&(0,n.jsxs)(pt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(rt,{text:i})]}),u]})};function yn(e){const{title:s,error:i,defaultExpanded:u,children:p}=e;return(0,n.jsx)(Un,{severity:"error",title:s!=null?s:i.message,defaultExpanded:u,children:(0,n.jsx)(Dn,{error:i.name,message:i.message,stack:i.stack,children:p})})}var nn=t(85256);const En=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function ar(e){var s;const{title:i,error:u,defaultExpanded:p}=e,v=En();if(u.name!=="ResponseError")return(0,n.jsx)(yn,{title:i!=null?i:u.message,defaultExpanded:p,error:u});const{body:j,cause:Z}=u,{request:V,response:F}=j,ve=`${F.statusCode}: ${Z.name}`,oe=V&&`${V.method} ${V.url}`,xe=Z.message.replace(/\\n/g,`
|
|
14
|
+
`),Te=(s=Z.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
+
`),Je=JSON.stringify(j,void 0,2);return(0,n.jsxs)(yn,{title:i!=null?i:u.message,defaultExpanded:p,error:{name:ve,message:xe,stack:Te},children:[oe&&(0,n.jsxs)(pt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:v.text},primary:"Request",secondary:V?`${oe}`:void 0}),(0,n.jsx)(rt,{text:oe})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nn.Z,{component:"li",className:v.divider}),(0,n.jsx)(pt.Z,{alignItems:"flex-start",children:(0,n.jsx)(ut.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,n.jsx)(vt,{language:"json",text:Je,showCopyCodeButton:!0})]})]})}var C=t(28316);function d(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function m(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function w(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||d(e);return p||m(v),v.appendChild(s.current),function(){s.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var G=null;const fe="core.calloutSeen";function be(){const[e,s]=useState(()=>{const u=localStorage.getItem(fe);return u?JSON.parse(u):{}}),i=useCallback((u,p)=>{const v=localStorage.getItem(fe),Z={...v?JSON.parse(v):{},[u]:p};s(Z),localStorage.setItem(fe,JSON.stringify(Z))},[]);return{states:e,setState:i}}function Be(e){const{states:s,setState:i}=be(),u=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:u}}function ht(e){const{seen:s,markSeen:i}=Be(e);return{show:s===!1,hide:i}}const $t=(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 on(e){const{featureId:s,title:i,description:u,children:p}=e,{show:v,hide:j}=useShowCallout(s),Z=usePortal("core.callout"),V=useRef(null),[F,ve]=useState(),oe=$t(),xe=useCallback(()=>{if(V.current){const Te=V.current.getBoundingClientRect(),Je=Math.max(Te.width,Te.height),tt=800,Rt=Te.x-(Je-Te.width)/2-tt,zt=Te.y-(Je-Te.height)/2-tt,Xt=Je+2*tt,qt=450,Lt=Te.x+Te.width/2-qt,Jt=Te.y-(Je-Te.height)/2+Je+20;ve({dotLeft:Rt,dotTop:zt,dotSize:Xt,borderWidth:tt,textTop:Jt,textLeft:Lt,textWidth:qt})}},[]);return useEffect(()=>(window.addEventListener("resize",xe),window.addEventListener("scroll",xe),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe)}),[xe]),useLayoutEffect(xe,[V.current,xe]),v?_jsxs(_Fragment,{children:[_jsx("div",{className:oe.featureWrapper,ref:V,children:p}),createPortal(_jsx("div",{className:oe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx("div",{className:oe.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx("div",{className:oe.pulseCircle})}),_jsxs("div",{className:oe.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:u})]})]})})}),Z)]}):_jsx(_Fragment,{children:p})}var Mn=t(35292);const kr=(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 ds({color:e="primary",disabled:s=!1,href:i="#",icon:u=(0,n.jsx)(Mn.Z,{}),label:p,onClick:v,title:j}){const Z=kr();return s?(0,n.jsxs)("div",{title:j,className:X()(Z.link,Z.disabled),children:[u,(0,n.jsx)("span",{className:Z.label,children:p})]}):(0,n.jsxs)(Ze,{title:j,className:X()(Z.link,Z[e]),to:i,onClick:v,children:[u,(0,n.jsx)("span",{className:Z.label,children:p})]})}const tr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Hn(e){const{links:s}=e,i=tr();return(0,n.jsx)("nav",{className:i.links,children:s.map((u,p)=>(0,n.jsx)(ds,{...u},p+1))})}const Gn=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
16
|
+
hsl(0, 0%, ${s}) 0%,
|
|
17
|
+
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
18
|
+
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
19
|
+
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
20
|
+
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
21
|
+
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
22
|
+
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
23
|
+
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
24
|
+
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
25
|
+
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
26
|
+
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
27
|
+
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
28
|
+
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
29
|
+
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
|
+
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
|
+
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
+
`},jr=100,Er=10,us=(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:jr,height:`calc(100% + ${Er}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Er,background:`linear-gradient(90deg, ${Gn(e.palette.type)})`},fadeRight:{right:-Er,background:`linear-gradient(270deg, ${Gn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Or(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const v=()=>{const j=p.scrollLeft,Z=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([j,Z])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,i]}function Vr(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=window.performance.now(),j=requestAnimationFrame(Z=>{if(!e.current)return;const V=Z-v,F=Math.abs(u)*V/s,oe=Math.max(i,F)*Math.sign(u);e.current.scrollBy({left:oe});const xe=u-oe;Math.sign(u)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(j)},[e,u,s,i]),p}function Wr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...v}=e,j=us(e),Z=React.useRef(),[V,F]=Or(Z),ve=Vr(Z,i,u),oe=xe=>{!Z.current||ve(xe?s:-s)};return _jsxs("div",{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:Z,children:p}),_jsx("div",{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:V===0})}),_jsx("div",{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:F===0})}),V>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>oe(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>oe(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const $r=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Yn(e){const s=$r(e),{shorthand:i,alpha:u}=e;return i?_jsx("span",{className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const Ar=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Tr(e){const{Progress:s}=(0,I.qD)().getComponents();return(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(Ar,{...e})})}const Hr=(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"}),mr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(mr,e):e,nr=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(mr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},lr={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,n.jsx)(vt,{language:v[1],text:p}):(0,n.jsx)("code",{className:s,...u,children:i})},h1:nr,h2:nr,h3:nr,h4:nr,h5:nr,h6:nr};function Bs(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:v,className:j}=e,Z=Hr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${Z.markdown} ${j}`,children:s,components:lr,linkTarget:u,transformLinkUri:p,transformImageUri:v})}var rr=t(23054);const Gr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),hs=({request:e,busy:s,setBusy:i})=>{const u=Gr(),[p,v]=useState(),j=async()=>{i(!0);try{await e.trigger()}catch(V){v(isError(V)?V.message:"An unspecified error occurred")}finally{i(!1)}},Z=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(Z,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var Kr=null;const ps=(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 Zs(e){const s=ps(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach(Z=>Z.reject())};return _jsxs(Dialog,{open:Boolean(v.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:v.map(Z=>_jsx(LoginRequestListItem,{request:Z,busy:i,setBusy:u},Z.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var fs=t(15277),gs=t.n(fs),Yr=t(29862);const ms=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Jr(e){const[s,i]=(0,g.useState)(!1),u=(0,Yr.t)(),p=ms(),v=Z=>{u()&&i(Z)};var j;return(0,n.jsx)(Me.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(gs(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var Qr=t(67358);function vr(e){const[s,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const u=setTimeout(()=>i(!0),250);return()=>clearTimeout(u)},[]),s?(0,n.jsx)(Qr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Zt=t(94339),Xr=t(14503),vs=t(24579),qr=t(32552),xn=t(15459),Jn=t(95544),ys=t(27597);const xs=(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 bs(e){const{link:s,title:i,onClick:u}=e,p=xs();return(0,n.jsxs)("div",{children:[(0,n.jsx)(nn.Z,{}),(0,n.jsx)(Ze,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(Jn.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Jn.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(q.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(ys.Z,{className:p.arrow})]})})]})}const Ss=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)(We,{to:s.href,variant:"contained",children:s.name})},Cs=class extends g.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:u}=this.state;return u?(0,n.jsx)(yn,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(Ss,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},ws=(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"}),js=(0,xn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Xr.Z),_r={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 Ir(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:Z,children:V,headerStyle:F,headerProps:ve,icon:oe,action:xe,actionsClassName:Te,actions:Je,cardClassName:tt,actionsTopRight:Rt,className:zt,noPadding:Xt,titleTypographyProps:qt}=e,Lt=ws();let Jt={},Vt={};Z&&Z.split(/[\s]+/g).forEach(Cr=>{Jt={...Jt,..._r.card[Cr]},Vt={...Vt,..._r.cardContent[Cr]}});const xr=()=>(0,n.jsxs)("div",{className:Lt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:Lt.subheader,children:i}),oe]}),br=j||(v?{slackChannel:v}:{});return(0,n.jsx)(Zt.Z,{style:Jt,className:zt,children:(0,n.jsxs)(Cs,{...br,children:[s&&(0,n.jsx)(qr.Z,{classes:{root:Lt.header,title:Lt.headerTitle,subheader:Lt.headerSubheader,avatar:Lt.headerAvatar,action:Lt.headerAction,content:Lt.headerContent},title:s,subheader:xr(),action:xe,style:{...F},titleTypographyProps:qt,...ve}),Rt&&(0,n.jsx)(js,{children:Rt}),u&&(0,n.jsx)(nn.Z,{}),(0,n.jsx)(vs.Z,{className:X()(tt,{[Lt.noPadding]:Xt}),style:Vt,children:V}),Je&&(0,n.jsx)(Xr.Z,{className:Te,children:Je}),p&&(0,n.jsx)(bs,{...p})]})})}var Ds=t(39307);const Es=(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"}),es={fractional:!0,inverse:!1,unit:"%",max:100},Ns=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||es.max,v=i?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function y(e){const[s,i]=useState(null),{getColor:u=Ns}=e,p=Es(e),{palette:v}=useTheme(),{value:j,fractional:Z,inverse:V,unit:F,max:ve,description:oe}={...es,...e},xe=Z?Math.round(j*ve):j,Te=ve!==100?Math.round(j):xe,[Je,tt]=useState(!1);return useEffect(()=>{const Rt=s,zt=()=>tt(!0),Xt=()=>tt(!1);return Rt&&oe?(Rt.addEventListener("mouseenter",zt),Rt.addEventListener("mouseleave",Xt),()=>{Rt.removeEventListener("mouseenter",zt),Rt.removeEventListener("mouseleave",Xt)}):()=>{tt(!1)}},[oe,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:v,value:Te,inverse:V,max:ve}),className:p.circle}),oe&&Je?_jsx("div",{className:p.description,children:oe}):_jsx("div",{className:p.overlay,children:isNaN(j)?"N/A":`${Te}${F}`})]})}const b=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function k(e){const s=b(e),{title:i,subheader:u,progress:p,inverse:v,deepLink:j,description:Z,icon:V,variant:F,getColor:ve}=e,oe={inverse:v,description:Z,getColor:ve,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:j,variant:F,icon:V,children:_jsx(Gauge,{...oe})})})}function N(e){const{value:s,getColor:i=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const v=i({palette:u,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var Y=t(21324),K=t(7089),de=t(1292),le=t(42494),ye=t(74603),Ee=t(56939),Le=t(12231),Ae=t(73698),Ge=t(72379);const yt=(0,l.Z)(()=>(0,R.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var _e=()=>{const e=yt();return(0,n.jsx)(Ge.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 Ot=(0,l.Z)(()=>(0,R.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Qn=()=>{const e=Ot();return(0,n.jsx)(Ge.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 Nn=(0,xn.Z)(e=>(0,R.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"})(ye.Z),cr=(0,l.Z)(e=>(0,R.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 un(e){const{multiple:s,items:i,label:u,placeholder:p,selected:v,onChange:j,triggerReset:Z,native:V=!1,disabled:F=!1,margin:ve}=e,oe=cr(),[xe,Te]=(0,g.useState)(v||(s?[]:"")),[Je,tt]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Te(s?[]:"")},[Z,s]),(0,g.useEffect)(()=>{v!==void 0&&Te(v)},[v]);const Rt=Lt=>{Te(Lt.target.value),j(Lt.target.value)},zt=Lt=>{if(F){Lt.preventDefault();return}tt(Jt=>s&&!(Lt.target instanceof HTMLElement)?!0:!Jt)},Xt=()=>{tt(!1)},qt=Lt=>()=>{const Jt=xe.filter(Vt=>Vt!==Lt);Te(Jt),j(Jt)};return(0,n.jsx)("div",{className:oe.root,children:(0,n.jsx)(de.Z,{onClickAway:Xt,children:(0,n.jsxs)(le.Z,{className:oe.formControl,children:[(0,n.jsx)(Ee.Z,{className:oe.formLabel,children:u}),(0,n.jsxs)(Ae.Z,{"aria-label":u,value:xe,native:V,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ve,onChange:Rt,onClick:zt,open:Je,input:(0,n.jsx)(Nn,{}),label:u,tabIndex:0,renderValue:Lt=>{var Jt;return s&&xe.length!==0?(0,n.jsx)("div",{className:oe.chips,children:Lt.map(Vt=>{var xr,br;return(0,n.jsx)(K.Z,{label:(xr=i.find(Sr=>Sr.value===Vt))===null||xr===void 0?void 0:xr.label,clickable:!0,onDelete:qt(Vt),className:oe.chip},(br=i.find(Sr=>Sr.value===Vt))===null||br===void 0?void 0:br.value)})}):(0,n.jsx)(q.Z,{children:xe.length===0?p||"":(Jt=i.find(Vt=>Vt.value===Lt))===null||Jt===void 0?void 0:Jt.label})},IconComponent:()=>Je?(0,n.jsx)(Qn,{}):(0,n.jsx)(_e,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(Le.Z,{value:[],children:p}),V?i&&i.map(Lt=>(0,n.jsx)("option",{value:Lt.value,children:Lt.label},Lt.value)):i&&i.map(Lt=>(0,n.jsxs)(Le.Z,{value:Lt.value,children:[s&&(0,n.jsx)(Y.Z,{color:"primary",checked:xe.includes(Lt.value)||!1,className:oe.checkbox}),Lt.label]},Lt.value))]})]})})})}const bn=()=>{},Fn=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:bn,stepHistory:[],setStepHistory:bn,onStepChange:bn});function Rr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[v,j]=useState(p),[Z,V]=useState([0]);useEffect(()=>{j(p)},[p]);const F=[];let ve;return Children.forEach(s,oe=>{isValidElement(oe)&&(oe.props.end?ve=oe:F.push(oe))}),_jsxs(_Fragment,{children:[_jsx(Fn.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:Z,setStepHistory:V,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:i?2:0,children:F})}),v>=Children.count(s)-1&&ve]})}const yr=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Br=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),An=({text:e,handleClick:s,disabled:i,last:u,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(u?"Finish":"Next")}),Sn=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:i,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),dr=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),si=({actions:e={},children:s})=>{const i=yr(),{stepperLength:u,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:Z,onStepChange:V}=useContext(VerticalStepperContext),F=(Te,Je)=>{Je&&Je(),V&&V(p,Te),v(Te)},ve=()=>{const Te=e.nextStep?e.nextStep(p,u-1):p+1;F(Te,e.onNext),Z([...j,Te])},oe=()=>{j.pop(),F(j[j.length-1],e.onBack),Z([...j])},xe=()=>{F(0,e.onRestart),Z([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(dr,{text:e.backText,handleClick:oe,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Sn,{text:e.skipText,handleClick:ve,disabled:!!u&&p>=u||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(An,{text:e.nextText,handleClick:ve,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Br,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},So=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Yi(e){const{title:s,children:i,end:u,actions:p,...v}=e,j=So();return u?_jsxs("div",{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Zr=(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 Dr(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Ji(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function oi(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Qi(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Xi(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Ln(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Fs=t(74600),Us=t(15584);const ts=e=>(0,R.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),ns={root:{border:"0",verticalAlign:"top"}},rs=e=>(0,R.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),Co=e=>(0,R.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ms=(0,xn.Z)(ts,{name:"BackstageMetadataTableTitleCell"})(Us.Z),wo=(0,xn.Z)(ns,{name:"BackstageMetadataTableCell"})(Us.Z),ii=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),ai=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(Ms,{children:e}),_jsx(wo,{colSpan:e?1:2,...i,children:s})]}),zs=(0,xn.Z)(rs,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),li=(0,xn.Z)(Co,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),ur=(0,R.Z)({root:{margin:"0 0",listStyleType:"none"}}),As=e=>(0,R.Z)({root:{...ur.root,paddingLeft:e.spacing(1)}}),Vs=(0,xn.Z)(ur,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(zs,{classes:e,children:s})),Ws=(0,xn.Z)(As,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(zs,{classes:e,children:s}));function Hs(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:Ts(u)},p));return s?_jsx(Ws,{children:i}):_jsx(Vs,{children:i})}function jo(e,s,i){const u=Object.keys(e).map(p=>{const v=Ts(e[p],!0),j=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${j}: `,v]},p)});return s?_jsx(Ws,{children:u}):_jsx(Vs,{children:u})}function Ts(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?jo(e,s,i):Array.isArray(e)?Hs(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const Eo=({value:e,options:s})=>_jsx(Fragment,{children:Ts(e,s)}),Ao=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Eo,{value:s,options:i})});function ci(e,s){return Object.keys(e).map(i=>_jsx(Ao,{title:i,value:e[i],options:s},i))}function di(e){const{metadata:s,dense:i=!0,options:u}=e,p=ci(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var To=t(49429),Io=t(86136),Gs=t(79784),Ks=t(19126),ss=t.n(Ks);function Ro(e){return qs.stringify(e,{strictNullHandling:!0})}function Ys(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Js(e,s){return Ys(e)[s]}function Lo(e,s,i){const u={...Ys(e),[s]:i};return Ro(u)}function qi(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[v,j]=useState(Js(p,e));return useEffect(()=>{const Z=Js(p,e);j(V=>isEqual(Z,V)?V:Z)},[p,j,e]),useDebouncedEffect(()=>{const Z=Lo(p,e,v);p!==Z&&u(Z,{replace:!0})},[u,v,p,e],s),[v,j]}const ui={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 Nr(){const s=(0,I.I_)().get(I.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return ui;var u;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((u=p.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var hi=t(80079);function Xn(e,s){const u=(0,I.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)(hi.Z,{...s})}function pi(e){return Xn("brokenImage",e)}function fi(e){return Xn("catalog",e)}function Po(e){return Xn("chat",e)}function _i(e){return Xn("dashboard",e)}function ea(e){return Xn("docs",e)}function ko(e){return Xn("email",e)}function Oo(e){return Xn("github",e)}function gi(e){return Xn("group",e)}function os(e){return Xn("help",e)}function ta(e){return Xn("user",e)}function na(e){return Xn("warning",e)}const mi=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),zn=({icon:e})=>{const s=(0,I.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:os;return(0,n.jsx)(u,{})};var Qs;const $o=({link:e})=>(0,n.jsx)(Ze,{to:e.url,children:(Qs=e.title)!==null&&Qs!==void 0?Qs:e.url}),vi=({item:e})=>{var s;return(0,n.jsxs)(pt.Z,{children:[(0,n.jsx)(Io.Z,{children:(0,n.jsx)(zn,{icon:e.icon})}),(0,n.jsx)(ut.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)($o,{link:u},u.url)],[])})]})};function yi(e){const{title:s,items:i,children:u}=e,{items:p}=Nr(),[v,j]=(0,g.useState)(!1),[Z,V]=(0,g.useState)(null),F=mi(),ve=(0,Ke.Z)(Te=>Te.breakpoints.down("sm")),oe=Te=>{V(Te.currentTarget),j(!0)},xe=()=>{j(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Jn.Z,{display:"flex",ml:1,children:ve?(0,n.jsx)(nt.Z,{color:"primary",size:"small",onClick:oe,"data-testid":"support-button",children:(0,n.jsx)(os,{})}):(0,n.jsx)(Q.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:oe,startIcon:(0,n.jsx)(os,{}),children:"Support"})}),(0,n.jsxs)(Gs.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:Z,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,n.jsxs)(it.Z,{className:F.popoverList,children:[s&&(0,n.jsx)(pt.Z,{alignItems:"flex-start",children:(0,n.jsx)(q.Z,{variant:"subtitle1",children:s})}),g.Children.map(u,(Te,Je)=>(0,n.jsx)(pt.Z,{alignItems:"flex-start",children:Te},`child-${Je}`)),(i!=null?i:p).map((Te,Je)=>(0,n.jsx)(vi,{item:Te},`item-${Je}`))]}),(0,n.jsx)(To.Z,{children:(0,n.jsx)(Q.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var Xs=t(18671),_s=t(16060);const Is=72,Bo=24,Zo=18,hr={drawerWidthClosed:Is,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Is,iconSize:Is-Bo*2,iconPadding:Bo,selectedIndicatorWidth:3,userBadgePadding:Zo,userBadgeDiameter:Is-Zo*2,mobileSidebarHeight:56},xi=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),Do={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},eo=e=>({...Do,...e}),bi="@backstage/core/sidebar-intro-dismissed",qn=(0,g.createContext)({sidebarConfig:hr,submenuConfig:Do}),to=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var is;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(is||(is={}));const no={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(is.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(is.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var as=t(51837);const ro={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},so=(0,g.createContext)(ro),oo=(0,as.CT)("sidebar-pin-state-context");function Si(e){const{children:s,value:i}=e;return(0,n.jsx)(so.Provider,{value:i,children:(0,n.jsx)(oo.Provider,{value:(0,as.EI)({1:i}),children:s})})}const Fr=()=>{const e=(0,g.useContext)(oo),s=(0,g.useContext)(so);if(e===void 0)return s||ro;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},No=(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"}),Fo=(0,g.createContext)({content:{contentRef:void 0}});function Uo(e){const[s,i]=(0,g.useState)(()=>no.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(qn),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{no.setSidebarPinState(s)},[s]);const j=(0,Ke.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),Z=()=>i(!s),V=No({isPinned:s,sidebarConfig:u});return(0,n.jsx)(Si,{value:{isPinned:s,toggleSidebarPinState:Z,isMobile:j},children:(0,n.jsx)(Fo.Provider,{value:v,children:(0,n.jsx)("div",{className:V.root,children:e.children})})})}function io(){const{content:e}=(0,g.useContext)(Fo);return{focusContent:(0,g.useCallback)(()=>{var i,u;e==null||(i=e.contentRef)===null||i===void 0||(u=i.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const ao={isOpen:!1,setOpen:()=>{}},lo=(0,g.createContext)(ao),co=(0,as.CT)("sidebar-open-state-context");function uo(e){const{children:s,value:i}=e;return(0,n.jsx)(lo.Provider,{value:i,children:(0,n.jsx)(co.Provider,{value:(0,as.EI)({1:i}),children:s})})}const Rs=()=>{const e=(0,g.useContext)(co),s=(0,g.useContext)(lo);if(e===void 0)return s||ao;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Mo=t(50023),_n=t(4190),zo=t(87685),Vo=t(44882),Wo=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"}})),Ho=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(qn),j=ho({sidebarConfig:v}),Z=(0,A.TH)(),{selectedMenuItemIndex:V,setSelectedMenuItemIndex:F}=(0,g.useContext)(a),ve=(xe,Te)=>{F(Te===V?-1:Te)},oe=p===V&&V>=0||p!==V&&!(V>=0)&&s===Z.pathname;return(0,n.jsx)(Wo.Z,{label:i,icon:u,component:Ze,to:s||Z.pathname,onChange:ve,value:p,selected:oe,classes:j})},po=e=>{const{children:s,to:i,label:u,icon:p,value:v}=e,{isMobile:j}=Fr();return j?(0,n.jsx)(Ho,{to:i,label:u,icon:p,value:v}):(0,n.jsx)(n.Fragment,{children:s})},fo=(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"),Ci=g.createElement(po).type,Ko=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(qn),v=fo({sidebarConfig:p});return(0,n.jsxs)(_n.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,n.jsxs)(Jn.Z,{className:v.overlayHeader,children:[(0,n.jsx)(q.Z,{variant:"h3",children:s}),(0,n.jsx)(nt.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,n.jsx)(zo.Z,{})})]}),(0,n.jsx)(Jn.Z,{component:"nav",children:e})]})},a=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),r=e=>{const{sidebarConfig:s}=(0,g.useContext)(qn),{children:i}=e,u=fo({sidebarConfig:s}),p=(0,A.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let Z=(0,I.vJ)(i,F=>F.getElements().filter(ve=>ve.type===Ci));if(i)Z.length?Z=Go(Z):Z.push((0,n.jsx)(po,{icon:(0,n.jsx)(Vo.Z,{}),children:i},"default_menu"));else return null;const V=v>=0&&!Z[v].props.to;return(0,n.jsx)(uo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(a.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,n.jsx)(Ko,{label:Z[v]&&Z[v].props.label,open:V,onClose:()=>j(-1),children:Z[v]&&Z[v].props.children}),(0,n.jsx)(Mo.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:Z})]})})},o=(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 c;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(c||(c={}));const f=e=>{const{sidebarConfig:s}=(0,g.useContext)(qn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=o({sidebarConfig:s}),Z=(0,Ke.Z)(zt=>zt.breakpoints.down("md"),{noSsr:!0}),[V,F]=(0,g.useState)(c.Closed),ve=(0,g.useRef)(),{isPinned:oe,toggleSidebarPinState:xe}=Fr(),Te=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),V!==c.Open&&!Z&&(ve.current=window.setTimeout(()=>{ve.current=void 0,F(c.Open)},i),F(c.Idle)))},Je=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),V===c.Idle?F(c.Closed):V===c.Open&&(ve.current=window.setTimeout(()=>{ve.current=void 0,F(c.Closed)},u)))},tt=V===c.Open&&!Z||oe,Rt=zt=>{zt?(F(c.Open),xe()):(F(c.Closed),xe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(M,{}),(0,n.jsx)(uo,{value:{isOpen:tt,setOpen:Rt},children:(0,n.jsx)("div",{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Te,onFocus:p?()=>{}:Te,onMouseLeave:p?()=>{}:Je,onBlur:p?()=>{}:Je,children:(0,n.jsx)("div",{className:X()(j.drawer,{[j.drawerOpen]:tt}),children:v})})})]})},O=e=>{var s;const i=xi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=eo((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:j,openDelayMs:Z,closeDelayMs:V}=e,{isMobile:F}=Fr();return F?(0,n.jsx)(r,{children:v}):(0,n.jsx)(qn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(f,{openDelayMs:Z,closeDelayMs:V,disableExpandOnHover:j,children:v})})};function M(){const{sidebarConfig:e}=(0,g.useContext)(qn),{focusContent:s,contentRef:i}=io(),u=o({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(Q.Z,{onClick:s,variant:"contained",className:X()(u.visuallyHidden),children:"Skip to content"}):null}function z(e,s){const i=new URLSearchParams(s.search).toString(),u=ss().parse(i),p=new URLSearchParams(e.search).toString(),v=ss().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(v,u)}const re=(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"}),Ve=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:v}=e,j=re(),{setIsHoveredOn:Z}=useContext(SidebarItemWithSubmenuContext),V=()=>{Z(!1)},F=useResolvedPath(u!=null?u:""),ve=useLocation();let oe=isLocationMatch(ve,F);const[xe,Te]=useState(!1),Je=()=>{Te(!xe)};return v!==void 0?(v.some(tt=>{const Rt=resolvePath(tt.to);return oe=isLocationMatch(ve,Rt),oe}),_jsxs("div",{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Je,onTouchStart:tt=>tt.stopPropagation(),className:classnames(j.item,oe?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]}),xe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&xe&&_jsx("div",{className:j.dropdown,children:v.map((tt,Rt)=>_jsx(Tooltip,{title:tt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:tt.to,underline:"none",className:j.dropdownItem,onClick:V,onTouchStart:zt=>zt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:tt.title})})},Rt))})]})):_jsx("div",{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(j.item,oe?j.selected:void 0),onClick:V,onTouchStart:tt=>tt.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]})]})})})};var Ue;const Ct=(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:(Ue=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&Ue!==void 0?Ue:"#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"}),dt=e=>{const{isOpen:s}=Rs(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(qn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,v=Ct({left:p,submenuConfig:u}),{isHoveredOn:j}=(0,g.useContext)(to),[Z,V]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{V(j)},[j]),(0,n.jsxs)("div",{className:X()(v.drawer,{[v.drawerOpen]:Z}),children:[(0,n.jsx)(q.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var It=t(76600),Dt=t(26739),Mt=t(98989),Tn=t(59797),sr=t(83543);const er=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),pr=()=>{const e=er();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 Ls=null;const Yo=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),wi=()=>{const e=Yo();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 go=null,Ps,fr;const ra=e=>(0,l.Z)(s=>{var i,u;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:(Ps=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Ps!==void 0?Ps:"#404040"}},highlighted:{background:(fr=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&fr!==void 0?fr:"#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 mo(e){return(0,g.useMemo)(()=>ra(e),[e])()}const sa=(e,s)=>(0,I.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:j})=>u=u||z(s,(0,_s.i3)(j)));return}p&&(u=z(s,(0,_s.i3)(p)))}}),u},[s.pathname]);function ji(e){return e.to===void 0}const oa=g.createElement(dt).type,ia=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:v,caseSensitive:j,activeClassName:Z="active","aria-current":V="page",...F},ve){let{pathname:oe}=(0,A.TH)(),{pathname:xe}=(0,A.WU)(s);j||(oe=oe.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Te=oe===xe;!Te&&!i&&(Te=oe.startsWith(`${xe}/`));const Je=Te?V:void 0;return(0,n.jsx)(he.rU,{...F,to:s,ref:ve,"aria-current":Je,style:{...u,...Te?v:void 0},className:X()([p,Te?Z:void 0])})}),Ei=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:Z,children:V,className:F,...ve}=e,{sidebarConfig:oe}=(0,g.useContext)(qn),xe=mo(oe),{isOpen:Te}=Rs(),Je=!Te&&v?{display:"flex",marginLeft:"24px"}:{},tt=(0,n.jsxs)("div",{style:Je,children:[(0,n.jsx)(i,{fontSize:"small"}),!Te&&v?(0,n.jsx)(Mt.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Rt=(0,n.jsx)(Dt.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:X()({[xe.closedItemIcon]:!Te}),children:tt}),zt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:xe.iconContainer,children:Rt}),u&&(0,n.jsx)(q.Z,{variant:"subtitle2",className:xe.label,children:u}),(0,n.jsx)("div",{className:xe.secondaryAction,children:V})]}),Xt=Te?zt:Rt,qt={onClick:Z,className:X()(F,xe.root,Te?xe.open:xe.closed,ji(e)&&xe.buttonItem,{[xe.highlightable]:!j})};return ji(e)?(0,n.jsx)("button",{"aria-label":u,...qt,ref:s,children:Xt}):(0,n.jsx)(ia,{...qt,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ve,children:Xt})}),aa=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(qn),u=mo(i),[p,v]=(0,g.useState)(!1),j=(0,A.TH)(),Z=sa(e,j),V=(0,Ke.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{v(!0)},ve=()=>{v(!1)},oe=()=>V?p?(0,n.jsx)(Tn.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(sr.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,n.jsx)(Mt.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)(to.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ve,onTouchStart:p?ve:F,onMouseEnter:F,className:X()(p&&u.highlighted),children:[(0,n.jsx)(Ei,{hasSubmenu:!0,className:Z?u.selected:"",...s,children:oe()}),p&&e]})})},Ai=(0,g.forwardRef)((e,s)=>{const[i]=(0,I.vJ)(e.children,u=>u.getElements().filter(p=>p.type===oa));return i?(0,n.jsx)(aa,{...e,children:i}):(0,n.jsx)(Ei,{...e,ref:s})});function Ul(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=mo(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(i),u("")},Z=oe=>{oe.key==="Enter"&&(oe.preventDefault(),j())},V=oe=>{u(oe.target.value)},F=oe=>{oe.preventDefault(),oe.stopPropagation()},ve=oe=>{j(),oe.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(Ai,{icon:v,to:e.to,onClick:ve,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:F,onChange:V,onKeyDown:Z,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Ml=(0,It.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),zl=(0,It.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),la=(0,It.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),ca=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Vl=(0,It.Z)("div")(({theme:e})=>{const s=ca(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Wl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=mo(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!i)};return _jsx("button",{onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},da=(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 ua(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=da({sidebarConfig:s}),{text:u,onClose:p}=e,v=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx("div",{className:i.introDismiss,children:_jsxs(IconButton,{onClick:v,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ti=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(ua,{text:s,onClose:v})})},ha=null,pa="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[u,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=u!=null?u:{},Z=()=>{p(F=>({...i,...F,starredItemsDismissed:!0}))},V=()=>{p(F=>({...i,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ti,{text:ha,onDismiss:Z}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ti,{text:pa,onDismiss:V})]}):null}const fa=(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 Ii(e){const{className:s,stretch:i,noPadding:u,children:p,...v}=e,{contentRef:j}=io(),Z=fa();return(0,n.jsx)("article",{ref:j,tabIndex:-1,...v,className:X()(Z.root,s,{[Z.stretch]:i,[Z.noPadding]:u}),children:p})}var ga=t(6487),ma=t(99152);const va=(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 Ri(e){const{tabs:s,onChange:i,selectedIndex:u}=e,[p,v]=(0,g.useState)(u!=null?u:0),j=va(),Z=(0,g.useCallback)((V,F)=>{u===void 0&&v(F),i&&u!==F&&i(F)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,n.jsx)("div",{className:j.tabsWrapper,children:(0,n.jsx)(ma.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:Z,value:p,children:s.map((V,F)=>(0,g.createElement)(ga.Z,{...V.tabProps,"data-testid":`header-tab-${F}`,label:V.label,key:V.id,value:F,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function ya(e){const s=(0,A.UO)(),u=e.map(({path:xe,children:Te})=>({caseSensitive:!1,path:`${xe}/*`,element:Te})).sort((xe,Te)=>Te.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,A.V$)(u))!==null&&p!==void 0?p:e[0].children;var j;let Z=(j=s["*"])!==null&&j!==void 0?j:"";Z.startsWith("/")||(Z=`/${Z}`);var V;const[F]=(V=(0,_s.fp)(u,Z))!==null&&V!==void 0?V:[],ve=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var oe;return{index:ve===-1?0:ve,element:v,route:(oe=e[ve])!==null&&oe!==void 0?oe:e[0]}}function Li(e){const{routes:s}=e,i=(0,A.s0)(),{index:u,route:p,element:v}=ya(s),j=(0,g.useMemo)(()=>s.map(V=>({id:V.path,label:V.title,tabProps:V.tabProps})),[s]),Z=V=>{let{path:F}=s[V];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),i(F)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ri,{tabs:j,selectedIndex:u,onChange:Z}),(0,n.jsxs)(Ii,{children:[(0,n.jsx)(Xs.q,{title:p.title}),v]})]})}const Jo=()=>null;(0,I.R5)(Jo,"core.gatherMountPoints",!0);function Pi(e){const s=(0,n.jsx)(Jo,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return Pi(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:v,tabProps:j}=i.props;return[{path:u,title:p,children:v,tabProps:j}]})}function xa(e){const s=Pi(e.children);return(0,n.jsx)(Li,{routes:s})}xa.Route=Jo;const ba=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Sa(e){const{value:s,subvalue:i}=e,u=ba();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:u.value,children:s}),(0,n.jsx)("div",{className:u.subvalue,children:i})]})}var Ca=t(21070),wa=t(90324),ja=t(98281),Ea=t(48049),ki=t(51209),Oi=t(33375),Aa=t(44233),Ta=t(27604),Qo=t(36444),Ia=t(37971),Ra=t(59709),La=t(17373),Pa=t(3702),ka=t(93111),vo=t(67222);const Oa=(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"}),$a=e=>{var s;const i=Oa(),{onChangeFilters:u}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,Z]=(0,g.useState)(!1),V=()=>{v({}),Z(F=>!F)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(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)(Q.Z,{color:"primary",onClick:V,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(F=>(0,n.jsx)(un,{triggerReset:j,...F.element,selected:p[F.element.label],onChange:ve=>v({...p,[F.element.label]:ve})},F.element.label))})]})},$i={Add:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ja.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Oi.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Aa.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ki.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ta.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pa.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Qo.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ia.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ra.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ki.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ea.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Oi.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Qo.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,n.jsx)(La.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ka.Z,{...e,ref:s}))};function Bi(e,s){const i=s.split(".");let u=e[i[0]];for(let p=1;p<i.length;++p){if(u===void 0)return u;const v=i[p];u=u[v]}return u}const Ba=(0,xn.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"})(vo.W$),Zi=(0,xn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(vo.UW),Za=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Da=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Na(e,s){return e.map(i=>{const u={};let p=i.cellStyle||{};if(i.highlight)if(u.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const v=p;p=(j,Z,V)=>({...v(j,Z,V),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Fa(e,s){return(0,ie.transform)(e,(i,u,p)=>{(0,ie.isEqual)(u,s[p])||(i[p]=u)})}const Di={search:"",filtersOpen:!1,filters:{}};function Ua(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:v}=e,j=Za(),Z=(0,g.useCallback)(V=>{e.onSearchChanged(V),i(V)},[e,i]);return u?(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsx)(nt.Z,{onClick:v,"aria-label":"filter list",children:(0,n.jsx)(Qo.Z,{})}),(0,n.jsxs)(q.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Zi,{...e,ref:s,onSearchChanged:Z})]}):(0,n.jsx)(Zi,{...e,ref:s,onSearchChanged:Z})}function Ni(e){const{data:s,columns:i,options:u,title:p,subtitle:v,filters:j,initialState:Z,emptyContent:V,onStateChange:F,components:ve,...oe}=e,xe=Da(),Te=(0,gt.Z)(),Je={...Di,...Z},[tt,Rt]=(0,g.useState)(Je.filtersOpen),zt=(0,g.useCallback)(()=>Rt(Pn=>!Pn),[Rt]),[Xt,qt]=(0,g.useState)(0),[Lt,Jt]=(0,g.useState)(s),[Vt,xr]=(0,g.useState)(Je.filters),br=Na(i,Te),[Sr,Cr]=(0,g.useState)(Je.search);(0,g.useEffect)(()=>{if(F){const Pn=Fa({search:Sr,filtersOpen:tt,filters:Vt},Di);F(Pn)}},[Sr,tt,Vt,F]);const ti={headerStyle:{textTransform:"uppercase"}},Lr=(0,g.useCallback)(Pn=>{var gr;return(gr=i.find(Ur=>Ur.title===Pn))===null||gr===void 0?void 0:gr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Vt){Jt(s);return}const Pn=Object.values(Vt);if(s&&Pn.flat().length){const gr=s.filter(Ur=>!!Object.entries(Vt).filter(([,Mr])=>!!Mr.length).every(([Mr,rn])=>{const hn=Bi(Ur,Lr(Mr));return Array.isArray(hn)&&Array.isArray(rn)?hn.some(cs=>rn.includes(cs)):Array.isArray(hn)?hn.includes(rn):Array.isArray(rn)?rn.includes(hn):hn===rn}));Jt(gr)}else Jt(s);qt(Pn.flat().length)},[s,Vt,Lr]);const ni=(Pn,gr)=>{const Ur=rn=>{const hn=new Set,cs=zr=>{zr!=null&&hn.add(zr)};return gr&&gr.forEach(zr=>{const Os=Bi(zr,Lr(rn));Array.isArray(Os)?Os.forEach(cs):cs(Os)}),hn},Mr=rn=>({placeholder:"All results",label:rn.column,multiple:rn.type==="multiple-select",items:[...Ur(rn.column)].sort().map(hn=>({label:hn,value:hn}))});return Pn.map(rn=>({type:rn.type,element:Mr(rn)}))},Wt=!!(j!=null&&j.length),ls=(0,g.useCallback)(Pn=>(0,n.jsx)(Ua,{setSearch:Cr,hasFilters:Wt,selectedFiltersLength:Xt,toggleFilters:zt,...Pn}),[zt,Wt,Xt,Cr]),xo=typeof s!="function"&&s.length===0,Pr=i.length,ri=(0,g.useCallback)(Pn=>V&&xo?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Pr,children:V})})}):(0,n.jsx)(vo.os,{...Pn}),[xo,V,Pr]);return(0,n.jsxs)("div",{className:xe.root,children:[tt&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,n.jsx)($a,{filters:ni(j,s),selectedFilters:Vt,onChangeFilters:xr}),(0,n.jsx)(vo.ZP,{components:{Header:Ba,Toolbar:ls,Body:ri,...ve},options:{...ti,...u},columns:br,icons:$i,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q.Z,{variant:"h5",component:"h2",children:p}),v&&(0,n.jsx)(q.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:Lt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...oe})]})}Ni.icons=Object.freeze($i);const Gl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},Ma=(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"}),Kl=e=>{const s=Ma(e),{ariaLabel:i,onClick:u}=e;return _jsx(IconButton,{onClick:u,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},za=(e,s)=>s?e?"20px":"0":"40px",Va=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>za(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Va(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Wa=(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"}),Jl=e=>{const s=Wa(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ha=(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 Ql(e){const{tabs:s}=e,i=Ha(),[u,p]=useState([0,0]),[v,j]=useState(0),[Z,V]=useState(0),[F,ve]=useState([[]]),oe=useRef(),{width:xe}=useWindowSize(),Te=(Xt,qt)=>{p([v,qt])},Je=()=>{j(v-1)},tt=()=>{j(v+1)},Rt=()=>v+1<F.length;useEffect(()=>{const qt=v===0?1:2,Lt=oe.current.offsetWidth-20-qt*30,Jt=u[0]*Z+u[1],Vt=Math.floor(Lt/170);V(Vt),ve(chunkArray(s,Vt)),p([Math.floor(Jt/Vt),Jt%Vt])},[xe,s]);const zt=v===u[0]?u[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:oe,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:zt,onChange:Te,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Je,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[v].map((Xt,qt)=>_jsx(StyledTab,{value:qt,isFirstIndex:qt===0,isFirstNav:v===0,icon:Xt.icon||void 0,label:Xt.label||void 0},qt)),Rt()&&_jsx(StyledIcon,{isNext:!0,onClick:tt,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),zt!==!1?F[v].map((Xt,qt)=>_jsx(TabPanel,{value:qt,index:zt,children:Xt.content},qt)):_jsx(TabPanel,{value:u[1],index:u[1],children:F[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ga(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 ql(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:Ga(e.data,s)})]})}const Ka=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"}),Ya=({title:e="Unknown page",className:s})=>(0,n.jsx)(q.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ja(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:v="left"}=e,j=Ka({textAlign:v})(),Z=u||(0,n.jsx)(Ya,{title:i,className:j.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Xs.q,{title:i}),(0,n.jsxs)("div",{className:j.container,children:[(0,n.jsxs)("div",{className:j.leftItemsBox,children:[Z,s&&(0,n.jsx)(q.Z,{className:j.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:j.rightItemsBox,children:p})]})]})}var Qa=t.p+"static/mic-drop.fe3ef4d0..svg";const Xa=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),qa=()=>{const e=Xa();return(0,n.jsx)("img",{src:Qa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},_a=(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 el(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,v=_a(),j=(0,A.s0)(),Z=Nr();return(0,n.jsxs)(P.Z,{container:!0,spacing:0,className:v.container,children:[(0,n.jsxs)(P.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(q.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(q.Z,{variant:"body1",className:v.subtitle,children:u}),(0,n.jsx)(q.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(q.Z,{variant:"h6",children:[(0,n.jsx)(Ze,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Ze,{to:p||Z.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(qa,{})]})}var tl=t(16173);const nl=(0,xn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(q.Z),Xo=(0,xn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Jn.Z);function rl(e){const{children:s,...i}=e,[u,p]=g.useState(null),v=g.Children.toArray(s),[j,Z,...V]=v,F=V.length?V.pop():v[v.length-1],ve=v.length>3,oe=Je=>{p(Je.currentTarget)},xe=()=>{p(null)},Te=Boolean(u);return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(tl.Z,{"aria-label":"breadcrumb",...i,children:[v.length>1&&(0,n.jsx)(Xo,{clone:!0,children:j}),v.length>2&&(0,n.jsx)(Xo,{clone:!0,children:Z}),ve&&(0,n.jsx)(nl,{onClick:oe,children:"..."}),(0,n.jsx)(Jn.Z,{style:{fontStyle:"italic"},children:F})]}),(0,n.jsx)(Gs.ZP,{open:Te,anchorEl:u,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(it.Z,{children:V.map((Je,tt)=>(0,n.jsx)(pt.Z,{button:!0,children:(0,n.jsx)(Xo,{clone:!0,children:Je})},tt))})})]})}const sl=(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"}),ol=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,n.jsxs)(rl,{className:i.breadcrumb,children:[(0,n.jsx)(Ze,{to:s,children:e}),(0,n.jsx)(q.Z,{children:u})]}):(0,n.jsx)(q.Z,{className:i.type,children:e}):null,il=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,n.jsx)(q.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Me.ZP,{title:i,placement:"top-start",children:u}):u},al=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(q.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Fi(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:v,tooltip:j,type:Z,typeLink:V}=e,F=sl(),oe=(0,I.h_)(I.Ds).getOptionalString("app.title")||"Backstage",xe=i||v,Te=v||i,Je=`${xe} | %s | ${oe}`,tt=`${xe} | ${oe}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Xs.q,{titleTemplate:Je,defaultTitle:tt}),(0,n.jsxs)("header",{style:u,className:F.header,children:[(0,n.jsxs)(Jn.Z,{className:F.leftItemsBox,children:[(0,n.jsx)(ol,{classes:F,type:Z,typeLink:V,pageTitle:Te}),(0,n.jsx)(il,{classes:F,pageTitle:Te,tooltip:j}),(0,n.jsx)(al,{classes:F,subtitle:p})]}),(0,n.jsx)(P.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const ll=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:v=>{p&&p(v)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[i,u]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>u(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>u(!1),children:_jsx(List,{children:s.map((v,j)=>_jsx(ll,{...v},`header-action-menu-${j}`))})})]})}const cl=(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"}),dl=({value:e,className:s})=>(0,n.jsx)(q.Z,{className:s,children:e});function ul(e){const{label:s,value:i,url:u}=e,p=cl(),v=(0,n.jsx)(dl,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(P.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(q.Z,{className:p.label,children:s}),u?(0,n.jsx)(Ze,{to:u,children:v}):v]})})}const hl=e=>(0,R.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),pl=(0,l.Z)(hl,{name:"BackstageItemCardHeader"});function fl(e){const{title:s,subtitle:i,children:u}=e,p=pl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(q.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(q.Z,{variant:"h6",component:"h4",children:s}),u]})}function ec(e){const{description:s,tags:i,title:u,type:p,subtitle:v,label:j,onClick:Z,href:V}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((F,ve)=>_jsx(Chip,{size:"small",label:F},ve))}):null,s]}),_jsxs(CardActions,{children:[!V&&_jsx(Button,{to:"#",onClick:Z,color:"primary",children:j}),V&&_jsx(Button,{to:V,color:"primary",children:j})]})]})}const gl=e=>(0,R.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ml=(0,l.Z)(gl,{name:"BackstageItemCardGrid"});function vl(e){const{children:s,...i}=e,u=ml(i);return(0,n.jsx)("div",{className:u.root,...i,children:s})}var yl=t(41547);const xl=(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 Ui(e){const{themeId:s,children:i}=e,{isMobile:u}=Fr(),p=xl({isMobile:u});return(0,n.jsx)(yl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function bl(e){const{themeId:s,children:i,...u}=e;return(0,n.jsxs)(Ui,{themeId:s,children:[(0,n.jsx)(Fi,{...u}),i]})}var Vn=t(30195);const tc=Vn.z.object({providerInfo:Vn.z.object({}).catchall(Vn.z.unknown()).optional(),profile:Vn.z.object({email:Vn.z.string().optional(),displayName:Vn.z.string().optional(),picture:Vn.z.string().optional()}),backstageIdentity:Vn.z.object({token:Vn.z.string(),identity:Vn.z.object({type:Vn.z.literal("user"),userEntityRef:Vn.z.string(),ownershipEntityRefs:Vn.z.array(Vn.z.string())})})}),Mi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Sl(e){const s=new Date(Date.now()+Mi.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),v=JSON.parse(atob(u));return typeof v.exp!="number"?s:new Date(v.exp*1e3-Mi.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!u)throw new TypeError(`Invalid user entity reference "${i}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:Sl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});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 rc=e=>{const s=useApi(discoveryApiRef),[{status:i,error:u},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},Cl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),qo=({children:e})=>{const s=Cl();return(0,n.jsx)(P.Z,{component:"li",item:!0,classes:s,children:e})};class _o{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 wl(e){const[s,i,u]=e.split(".");return JSON.parse(atob(i))}class ei{getUserId(){return this.result.userId}static fromResult(s){return new ei(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:u}=wl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:u!=null?u:[]}}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 ks{static createGuest(){return new _o}static fromLegacy(s){return ei.fromResult(s)}static create(s){return new ks(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,u){this.identity=s,this.authApi=i,this.profile=u}}const jl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,v=(0,I.h_)(i),j=(0,I.h_)(I.VE),Z=async()=>{try{const V=await v.getBackstageIdentity({instantPopup:!0});if(!V)throw new Error(`The ${u} provider is not configured to support sign-in`);const F=await v.getProfile();s(ks.create({identity:V.identity,profile:F,authApi:v}))}catch(V){j.post(new rr.SP("Login failed",V))}};return(0,n.jsx)(qo,{children:(0,n.jsx)(Ir,{variant:"fullHeight",title:u,actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,n.jsx)(q.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),u=await i.getBackstageIdentity({optional:!0});if(!u)return;const p=await i.getProfile();return ks.create({identity:u.identity,profile:p,authApi:i})}},El={Component:({onSignInSuccess:e})=>(0,n.jsx)(qo,{children:(0,n.jsx)(Ir,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:()=>e(new _o),children:"Enter"}),children:(0,n.jsxs)(q.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 _o};var Al=t(63955),zi=t(86619),Vi=t(74828),Tl=t(45455),Il=t.n(Tl);const Rl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ll=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Wi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Pl={Component:({onSignInSuccess:e})=>{const s=Ll(),{register:i,handleSubmit:u,formState:p}=(0,Al.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:Z})=>{e(ks.fromLegacy({userId:Z,profile:{email:`${Z}@example.com`}}))};return(0,n.jsx)(qo,{children:(0,n.jsxs)(Ir,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(q.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:u(j),children:[(0,n.jsxs)(le.Z,{children:[(0,n.jsx)(zi.Z,{...Wi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,n.jsx)(Vi.Z,{error:!0,children:v.userId.message})]}),(0,n.jsxs)(le.Z,{children:[(0,n.jsx)(zi.Z,{...Wi(i("idToken",{required:!1,validate:Z=>!Z||Rl.test(Z)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,n.jsx)(Vi.Z,{error:!0,children:v.idToken.message})]}),(0,n.jsx)(Q.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Il()(v),children:"Continue"})]})]})})},loader:async()=>{}},yo="@backstage/core:SignInPage:provider",Hi={guest:El,custom:Pl,common:jl};function Gi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function dc(e){return e.reduce((i,u)=>{if(typeof u=="string")return Gi(u,i),i[u]={components:Hi[u],id:u},i;const{id:p}=u;return Gi(p,i),i[p]={components:Hi.common,id:p,config:u},i},{})}const uc=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,v]=useState(!0),j=useCallback(V=>{s(IdentityApiSignOutProxy.from({identityApi:V,signOut:async()=>{var F;localStorage.removeItem(yo),await((F=V.signOut)===null||F===void 0?void 0:F.call(V))}}))},[s]);useLayoutEffect(()=>{var V;if(!p)return;const F=localStorage.getItem(yo);if(F===null){v(!1);return}const ve=e[F];if(!ve){v(!1);return}let oe=!1;return ve.components.loader(u,(V=ve.config)===null||V===void 0?void 0:V.apiRef).then(xe=>{oe||(xe?j(xe):v(!1))}).catch(xe=>{oe||(localStorage.removeItem(yo),i.post(xe),v(!1))}),()=>{oe=!0}},[p,i,s,u,e,j]);const Z=useMemo(()=>Object.keys(e).map(V=>{const F=e[V],{Component:ve}=F.components,oe=xe=>{localStorage.setItem(yo,F.id),j(xe)};return _jsx(ve,{config:F.config,onSignInSuccess:oe},F.id)}),[e,j]);return[p,Z]},kl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[Z,V]=useSignInProviders(j,e);return Z?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:v,children:V})]})]})},Ol=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,Z]=useState(),[V,F]=useState(!1),ve=async({checkExisting:oe,showPopup:xe})=>{try{let Te;if(oe&&(Te=await p.getBackstageIdentity({optional:!0})),!Te&&(xe||s)&&(F(!0),Te=await p.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){F(!0);return}const Je=await p.getProfile();i(UserIdentity.create({identity:Te.identity,authApi:p,profile:Je}))}catch(Te){Z(Te),F(!0)}};return useMountEffect(()=>ve({checkExisting:!0})),V?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ve({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx(Ol,{...e}):_jsx(kl,{...e})}const $l=(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"}),Bl=(0,xn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(qr.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:v,value:j,onChange:Z}=e,V=$l(),[F,ve]=useState(0),oe=Z||((Je,tt)=>ve(tt));let xe;j?React.Children.map(u,Je=>{React.isValidElement(Je)&&(Je==null?void 0:Je.props.value)===j&&(xe=Je==null?void 0:Je.props.children)}):React.Children.map(u,(Je,tt)=>{React.isValidElement(Je)&&tt===F&&(xe=Je==null?void 0:Je.props.children)});const Te=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[p&&_jsx(Bl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:V,value:j||F,onChange:oe,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),v&&_jsx(BottomLink,{...v})]})})}const Zl=(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 fc(e){const{children:s,...i}=e,u=Zl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(jt,Fe,t){"use strict";t.d(Fe,{fC:function(){return x},CL:function(){return nt},sM:function(){return _},$v:function(){return Ie},v_:function(){return Qe},hg:function(){return Ze},uB:function(){return ee},R5:function(){return Pt},bq:function(){return T},Ds:function(){return we},ni:function(){return X},T0:function(){return D},CO:function(){return Bn},x8:function(){return ln},rx:function(){return Cn},YO:function(){return Yt},P4:function(){return In},NT:function(){return Qt},NW:function(){return We},VE:function(){return gt},W0:function(){return Me},gP:function(){return ze},IY:function(){return ft},F4:function(){return ie},ux:function(){return L},Kp:function(){return he},$4:function(){return Xe},p_:function(){return $},ZM:function(){return rt},D:function(){return A},gW:function(){return E},E6:function(){return ct},z$:function(){return vt},h_:function(){return ne},I_:function(){return R},qD:function(){return Re},vJ:function(){return Rn},yx:function(){return ke},tg:function(){return fn},Oi:function(){return Kn}});var h=t(52322),n=t(51837),g=t(2784);const I=(0,n.CT)("analytics-context"),W=()=>{const ge=(0,g.useContext)(I);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const te=ge.atVersion(1);if(te===void 0)throw new Error("No context found for version 1.");return te},x=ge=>{const{attributes:te,children:je}=ge,qe={...W(),...te},bt=(0,n.EI)({1:qe});return(0,h.jsx)(I.Provider,{value:bt,children:je})};function l(ge,te){const je=De=>_jsx(x,{attributes:te,children:_jsx(ge,{...De})});return je.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,je}function R(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const te=ge.atVersion(1);if(!te)throw new Error("ApiContext v1 not available");return te}function ne(ge){const je=R().get(ge);if(!je)throw new Error(`No implementation available for ${ge}`);return je}function J(ge){return function(je){const De=bt=>{const ae=R(),P={};for(const q in ge)if(ge.hasOwnProperty(q)){const Ye=ge[q],U=ae.get(Ye);if(!U)throw new Error(`No implementation available for ${Ye}`);P[q]=U}return _jsx(je,{...bt,...P})},qe=je.displayName||je.name||"Component";return De.displayName=`withApis(${qe})`,De}}class Q{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(te){if(this.config=te,!te.id.split(".").flatMap(De=>De.split("-")).every(De=>De.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${te.id}'`)}}function D(ge){return new Q(ge)}function X(ge,te){return"id"in ge?{api:ge,deps:{},factory:()=>te}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const he=D({id:"core.auth.google"}),ie=D({id:"core.auth.github"}),A=D({id:"core.auth.okta"}),L=D({id:"core.auth.gitlab"}),$=D({id:"core.auth.microsoft"}),E=D({id:"core.auth.onelogin"}),T=D({id:"core.auth.bitbucket"}),ee=D({id:"core.auth.atlassian"}),Ie=D({id:"core.alert"}),Qe=D({id:"core.analytics"}),Ze=D({id:"core.apptheme"}),we=D({id:"core.config"}),We=D({id:"core.discovery"}),gt=D({id:"core.error"});var nt;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(nt||(nt={}));const Me=D({id:"core.featureflags"}),ze=D({id:"core.fetch"}),Xe=D({id:"core.identity"}),rt=D({id:"core.oauthrequest"}),ct=D({id:"core.storage"});class lt{setContext(te){this.context=te}captureEvent(te,je,{value:De,attributes:qe}={}){try{this.analyticsApi.captureEvent({action:te,subject:je,value:De,attributes:qe,context:this.context})}catch(bt){console.warn("Error during analytics event capture. %o",bt)}}constructor(te,je={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=je}}function mt(){try{return ne(Qe)}catch{return{captureEvent:()=>{}}}}function vt(){const ge=(0,g.useRef)(null),te=W(),je=mt();function De(){return ge.current===null&&(ge.current=new lt(je)),ge.current}const qe=De();return qe.setContext(te),qe}const Ke="plugin-context",se=ge=>{const{children:te,plugin:je}=ge,{Provider:De}=(0,n.CT)(Ke);return(0,h.jsx)(De,{value:(0,n.EI)({1:{plugin:je}}),children:te})};function ke(){const ge=(0,n.Vt)(Ke);if(!ge)throw new Error("Plugin Options context is not available");const te=ge.atVersion(1);if(!te)throw new Error("Plugin Options v1 is not available");return te.plugin.getPluginOptions()}const Re=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const te=ge.atVersion(1);if(!te)throw new Error("AppContext v1 not available");return te},st=(0,n.uW)("component-data-store",()=>new WeakMap),xt="__backstage_data";function Pt(ge,te,je){const De=ge;var qe;let bt=(qe=De[xt])!==null&&qe!==void 0?qe:st.get(ge);if(bt||(bt={map:new Map},Object.defineProperty(De,xt,{enumerable:!1,configurable:!0,writable:!1,value:bt}),st.set(ge,bt)),bt.map.has(te)){const ae=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${ae}"`)}bt.map.set(te,je)}function ft(ge,te){if(!ge)return;const je=ge.type;if(!je)return;var De;const qe=(De=je[xt])!==null&&De!==void 0?De:st.get(je);if(!!qe)return qe.map.get(te)}const Et=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let wt=Et;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,je){this.id=te,this.params=je,this[wt]="absolute"}}function Qt(ge){var te;return new kt(ge.id,(te=ge.params)!==null&&te!==void 0?te:[])}const tn=/^\w+$/;let Ht=null;class Gt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,je,De,qe){this.id=te,this.path=je,this.parent=De,this.params=qe,this[Ht]="sub"}}function pn(ge){const{id:te,path:je,parent:De}=ge,qe=je.split("/").filter(P=>P.startsWith(":")).map(P=>P.substring(1)),bt=[...De.params,...qe];if(De.params.some(P=>qe.includes(P)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!je.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${je}'`);if(je.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${je}'`);for(const P of qe)if(!tn.test(P))throw new Error(`SubRouteRef path has invalid param, got '${P}'`);return new Gt(te,je,De,bt)}let _t=Et;class On{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,je,De){this.id=te,this.params=je,this.optional=De,this[_t]="external"}}function ln(ge){var te;return new On(ge.id,(te=ge.params)!==null&&te!==void 0?te:[],Boolean(ge.optional))}var $n=t(73557);function fn(ge){const te=(0,$n.TH)(),je=(0,n.Vt)("routing-context");if(!je)throw new Error("Routing context is not available");const De=je.atVersion(1),qe=(0,g.useMemo)(()=>De&&De.resolve(ge,te),[De,ge,te]);if(!je)throw new Error("useRouteRef used outside of routing context");if(!De)throw new Error("RoutingContext v1 not available");const bt="optional"in ge&&ge.optional;if(!qe&&!bt)throw new Error(`No path for ${ge}`);return qe}function Kn(ge){return(0,$n.UO)()}class Kt extends g.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:je,plugin:De}=this.props,{ErrorBoundaryFallback:qe}=je.getComponents();return te?(0,h.jsx)(qe,{error:te,resetError:this.handleErrorReset,plugin:De}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function In(ge){const{component:te,mountPoint:je,name:De}=ge;return Yt({component:{lazy:()=>te().then(qe=>{const bt=P=>{try{fn(je)}catch(q){if(typeof q=="object"&&q!==null){const{message:Ye}=q;if(typeof Ye=="string"&&Ye.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${je} 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)(qe,{...P})},ae=De||qe.displayName||qe.name||"LazyComponent";return bt.displayName=`RoutableExtension(${ae})`,bt},qe=>ae=>{const P=Re(),{BootErrorPage:q}=P.getComponents();return(0,h.jsx)(q,{step:"load-chunk",error:qe})})},data:{"core.mountPoint":je},name:De})}function Bn(ge){const{component:te,name:je}=ge;return Yt({component:te,name:je})}function Yt(ge){const{data:te={},name:je}=ge;je||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let De;if("lazy"in ge.component){const bt=ge.component.lazy;De=(0,g.lazy)(()=>bt().then(ae=>({default:ae})))}else De=ge.component.sync;const qe=je||De.displayName||De.name||"Component";return{expose(bt){const ae=P=>{const q=Re(),{Progress:Ye}=q.getComponents(),U=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(g.Suspense,{fallback:(0,h.jsx)(Ye,{}),children:(0,h.jsx)(Kt,{app:q,plugin:bt,children:(0,h.jsx)(x,{attributes:{pluginId:bt.getId(),...je&&{extension:je},...U&&{routeRef:U.id}},children:(0,h.jsx)(se,{plugin:bt,children:(0,h.jsx)(De,{...P})})})})})};Pt(ae,"core.plugin",bt);for(const[P,q]of Object.entries(te))Pt(ae,P,q);return ae.displayName=`Extension(${qe})`,ae}}}function gn(ge,te,je,De){return g.Children.toArray(ge).flatMap(qe=>{if(!(0,g.isValidElement)(qe))return[];if(qe.type===g.Fragment)return gn(qe.props.children,te,je,De);if(ft(qe,"core.featureFlagged")){const bt=qe.props;return("with"in bt?te.isActive(bt.with):!te.isActive(bt.without))?gn(qe.props.children,te,je,De):[]}if(je===void 0||je(qe))return[qe];if(De)throw new Error(De);return gn(qe.props.children,te,je,De)})}class cn{selectByComponentData(te){const je=gn(this.node,this.featureFlagsApi,De=>ft(De,te.key)!==void 0,te.withStrictError);return new cn(je,this.featureFlagsApi)}findComponentData(te){return gn(this.node,this.featureFlagsApi,De=>ft(De,te.key)!==void 0).map(De=>ft(De,te.key)).filter(De=>De!==void 0)}getElements(){return gn(this.node,this.featureFlagsApi)}constructor(te,je){this.node=te,this.featureFlagsApi=je}}function Rn(ge,te,je=[]){const De=ne(Me),qe=new cn(ge,De);return(0,g.useMemo)(()=>te(qe),[ge,...je])}class Zn{getId(){return this.config.id}getApis(){var te;return(te=this.config.apis)!==null&&te!==void 0?te:[]}getFeatureFlags(){var te,je;return(je=(te=this.config.featureFlags)===null||te===void 0?void 0:te.slice())!==null&&je!==void 0?je:[]}get routes(){var te;return(te=this.config.routes)!==null&&te!==void 0?te:{}}get externalRoutes(){var te;return(te=this.config.externalRoutes)!==null&&te!==void 0?te:{}}provide(te){return te.expose(this)}__experimentalReconfigure(te){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(te))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var te;return(te=this.options)!==null&&te!==void 0?te:{}}toString(){return`plugin{${this.config.id}}`}constructor(te){this.config=te,this.options=void 0}}function Cn(ge){return new Zn(ge)}},23054:function(jt,Fe,t){"use strict";t.d(Fe,{SP:function(){return _},dR:function(){return Q},VL:function(){return ie},BD:function(){return n}});function h(A){if(typeof A!="object"||A===null||Array.isArray(A))return!1;const L=A;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function n(A){if(typeof A!="object"||A===null||Array.isArray(A))throw new Error(`Encountered invalid error, not an object, got '${A}'`);const L=A;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${A}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${A}'`)}var g=t(24852);function I(A,L){const E={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(A)};return L!=null&&L.includeStack||delete E.stack,E}function W(A){const L=(0,g.deserializeError)(A);return A.stack||(L.stack=void 0),L}function x(A){if(h(A)){const L=String(A);return L!=="[object Object]"?L:`${A.name}: ${A.message}`}return`unknown error '${A}'`}class l extends Error{constructor(L,$){var E;let T=L;if($!==void 0){const ee=x($);T?T+=`; caused by ${ee}`:T=`caused by ${ee}`}super(T),(E=Error.captureStackTrace)===null||E===void 0||E.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class R extends null{}class ne extends null{}class J extends null{}class Q extends l{}class D extends null{}class X extends null{}class _ extends l{constructor(L,$){super(L,$),this.name=h($)?$.name:"Error"}}async function he(A){try{const $=await A.text();if($){var L;if(!((L=A.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const E=JSON.parse($);if(E.error&&E.response)return E}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}, ${$}`},response:{statusCode:A.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}`},response:{statusCode:A.status}}}class ie extends Error{static async fromResponse(L){const $=await he(L),E=$.response.statusCode||L.status,T=$.error.name||L.statusText,ee=`Request failed with ${E} ${T}`,Ie=W($.error);return new ie({message:ee,response:L,data:$,cause:Ie})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(jt,Fe,t){"use strict";t.d(Fe,{nW:function(){return ie},ae:function(){return Q},q3:function(){return D}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var g=new WeakMap;class I{async getCredentials(L){const $=new URL(L.url),E=_class_private_field_get(this,g).find(T=>T.isUrlSupported($));if(!E)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return E.getCredentials(L)}constructor(L){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_set(this,g,L)}}var W=new WeakMap,x=new WeakMap,l=new WeakMap,R=new WeakMap;class ne{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:L,gitlab:$,azure:E,bitbucket:T})=>ne.merge(ne.forGithub(L),ne.forGitlab($),ne.forAzure(E),ne.forBitbucket(T))})}static forAuthApi(L,$){return new ne("generic",L,$.host,$.scopeMapping)}static forGithub(L,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"github.com";return new ne("github",L,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"gitlab.com";return new ne("gitlab",L,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"dev.azure.com";return new ne("azure",L,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"bitbucket.org";return new ne("bitbucket",L,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new I(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,x)}getAdditionalScopesForProvider(L){var $;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,R)==="generic")return[];var E;return(E=($=L.customScopes)===null||$===void 0?void 0:$[_class_private_field_get(this,R)])!==null&&E!==void 0?E:[]}async getCredentials(L){const{url:$,additionalScope:E,...T}=L,ee=_class_private_field_get(this,l).default.slice();E!=null&&E.repoWrite&&ee.push(..._class_private_field_get(this,l).repoWrite);const Ie=this.getAdditionalScopesForProvider(E);Ie.length&&ee.push(...Ie);const Qe=[...new Set(ee)],Ze=await _class_private_field_get(this,W).getAccessToken(Qe,T);return{token:Ze,headers:{Authorization:`Bearer ${Ze}`}}}constructor(L,$,E,T){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,x,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,R,{writable:!0,value:void 0}),_class_private_field_set(this,W,$),_class_private_field_set(this,x,E),_class_private_field_set(this,l,T),_class_private_field_set(this,R,L)}}var J=t(79158);class Q{static fromConfig(L){return J.Lx.fromConfig(L)}}const D=(0,h.T0)({id:"integration.scmintegrations"});var X=t(52322),_=t(73250),he=t(2784);const ie=A=>{const{type:L}=A,$=(0,h.qD)(),E=_.Z;var T;const ee=L&&(T=$.getSystemIcon(L))!==null&&T!==void 0?T:E;return(0,X.jsx)(ee,{})}},79158:function(jt,Fe,t){"use strict";t.d(Fe,{Lx:function(){return ar},BT:function(){return at}});var h=t(82717),n=t.n(h),g=t(76635);function I(C){const d=new URL("http://example.com");return d.host=C,d.host===C}function W(C){try{return new URL(C),!0}catch{return!1}}function x(C,d){return{list(){return C},byUrl(m){try{const w=typeof m=="string"?new URL(m):m;return C.find(G=>d(G)===w.host)}catch{return}},byHost(m){return C.find(w=>d(w)===m)}}}function l(C){const{url:d,base:m,lineNumber:w}=C;try{return new URL(d),d}catch{}let G;if(d.startsWith("/")){const{filepath:fe}=n()(m);G=new URL(m);const be=(0,g.trimEnd)(G.pathname.substring(0,G.pathname.length-fe.length),"/");G.pathname=`${be}${d}`}else G=new URL(d,m);return G.search=new URL(m).search,w&&(G.hash=`L${w}`),G.toString()}const R="amazonaws.com";function ne(C){const d=C.getOptionalString("endpoint");var m;const w=(m=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&m!==void 0?m:!1;let G,fe;if(d){try{const on=new URL(d);G=on.host,fe=on.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(fe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else G=R;const be=C.getOptionalString("accessKeyId"),Be=C.getOptionalString("secretAccessKey"),ht=C.getOptionalString("roleArn"),$t=C.getOptionalString("externalId");return{host:G,endpoint:d,s3ForcePathStyle:w,accessKeyId:be,secretAccessKey:Be,roleArn:ht,externalId:$t}}function J(C){const d=C.map(ne);return d.some(m=>m.host===R)||d.push({host:R}),d}class Q{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}Q.factory=({config:C})=>{var d;const m=J((d=C.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new Q(w)),w=>w.config.host)};var D=t(90383),X=t(22504),_=t(69866);const he="GB";var ie=new WeakMap,A=new WeakMap,L=new WeakMap,$=new WeakMap,E=new WeakMap,T=new WeakMap,ee=new WeakMap;class Ie{static fromRepoUrl(d){const m=new URL(d);let w,G,fe;const be=m.pathname.split("/").map(Mn=>decodeURIComponent(Mn));if(be[2]==="_git"?(w=be[1],G=fe=be[3]):be[3]==="_git"?(w=be[1],G=be[2],fe=be[4]):be[4]==="_git"&&(w=`${be[1]}/${be[2]}`,G=be[3],fe=be[5]),!w||!G||!fe)throw new Error("Azure URL must point to a git repository");var Be;const ht=(Be=m.searchParams.get("path"))!==null&&Be!==void 0?Be:void 0;let $t;const on=m.searchParams.get("version");if(on){if(on.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");$t=on.slice(2)}return new Ie(m.origin,w,G,fe,ht,$t)}toRepoUrl(){let d;return(0,D.Z)(this,L)===(0,D.Z)(this,$)?d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,A),"_git",(0,D.Z)(this,$)):d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,A),(0,D.Z)(this,L),"_git",(0,D.Z)(this,$)),(0,D.Z)(this,E)&&d.searchParams.set("path",(0,D.Z)(this,E)),(0,D.Z)(this,T)&&d.searchParams.set("version",he+(0,D.Z)(this,T)),d.toString()}toFileUrl(){if(!(0,D.Z)(this,E))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,A),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,D.Z)(this,E)),(0,D.Z)(this,T)&&d.searchParams.set("version",(0,D.Z)(this,T)),d.toString()}toArchiveUrl(){const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,A),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,D.Z)(this,E)&&d.searchParams.set("scopePath",(0,D.Z)(this,E)),(0,D.Z)(this,T)&&d.searchParams.set("version",(0,D.Z)(this,T)),d.toString()}toCommitsUrl(){const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,A),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"commits");return d.searchParams.set("api-version","6.0"),(0,D.Z)(this,T)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,D.Z)(this,T)),d.toString()}getOwner(){return(0,D.Z)(this,A)}getProject(){return(0,D.Z)(this,L)}getRepo(){return(0,D.Z)(this,$)}getPath(){return(0,D.Z)(this,E)}getRef(){return(0,D.Z)(this,T)}constructor(d,m,w,G,fe,be){(0,X.Z)(this,ie,{writable:!0,value:void 0}),(0,X.Z)(this,A,{writable:!0,value:void 0}),(0,X.Z)(this,L,{writable:!0,value:void 0}),(0,X.Z)(this,$,{writable:!0,value:void 0}),(0,X.Z)(this,E,{writable:!0,value:void 0}),(0,X.Z)(this,T,{writable:!0,value:void 0}),(0,X.Z)(this,ee,{writable:!0,value:(...Be)=>{const ht=new URL((0,D.Z)(this,ie));return ht.pathname=Be.map($t=>encodeURIComponent($t)).join("/"),ht}}),(0,_.Z)(this,ie,d),(0,_.Z)(this,A,m),(0,_.Z)(this,L,w),(0,_.Z)(this,$,G),(0,_.Z)(this,E,fe),(0,_.Z)(this,T,be)}}const Qe="dev.azure.com";function Ze(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:Qe,w=C.getOptionalString("token");if(!I(m))throw new Error(`Invalid Azure integration config, '${m}' is not a valid host`);return{host:m,token:w}}function we(C){const d=C.map(Ze);return d.some(m=>m.host===Qe)||d.push({host:Qe}),d}class We{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:m,base:w}=d;if(W(m))return m;try{const fe=Ie.fromRepoUrl(w),be=new URL(w);var G;const Be=new URL(`https://a.com${(G=fe.getPath())!==null&&G!==void 0?G:""}`),ht=new URL(m,Be).pathname;return be.searchParams.set("path",ht),d.lineNumber&&(be.searchParams.set("line",String(d.lineNumber)),be.searchParams.set("lineEnd",String(d.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(m,w).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}We.factory=({config:C})=>{var d;const m=we((d=C.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new We(w)),w=>w.config.host)};var gt=t(48834).lW;function nt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function Me(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ze(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function Xe(C,d){const m=d?{...d}:{};if(C.token){const w=gt.from(`:${C.token}`,"utf8");m.Authorization=`Basic ${w.toString("base64")}`}return{headers:m}}const rt="bitbucket.org",ct="https://api.bitbucket.org/2.0";function lt(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:rt;let w=C.getOptionalString("apiBaseUrl");const G=C.getOptionalString("token"),fe=C.getOptionalString("username"),be=C.getOptionalString("appPassword");if(!I(m))throw new Error(`Invalid Bitbucket integration config, '${m}' is not a valid host`);return w?w=(0,g.trimEnd)(w,"/"):m===rt?w=ct:w=`https://${m}/rest/api/1.0`,{host:m,apiBaseUrl:w,token:G,username:fe,appPassword:be}}function mt(C){const d=C.map(lt);return d.some(m=>m.host===rt)||d.push({host:rt,apiBaseUrl:ct}),d}class vt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(!d.lineNumber)return m;const w=new URL(m);return this.integrationConfig.host==="bitbucket.org"?w.hash=`lines-${d.lineNumber}`:w.hash=`${d.lineNumber}`,w.toString()}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("spa","0"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}vt.factory=({config:C})=>{var d,m,w;const G=mt((w=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(m=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&m!==void 0?m:[]]);return x(G.map(fe=>new vt(fe)),fe=>fe.config.host)};var Ke=t(96279),se=t(48834).lW;async function ke(C,d){const{name:m,owner:w,resource:G}=parseGitUrl(C),fe=G==="bitbucket.org";let be=fe?`${d.apiBaseUrl}/repositories/${w}/${m}`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,Be=await fetch(be,xt(d));if(Be.status===404&&!fe&&(be=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,Be=await fetch(be,xt(d))),!Be.ok){const $t=`Failed to retrieve default branch from ${be}, ${Be.status} ${Be.statusText}`;throw new Error($t)}let ht;if(fe)ht=(await Be.json()).mainbranch.name;else{const{displayId:$t}=await Be.json();ht=$t}if(!ht)throw new Error(`Failed to read default branch from ${be}. Response ${Be.status} ${Be.json()}`);return ht}async function Re(C,d){const{name:m,owner:w,ref:G,protocol:fe,resource:be,filepath:Be}=parseGitUrl(C),ht=be==="bitbucket.org";let $t=G;$t||($t=await ke(C,d));const on=Be?`&path=${encodeURIComponent(decodeURIComponent(Be))}`:"";return ht?`${fe}://${be}/${w}/${m}/get/${$t}.tar.gz`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${$t}&prefix=${w}-${m}${on}`}function st(C,d){try{const{owner:m,name:w,ref:G,filepathtype:fe,filepath:be}=parseGitUrl(C);if(!m||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Be=be.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!G)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${G}/${Be}`}return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${Be}?at=${G}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function xt(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const m=se.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}const Pt="bitbucket.org",ft="https://api.bitbucket.org/2.0";function Et(C){const d=Pt,m=ft,w=C.getString("username"),G=C.getString("appPassword");return{host:d,apiBaseUrl:m,username:w,appPassword:G}}function wt(C){const d=C.map(Et);return d.length===0&&d.push({host:Pt,apiBaseUrl:ft}),d}class kt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=`lines-${d.lineNumber}`,w.toString()}return m}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}kt.factory=({config:C})=>{var d;const m=wt((d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new kt(w)),w=>w.config.host)};var Qt=t(48834).lW;async function tn(C,d){const{name:m,owner:w}=parseGitUrl(C),G=`${d.apiBaseUrl}/repositories/${w}/${m}`,fe=await fetch(G,pn(d));if(!fe.ok){const ht=`Failed to retrieve default branch from ${G}, ${fe.status} ${fe.statusText}`;throw new Error(ht)}const Be=(await fe.json()).mainbranch.name;if(!Be)throw new Error(`Failed to read default branch from ${G}. Response ${fe.status} ${fe.json()}`);return Be}async function Ht(C,d){const{name:m,owner:w,ref:G,protocol:fe,resource:be}=parseGitUrl(C);let Be=G;return Be||(Be=await tn(C,d)),`${fe}://${be}/${w}/${m}/get/${Be}.tar.gz`}function Gt(C,d){try{const{owner:m,name:w,ref:G,filepathtype:fe,filepath:be}=parseGitUrl(C);if(!m||!w||fe!=="src"&&fe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Be=be.replace(/^\//,"");if(!G)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${G}/${Be}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function pn(C){const d={};if(C.username&&C.appPassword){const m=Qt.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function _t(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token"),G=C.getOptionalString("username"),fe=C.getOptionalString("password");if(!I(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:m,token:w,username:G,password:fe}}function On(C){return C.map(_t)}class ln{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=d.lineNumber.toString(),w.toString()}return m}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}ln.factory=({config:C})=>{var d;const m=On((d=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ln(w)),w=>w.config.host)};var $n=t(48834).lW;async function fn(C,d){const{name:m,owner:w}=parseGitUrl(C);let G=`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,fe=await fetch(G,In(d));if(fe.status===404&&(G=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,fe=await fetch(G,In(d))),!fe.ok){const ht=`Failed to retrieve default branch from ${G}, ${fe.status} ${fe.statusText}`;throw new Error(ht)}const{displayId:be}=await fe.json(),Be=be;if(!Be)throw new Error(`Failed to read default branch from ${G}. Response ${fe.status} ${fe.json()}`);return Be}async function Kn(C,d){const{name:m,owner:w,ref:G,filepath:fe}=parseGitUrl(C);let be=G;be||(be=await fn(C,d));const Be=fe?`&path=${encodeURIComponent(decodeURIComponent(fe))}`:"";return`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${be}&prefix=${w}-${m}${Be}`}function Kt(C,d){try{const{owner:m,name:w,ref:G,filepathtype:fe,filepath:be}=parseGitUrl(C);if(!m||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Be=be.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${Be}?at=${G}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function In(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const m=$n.from(`${C.username}:${C.password}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function Bn(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl"),w=C.getOptionalString("cloneUrl"),G=C.getOptionalString("gitilesBaseUrl");const fe=C.getOptionalString("username"),be=C.getOptionalString("password");if(I(d)){if(m&&!W(m))throw new Error(`Invalid Gerrit integration config, '${m}' is not a valid baseUrl`);if(w&&!W(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(G&&!W(G))throw new Error(`Invalid Gerrit integration config, '${G}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,G?G=(0,g.trimEnd)(G,"/"):G=`https://${d}`,w?w=(0,g.trimEnd)(w,"/"):w=m,{host:d,baseUrl:m,cloneUrl:w,gitilesBaseUrl:G,username:fe,password:be}}function Yt(C){return C.map(Bn)}var gn=t(48834).lW;const cn=")]}'";function Rn(C,d){const w=d.replace(C.gitilesBaseUrl,"").split("/").filter($t=>!!$t),G=w.indexOf("+");if(G<=0)throw new Error(`Unable to parse project from url: ${d}`);const fe=(0,g.trimStart)(w.slice(0,G).join("/"),"/"),be=w.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${d}`);const Be=w[be+1],ht=w.slice(be+2).join("/");return{branch:Be,filePath:ht===""?"/":ht,project:fe}}function Zn(C,d,m,w){return`${C.gitilesBaseUrl}/${d}/+/refs/heads/${m}/${(0,g.trimStart)(w,"/")}`}function Cn(C){return C.password?"/a/":"/"}function ge(C,d){const{branch:m,project:w}=Rn(C,d);return`${C.baseUrl}${Cn(C)}projects/${encodeURIComponent(w)}/branches/${m}`}function te(C,d){const{project:m}=Rn(C,d);return`${C.cloneUrl}${Cn(C)}${m}`}function je(C,d){const{branch:m,filePath:w,project:G}=Rn(C,d);return`${C.baseUrl}${Cn(C)}projects/${encodeURIComponent(G)}/branches/${m}/files/${encodeURIComponent(w)}/content`}function De(C){return`${C.baseUrl}${Cn(C)}projects/`}function qe(C){const d={};if(!C.password)return d;const m=gn.from(`${C.username}:${C.password}`,"utf8");return d.Authorization=`Basic ${m.toString("base64")}`,{headers:d}}async function bt(C){const d=await C.text();if(d.startsWith(cn))try{return JSON.parse(d.slice(cn.length))}catch(m){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${m}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:m,base:w,lineNumber:G}=d;let fe;if(m.startsWith("/")){const{branch:be,project:Be}=Rn(this.config,w);return Zn(this.config,Be,be,m)}return m?fe=new URL(m,w):fe=new URL(w),G&&(fe.hash=G.toString()),fe.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ae.factory=({config:C})=>{var d;const m=Yt((d=C.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ae(w)),w=>w.config.host)};function P(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl");const w=C.getOptionalString("username"),G=C.getOptionalString("password");if(!I(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,{host:d,baseUrl:m,username:w,password:G}}var q=t(48834).lW;function Ye(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[G,fe,be,Be,ht,$t,...on]=d.replace(w,"").split("/"),Mn=on.join("/").replace(/^\//,"");return`${w}/${fe}/${be}/_edit/${$t}/${Mn}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function U(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[G,fe,be,Be,ht,$t,...on]=d.replace(w,"").split("/"),Mn=on.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${fe}/${be}/contents/${Mn}?ref=${$t}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function B(C){const d={},{username:m,password:w}=C;return w?(m?d.Authorization=`basic ${q.from(`${m}:${w}`).toString("base64")}`:d.Authorization=`token ${w}`,{headers:d}):d}class ce{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return l(d)}resolveEditUrl(d){return Ye(this.config,d)}constructor(d){this.config=d}}ce.factory=({config:C})=>{var d;const w=((d=C.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(G=>P(G));return x(w.map(G=>new ce(G)),G=>G.config.host)};const pe="github.com",Se="https://api.github.com",$e="https://raw.githubusercontent.com";function Oe(C){var d,m;const w=(m=C.getOptionalString("host"))!==null&&m!==void 0?m:pe;let G=C.getOptionalString("apiBaseUrl"),fe=C.getOptionalString("rawBaseUrl");const be=C.getOptionalString("token"),Be=(d=C.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(ht=>({appId:ht.getNumber("appId"),clientId:ht.getString("clientId"),clientSecret:ht.getString("clientSecret"),webhookSecret:ht.getString("webhookSecret"),privateKey:ht.getString("privateKey"),allowedInstallationOwners:ht.getOptionalStringArray("allowedInstallationOwners")}));if(!I(w))throw new Error(`Invalid GitHub integration config, '${w}' is not a valid host`);return G?G=(0,g.trimEnd)(G,"/"):w===pe&&(G=Se),fe?fe=(0,g.trimEnd)(fe,"/"):w===pe&&(fe=$e),{host:w,apiBaseUrl:G,rawBaseUrl:fe,token:be,apps:Be}}function He(C){const d=C.map(Oe);return d.some(m=>m.host===pe)||d.push({host:pe,apiBaseUrl:Se,rawBaseUrl:$e}),d}function ot(C,d,m){try{const{owner:w,name:G,ref:fe,filepathtype:be,filepath:Be}=parseGitUrl(C);if(!w||!G||!fe||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const ht=Be.replace(/^\//,"");return H(d,m)==="api"?`${d.apiBaseUrl}/repos/${w}/${G}/contents/${ht}?ref=${fe}`:`${d.rawBaseUrl}/${w}/${G}/${fe}/${ht}`}catch(w){throw new Error(`Incorrect URL: ${C}, ${w}`)}}function S(C,d){const m={};return H(C,d)==="api"&&(m.Accept="application/vnd.github.v3.raw"),d.token&&(m.Authorization=`token ${d.token}`),{headers:m}}function H(C,d){return C.apiBaseUrl&&(d.token||!C.rawBaseUrl)?"api":"raw"}var me=t(42822),ue=t(89393),Ce=t(26228);class Pe{async getOrCreateToken(d,m,w){let G=this.tokenCache.get(d);if((!G||this.isExpired(G.expiresAt))&&(G=await w(),G.expiresAt=G.expiresAt.minus({minutes:10}),this.tokenCache.set(d,G)),!this.appliesToRepo(G,m))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${m}`);return{accessToken:G.token}}appliesToRepo(d,m){return m===void 0?!0:d.repositories!==void 0?d.repositories.includes(m):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>Ce.ou.local()>d}}const Ne={Accept:"application/vnd.github.machine-man-preview+json"};class it{async getInstallationCredentials(d,m){if(this.allowedInstallationOwners){var w;if(!(!((w=this.allowedInstallationOwners)===null||w===void 0)&&w.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,m,async()=>{const{installationId:G,suspended:fe}=await this.getInstallationData(d);if(fe)throw new Error(`The GitHub application for ${d} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:G,headers:Ne});let Be;if(be.data.repository_selection==="selected"){const $t=new ue.v({baseUrl:this.baseUrl,auth:be.data.token}),on=await $t.paginate($t.apps.listReposAccessibleToInstallation);var ht;Be=((ht=on.repositories)!==null&&ht!==void 0?ht:on).map(kr=>kr.name)}return{token:be.data.token,expiresAt:Ce.ou.fromISO(be.data.expires_at),repositories:Be}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const w=(await this.getInstallations()).find(fe=>{var be,Be;return((be=fe.account)===null||be===void 0||(Be=be.login)===null||Be===void 0?void 0:Be.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(w)return{installationId:w.id,suspended:Boolean(w.suspended_by)};const G=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw G.name="NotFoundError",G}constructor(d,m){this.cache=new Pe,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=m,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new ue.v({baseUrl:m,headers:Ne,authStrategy:me.i,auth:this.baseAuthConfig})}}class pt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(m=>m.getInstallations()))).flat():[]}async getAppToken(d,m){if(this.apps.length===0)return;const w=await Promise.all(this.apps.map(Be=>Be.getInstallationCredentials(d,m).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),G=w.find(Be=>Be.credentials);if(G)return G.credentials.accessToken;const be=w.map(Be=>Be.error).find(Be=>Be.name!=="NotFoundError");if(be)throw be}constructor(d){var m,w;this.apps=(w=(m=d.apps)===null||m===void 0?void 0:m.map(G=>new it(G,d.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class ut{async getCredentials(d){const m=n()(d.url),w=m.owner||m.name,G=m.owner?m.name:void 0;let fe="app",be=await this.githubAppCredentialsMux.getAppToken(w,G);return be||(fe="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:fe}}constructor(d,m){this.githubAppCredentialsMux=d,this.token=m}}ut.create=C=>new ut(new pt(C),C.token);class et{static fromIntegrations(d){const m=new Map;return d.github.list().forEach(w=>{const G=SingleInstanceGithubCredentialsProvider.create(w.config);m.set(w.config.host,G)}),new et(m)}async getCredentials(d){const m=new URL(d.url),w=this.providers.get(m.host);if(!w)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return w.getCredentials(d)}constructor(d){this.providers=d}}class St{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return at(l(d),"tree")}resolveEditUrl(d){return at(d,"edit")}constructor(d){this.integrationConfig=d}}St.factory=({config:C})=>{var d;const m=He((d=C.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new St(w)),w=>w.config.host)};function at(C,d){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(m,w,G,fe)=>`//${w}/${G}/${fe}/${d}/`)}const Tt=null;class Bt extends St{get config(){return super.config}constructor(d){super(d)}}Bt.factory=St.factory;const Nt=null,mn=null,Wn=null,wn="gitlab.com",Ut="https://gitlab.com/api/v4";function Ft(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token");let G=C.getOptionalString("baseUrl");if(m?m=(0,g.trimEnd)(m,"/"):d===wn&&(m=Ut),G?G=(0,g.trimEnd)(G,"/"):G=`https://${d}`,I(d)){if(!m||!W(m))throw new Error(`Invalid GitLab integration config, '${m}' is not a valid apiBaseUrl`);if(!W(G))throw new Error(`Invalid GitLab integration config, '${G}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:w,apiBaseUrl:m,baseUrl:G}}function dn(C){const d=C.map(Ft);return d.some(m=>m.host===wn)||d.push({host:wn,apiBaseUrl:Ut,baseUrl:`https://${wn}`}),d}function vn(C){let d="";return C.host!==wn&&(d=new URL(C.baseUrl).pathname),trimEnd(d,"/")}async function Un(C,d){const m=await yn(C,d);return Dn(C,m,d).toString()}function jn(C){const{token:d=""}=C;return{headers:{"PRIVATE-TOKEN":d}}}function Dn(C,d,m){try{const w=new URL(C),G=w.pathname.split("/blob/").slice(1).join("/blob/"),[fe,...be]=G.split("/"),Be=getGitLabIntegrationRelativePath(m);return w.pathname=[...Be?[Be]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),w.search=`?ref=${fe}`,w}catch(w){throw new Error(`Incorrect url: ${C}, ${w}`)}}async function yn(C,d){const m=new URL(C);if(!m.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let w=m.pathname.split("/-/blob/")[0].split("/blob/")[0];const G=getGitLabIntegrationRelativePath(d);G&&(w=w.replace(G,""));const fe=new URL(`${m.origin}${G}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),be=await fetch(fe.toString(),jn(d)),Be=await be.json();if(!be.ok)throw new Error(`GitLab Error '${Be.error}', ${Be.error_description}`);return Number(Be.id)}catch(w){throw new Error(`Could not get GitLab project ID for: ${C}, ${w}`)}}class nn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return En(d,"edit")}constructor(d){this.integrationConfig=d}}nn.factory=({config:C})=>{var d;const m=dn((d=C.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new nn(w)),w=>w.config.host)};function En(C,d){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class ar{static fromConfig(d){return new ar({awsS3:Q.factory({config:d}),azure:We.factory({config:d}),bitbucket:vt.factory({config:d}),bitbucketCloud:kt.factory({config:d}),bitbucketServer:ln.factory({config:d}),gerrit:ae.factory({config:d}),github:St.factory({config:d}),gitlab:nn.factory({config:d}),gitea:ce.factory({config:d})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(d=>d.list())}byUrl(d){let m=Object.values(this.byType).map(w=>w.byUrl(d)).filter(Boolean);if(m.length>1){const w=m.filter(G=>!(G instanceof vt));w.length!==0&&(m=w)}return m[0]}byHost(d){return Object.values(this.byType).map(m=>m.byHost(d)).find(Boolean)}resolveUrl(d){const m=this.byUrl(d.base);return m?m.resolveUrl(d):l(d)}resolveEditUrl(d){const m=this.byUrl(d);return m?m.resolveEditUrl(d):d}constructor(d){this.byType=d}}},96215:function(jt,Fe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var n=t(52322),g=t(2784),I=t(28316),W=t(73557),x=t(25248);const l=(0,x.T0)({id:"plugin.techdocs.storageservice"}),R=(0,x.T0)({id:"plugin.techdocs.service"});var ne=t(92077),J=t(95481),Q=t(7476),D=t(93225),X=t(67896),_=t(65124),he=t(17339),ie=t(85478),A=t(68435),L=t(3482),$=t(42081),E=t(48431),T=t(89258),ee=t(52943),Ie=t(61886),Qe=t(13980),Ze=t.n(Qe);class we{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var We=t(51837);const gt=(0,We.CT)("api-context"),nt=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,g.useContext)(gt))===null||r===void 0?void 0:r.atVersion(1),O=f?new we(o,f):o;return(0,n.jsx)(gt.Provider,{value:(0,We.EI)({1:O}),children:c})};nt.propTypes={apis:Ze().shape({get:Ze().func.isRequired}).isRequired,children:Ze().node};class Me{static validateFactories(r,o){for(const c of o){const f=[c],O=new Set;for(;f.length;){const M=f.shift(),z=r.get(M);if(!!z)for(const re of Object.values(z.deps)){if(re.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);O.has(re)||(O.add(re),f.push(re))}}}}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 O=this.loadDeps(r,f.deps,[...o,f.api]),M=f.factory(O);return this.apis.set(r.id,M),M}loadDeps(r,o,c){const f={};for(const O in o)if(o.hasOwnProperty(O)){const M=o[O],z=this.load(M,c);if(!z)throw new Error(`No API factory available for dependency ${M} of dependent ${r}`);f[O]=z}return f}constructor(r){this.factories=r,this.apis=new Map}}var ze;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(ze||(ze={}));class Xe{register(r,o){const c=ze[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 rt(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,O=window.screen.width/2-c/2,M=window.screen.height/2-f/2,z=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${M},left=${O}`);let re="";if(!z||typeof z.closed=="undefined"||z.closed){const dt=new Error("Failed to open auth popup.");dt.name="PopupRejectedError",o(dt);return}const Ve=dt=>{if(dt.source!==z||dt.origin!==a.origin)return;const{data:It}=dt;if(It.type==="config_info"){re=It.targetOrigin;return}if(It.type!=="authorization_response")return;const Dt=It;if("error"in Dt){const Mt=new Error(Dt.error.message);Mt.name=Dt.error.name,o(Mt)}else r(Dt.response);Ct()},Ue=setInterval(()=>{if(z.closed){const dt=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,It=new Error(dt);It.name="PopupClosedError",o(It),Ct()}},100);function Ct(){window.removeEventListener("message",Ve),clearInterval(Ue)}window.addEventListener("message",Ve)})}function ct(a){return[...a].join(" ")}class lt{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:window.location.origin}),f=await rt({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:O=ct,oauthRequestApi:M,sessionTransform:z=re=>re}=r;this.authRequester=M.createAuthRequester({provider:f,onAuthRequest:re=>this.showPopup(re)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=O,this.sessionTransform=z}}function mt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class vt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return mt(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 O of f)c.add(O)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Ke=t(82394),se=t.n(Ke);let ke=Symbol.observable;class Re{[ke](){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 xt{[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 Pt{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?x.sM.SignedIn:x.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new xt(x.sM.SignedOut),this.signedIn=!1}}class ft{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),O=this.sessionScopesFunc(c);return mt(O,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 Pt;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:O}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=O,this.helper=new vt({sessionScopes:f,defaultScopes:c})}}class Et{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 wt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=wt,oauthRequestApi:O,defaultScopes:M=[],scopeTransform:z=Ue=>Ue}=r,re=new lt({discoveryApi:o,environment:c,provider:f,oauthRequestApi:O,sessionTransform(Ue){return{...Ue,providerInfo:{idToken:Ue.providerInfo.idToken,accessToken:Ue.providerInfo.accessToken,scopes:kt.normalizeScopes(z,Ue.providerInfo.scope),expiresAt:new Date(Date.now()+Ue.providerInfo.expiresInSeconds*1e3)}}}}),Ve=new ft({connector:re,defaultScopes:new Set(M),sessionScopes:Ue=>Ue.providerInfo.scopes,sessionShouldRefresh:Ue=>(Ue.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:Ve,scopeTransform:z})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=kt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var O;return(O=f==null?void 0:f.providerInfo.accessToken)!==null&&O!==void 0?O:""}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 Qt={id:"github",title:"GitHub",icon:()=>null};class tn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Qt,oauthRequestApi:O,defaultScopes:M=["read:user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const Ht={id:"gitlab",title:"GitLab",icon:()=>null};class Gt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ht,oauthRequestApi:O,defaultScopes:M=["read_user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const pn={id:"google",title:"Google",icon:()=>null},_t="https://www.googleapis.com/auth/";class On{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:O=pn,defaultScopes:M=["openid",`${_t}userinfo.email`,`${_t}userinfo.profile`]}=r;return kt.create({discoveryApi:o,oauthRequestApi:c,provider:O,environment:f,defaultScopes:M,scopeTransform(z){return z.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${_t}userinfo.${re}`:re.startsWith(_t)?re:`${_t}${re}`)}})}}const ln={id:"okta",title:"Okta",icon:()=>null},$n=new Set(["openid","profile","email","phone","address","groups","offline_access"]),fn="okta.";class Kn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:O,defaultScopes:M=["openid","email","profile","offline_access"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M,scopeTransform(z){return z.map(re=>$n.has(re)||re.startsWith(fn)?re:`${fn}${re}`)}})}}var Kt=t(30195);const In=Kt.z.object({profile:Kt.z.object({email:Kt.z.string().optional(),displayName:Kt.z.string().optional(),picture:Kt.z.string().optional()}),backstageIdentity:Kt.z.object({token:Kt.z.string(),identity:Kt.z.object({type:Kt.z.literal("user"),userEntityRef:Kt.z.string(),ownershipEntityRefs:Kt.z.array(Kt.z.string())})})}),Bn={id:"saml",title:"SAML",icon:()=>null};class Yt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Bn}=r,O=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),M=new StaticAuthSessionManager({connector:O}),z=new AuthSessionStore({manager:M,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Yt(z)}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 gn={id:"microsoft",title:"Microsoft",icon:()=>null};class cn{static create(r){const{environment:o="development",provider:c=gn,oauthRequestApi:f,discoveryApi:O,defaultScopes:M=["openid","offline_access","profile","email","User.Read"]}=r;return kt.create({discoveryApi:O,oauthRequestApi:f,provider:c,environment:o,defaultScopes:M})}}const Rn={id:"onelogin",title:"onelogin",icon:()=>null},Zn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Cn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Rn,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(z=>Zn.has(z)||z.startsWith(Cn)?z:`${Cn}${z}`)}})}}const te={id:"bitbucket",title:"Bitbucket",icon:()=>null};class je{static create(r){const{discoveryApi:o,environment:c="development",provider:f=te,oauthRequestApi:O,defaultScopes:M=["team"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const De={id:"atlassian",title:"Atlassian",icon:()=>null};class qe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=De,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c})}}class bt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Re}}class ae{captureEvent(r){}}const P="theme";class q{static createWithStorage(r){const o=new q(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(P))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(O=>{O?window.localStorage.setItem(P,O):window.localStorage.removeItem(P)}),window.addEventListener("storage",O=>{if(O.key===P){var M;const z=(M=localStorage.getItem(P))!==null&&M!==void 0?M:void 0;o.setActiveThemeId(z)}}),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 xt(void 0)}}var Ye=t(9850),U=t.n(Ye),B=t(12782),ce=t.n(B);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Se(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function $e(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 Oe={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 He{static fromConfigs(r){return r.length===0?new He(void 0):r.reduce((o,{data:c,context:f,filteredKeys:O,deprecatedKeys:M})=>{const z=new He(c,f,o);if(z.filteredKeys=O,M)for(const{key:re,description:Ve}of M)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${Ve||""}`);return z},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(Oe.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=U()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var O;return f}else if(f===void 0)return c;return ce()({},{value:f},{value:c},(M,z)=>!Se(z)||!Se(M)?z:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Oe.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(Se(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Oe.type(this.fullKey(r),this.context,$e(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[O,M]of f.entries())if(!Se(M))return{expected:"object-array",value:M,key:`${r}[${O}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,O)=>this.copy(f,`${r}[${O}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Oe.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(Oe.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Oe.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(Oe.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(Oe.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 He(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 O;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const M=o(c);if(M!==!0){const{key:z=r,value:re=c,expected:Ve}=M;throw new TypeError(Oe.type(this.fullKey(z),this.context,$e(re),Ve))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,O]of o.entries())if(Se(c))c=c[O];else if(c!==void 0){const M=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Oe.type(M,this.context,$e(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 ot="Invalid discovery URL pattern,";class S{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(`${ot} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${ot} URL must not have a hash`);if(f.search)throw new Error(`${ot} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${ot} URL must not end with a slash`);return new S(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class H{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 me{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Re}}class ue{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function Ce(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 Pe{registerFlag(r){Ce(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===x.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===x.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,O])=>(Ce(f),O===x.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ne(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 it{static create(r){var o,c;const f=pt(r),O=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",M=((c=r.header)===null||c===void 0?void 0:c.value)||(z=>`Bearer ${z}`);return new it(r.identityApi,f,O,M)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:O}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof O!="string"||!O||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(O)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function pt(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 et(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class St{apply(r){return async(o,c)=>{const f=new Request(o,c),O="plugin://";if(!f.url.startsWith(O))return r(o,c);const{hostname:M,pathname:z,search:re,hash:Ve,username:Ue,password:Ct}=new URL(`http://${f.url.substring(O.length)}`);let dt=await this.discoveryApi.getBaseUrl(M);if(Ue||Ct){const Dt=new URL(dt),Mt=`${Ue}${Ct?`:${Ct}`:""}@`;dt=`${Dt.protocol}//${Mt}${Dt.host}${Dt.pathname}`}const It=`${et(dt,z)}${re}${Ve}`;return r(It,typeof o=="string"||at(o)?c:o)}}constructor(r){this.discoveryApi=r}}function at(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(r){return new St(r.discoveryApi)}static injectIdentityAuth(r){return it.create(r)}constructor(){}}function Bt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function Nt(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class mn{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=>Bt(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)=>Nt(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 xt(this.getCurrentPending())}}class Wn{createAuthRequester(r){const o=new mn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const O=this.currentRequests.slice(),M=this.makeAuthRequest(f,r);M?O[c]=M:delete O[c],this.currentRequests=O,this.subject.next(O.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 xt([]),this.currentRequests=[],this.handlerCount=0}}const wn=new Map;class Ut{static create(r){var o;return new Ut((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,(O,M)=>(typeof M=="object"&&M!==null&&Object.freeze(M),M)),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 wn.has(o)||wn.set(o,new Ut(o,this.errorApi)),wn.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 Ft=t(64279);function dn(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:g.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:O}=o.shift();g.Children.forEach(c,M=>{if(!(0,g.isValidElement)(M))return;const z={};for(const re in r)if(r.hasOwnProperty(re)){const Ve=r[re];z[re]=Ve.visit(Ve.accumulator,M,f,O[re])}for(const re of a.discoverers){const Ve=re(M);Ve&&o.push({node:Ve,parent:M,contexts:z})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function vn(a,r){return()=>({accumulator:a(),visit:r})}function Un(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function jn(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 Dn=vn(()=>new Set,(a,r)=>{const o=(0,x.IY)(r,"core.plugin");o&&a.add(o)}),yn=a=>{const{children:r}=a,o=(0,x.h_)(x.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,x.R5)(yn,"core.featureFlagged",!0);const nn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function En(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 ar(a,r=new Array){return g.Children.forEach(a,o=>{if(!(0,g.isValidElement)(o))return;const c=(0,x.IY)(o,"core.mountPoint");if(c){const f=(0,x.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}ar(o.props.children,r)}),r}const C=vn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const M=(f=r.props)===null||f===void 0?void 0:f.path,z=(0,x.IY)(r,"core.mountPoint");if(z&&M)throw new Error(`Path property may not be set directly on a routable extension "${En(r)}"`);var re;const Ve=(re=c==null||(O=c.obj)===null||O===void 0?void 0:O.children)!==null&&re!==void 0?re:a.objects;if(M!==void 0){if(typeof M!="string")throw new Error(`Element path must be a string at "${En(r)}"`);const It=M.startsWith("/")?M.slice(1):M,Dt=r.props.element;if((0,x.IY)(r,"core.gatherMountPoints")){var Ue;if(Dt)throw new Error(`Mount point gatherers may not have an element prop "${En(r)}"`);const Mt={path:It,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ue=r.props)===null||Ue===void 0?void 0:Ue.caseSensitive),children:[nn],plugin:void 0};return Ve.push(Mt),{obj:Mt,gatherPath:It,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Dt){var Ct;const[Mt,...Tn]=ar(Dt);if(Tn.length>0)throw new Error(`Route element with path "${M}" may not contain multiple routable extensions`);if(!Mt)return c;const{routeRef:sr,plugin:er}=Mt,pr={path:It,element:"mounted",routeRefs:new Set([sr]),caseSensitive:Boolean((Ct=r.props)===null||Ct===void 0?void 0:Ct.caseSensitive),children:[nn],plugin:er};return Ve.push(pr),a.paths.set(sr,It),a.parents.set(sr,c==null?void 0:c.routeRef),{obj:pr,routeRef:sr!=null?sr:c==null?void 0:c.routeRef,gatherPath:It,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(z){var dt;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${En(r)}" with mount point "${z}" must be assigned a path`);return c==null||(dt=c.obj)===null||dt===void 0||dt.routeRefs.add(z),a.paths.set(z,c.gatherPath),a.parents.set(z,c==null?void 0:c.gatherRouteRef),{...c,routeRef:z}}return c}),d=vn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O,M;if((o==null?void 0:o.props.element)===r)return c;let z=c==null?void 0:c.obj,re=c==null?void 0:c.routeRef,Ve=c==null?void 0:c.sticky;const Ue=(f=r.props)===null||f===void 0?void 0:f.path;var Ct;const dt=(Ct=z==null?void 0:z.children)!==null&&Ct!==void 0?Ct:a.objects,It=Boolean((O=r.props)===null||O===void 0?void 0:O.caseSensitive);let Dt=c==null?void 0:c.path;if((0,x.IY)(r,"core.gatherMountPoints")){if(!Ue)throw new Error("Mount point gatherer must have a path");Dt=Ue}const Mt=(M=r.props)===null||M===void 0?void 0:M.element;let Tn=(0,x.IY)(r,"core.mountPoint");if(!Tn&&(0,g.isValidElement)(Mt)&&(Tn=(0,x.IY)(Mt,"core.mountPoint")),Tn){let pr=Ue;if(Dt&&(pr?Dt=void 0:pr=Dt),!pr)throw new Error("Mounted routable extension must have a path");a.paths.set(Tn,pr),re&&Ve?(a.parents.set(Tn,re),Ue&&(re=Tn,Ve=!1)):(a.parents.set(Tn,re),re=Tn),Ue?(z={caseSensitive:It,path:Ue,element:"mounted",routeRefs:new Set([Tn]),children:[nn],plugin:(0,x.IY)(r.props.element,"core.plugin")},dt.push(z)):z==null||z.routeRefs.add(Tn)}if((0,x.IY)(r,"core.gatherMountPoints")&&(Ve=!0),(0,x.IY)(r,"core.gatherMountPoints")){if(!Ue)throw new Error("Mount point gatherer must have a path");if(!Tn){var er;z={caseSensitive:It,path:Ue,element:"gathered",routeRefs:new Set,children:[nn],plugin:c==null||(er=c.obj)===null||er===void 0?void 0:er.plugin},dt.push(z)}}return{obj:z,path:Dt,routeRef:re,sticky:Ve}}),m=vn(()=>new Set,(a,r)=>{if(r.type===yn){const o=r.props;a.add("with"in o?o.with:o.without)}});var w=t(16060);const G=(0,We.uW)("route-ref-type",()=>Symbol("route-ref-type"));function fe(a){return a[G]==="absolute"}function be(a){return a[G]==="sub"}function Be(a){return a[G]==="external"}function ht(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function $t(a,r,o){let c,f="";if(fe(a))c=a;else if(be(a))c=a.parent,f=a.path;else if(Be(a)){const z=o.get(a);if(!z)return[void 0,""];if(fe(z))c=z;else if(be(z))c=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}else throw a[G]?new Error(`Unknown or invalid route ref type, ${a[G]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const O=r.get(c);if(O===void 0)return[void 0,""];const M=ht(O,f);return[c,M]}function on(a,r,o,c,f){var O;const M=(O=(0,w.fp)(f,r))!==null&&O!==void 0?O:[],z=Array();let re=-1;for(let Ct=a;Ct&&(re=M.findIndex(dt=>dt.route.routeRefs.has(Ct)),re===-1);Ct=c.get(Ct))z.unshift(Ct);z.length===0&&(re-=1);const Ve=re===-1?"":M[re].pathname,Ue=z.slice(0,-1).map(Ct=>{const dt=o.get(Ct);if(dt===void 0)throw new Error(`No path for ${Ct}`);if(dt.includes(":"))throw new Error(`Cannot route to ${a} with parent ${Ct} as it has parameters`);return dt});return`${ht(Ve,...Ue)}/`}class Mn{resolve(r,o){const[c,f]=$t(r,this.routePaths,this.routeBindings);if(!c)return;let O;typeof o=="string"?O=this.trimPath(o):o.pathname?O={...o,pathname:this.trimPath(o.pathname)}:O=o;const M=this.appBasePath+on(c,O,this.routePaths,this.routeParents,this.routeObjects);return(...[re])=>ht(M,(0,w.Gn)(f,re))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,O){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=O}}const kr=(0,We.CT)("routing-context"),ds=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:O})=>{const M=new Mn(a,r,o,c,f),z=(0,We.EI)({1:M});return(0,n.jsx)(kr.Provider,{value:z,children:O})},tr=(a,r)=>{try{var o,c;const f=(0,w.fp)(r,{pathname:a}),O=(o=f==null?void 0:f.filter(z=>{var re;return((re=z==null?void 0:z.route.routeRefs)===null||re===void 0?void 0:re.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!O)return{};let M;return O.routeRefs.size===1&&(M=O.routeRefs.values().next().value),{extension:"App",pluginId:((c=O.plugin)===null||c===void 0?void 0:c.getId())||"root",...M?{routeRef:M.id}:{}}}catch{return{}}},Hn=({pathname:a,search:r,hash:o})=>{const c=(0,x.z$)();return(0,g.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Gn=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,W.TH)();return(0,n.jsx)(x.fC,{attributes:tr(r,a),children:(0,n.jsx)(Hn,{pathname:r,search:o,hash:c})})};function jr(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,O="";for(;f;){const z=a.get(f);if(z===void 0)throw new Error(`No path for ${f}`);O=ht(z,O),f=r.get(f)}const M=O.match(/:(\w+)/g);if(M){for(let z=0;z<M.length;z++)for(let re=z+1;re<M.length;re++)if(M[re]===M[z])throw new Error(`Parameter ${M[re]} is duplicated in path ${O}`)}}}function Er(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 us=(0,We.CT)("app-context"),Or=({appContext:a,children:r})=>{const o=(0,We.EI)({1:a});return(0,n.jsx)(us.Provider,{value:o,children:r})};function Vr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function Wr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class $r{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 Wr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Vr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Wr("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 Wr("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var Yn=t(72164);function Ar(a,r,o){if(a!==void 0){const f=o.find(O=>O.id===a);if(f)return f}if(r){const f=o.find(O=>O.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Tr=()=>{const a=(0,g.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,g.useState)(a.matches);return(0,g.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Hr({children:a}){const r=(0,x.h_)(x.hg),o=(0,Yn.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Tr():!1,f=Ar(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const mr=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 nr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new lr(new Map(this.apis))}constructor(){this.apis=[]}}class lr{static builder(){return new nr}static from(r){return new lr(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new lr(new Map([[r.id,o]]))}with(r,o){return new lr(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Bs(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[O,M]of Object.entries(f)){const z=c[O];if(!z)throw new Error(`Key ${O} is not an existing external route`);if(!M&&!z.optional)throw new Error(`External route ${O} is required but was undefined`);M&&r.set(z,M)}}}),r}function rr(){const[a]=(0,W.is)((0,n.jsx)(W.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Gr=(0,g.createContext)({routeObjects:[]});function hs(a){return rr()?Kr(a):""}function Kr(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 ps(a,r,o){const c=Boolean(a),f=(0,Ft.default)(a||(()=>Promise.resolve([])));let O;if(c&&f.loading){const{Progress:Ve}=r;O=(0,n.jsx)(Ve,{})}else if(f.error){const{BootErrorPage:Ve}=r;O=(0,n.jsx)(Ve,{step:"load-config",error:f.error})}const{ThemeProvider:M=Hr}=r;if(O)return{node:(0,n.jsx)(nt,{apis:lr.with(x.hg,o),children:(0,n.jsx)(M,{children:O})})};var z;return{api:He.fromConfigs((z=f.value)!==null&&z!==void 0?z:[])}}class Zs{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 fs{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new Zs(this);let o=!1;return({children:f})=>{const O=(0,g.useMemo)(()=>q.createWithStorage(this.themes),[]),{routing:M,featureFlags:z,routeBindings:re}=(0,g.useMemo)(()=>{const dt=dn({root:f,discoverers:[Un,jn],collectors:{routing:rr()?d:C,collectedPlugins:Dn,featureFlags:m}});return dt.collectedPlugins.forEach(It=>this.plugins.add(It)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...dt,routeBindings:Bs(this.bindRoutes)}},[f]);o||(o=!0,jr(M.paths,M.parents),Er(re,this.plugins));const Ve=ps(this.configLoader,this.components,O),Ue="api"in Ve;if(Ue){const{api:dt}=Ve;this.configApi=dt}if((0,g.useEffect)(()=>{if(Ue){const dt=this.getApiHolder().get(x.W0);for(const It of this.plugins.values())if("getFeatureFlags"in It)for(const Dt of It.getFeatureFlags())dt.registerFlag({name:Dt.name,pluginId:It.getId()});else for(const Dt of It.output())Dt.type==="feature-flag"&&dt.registerFlag({name:Dt.name,pluginId:It.getId()});for(const It of z)dt.registerFlag({name:It,pluginId:""})}},[Ue,Ve,z]),"node"in Ve)return Ve.node;const{ThemeProvider:Ct=Hr}=this.components;return(0,n.jsx)(nt,{apis:this.getApiHolder(),children:(0,n.jsx)(Or,{appContext:r,children:(0,n.jsx)(Ct,{children:(0,n.jsx)(ds,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:re,basePath:hs(Ve.api),children:(0,n.jsx)(Gr.Provider,{value:{routeObjects:M.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:O,children:M})=>{const[z,re]=(0,g.useState)(),Ve=(0,x.h_)(x.Ds),Ue=hs(Ve);return z?(this.appIdentityProxy.setTarget(z,{signOutTargetUrl:Ue||"/"}),M):(0,n.jsx)(O,{onSignInSuccess:re})};return({children:O})=>{const M=(0,x.h_)(x.Ds),z=Kr(M),re=`${z}/*`,{routeObjects:Ve}=(0,g.useContext)(Gr);return o?rr()?(0,n.jsxs)(r,{children:[(0,n.jsx)(Gn,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(Gn,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(n.Fragment,{children:O})})]}):(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:z||"/"}),rr()?(0,n.jsxs)(r,{children:[(0,n.jsx)(Gn,{routeObjects:Ve}),(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(Gn,{routeObjects:Ve}),O]}))}}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 Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:x.hg,deps:{},factory:()=>q.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:x.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:x.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:x.W0,deps:{},factory:()=>new Pe});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 Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Me(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 $r;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:mr;var O;this.defaultApis=(O=r.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new Xe}}function gs(a){return new fs(a)}let Yr=!1;const ms=a=>{const r=(0,x.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,g.useMemo)(()=>rr(),[]),O=[...(0,x.vJ)(a.children,M=>M.getElements().flatMap(z=>{let re=z.props.path;if(re==="")return[];var Ve;re=(Ve=re==null?void 0:re.replace(/\/\*$/,""))!==null&&Ve!==void 0?Ve:"/";let Ue=c?z:z.props.element;return!c&&!Ue&&(Ue=z,Yr||(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] />} />."),Yr=!0)),[{path:re,element:Ue,children:z.props.children?[{path:re==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,re)=>re.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,W.V$)(O)};var Jr=t(25488);const Qr=[(0,x.ni)({api:x.NW,deps:{configApi:x.Ds},factory:({configApi:a})=>S.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,x.ni)({api:x.$v,deps:{},factory:()=>new bt}),(0,x.ni)({api:x.v_,deps:{},factory:()=>new ae}),(0,x.ni)({api:x.VE,deps:{alertApi:x.$v},factory:({alertApi:a})=>{const r=new H(a,new me);return ue.forward(r,{hidden:!1}),r}}),(0,x.ni)({api:x.E6,deps:{errorApi:x.VE},factory:({errorApi:a})=>Ut.create({errorApi:a})}),(0,x.ni)({api:x.gP,deps:{configApi:x.Ds,identityApi:x.$4,discoveryApi:x.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Ne({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:r,config:a})]})}),(0,x.ni)({api:x.ZM,deps:{},factory:()=>new Wn}),(0,x.ni)({api:x.Kp,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>On.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.p_,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>cn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.F4,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>tn.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.D,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Kn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.ux,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Gt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.gW,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ge.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.bq,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>je.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.uB,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>qe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:Jr.RV,deps:{discovery:x.NW,identity:x.$4,config:x.Ds},factory:({config:a,discovery:r,identity:o})=>Jr.iM.create({config:a,discovery:r,identity:o})})];var vr=t(77277),Zt=t(93414),Xr=t(39857);function vs({children:a}){return(0,W.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(W.VA,{children:a})}const qr=()=>(0,n.jsx)(Zt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),xn=({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)(vs,{children:(0,n.jsx)(Zt.mf,{status:"501",statusMessage:o})})},Jn=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Zt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(vr.Z,{variant:"outlined",onClick:r,children:"Retry"})}),ys={Progress:Zt.Ex,Router:Xr.VK,NotFoundErrorPage:qr,BootErrorPage:xn,ErrorBoundaryFallback:Jn};var xs=t(43642),bs=t(80079),Ss=t(90941),Cs=t(32915),ws=t(40562),js=t(21853),_r=t(60744),Ir=t(66569),Ds=t(30254),Es=t(13384),es=t(15933),Ns=t(58838),y=t(86737),b=t(4989),k=t(44407),N=t(18628),Y=t(84219),K=t(98685),de=t(39781);const le={brokenImage:bs.Z,catalog:N.Z,scaffolder:Cs.Z,techdocs:ws.Z,search:js.Z,chat:_r.Z,dashboard:Ir.Z,docs:Ds.Z,email:Es.Z,github:Ns.Z,group:Y.Z,help:y.Z,"kind:api":es.Z,"kind:component":k.Z,"kind:domain":xs.Z,"kind:group":Y.Z,"kind:location":b.Z,"kind:system":Ss.Z,"kind:user":K.Z,user:K.Z,warning:de.Z};var ye=t(73689),Ee=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")`},Ae={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 Ge(a){const{colors:r,shape:o,options:c}=a,O=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,M=`${o}, ${O}`;var z;const re=(z=c==null?void 0:c.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:r,shape:o,backgroundImage:M,fontColor:re}}const yt={home:Ge({colors:Ae.teal,shape:Le.wave}),documentation:Ge({colors:Ae.pinkSea,shape:Le.wave2}),tool:Ge({colors:Ae.purpleSky,shape:Le.round}),service:Ge({colors:Ae.marineBlue,shape:Le.wave}),website:Ge({colors:Ae.veryBlue,shape:Le.wave}),library:Ge({colors:Ae.rubyRed,shape:Le.wave}),other:Ge({colors:Ae.darkGrey,shape:Le.wave}),app:Ge({colors:Ae.toastyOrange,shape:Le.wave}),apis:Ge({colors:Ae.teal,shape:Le.wave2}),card:Ge({colors:Ae.greens,shape:Le.wave})},At=16,_e='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Ot(a){const{palette:r,htmlFontSize:o=At,fontFamily:c=_e,defaultPageTheme:f,pageTheme:O=yt}=a;if(!O[f])throw new Error(`${f} is not defined in pageTheme.`);var M;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:O[f],getPageTheme:({themeId:z})=>(M=O[z])!==null&&M!==void 0?M:O[f]}}function en(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,Ee.darken)(a.palette.link,.3),background:(0,Ee.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 Qn(a){const r=Ot(a),o=(0,ye.Z)(r),c=en(o);return{...o,overrides:c}}var Nn=t(34505);const cr=Qn({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:Nn.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:yt}),un=Qn({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:Nn.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:yt});var bn=t(98192),Fn=t(15222),Rr=t(41547),yr=t(87561);const Br=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(Fn.Z,{}),Provider:({children:a})=>(0,n.jsx)(Rr.Z,{theme:cr,children:(0,n.jsx)(yr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(bn.Z,{}),Provider:({children:a})=>(0,n.jsx)(Rr.Z,{theme:un,children:(0,n.jsx)(yr.ZP,{children:a})})}];function An(a){var r,o,c;return gs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...ys,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:Qr,icons:{...le,...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:Br})}var Sn=t(25271),dr=t(76635);async function si({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,dr.isArray)(c))return;var f;const O=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(dr.isString).map(M=>M.split(":")).filter(M=>M.length===4&&M[0]==="entity").map(([M,z,re,Ve])=>(0,Sn.eE)({kind:z,namespace:re,name:Ve})).forEach(M=>O.add(M)),await o.set("entityRefs",Array.from(O)),await r.remove("starredEntities")}class So{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)})),si(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 Yi=t(33414),Zr=t(79324),Dr=t(79692),Ji=t(65826);const oi=(0,Dr.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function Qi(a){const r=a.result,o=a.highlight,c=oi(),f=useAnalytics(),O=()=>{f.captureEvent("discover",r.title,{attributes:{to:r.location},value:a.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:c.flexContainer,children:[_jsx(ListItemText,{className:c.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:r.location,onClick:O,children:o!=null&&o.fields.title?_jsx(HighlightedSearchResultText,{text:o.fields.title,preTag:o.preTag,postTag:o.postTag}):r.title}),secondary:o!=null&&o.fields.text?_jsx(HighlightedSearchResultText,{text:o.fields.text,preTag:o.preTag,postTag:o.postTag}):r.text}),_jsxs(Box,{children:[r.kind&&_jsx(Chip,{label:`Kind: ${r.kind}`,size:"small"}),r.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${r.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var Xi=t(86359),Ln=t(43297),Fs=t(95544),Us=t(99688),ts=t(12231),ns=t(86136),rs=t(49378),Co=t(85256),Ms=t(61837),wo=t(79784),ii=t(50758),ai=t(31654),zs=t(43054),li=t(65759),ur=t(51666);const As="catalog-entity",Vs=(0,ur.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:As}),Ws=(0,ur.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Hs=(0,ur.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:As}),jo=(0,ur.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:As}),Ts=(0,ur.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Eo=(0,ur.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Ao=(0,ur.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ci=[Vs,Ws,Hs,jo,Ts,Eo,Ao];var di=t(49166);function To(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,O=typeof(r==null?void 0:r.disableUnregister)=="boolean";var M;const z=(M=!o||(O?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&M!==void 0?M:!1;let re=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(re=(0,n.jsxs)(ts.Z,{onClick:()=>{f(),c()},disabled:z,children:[(0,n.jsx)(ns.Z,{children:(0,n.jsx)(di.Z,{fontSize:"small"})}),(0,n.jsx)(rs.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:re})}const Io=(0,Dr.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Gs(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[O,M]=(0,g.useState)(),z=Io(),Ve=(0,Ln.N$)(Hs).allowed,Ue=Mt=>{M(Mt.currentTarget)},Ct=()=>{M(void 0)},dt=(0,x.h_)(x.$v),It=(0,g.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>dt.post({message:"Copied!",severity:"info"}))},[dt]),Dt=r&&[...r.map(Mt=>(0,n.jsxs)(ts.Z,{onClick:()=>{Ct(),Mt.onClick()},children:[(0,n.jsx)(ns.Z,{children:(0,n.jsx)(Mt.Icon,{fontSize:"small"})}),(0,n.jsx)(rs.Z,{primary:Mt.title})]},Mt.title)),(0,n.jsx)(Co.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ms.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!O,role:"button",onClick:Ue,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,n.jsx)(zs.Z,{})}),(0,n.jsx)(wo.ZP,{open:Boolean(O),onClose:Ct,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(ii.Z,{children:[Dt,(0,n.jsx)(To,{unregisterEntityOptions:o,isUnregisterAllowed:Ve,onUnregisterEntity:c,onClose:Ct}),(0,n.jsxs)(ts.Z,{onClick:()=>{Ct(),f()},children:[(0,n.jsx)(ns.Z,{children:(0,n.jsx)(ai.Z,{fontSize:"small"})}),(0,n.jsx)(rs.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(ts.Z,{onClick:()=>{Ct(),It()},children:[(0,n.jsx)(ns.Z,{children:(0,n.jsx)(li.Z,{fontSize:"small"})}),(0,n.jsx)(rs.Z,{primary:"Copy entity URL"})]})]})})]})}const Ks="plugin.catalog.entityLayoutRoute",ss=()=>null;(0,x.R5)(ss,Ks,!0),(0,x.R5)(ss,"core.gatherMountPoints",!0);function Ro(a){const{entity:r,title:o}=a;return(0,n.jsxs)(Fs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(Fs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(Ln.LH,{entity:r})]})}function Ys(a,r,o,c){var f;const O=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var M;const z=(M=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&M!==void 0?M:"";var re,Ve,Ue;return{headerTitle:`${(Ue=(Ve=(re=c==null?void 0:c.metadata.title)!==null&&re!==void 0?re:o)!==null&&Ve!==void 0?Ve:c==null?void 0:c.metadata.name)!==null&&Ue!==void 0?Ue:""}${z&&z!==Sn.zG?` in ${z}`:""}`,headerType:(()=>{let dt=O.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(dt+=" \u2014 ",dt+=c.spec.type.toLocaleLowerCase("en-US")),dt})()}}function Js(a){var r;const{entity:o}=a,c=(0,Ln.hF)(o,Sn.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Zt.i9,{label:"Owner",value:(0,n.jsx)(Ln.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Zt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Lo=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:O,NotFoundComponent:M}=a,{kind:z,namespace:re,name:Ve}=(0,x.Oi)(Ln.wi),{entity:Ue,loading:Ct,error:dt}=(0,Ln.ce)(),It=(0,W.TH)(),Dt=(0,x.vJ)(O,Ps=>Ps.selectByComponentData({key:Ks,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:fr})=>{if(Ue){if(fr.if&&!fr.if(Ue))return[]}else return[];return[{path:fr.path,title:fr.title,children:fr.children,tabProps:fr.tabProps}]}),[Ue]),{headerTitle:Mt,headerType:Tn}=Ys(z,re,Ve,Ue),[sr,er]=(0,g.useState)(!1),[pr,Ls]=(0,g.useState)(!1),Yo=(0,W.s0)(),wi=async()=>{er(!1),Ls(!1),Yo("/")};(0,g.useEffect)(()=>{er(!1),Ls(!1)},[It.pathname]);var go;return(0,n.jsxs)(Zt.T3,{themeId:(go=Ue==null||(r=Ue.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&go!==void 0?go:"home",children:[(0,n.jsx)(Zt.h4,{title:(0,n.jsx)(Ro,{title:Mt,entity:Ue}),pageTitleOverride:Mt,type:Tn,children:Ue&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Js,{entity:Ue}),(0,n.jsx)(Gs,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>er(!0),onInspectEntity:()=>Ls(!0)})]})}),Ct&&(0,n.jsx)(Zt.Ex,{}),Ue&&(0,n.jsx)(Zt.tn,{routes:Dt}),dt&&(0,n.jsx)(Zt.VY,{children:(0,n.jsx)(Us.Z,{severity:"error",children:dt.toString()})}),!Ct&&!dt&&!Ue&&(0,n.jsx)(Zt.VY,{children:M||(0,n.jsxs)(Zt.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,n.jsx)(Zt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(Ln.pp,{open:sr,entity:Ue,onConfirm:wi,onClose:()=>er(!1)}),(0,n.jsx)(Ln.U_,{open:pr,entity:Ue,onClose:()=>Ls(!1)})]})};Lo.Route=ss;var qi=t(23054);function ui(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[O,M]=useState(!1),z=useApi(catalogApiRef),re=useApi(alertApiRef),Ve=async()=>{M(!0);try{const Ue=f.metadata.uid;await z.removeEntityByUid(Ue),c()}catch(Ue){assertError(Ue),re.post({message:Ue.message})}finally{M(!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:O,onClick:Ve,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Nr=t(19625);function hi(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 Xn(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),O=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:O,onClose:()=>c(!1)})]})}var pi=t(29644);const fi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Po(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var O,M;return{errors:((M=(O=f.entity.status)===null||O===void 0?void 0:O.items)!==null&&M!==void 0?M:[]).filter(fi).map(Ve=>Ve.error).filter(Ve=>Boolean(Ve)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function _i(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Po(stringifyEntityRef(a),o)).items.length>0}function ea(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:O}=useAsync(async()=>Po(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!O?null:_jsx(_Fragment,{children:O.items.map((M,z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(M.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:M.entity})]}),M.errors.map((re,Ve)=>_jsx(ResponseErrorPanel,{error:re},Ve))]},z))})}const ko="core.backstage.entitySwitch",Oo=a=>null;(0,x.R5)(Oo,ko,!0);const gi=a=>{var r;const{entity:o,loading:c}=(0,Ln.ce)(),f=(0,x.I_)(),O=(0,x.vJ)(a.children,re=>re.selectByComponentData({key:ko,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ve=>{if(c)return[];const{if:Ue,children:Ct}=Ve.props;if(!o)return[{if:Ue===void 0,children:Ct}];var dt;return[{if:(dt=Ue==null?void 0:Ue(o,{apis:f}))!==null&&dt!==void 0?dt:!0,children:Ct}]}),[f,o,c]);if(O.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,n.jsx)(os,{results:O});var z;return(z=(r=O.find(re=>re.if))===null||r===void 0?void 0:r.children)!==null&&z!==void 0?z:null};function os({results:a}){const{loading:r,value:o}=(0,Ft.default)(async()=>{const c=a.map(async({if:O,children:M})=>{try{if(await O)return M}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}gi.Case=Oo;const ta=null,na=Ln._i.Filters,mi=Ln._i.Content,zn=(0,x.rx)({id:"catalog",apis:[(0,x.ni)({api:Ln.Ah,deps:{discoveryApi:x.NW,fetchApi:x.gP},factory:({discoveryApi:a,fetchApi:r})=>new pi.MS({discoveryApi:a,fetchApi:r})}),(0,x.ni)({api:Ln.p3,deps:{storageApi:x.E6},factory:({storageApi:a})=>new So({storageApi:a})})],routes:{catalogIndex:Nr._Z,catalogEntity:Ln.wi},externalRoutes:{createComponent:Nr.yw,viewTechDoc:Nr.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Qs=zn.provide((0,x.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Nr._Z})),$o=zn.provide((0,x.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:Ln.wi})),vi=zn.provide((0,x.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),yi=zn.provide((0,x.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),Xs=zn.provide((0,x.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),_s=zn.provide((0,x.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Is=zn.provide((0,x.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Bo=zn.provide((0,x.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Zo=zn.provide((0,x.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),hr=zn.provide((0,x.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),xi=zn.provide((0,x.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Do=zn.provide((0,x.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var eo=t(32838);class bi{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}`,O=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(O.status===404)throw new Error("Page not found");return O.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 qn{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 to=[(0,x.ni)({api:Ie.Dl,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new bi({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Ie.gT,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new qn({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:eo.q3,deps:{configApi:x.Ds},factory:({configApi:a})=>eo.ae.fromConfig(a)})],is={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},no={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function as(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function ro(){const a=await mr(),r=await as();return[...a,{context:"detected",data:r?is:no}]}var so=t(58845);const oo=(0,Dr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Fr=()=>{const a=oo();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 No=(0,Dr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Uo=()=>{const a=No();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 io=(0,Dr.Z)({root:{width:Zt.po.drawerWidthClosed,height:3*Zt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Zt.po.drawerWidthClosed,marginLeft:24}}),ao=()=>{const a=io(),{isOpen:r}=(0,Zt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Zt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(Fr,{}):(0,n.jsx)(Uo,{})})})},lo=({children:a})=>(0,n.jsxs)(Zt.tR,{children:[(0,n.jsxs)(Zt.YE,{children:[(0,n.jsx)(ao,{}),(0,n.jsx)(Zt.v7,{}),(0,n.jsx)(Zt.R6,{icon:so.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var co=t(80030),uo=t(32388),Rs=t(4142);const Mo=(0,Dr.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 _n;(function(a){a.LIGHT="light",a.DARK="dark"})(_n||(_n={}));const zo=()=>{const a=(0,x.h_)(x.hg),r=Mo(),[o,c]=(0,g.useState)(a.getActiveThemeId()===_n.DARK?_n.DARK:_n.LIGHT),f={[_n.LIGHT]:{icon:Rs.Z,title:"Dark theme"},[_n.DARK]:{icon:uo.Z,title:"Light theme"}},{title:O,icon:M}=f[o],z=()=>{c(re=>{const Ve=re===_n.LIGHT?_n.DARK:_n.LIGHT;return a.setActiveThemeId(Ve),Ve})};return(0,n.jsx)(Fs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(co.ZP,{title:O,arrow:!0,children:(0,n.jsx)(Ms.Z,{size:"small",onClick:z,children:(0,n.jsx)(M,{className:r.headerIcon})})})})},Vo=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(D.S,{}),(0,n.jsx)(X.F,{withSearch:!1})]}),Wo=(0,n.jsx)(Vo,{}),ho=An({apis:to,configLoader:ro,plugins:Object.values(h)}),Ho=ho.getProvider(),po=ho.getRouter(),fo=T.s4.provide((0,Ie.KY)({name:"ThemeToggleAddon",component:zo,location:Ie.oZ.Header})),Go=(0,n.jsxs)(ms,{children:[(0,n.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)($o,{})}),(0,n.jsx)(W.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(L.u,{})}),(0,n.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[Wo,(0,n.jsx)(Ie.DR,{children:(0,n.jsx)(fo,{})})]})]});var Ko=()=>(0,n.jsx)(Ho,{children:(0,n.jsx)(po,{children:(0,n.jsx)(lo,{children:Go})})});I.render((0,n.jsx)(Ko,{}),document.getElementById("root"))},51837:function(jt,Fe,t){"use strict";t.d(Fe,{CT:function(){return x},EI:function(){return ne},uW:function(){return I},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(),g=J=>`__@backstage/${J}__`;function I(J,Q){const D=g(J);let X=n[D];return X||(X=Q(),n[D]=X,X)}var W=t(2784);function x(J){return I(J,()=>(0,W.createContext)(void 0))}function l(J){return(0,W.useContext)(x(J))}function R(J){return{set(Q){globalThis[`__@backstage/${J}__`]=createContext(createVersionedValueMap(Q))},reset(){delete globalThis[`__@backstage/${J}__`]}}}function ne(J){Object.freeze(J);const Q={atVersion(D){return J[D]}};return Object.defineProperty(Q,"$map",{configurable:!0,enumerable:!0,get(){return J}}),Q}},43297:function(jt,Fe,t){"use strict";t.d(Fe,{h$:function(){return tn},n3:function(){return h.n3},_i:function(){return $},zo:function(){return ke},tW:function(){return U},df:function(){return ue},UO:function(){return Bn},dq:function(){return it},nl:function(){return es},dx:function(){return Xe},rI:function(){return ct},u3:function(){return Bt},xE:function(){return wn},sL:function(){return Ut},LH:function(){return Dn},U_:function(){return Xr},pp:function(){return xs},EW:function(){return _r},Ah:function(){return g},wi:function(){return gt},hF:function(){return vt},CV:function(){return Ke},$3:function(){return Me},p3:function(){return I},ce:function(){return pn},X2:function(){return Gt},wp:function(){return Yt},ZW:function(){return bt},N$:function(){return P},eK:function(){return Cn},CR:function(){return je}});var h=t(29644),n=t(25248);const g=(0,n.T0)({id:"plugin.catalog.service"}),I=(0,n.T0)({id:"catalog-react.starred-entities"});var W=t(82394);class x{async toggleStarred(b){this.starredEntities.delete(b)||this.starredEntities.add(b);for(const k of this.subscribers)k.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(b=>(b.next(new Set(this.starredEntities)),this.subscribers.add(b),()=>{this.subscribers.delete(b)}))}}var l=t(52322),R=t(2784),ne=t(41156),J=t(60364),Q=t(77277),D=t(4190),X=t(95544),_=t(90436),he=t(60905),ie=t(36444);const A=y=>{const b=(0,ne.Z)(K=>K.breakpoints.down("md")),k=(0,J.Z)(),[N,Y]=(0,R.useState)(!1);return b?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{style:{marginTop:k.spacing(1),marginLeft:k.spacing(1)},onClick:()=>Y(!0),startIcon:(0,l.jsx)(ie.Z,{}),children:"Filters"}),(0,l.jsx)(D.ZP,{open:N,onClose:()=>Y(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(X.Z,{m:2,children:[(0,l.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:k.spacing(1)},children:"Filters"}),y.children]})})]}):(0,l.jsx)(he.Z,{item:!0,lg:2,children:y.children})},L=y=>(0,l.jsx)(he.Z,{item:!0,xs:12,lg:10,children:y.children}),$=y=>(0,l.jsx)(he.Z,{container:!0,style:{position:"relative"},children:y.children});$.Filters=A,$.Content=L;var E=t(93414),T=t(82108),ee=t.n(T),Ie=t(829),Qe=t.n(Ie),Ze=t(64279),we=t(25271),We=t(51837);const gt=(0,We.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function nt(y){var b,k;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(k=(b=y.metadata.namespace)===null||b===void 0?void 0:b.toLocaleLowerCase("en-US"))!==null&&k!==void 0?k:DEFAULT_NAMESPACE,name:y.metadata.name}}function Me(y,b){const k=b==null?void 0:b.defaultKind;let N,Y,K;return"metadata"in y?(N=y.kind,Y=y.metadata.namespace,K=y.metadata.name):(N=y.kind,Y=y.namespace,K=y.name),(Y===void 0||Y==="")&&(Y=we.zG),(b==null?void 0:b.defaultNamespace)!==void 0?(b==null?void 0:b.defaultNamespace)===Y&&(Y=void 0):Y===we.zG&&(Y=void 0),N=N.toLocaleLowerCase("en-US"),N=k&&k.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${Y?`${Y}/`:""}${K}`}var ze=t(80030);const Xe=(0,R.forwardRef)((y,b)=>{const{entityRef:k,defaultKind:N,title:Y,children:K,...de}=y,le=(0,n.tg)(gt);let ye,Ee,Le;if(typeof k=="string"){const _e=(0,we.of)(k);ye=_e.kind,Ee=_e.namespace,Le=_e.name}else"metadata"in k?(ye=k.kind,Ee=k.metadata.namespace,Le=k.metadata.name):(ye=k.kind,Ee=k.namespace,Le=k.name);ye=ye.toLocaleLowerCase("en-US");var Ae;Ee=(Ae=Ee==null?void 0:Ee.toLocaleLowerCase("en-US"))!==null&&Ae!==void 0?Ae:we.zG;const Ge={kind:ye,namespace:Ee,name:Le},yt=Me({kind:ye,namespace:Ee,name:Le},{defaultKind:N}),At=(0,l.jsxs)(E.rU,{...de,ref:b,to:le(Ge),children:[K,!K&&(Y!=null?Y:yt)]});return Y?(0,l.jsx)(ze.ZP,{title:yt,children:At}):At});function rt(y){const{entityRefs:b,defaultKind:k,getTitle:N,...Y}=y,K=(0,n.h_)(g),{value:de=new Array,loading:le,error:ye}=(0,Ze.default)(async()=>{const Ee=b.reduce((Ae,Ge)=>"metadata"in Ge?Ae:[...Ae,(0,we.of)(Ge)],new Array),Le=b.filter(Ae=>"metadata"in Ae);return Ee.length>0?[...(await K.getEntities({filter:Ee.map(Ae=>({kind:Ae.kind,"metadata.namespace":Ae.namespace,"metadata.name":Ae.name}))})).items,...Le]:Le},[b]);return le?(0,l.jsx)(E.Ex,{}):ye?(0,l.jsx)(E.yu,{error:ye}):(0,l.jsx)(l.Fragment,{children:de.map((Ee,Le)=>(0,l.jsxs)(R.Fragment,{children:[Le>0&&", ",(0,l.jsx)(Xe,{...Y,defaultKind:k,entityRef:Ee,title:N(Ee)})]},Le))})}function ct(y){const{entityRefs:b,defaultKind:k,fetchEntities:N,getTitle:Y,...K}=y;return N?(0,l.jsx)(rt,{...K,defaultKind:k,entityRefs:b,getTitle:Y}):(0,l.jsx)(l.Fragment,{children:b.map((de,le)=>(0,l.jsxs)(R.Fragment,{children:[le>0&&", ",(0,l.jsx)(Xe,{...K,defaultKind:k,entityRef:de,title:Y?Y(de):void 0})]},le))})}function lt(y){return y.reduce((b,k)=>({...b,...k.getCatalogFilters?k.getCatalogFilters():{}}),{})}function mt(y){return b=>y.every(k=>!k.filterEntity||k.filterEntity(b))}function vt(y,b,k){var N;let Y=(y==null||(N=y.relations)===null||N===void 0?void 0:N.filter(K=>K.type===b).map(K=>(0,we.of)(K.targetRef)))||[];return k!=null&&k.kind&&(Y=Y.filter(K=>K.kind.toLocaleLowerCase("en-US")===k.kind.toLocaleLowerCase("en-US"))),Y}function Ke(y,b){var k;const N=(k=y.metadata.annotations)===null||k===void 0?void 0:k[we.M6];if(!!N)try{const Y=(0,we.Ou)(N),K=b.byUrl(Y.target);return{locationTargetUrl:Y.target,integrationType:K==null?void 0:K.type}}catch{return}}function se(y,b){const k=new Set([...getEntityRelations(y,RELATION_MEMBER_OF,{kind:"group"}),...y?[getCompoundEntityRef(y)]:[]].map(stringifyEntityRef)),N=getEntityRelations(b,RELATION_OWNED_BY).map(stringifyEntityRef);for(const Y of N)if(k.has(Y))return!0;return!1}class ke{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(b){this.value=b}}class Re{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(b){this.value=b}}class st{filterEntity(b){var k;return this.values.every(N=>((k=b.metadata.tags)!==null&&k!==void 0?k:[]).includes(N))}toQueryValue(){return this.values}constructor(b){this.values=b}}class xt{filterEntity(b){const k=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([b.metadata.tags]),Y=this.toUpperArray([b.metadata.name,b.metadata.title]);for(const K of k)if(N.every(de=>de!==K)&&Y.every(de=>!de.includes(K)))return!1;return!0}toUpperArray(b){return b.flat().filter(k=>Boolean(k)).map(k=>k.toLocaleUpperCase("en-US"))}constructor(b){this.value=b}}class Pt{filterEntity(b){return this.values.some(k=>vt(b,we.S4).some(N=>Me(N,{defaultKind:"group"})===k))}toQueryValue(){return this.values}constructor(b){this.values=b}}class ft{filterEntity(b){return this.values.some(k=>{var N;return((N=b.spec)===null||N===void 0?void 0:N.lifecycle)===k})}toQueryValue(){return this.values}constructor(b){this.values=b}}class Et{filterEntity(b){switch(this.value){case"owned":return this.isOwnedEntity(b);case"starred":return this.isStarredEntity(b);default:return!0}}toQueryValue(){return this.value}constructor(b,k,N){this.value=b,this.isOwnedEntity=k,this.isStarredEntity=N}}class wt{filterEntity(b){var k;const N=(k=b.metadata.annotations)===null||k===void 0?void 0:k["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(b){this.value=b}}class kt{filterEntity(b){var k,N;const Y=(b==null||(k=b.status)===null||k===void 0||(N=k.items)===null||N===void 0?void 0:N.length)>0;return Y!==void 0&&this.value===Y}constructor(b){this.value=b}}const Qt=(0,We.CT)("entity-context"),tn=({children:y,entity:b,loading:k,error:N,refresh:Y})=>{const K={entity:b,loading:k,error:N,refresh:Y};return(0,l.jsx)(Qt.Provider,{value:(0,We.EI)({1:K}),children:(0,l.jsx)(n.fC,{attributes:{...b?{entityRef:(0,we.eE)(b)}:void 0},children:y})})},Ht=y=>_jsx(tn,{entity:y.entity,loading:!Boolean(y.entity),error:void 0,refresh:void 0,children:y.children});function Gt(){const y=(0,We.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");if(!b.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:b.entity}}function pn(){const y=(0,We.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");const{entity:k,loading:N,error:Y,refresh:K}=b;return{entity:k,loading:N,error:Y,refresh:K}}var _t=t(76635),On=t(19126),ln=t.n(On),$n=t(73557),fn=t(69294),Kn=t(48760),Kt=t(90736);const In=(0,R.createContext)(void 0),Bn=({children:y})=>{const b=(0,Kt.default)(),k=(0,n.h_)(g),[N,Y]=(0,R.useState)({}),K=(0,$n.TH)();var de;const le=(0,R.useMemo)(()=>(de=ln().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&de!==void 0?de:{},[K]),[ye,Ee]=(0,R.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Le,error:Ae},Ge]=(0,fn.default)(async()=>{const _e=(0,_t.compact)(Object.values(N)),Ot=mt(_e),en=lt(_e),Qn=lt((0,_t.compact)(Object.values(ye.appliedFilters))),Nn=Object.keys(N).reduce((un,bn)=>{const Fn=N[bn];return Fn!=null&&Fn.toQueryValue&&(un[bn]=Fn.toQueryValue()),un},{});if((0,_t.isEqual)(Qn,en))Ee({appliedFilters:N,backendEntities:ye.backendEntities,entities:ye.backendEntities.filter(Ot)});else{const un=await k.getEntities({filter:en});Ee({appliedFilters:N,backendEntities:un.items,entities:un.items.filter(Ot)})}if(b()){var cr;const un=ln().parse(K.search,{ignoreQueryPrefix:!0}),bn=ln().stringify({...un,filters:Nn},{addQueryPrefix:!0,arrayFormat:"repeat"}),Fn=`${window.location.pathname}${bn}`;(cr=window.history)===null||cr===void 0||cr.replaceState(null,document.title,Fn)}},[k,le,N,ye],{loading:!0});(0,Kn.Z)(Ge,10,[N]);const yt=(0,R.useCallback)(_e=>{Y(Ot=>{const en=typeof _e=="function"?_e(Ot):_e;return{...Ot,...en}})},[]),At=(0,R.useMemo)(()=>({filters:ye.appliedFilters,entities:ye.entities,backendEntities:ye.backendEntities,updateFilters:yt,queryParameters:le,loading:Le,error:Ae}),[ye,yt,le,Le,Ae]);return(0,l.jsx)(In.Provider,{value:At,children:y})};function Yt(){const y=(0,R.useContext)(In);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var gn=t(18149),cn=t.n(gn);function Rn(){const y=(0,n.h_)(g),{filters:{kind:b,type:k},queryParameters:{type:N},updateFilters:Y}=Yt(),K=(0,R.useMemo)(()=>[N].flat().filter(Boolean),[N]);var de;const[le,ye]=(0,R.useState)(K.length?K:(de=k==null?void 0:k.getTypes())!==null&&de!==void 0?de:[]);(0,R.useEffect)(()=>{K.length&&ye(K)},[K]);const[Ee,Le]=(0,R.useState)([]),Ae=(0,R.useMemo)(()=>b==null?void 0:b.value,[b]),{error:Ge,loading:yt,value:At}=(0,Ze.default)(async()=>Ae?await y.getEntityFacets({filter:{kind:Ae},facets:["spec.type"]}).then(en=>en.facets["spec.type"]||[]):[],[Ae,y]),_e=(0,R.useRef)(At);return(0,R.useEffect)(()=>{const Ot=_e.current;if(_e.current=At,yt||!Ae||Ot===At||!At)return;const en=[...new Set(Qe()(At,Nn=>-Nn.count).map(Nn=>Nn.value.toLocaleLowerCase("en-US")))];Le(en);const Qn=le.filter(Nn=>en.includes(Nn));cn()(le,Qn)||ye(Qn)},[yt,Ae,le,ye,At]),(0,R.useEffect)(()=>{Y({type:le.length?new Re(le):void 0})},[le,Y]),{loading:yt,error:Ge,availableTypes:Ee,selectedTypes:le,setSelectedTypes:ye}}const Zn=20;function Cn(y,b){var k,N;const Y=b==null||(k=b.type)===null||k===void 0?void 0:k.toLocaleLowerCase("en-US"),K=b==null||(N=b.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),de=(0,n.h_)(g),{loading:le,value:ye,error:Ee}=(0,Ze.default)(async()=>{var Le;const Ae=(Le=y.relations)===null||Le===void 0?void 0:Le.map(_e=>({type:_e.type,target:(0,we.of)(_e.targetRef)})).filter(_e=>(!Y||_e.type.toLocaleLowerCase("en-US")===Y)&&(!K||_e.target.kind===K));if(!Ae)return[];const Ge=Object.values((0,_t.groupBy)(Ae,({target:_e})=>`${_e.kind}:${_e.namespace}`.toLocaleLowerCase("en-US"))),yt=[];for(const _e of Ge)yt.push({kind:_e[0].target.kind,namespace:_e[0].target.namespace,nameBatches:(0,_t.chunk)(_e.map(Ot=>Ot.target.name),Zn)});return(await Promise.all(yt.flatMap(_e=>_e.nameBatches.map(Ot=>de.getEntities({filter:{kind:_e.kind,"metadata.namespace":_e.namespace,"metadata.name":Ot}}))))).flatMap(_e=>_e.items)},[y,Y,K]);return{entities:ye,loading:le,error:Ee}}var ge=t(72164);function te(y){return typeof y=="string"?y:(0,we.eE)(y)}function je(){const y=(0,n.h_)(I),b=(0,ge.Z)(y.starredEntitie$(),new Set),k=(0,R.useCallback)(Y=>b.has(te(Y)),[b]),N=(0,R.useCallback)(Y=>y.toggleStarred(te(Y)).then(),[y]);return{starredEntities:b,toggleStarredEntity:N,isStarredEntity:k}}function De(y){return typeof y=="string"?y:(0,we.eE)(y)}function qe(y){const b=(0,n.h_)(I),[k,N]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{const K=b.starredEntitie$().subscribe({next(de){N(de.has(De(y)))}});return()=>{K.unsubscribe()}},[y,b]),{toggleStarredEntity:(0,R.useCallback)(()=>b.toggleStarred(De(y)).then(),[y,b]),isStarredEntity:k}}function bt(){const y=(0,n.h_)(n.$4),{loading:b,value:k}=(0,Ze.default)(async()=>{const{ownershipEntityRefs:Y}=await y.getBackstageIdentity();return Y},[]),N=(0,R.useMemo)(()=>{const Y=new Set(k!=null?k:[]);return K=>{const de=vt(K,we.S4).map(we.eE);for(const le of de)if(Y.has(le))return!0;return!1}},[k]);return(0,R.useMemo)(()=>({loading:b,isOwnedEntity:N}),[b,N])}var ae=t(25488);function P(y){const{entity:b,loading:k,error:N}=pn(),{allowed:Y,loading:K,error:de}=(0,ae.gI)({permission:y,resourceRef:b?(0,we.eE)(b):void 0});return k||K?{loading:!0,allowed:!1}:N?{loading:!1,allowed:!1,error:N}:{loading:!1,allowed:Y,error:de}}function q(){const y=(0,n.h_)(g),[b,k]=(0,R.useState)([]),{error:N,loading:Y,value:K}=(0,Ze.default)(async()=>{const le="kind";return await y.getEntityFacets({facets:[le]}).then(Ee=>Ee.facets[le]||[])},[y]),de=(0,R.useRef)(K);return(0,R.useEffect)(()=>{const le=de.current;if(de.current=K,Y||le===K||!K)return;const ye=[...new Set(Qe()(K,Ee=>Ee.value).map(Ee=>Ee.value.toLocaleLowerCase("en-US")))];k(ye)},[Y,K,k]),{loading:Y,error:N,availableKinds:b}}function Ye(y){var b;const{filters:k,queryParameters:{kind:N},updateFilters:Y}=Yt(),K=(0,R.useMemo)(()=>[N].flat()[0],[N]);var de;const[le,ye]=(0,R.useState)((de=K!=null?K:(b=k.kind)===null||b===void 0?void 0:b.value)!==null&&de!==void 0?de:y.initialFilter);(0,R.useEffect)(()=>{K&&ye(K)},[K]),(0,R.useEffect)(()=>{var Ge;if(!((Ge=k.kind)===null||Ge===void 0)&&Ge.value){var yt;ye((yt=k.kind)===null||yt===void 0?void 0:yt.value)}},[k.kind]);const{availableKinds:Ee,loading:Le,error:Ae}=q();return(0,R.useEffect)(()=>{Y({kind:le?new ke(le):void 0})},[le,Y]),{loading:Le,error:Ae,availableKinds:Ee,selectedKind:le,setSelectedKind:ye}}const U=y=>{const{hidden:b,initialFilter:k="component"}=y,N=(0,n.h_)(n.$v),{error:Y,availableKinds:K,selectedKind:de,setSelectedKind:le}=Ye({initialFilter:k});if((0,R.useEffect)(()=>{Y&&N.post({message:"Failed to load entity kinds",severity:"error"})},[Y,N]),(K==null?void 0:K.length)===0||Y)return null;const ye=[...K.map(Ee=>({value:Ee,label:ee()(Ee)}))];return b?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Kind",items:ye,selected:de,onChange:Ee=>le(String(Ee))})})};var B=t(79692),ce=t(5806),pe=t(21324),Se=t(86619),$e=t(19996),Oe=t(25505),He=t(38016),ot=t(88013);const S=(0,B.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),H=(0,l.jsx)(Oe.Z,{fontSize:"small"}),me=(0,l.jsx)($e.Z,{fontSize:"small"}),ue=()=>{var y;const b=S(),{updateFilters:k,backendEntities:N,filters:Y,queryParameters:{lifecycles:K}}=Yt(),de=(0,R.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[ye,Ee]=(0,R.useState)(de.length?de:(le=(y=Y.lifecycles)===null||y===void 0?void 0:y.values)!==null&&le!==void 0?le:[]);(0,R.useEffect)(()=>{de.length&&Ee(de)},[de]),(0,R.useEffect)(()=>{k({lifecycles:ye.length?new ft(ye):void 0})},[ye,k]);const Le=(0,R.useMemo)(()=>[...new Set(N.map(Ae=>{var Ge;return(Ge=Ae.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[N]);return Le.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(ot.ZP,{multiple:!0,options:Le,value:ye,onChange:(Ae,Ge)=>Ee(Ge),renderOption:(Ae,{selected:Ge})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:H,checkedIcon:me,checked:Ge}),label:Ae}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Ae=>(0,l.jsx)(Se.Z,{...Ae,className:b.input,variant:"outlined"})})]})}):null},Ce=(0,B.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Pe=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ne=(0,l.jsx)($e.Z,{fontSize:"small"}),it=()=>{var y;const b=Ce(),{updateFilters:k,backendEntities:N,filters:Y,queryParameters:{owners:K}}=Yt(),de=(0,R.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[ye,Ee]=(0,R.useState)(de.length?de:(le=(y=Y.owners)===null||y===void 0?void 0:y.values)!==null&&le!==void 0?le:[]);(0,R.useEffect)(()=>{de.length&&Ee(de)},[de]),(0,R.useEffect)(()=>{k({owners:ye.length?new Pt(ye):void 0})},[ye,k]);const Le=(0,R.useMemo)(()=>[...new Set(N.flatMap(Ae=>vt(Ae,we.S4).map(Ge=>Me(Ge,{defaultKind:"group"}))).filter(Boolean))].sort(),[N]);return Le.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(ot.ZP,{multiple:!0,options:Le,value:ye,onChange:(Ae,Ge)=>Ee(Ge),renderOption:(Ae,{selected:Ge})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Pe,checkedIcon:Ne,checked:Ge}),label:Ae}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ae=>(0,l.jsx)(Se.Z,{...Ae,className:b.input,variant:"outlined"})})]})}):null},pt=(0,B.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ut=()=>{var y;const b=pt(),{filters:k,updateFilters:N}=useEntityList();var Y;const[K,de]=useState((Y=(y=k.text)===null||y===void 0?void 0:y.value)!==null&&Y!==void 0?Y:"");return useDebounce(()=>{N({text:K.length?new EntityTextFilter(K):void 0})},250,[K,N]),_jsx(Toolbar,{className:b.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:b.input,placeholder:"Search",autoComplete:"off",onChange:le=>de(le.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>de(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},et=Object.freeze({createEntityRefColumn(y){const{defaultKind:b}=y;function k(N){var Y;return((Y=N.metadata)===null||Y===void 0?void 0:Y.title)||Me(N,{defaultKind:b})}return{title:"Name",highlight:!0,customFilterAndSearch(N,Y){return k(Y).includes(N)},customSort(N,Y){return k(N).localeCompare(k(Y))},render:N=>{var Y;return(0,l.jsx)(Xe,{entityRef:N,defaultKind:b,title:(Y=N.metadata)===null||Y===void 0?void 0:Y.title})}}},createEntityRelationColumn(y){const{title:b,relation:k,defaultKind:N,filter:Y}=y;function K(le){return vt(le,k,Y)}function de(le){return K(le).map(ye=>Me(ye,{defaultKind:N})).join(", ")}return{title:b,customFilterAndSearch(le,ye){return de(ye).includes(le)},customSort(le,ye){return de(le).localeCompare(de(ye))},render:le=>(0,l.jsx)(ct,{entityRefs:K(le),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:we.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:we.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:we.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,l.jsx)(E.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),St=[et.createEntityRefColumn({defaultKind:"system"}),et.createDomainColumn(),et.createOwnerColumn(),et.createMetadataDescriptionColumn()],at=[et.createEntityRefColumn({defaultKind:"component"}),et.createSystemColumn(),et.createOwnerColumn(),et.createSpecTypeColumn(),et.createSpecLifecycleColumn(),et.createMetadataDescriptionColumn()],Tt=(0,B.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Bt=y=>{const{entities:b,title:k,emptyContent:N,variant:Y="gridItem",columns:K}=y,de=Tt(),le={minWidth:"0",width:"100%"};return Y==="gridItem"&&(le.height="calc(100% - 10px)"),(0,l.jsx)(E.iA,{columns:K,title:k,style:le,emptyContent:N&&(0,l.jsx)("div",{className:de.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:b})};Bt.columns=et,Bt.systemEntityColumns=St,Bt.componentEntityColumns=at;const Nt=(0,B.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),mn=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Wn=(0,l.jsx)($e.Z,{fontSize:"small"}),wn=y=>{var b;const k=Nt(),{updateFilters:N,filters:Y,queryParameters:{tags:K}}=Yt(),de=(0,n.h_)(g),{value:le}=(0,Ze.default)(async()=>{var Ge;const yt="metadata.tags",{facets:At}=await de.getEntityFacets({facets:[yt],filter:(Ge=Y.kind)===null||Ge===void 0?void 0:Ge.getCatalogFilters()});return Object.fromEntries(At[yt].map(({value:_e,count:Ot})=>[_e,Ot]))},[Y.kind]),ye=(0,R.useMemo)(()=>[K].flat().filter(Boolean),[K]);var Ee;const[Le,Ae]=(0,R.useState)(ye.length?ye:(Ee=(b=Y.tags)===null||b===void 0?void 0:b.values)!==null&&Ee!==void 0?Ee:[]);return(0,R.useEffect)(()=>{ye.length&&Ae(ye)},[ye]),(0,R.useEffect)(()=>{N({tags:Le.length?new st(Le):void 0})},[Le,N]),Object.keys(le!=null?le:{}).length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(ot.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:Le,onChange:(Ge,yt)=>Ae(yt),renderOption:(Ge,{selected:yt})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:mn,checkedIcon:Wn,checked:yt}),label:y.showCounts?`${Ge} (${le==null?void 0:le[Ge]})`:Ge}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ge=>(0,l.jsx)(Se.Z,{...Ge,className:k.input,variant:"outlined"})})]})}):null},Ut=y=>{const{hidden:b,initialFilter:k}=y,N=(0,n.h_)(n.$v),{error:Y,availableTypes:K,selectedTypes:de,setSelectedTypes:le}=Rn();if((0,R.useEffect)(()=>{Y&&N.post({message:"Failed to load entity types",severity:"error"}),k&&le([k])},[Y,N,k,le]),K.length===0||Y)return null;const ye=[{value:"all",label:"all"},...K.map(Le=>({value:Le,label:Le}))];var Ee;return b?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Type",items:ye,selected:(Ee=ye.length>1?de[0]:void 0)!==null&&Ee!==void 0?Ee:"all",onChange:Le=>le(Le==="all"?[]:[String(Le)])})})};var Ft=t(15459),dn=t(61837),vn=t(11640),Un=t(28347);const jn=(0,Ft.Z)({root:{color:"#f3ba37"}})(vn.Z),Dn=y=>{const{toggleStarredEntity:b,isStarredEntity:k}=qe(y.entity);return(0,l.jsx)(dn.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>b(),children:(0,l.jsx)(ze.ZP,{title:k?"Remove from favorites":"Add to favorites",children:k?(0,l.jsx)(jn,{}):(0,l.jsx)(Un.Z,{})})})};var yn=t(8629),nn=t(79249),En=t(38724),ar=t(99152),C=t(6487),d=t(49429),m=t(55999),w=t(72779),G=t.n(w),fe=t(39412);const be=fe.Z;function Be(y,b){if(y)return y.toLocaleLowerCase("en-US");if(b)try{return(0,we.of)(b).kind.toLocaleLowerCase("en-US")}catch{return}}function ht(y,b){const k=(0,n.qD)(),N=Be(y,b);return N&&k.getSystemIcon(`kind:${N}`)||be}function $t(y){const{kind:b,entityRef:k,...N}=y,Y=ht(b,k);return(0,l.jsx)(Y,{...N})}const on=(0,B.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Mn(y){const b=(0,n.h_)(g),k=(0,we.eE)(y),{loading:N,error:Y,value:K}=(0,Ze.default)(async()=>{const de=await b.getEntityAncestors({entityRef:k}),le=new Array,ye=new Array;for(const Ee of de.items){const Le=(0,we.eE)(Ee.entity),Ae=Le===de.rootEntityRef;le.push({id:Le,root:Ae,...Ee.entity});for(const Ge of Ee.parentEntityRefs)ye.push({from:Le,to:Ge})}return{nodes:le,edges:ye}},[k]);return{loading:N,error:Y,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function kr({node:y}){const b=on(),k=(0,$n.s0)(),N=(0,n.tg)(gt),[Y,K]=(0,R.useState)(0),[de,le]=(0,R.useState)(0),ye=(0,R.useRef)(null);(0,R.useLayoutEffect)(()=>{if(ye.current){let{height:Ot,width:en}=ye.current.getBBox();Ot=Math.round(Ot),en=Math.round(en),(Ot!==de||en!==Y)&&(K(en),le(Ot))}},[Y,de]);const Ee=10,Le=de,Ae=Le+Ee,Ge=Ae+Y+Ee*2,yt=de+Ee*2,At=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?Me({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),_e=()=>{k(N({kind:y.kind,namespace:y.metadata.namespace||we.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:_e,className:b.clickable,children:[(0,l.jsx)("rect",{className:G()(b.node,y.root?"secondary":"primary"),width:Ge,height:yt,rx:10}),(0,l.jsx)($t,{kind:y.kind,y:Ee,x:Ee,width:Le,height:Le,className:G()(b.text,y.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:ye,className:G()(b.text,y.root?"secondary":"primary"),y:yt/2,x:Ae+(Y+Ee*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:At})]})}function ds(y){const{loading:b,error:k,nodes:N,edges:Y}=Mn(y.entity);return b?(0,l.jsx)(E.Ex,{}):k?(0,l.jsx)(E.Gk,{error:k}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(m.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)(E.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)(X.Z,{mt:4,children:(0,l.jsx)(E.mn,{nodes:N,edges:Y,renderNode:kr,direction:E.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var tr=t(11776),Hn=t(38402),Gn=t(86136),jr=t(99688),Er=t(49378),us=t(54506),Or=t(94339),Vr=t(24579),Wr=t(27685);const $r=(0,B.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Yn(y){const b=$r();return(0,l.jsx)(Er.Z,{...y,primaryTypographyProps:{className:b.monospace},secondaryTypographyProps:{className:b.monospace}})}function Ar(y){const b=$r();return(0,l.jsx)(us.Z,{className:b.monospace,children:y.children})}function Tr(y){return(0,l.jsx)(X.Z,{mt:2,children:(0,l.jsx)(Or.Z,{variant:"outlined",children:(0,l.jsxs)(Vr.Z,{children:[(0,l.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(nr,{to:y.helpLink})]}),y.children]})})})}function Hr(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function mr(y){const[b,k]=y.entry,N=Hr(k);return(0,l.jsxs)(Hn.Z,{children:[y.indent&&(0,l.jsx)(Gn.Z,{}),(0,l.jsx)(Yn,{primary:b,secondary:N?(0,l.jsx)(E.rU,{to:N,children:k}):k})]})}function nr(y){const b=$r();return(0,l.jsx)(E.rU,{to:y.to,className:b.helpIcon,children:(0,l.jsx)(Wr.Z,{fontSize:"inherit"})})}const lr=(0,B.Z)({root:{display:"flex",flexDirection:"column"}});function Bs(y){var b,k;const N=(0,n.h_)(g),Y=(0,we.eE)(y),K=(b=y.metadata.annotations)===null||b===void 0?void 0:b[we.P1],de=(k=y.metadata.annotations)===null||k===void 0?void 0:k[we.q1],{loading:le,error:ye,value:Ee}=(0,Ze.default)(async()=>!K&&!de?[]:(await N.getEntities({filter:[...K?[{[`metadata.annotations.${we.P1}`]:K}]:[],...de?[{[`metadata.annotations.${we.q1}`]:de}]:[]]})).items,[K,de]);return{loading:le,error:ye,location:K,originLocation:de,colocatedEntities:Ee==null?void 0:Ee.filter(Le=>(0,we.eE)(Le)!==Y)}}function rr(y){return(0,l.jsxs)(tr.Z,{dense:!0,children:[y.header&&(0,l.jsx)(mr,{entry:y.header},"header"),y.entities.map(b=>(0,l.jsxs)(Hn.Z,{children:[(0,l.jsx)(Gn.Z,{children:(0,l.jsx)($t,{kind:b.kind})}),(0,l.jsx)(Yn,{primary:(0,l.jsx)(Xe,{entityRef:b})})]},(0,we.eE)(b)))]})}function Gr(y){const{entity:b}=y,{loading:k,error:N,location:Y,originLocation:K,colocatedEntities:de}=Bs(b);if(k)return(0,l.jsx)(E.Ex,{});if(N)return(0,l.jsx)(E.Gk,{error:N});if(!Y&&!K)return(0,l.jsx)(jr.Z,{severity:"warning",children:"Entity had no location information."});if(!(de!=null&&de.length))return(0,l.jsx)(jr.Z,{severity:"info",children:"There were no other entities on this location."});if(Y===K)return(0,l.jsx)(rr,{entities:de});const le=de.filter(Ee=>{var Le;return((Le=Ee.metadata.annotations)===null||Le===void 0?void 0:Le[we.P1])===Y}),ye=de.filter(Ee=>{var Le;return((Le=Ee.metadata.annotations)===null||Le===void 0?void 0:Le[we.q1])===K});return(0,l.jsxs)(l.Fragment,{children:[le.length>0&&(0,l.jsx)(rr,{entities:le,header:["At the same location",Y]}),ye.length>0&&(0,l.jsx)(rr,{entities:ye,header:["At the same origin",K]})]})}function hs(y){const b=lr();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(m.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:b.root,children:(0,l.jsx)(Gr,{entity:y.entity})})]})}function Kr(y){return Object.fromEntries([...Object.entries(y)].sort((b,k)=>b[0]<k[0]?-1:1))}function ps(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:JSON.stringify(Kr(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zs=t(3440),fs=t.n(Zs);const gs=(0,B.Z)({root:{display:"flex",flexDirection:"column"}});function Yr(y){var b,k;const N=gs(),{apiVersion:Y,kind:K,metadata:de,spec:le,relations:ye=[],status:Ee={}}=y.entity,Le=fs()(Qe()(ye,Ae=>Ae.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:N.root,children:[(0,l.jsx)(Tr,{title:"Identity",children:(0,l.jsxs)(tr.Z,{dense:!0,children:[(0,l.jsx)(Hn.Z,{children:(0,l.jsx)(Yn,{primary:"apiVersion",secondary:Y})}),(0,l.jsx)(Hn.Z,{children:(0,l.jsx)(Yn,{primary:"kind",secondary:K})}),(le==null?void 0:le.type)&&(0,l.jsx)(Hn.Z,{children:(0,l.jsx)(Yn,{primary:"spec.type",secondary:le.type})}),de.uid&&(0,l.jsx)(Hn.Z,{children:(0,l.jsx)(Yn,{primary:"uid",secondary:de.uid})}),de.etag&&(0,l.jsx)(Hn.Z,{children:(0,l.jsx)(Yn,{primary:"etag",secondary:de.etag})})]})}),(0,l.jsxs)(Tr,{title:"Metadata",children:[!!Object.keys(de.annotations||{}).length&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsxs)(Ar,{children:["Annotations",(0,l.jsx)(nr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(de.annotations).map(Ae=>(0,l.jsx)(mr,{indent:!0,entry:Ae},Ae[0]))}),!!Object.keys(de.labels||{}).length&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:"Labels"}),children:Object.entries(de.labels).map(Ae=>(0,l.jsx)(mr,{indent:!0,entry:Ae},Ae[0]))}),!!(!((b=de.tags)===null||b===void 0)&&b.length)&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:"Tags"}),children:de.tags.map((Ae,Ge)=>(0,l.jsxs)(Hn.Z,{children:[(0,l.jsx)(Gn.Z,{}),(0,l.jsx)(Yn,{primary:Ae})]},`${Ae}-${Ge}`))})]}),!!ye.length&&(0,l.jsx)(Tr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Le).map(([Ae,Ge],yt)=>(0,l.jsx)("div",{children:(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Ar,{children:Ae}),children:Ge.map(At=>(0,l.jsxs)(Hn.Z,{children:[(0,l.jsx)(Gn.Z,{children:(0,l.jsx)($t,{entityRef:At.targetRef})}),(0,l.jsx)(Yn,{primary:(0,l.jsx)(Xe,{entityRef:At.targetRef})})]},At.targetRef))})},yt))}),!!(!((k=Ee.items)===null||k===void 0)&&k.length)&&(0,l.jsx)(Tr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ee.items.map((Ae,Ge)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(_.Z,{children:[Ae.level,": ",Ae.type]}),(0,l.jsx)(X.Z,{ml:2,children:Ae.message})]},Ge))})]})]})}var ms=t(72847);function Jr(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:ms.ZP.stringify(Kr(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Qr=(0,B.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function vr(y){const{children:b,value:k,index:N,...Y}=y,K=Qr();return(0,l.jsx)("div",{role:"tabpanel",hidden:k!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:K.tabContents,...Y,children:k===N&&(0,l.jsx)(X.Z,{pl:3,pr:3,children:b})})}function Zt(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function Xr(y){const b=Qr(),[k,N]=R.useState(0);return(0,R.useEffect)(()=>{N(0)},[y.open]),y.entity?(0,l.jsxs)(yn.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:b.fullHeightDialog},children:[(0,l.jsx)(nn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(En.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:b.root,children:[(0,l.jsxs)(ar.Z,{orientation:"vertical",variant:"scrollable",value:k,onChange:(Y,K)=>N(K),"aria-label":"Inspector options",className:b.tabs,children:[(0,l.jsx)(C.Z,{label:"Overview",...Zt(0)}),(0,l.jsx)(C.Z,{label:"Ancestry",...Zt(1)}),(0,l.jsx)(C.Z,{label:"Colocated",...Zt(2)}),(0,l.jsx)(C.Z,{label:"Raw JSON",...Zt(3)}),(0,l.jsx)(C.Z,{label:"Raw YAML",...Zt(4)})]}),(0,l.jsx)(vr,{value:k,index:0,children:(0,l.jsx)(Yr,{entity:y.entity})}),(0,l.jsx)(vr,{value:k,index:1,children:(0,l.jsx)(ds,{entity:y.entity})}),(0,l.jsx)(vr,{value:k,index:2,children:(0,l.jsx)(hs,{entity:y.entity})}),(0,l.jsx)(vr,{value:k,index:3,children:(0,l.jsx)(ps,{entity:y.entity})}),(0,l.jsx)(vr,{value:k,index:4,children:(0,l.jsx)(Jr,{entity:y.entity})})]})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(Q.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var vs=t(85256);function qr(y){var b;const k=(0,n.h_)(g),N=(b=y.metadata.annotations)===null||b===void 0?void 0:b[we.q1],Y=y.metadata.uid,K=N==="bootstrap:bootstrap",de=(0,Ze.default)(async()=>{const At=k.getLocationByRef(N);let _e;if(!N)_e=Promise.resolve([]);else{const Ot=`metadata.annotations.${we.q1}`;_e=k.getEntities({filter:{[Ot]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(en=>en.items)}return Promise.all([At,_e]).then(([Ot,en])=>({location:Ot,colocatedEntities:en}))},[k,y]),le=(0,R.useCallback)(async function(){const{location:_e}=de.value;await k.removeLocationById(_e.id)},[k,de]),ye=(0,R.useCallback)(async function(){await k.removeEntityByUid(Y)},[k,Y]);if(K)return{type:"bootstrap",location:N,deleteEntity:ye};const{loading:Ee,error:Le,value:Ae}=de;if(Ee)return{type:"loading"};if(Le)return{type:"error",error:Le};const{location:Ge,colocatedEntities:yt}=Ae;return Ge?{type:"unregister",location:N,colocatedEntities:yt.map(we.iB),unregisterLocation:le,deleteEntity:ye}:{type:"only-delete",deleteEntity:ye}}var xn=t(23054);const Jn=(0,B.Z)({advancedButton:{fontSize:"0.7em"}}),ys=({entity:y,onConfirm:b})=>{const k=(0,n.h_)(n.$v),N=(0,n.h_)(n.Ds),Y=Jn(),K=qr(y),[de,le]=(0,R.useState)(!1),[ye,Ee]=(0,R.useState)(!1);var Le;const Ae=(Le=N.getOptionalString("app.title"))!==null&&Le!==void 0?Le:"Backstage",Ge=(0,R.useCallback)(async function(){if("unregisterLocation"in K){Ee(!0);try{await K.unregisterLocation(),b()}catch(_e){(0,xn.BD)(_e),k.post({message:_e.message})}finally{Ee(!1)}}},[k,b,K]),yt=(0,R.useCallback)(async function(){if("deleteEntity"in K){Ee(!0);try{await K.deleteEntity(),b()}catch(_e){(0,xn.BD)(_e),k.post({message:_e.message})}finally{Ee(!1)}}},[k,b,K]);return K.type==="loading"?(0,l.jsx)(E.Ex,{}):K.type==="error"?(0,l.jsx)(E.Gk,{error:K.error}):K.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(jr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Ae," ","integrator."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[!de&&(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:Y.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:yt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:yt,children:"Delete Entity"})]}):K.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(m.Z,{component:"ul",children:K.colocatedEntities.map(At=>(0,l.jsx)("li",{children:(0,l.jsx)(Xe,{entityRef:At})},`${At.kind}:${At.namespace}/${At.name}`))}),(0,l.jsx)(m.Z,{children:"Located at the following location:"}),(0,l.jsx)(m.Z,{component:"ul",children:(0,l.jsx)("li",{children:K.location})}),(0,l.jsxs)(m.Z,{children:["To undo, just re-register the entity in ",Ae,"."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[(0,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:Ge,children:"Unregister Location"}),!de&&(0,l.jsx)(X.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:Y.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(vs.Z,{})}),(0,l.jsx)(m.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)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:yt,children:"Delete Entity"})]})]}):(0,l.jsx)(jr.Z,{severity:"error",children:"Internal error: Unknown state"})},xs=y=>{const{open:b,onConfirm:k,onClose:N,entity:Y}=y;return(0,l.jsxs)(yn.Z,{open:b,onClose:N,children:[(0,l.jsx)(nn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(En.Z,{children:(0,l.jsx)(ys,{entity:Y,onConfirm:k})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(Q.Z,{onClick:N,color:"primary",children:"Cancel"})})]})};var bs=t(12231),Ss=t(9520),Cs=t(47603);const ws=(0,B.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function js(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Cs.Z},{id:"starred",label:"Starred",icon:vn.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const _r=y=>{const{initialFilter:b,availableFilters:k}=y,N=ws(),Y=(0,n.h_)(n.Ds);var K;const de=(K=Y.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:le,updateFilters:ye,backendEntities:Ee,queryParameters:{kind:Le,user:Ae},loading:Ge}=Yt(),yt=["starred","all"],At=js(de).map(An=>({...An,items:An.items.filter(({id:Sn})=>["group","user"].some(dr=>dr===Le)?yt.includes(Sn):!k||k.includes(Sn))})).filter(({items:An})=>!!An.length),{isStarredEntity:_e}=je(),{isOwnedEntity:Ot,loading:en}=bt(),Qn=Ge||en,Nn=(0,R.useMemo)(()=>new Et("owned",Ot,_e),[Ot,_e]),cr=(0,R.useMemo)(()=>new Et("starred",Ot,_e),[Ot,_e]),un=(0,R.useMemo)(()=>[Ae].flat()[0],[Ae]),[bn,Fn]=(0,R.useState)(un!=null?un:b),Rr=(0,R.useMemo)(()=>Ee.filter(mt((0,_t.compact)(Object.values({...le,user:void 0})))),[le,Ee]),yr=(0,R.useMemo)(()=>({all:Rr.length,starred:Rr.filter(An=>cr.filterEntity(An)).length,owned:Rr.filter(An=>Nn.filterEntity(An)).length}),[Rr,cr,Nn]);(0,R.useEffect)(()=>{un&&Fn(un)},[un]),(0,R.useEffect)(()=>{!Qn&&!!bn&&bn!=="all"&&yr[bn]===0&&Fn("all")},[Qn,yr,bn,Fn]),(0,R.useEffect)(()=>{ye({user:bn?new Et(bn,Ot,_e):void 0})},[bn,Ot,_e,ye]);var Br;return(0,l.jsx)(Or.Z,{className:N.root,children:At.map(An=>(0,l.jsxs)(R.Fragment,{children:[(0,l.jsx)(_.Z,{variant:"subtitle2",component:"span",className:N.title,children:An.name}),(0,l.jsx)(Or.Z,{className:N.groupWrapper,children:(0,l.jsx)(tr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":An.name,children:An.items.map(Sn=>{var dr;return(0,l.jsxs)(bs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Fn(Sn.id),selected:Sn.id===((dr=le.user)===null||dr===void 0?void 0:dr.value),className:N.menuItem,disabled:yr[Sn.id]===0,"data-testid":`user-picker-${Sn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Sn.icon&&(0,l.jsx)(Gn.Z,{className:N.listIcon,children:(0,l.jsx)(Sn.icon,{fontSize:"small"})}),(0,l.jsx)(Er.Z,{children:(0,l.jsxs)(_.Z,{variant:"body1",children:[Sn.label," "]})}),(0,l.jsx)(Ss.Z,{children:(Br=yr[Sn.id])!==null&&Br!==void 0?Br:"-"})]},Sn.id)})})})]},An.name))})},Ir=(0,B.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ds=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Es=(0,l.jsx)($e.Z,{fontSize:"small"}),es=()=>{const y=Ir(),{updateFilters:b}=Yt(),[k,N]=(0,R.useState)([]);function Y(le){b({orphan:le?new wt(le):void 0})}function K(le){b({error:le?new kt(le):void 0})}const de=["Is Orphan","Has Error"];return(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(ot.ZP,{multiple:!0,options:de,value:k,onChange:(le,ye)=>{N(ye),Y(ye.includes("Is Orphan")),K(ye.includes("Has Error"))},renderOption:(le,{selected:ye})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Ds,checkedIcon:Es,checked:ye}),label:le}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,l.jsx)(Se.Z,{...le,className:y.input,variant:"outlined"})})]})})},Ns=({children:y,value:b})=>{var k;const[N,Y]=useState((k=b==null?void 0:b.filters)!==null&&k!==void 0?k:{}),K=useCallback(yt=>{Y(At=>{const _e=typeof yt=="function"?yt(At):yt;return{...At,..._e}})},[]),de=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,ye,Ee,Le,Ae;const Ge=useMemo(()=>({entities:(le=b==null?void 0:b.entities)!==null&&le!==void 0?le:de.entities,backendEntities:(ye=b==null?void 0:b.backendEntities)!==null&&ye!==void 0?ye:de.backendEntities,updateFilters:(Ee=b==null?void 0:b.updateFilters)!==null&&Ee!==void 0?Ee:K,filters:N,loading:(Le=b==null?void 0:b.loading)!==null&&Le!==void 0?Le:!1,queryParameters:(Ae=b==null?void 0:b.queryParameters)!==null&&Ae!==void 0?Ae:de.queryParameters,error:b==null?void 0:b.error}),[b,de,N,K]);return _jsx(EntityListContext.Provider,{value:Ge,children:y})}},33414:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{AboutCard:function(){return gt},AboutContent:function(){return we},AboutField:function(){return ee}});var h=t(52322),n=t(25271),g=t(93414),I=t(25248),W=t(32838),x=t(43297),l=t(79692),R=t(94339),ne=t(32552),J=t(61837),Q=t(85256),D=t(24579),X=t(52866),_=t(30254),he=t(27604),ie=t(2784),A=t(19625),L=t(60905),$=t(90436),E=t(7089);const T=(0,l.Z)(nt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:nt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ee(nt){const{label:Me,value:ze,gridSizes:Xe,children:rt}=nt,ct=T(),lt=(0,I.vJ)(rt,vt=>vt.getElements()),mt=lt.length>0?lt:(0,h.jsx)($.Z,{variant:"body2",className:ct.value,children:ze||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...Xe,children:[(0,h.jsx)($.Z,{variant:"h2",className:ct.label,children:Me}),mt]})}var Ie=t(24851);const Qe=(0,l.Z)({description:{wordBreak:"break-word"}});function Ze(nt,Me,ze){if(Me==="url"||nt.includes("://"))return nt;const Xe=ze.type==="file"?`file://${ze.target}`:ze.target;return Me==="file"||ze.type==="file"?new URL(nt,Xe).href:Xe}function we(nt){var Me,ze,Xe,rt,ct,lt,mt,vt;const{entity:Ke}=nt,se=Qe(),ke=Ke.kind.toLocaleLowerCase("en-US")==="system",Re=Ke.kind.toLocaleLowerCase("en-US")==="resource",st=Ke.kind.toLocaleLowerCase("en-US")==="component",xt=Ke.kind.toLocaleLowerCase("en-US")==="api",Pt=Ke.kind.toLocaleLowerCase("en-US")==="template",ft=Ke.kind.toLocaleLowerCase("en-US")==="location",Et=Ke.kind.toLocaleLowerCase("en-US")==="group",wt=(0,x.hF)(Ke,n.cz,{kind:"system"}),kt=(0,x.hF)(Ke,n.cz,{kind:"component"}),Qt=(0,x.hF)(Ke,n.cz,{kind:"domain"}),tn=(0,x.hF)(Ke,n.S4);let Ht;try{Ht=(0,n.CV)(Ke)}catch{Ht=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(ee,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)($.Z,{variant:"body2",paragraph:!0,className:se.description,children:(Ke==null||(Me=Ke.metadata)===null||Me===void 0?void 0:Me.description)||"No description"})}),(0,h.jsx)(ee,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:tn.length>0&&(0,h.jsx)(x.rI,{entityRefs:tn,defaultKind:"group"})}),(ke||Qt.length>0)&&(0,h.jsx)(ee,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Qt.length>0&&(0,h.jsx)(x.rI,{entityRefs:Qt,defaultKind:"domain"})}),(xt||st||Re||wt.length>0)&&(0,h.jsx)(ee,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:wt.length>0&&(0,h.jsx)(x.rI,{entityRefs:wt,defaultKind:"system"})}),st&&kt.length>0&&(0,h.jsx)(ee,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(x.rI,{entityRefs:kt,defaultKind:"component"})}),(xt||st||Re||Pt||Et||ft||typeof(Ke==null||(ze=Ke.spec)===null||ze===void 0?void 0:ze.type)=="string")&&(0,h.jsx)(ee,{label:"Type",value:Ke==null||(Xe=Ke.spec)===null||Xe===void 0?void 0:Xe.type,gridSizes:{xs:12,sm:6,lg:4}}),(xt||st||typeof(Ke==null||(rt=Ke.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(ee,{label:"Lifecycle",value:Ke==null||(ct=Ke.spec)===null||ct===void 0?void 0:ct.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(ee,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ke==null||(lt=Ke.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Gt=>(0,h.jsx)(E.Z,{size:"small",label:Gt},Gt))}),ft&&((Ke==null||(mt=Ke.spec)===null||mt===void 0?void 0:mt.targets)||(Ke==null||(vt=Ke.spec)===null||vt===void 0?void 0:vt.target))&&(0,h.jsx)(ee,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Ie.s,{cols:1,items:(Ke.spec.targets||[Ke.spec.target]).map(Gt=>Gt).map(Gt=>{var pn;return{text:Gt,href:Ze(Gt,(Ke==null||(pn=Ke.spec)===null||pn===void 0?void 0:pn.type)||"unknown",Ht)}})})})]})}const We=(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 gt(nt){var Me,ze,Xe;const{variant:rt}=nt,ct=We(),{entity:lt}=(0,x.X2)(),mt=(0,I.h_)(W.q3),vt=(0,I.h_)(x.Ah),Ke=(0,I.h_)(I.$v),se=(0,I.h_)(I.VE),ke=(0,I.tg)(A.jU),Re=(0,x.CV)(lt,mt),st=(Me=lt.metadata.annotations)===null||Me===void 0?void 0:Me[n.Tf],xt={label:"View Source",disabled:!Re,icon:(0,h.jsx)(W.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},Pt={label:"View TechDocs",disabled:!(!((ze=lt.metadata.annotations)===null||ze===void 0)&&ze["backstage.io/techdocs-ref"])||!ke,icon:(0,h.jsx)(_.Z,{}),href:ke&&ke({namespace:lt.metadata.namespace||n.zG,kind:lt.kind,name:lt.metadata.name})};let ft="";rt==="gridItem"?ft=ct.gridItemCard:rt==="fullHeight"&&(ft=ct.fullHeightCard);let Et="";rt==="gridItem"?Et=ct.gridItemCardContent:rt==="fullHeight"&&(Et=ct.fullHeightCardContent);const wt=(Xe=lt.metadata.annotations)===null||Xe===void 0?void 0:Xe[n.P1],kt=(wt==null?void 0:wt.startsWith("url:"))||(wt==null?void 0:wt.startsWith("file:")),Qt=(0,ie.useCallback)(async()=>{try{await vt.refreshEntity((0,n.eE)(lt)),Ke.post({message:"Refresh scheduled",severity:"info"})}catch(tn){se.post(tn)}},[vt,Ke,se,lt]);return(0,h.jsxs)(R.Z,{className:ft,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[kt&&(0,h.jsx)(J.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Qt,children:(0,h.jsx)(X.Z,{})}),(0,h.jsx)(J.Z,{component:g.rU,"aria-label":"Edit",disabled:!st,title:"Edit Metadata",to:st!=null?st:"#",children:(0,h.jsx)(he.Z,{})})]}),subheader:(0,h.jsx)(g.M6,{links:[xt,Pt]})}),(0,h.jsx)(Q.Z,{}),(0,h.jsx)(D.Z,{className:Et,children:(0,h.jsx)(we,{entity:lt})})]})}},79324:function(jt,Fe,t){"use strict";t.d(Fe,{K:function(){return he}});var h=t(52322),n=t(2784),g=t(79692),I=t(12420),W=t(97580),x=t(73698),l=t(74603),R=t(12231),ne=t(43297),J=t(64279),Q=t(25248),D=t(19928),X=t.n(D);const _=(0,g.Z)(ie=>(0,I.Z)({root:{...ie.typography.h4}}));function he(ie){const{initialFilter:A="component",allowedKinds:L}=ie,$=_(),E=(0,Q.h_)(ne.Ah),{value:T}=(0,J.default)(async()=>await E.getEntityFacets({facets:["kind"]}).then(ze=>{var Xe;return((Xe=ze.facets.kind)===null||Xe===void 0?void 0:Xe.map(rt=>rt.value).sort())||[]})),{filters:ee,updateFilters:Ie,queryParameters:{kind:Qe}}=(0,ne.wp)(),Ze=(0,n.useMemo)(()=>{var ze;return(ze=[Qe].flat()[0])===null||ze===void 0?void 0:ze.toLocaleLowerCase("en-US")},[Qe]),[we,We]=(0,n.useState)(Ze!=null?Ze:A);(0,n.useEffect)(()=>{var ze;if(!((ze=ee.kind)===null||ze===void 0)&&ze.value){var Xe;We((Xe=ee.kind)===null||Xe===void 0?void 0:Xe.value)}},[ee.kind]),(0,n.useEffect)(()=>{Ie({kind:we?new ne.zo(we):void 0})},[we,Ie]),(0,n.useEffect)(()=>{Ze&&We(Ze)},[Ze]);var gt;const Me=[(0,W.Z)(we)].concat((gt=T==null?void 0:T.filter(ze=>L?L.some(Xe=>Xe.toLocaleLowerCase("en-US")===ze.toLocaleLowerCase("en-US")):!0))!==null&>!==void 0?gt:[]).sort().reduce((ze,Xe)=>(ze[Xe.toLocaleLowerCase("en-US")]=Xe,ze),{});return(0,h.jsx)(x.Z,{input:(0,h.jsx)(l.Z,{value:we}),value:we,onChange:ze=>We(ze.target.value),classes:$,children:Object.keys(Me).map(ze=>(0,h.jsx)(R.Z,{value:ze,children:`${X()(Me[ze])}`},ze))})}},86359:function(jt,Fe,t){"use strict";t.d(Fe,{E:function(){return ie}});var h=t(52322),n=t(25271),g=t(93414),I=t(43297),W=t(90436),x=t(15459),l=t(27604),R=t(2997),ne=t(11640),J=t(28347),Q=t(76635),D=t(2784),X=t(7089);const _=Object.freeze({createNameColumn(A){function L($){var E;return((E=$.metadata)===null||E===void 0?void 0:E.title)||(0,I.$3)($,{defaultKind:A==null?void 0:A.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:E}){return L($).localeCompare(L(E))},render:({entity:$})=>{var E;return(0,h.jsx)(I.dx,{entityRef:$,defaultKind:(A==null?void 0:A.defaultKind)||"Component",title:(E=$.metadata)===null||E===void 0?void 0:E.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:A})=>(0,h.jsx)(I.rI,{entityRefs:A.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:A})=>(0,h.jsx)(I.rI,{entityRefs:A.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:A})=>{var L,$;return(0,h.jsx)(h.Fragment,{children:((A==null||(L=A.spec)===null||L===void 0?void 0:L.targets)||(A==null||($=A.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(g.Or,{text:(A.spec.targets||[A.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:A})=>(0,h.jsx)(g.Or,{text:A.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:A})=>(0,h.jsx)(h.Fragment,{children:A.metadata.tags&&A.metadata.tags.map(L=>(0,h.jsx)(X.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(A){return{title:"Title",field:"entity.metadata.title",hidden:A==null?void 0:A.hidden,searchable:!0}},createLabelColumn(A,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var E;const T=(E=$.metadata)===null||E===void 0?void 0:E.labels,ee=T&&T[A]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:ee&&(0,h.jsx)(X.Z,{label:ee,size:"small",variant:"outlined"},ee)})},width:"auto"}}}),he=(0,x.Z)({root:{color:"#f3ba37"}})(ne.Z),ie=A=>{var L,$;const{columns:E,actions:T,tableOptions:ee,subtitle:Ie,emptyContent:Qe}=A,{isStarredEntity:Ze,toggleStarredEntity:we}=(0,I.CR)(),{loading:We,error:gt,entities:nt,filters:Me}=(0,I.wp)(),ze=(0,D.useMemo)(()=>{var se;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(se=Me.kind)===null||se===void 0?void 0:se.value}),...ke(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function ke(){var Re;switch((Re=Me.kind)===null||Re===void 0?void 0:Re.value){case"user":return[];case"domain":case"system":return[_.createOwnerColumn()];case"group":case"template":return[_.createSpecTypeColumn()];case"location":return[_.createSpecTypeColumn(),_.createSpecTargetsColumn()];default:return[_.createSystemColumn(),_.createOwnerColumn(),_.createSpecTypeColumn(),_.createSpecLifecycleColumn()]}}},[(L=Me.kind)===null||L===void 0?void 0:L.value]),Xe=Me.type===void 0;var rt;const ct=(0,Q.capitalize)((rt=($=Me.user)===null||$===void 0?void 0:$.value)!==null&&rt!==void 0?rt:"all");if(gt)return(0,h.jsx)("div",{children:(0,h.jsx)(g.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(g.Oi,{language:"text",text:gt.toString()})})});const lt=[({entity:se})=>{var ke;const Re=(ke=se.metadata.annotations)===null||ke===void 0?void 0:ke[n.l2],st="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:st}),(0,h.jsx)(R.Z,{fontSize:"small"})]}),tooltip:st,disabled:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{var ke;const Re=(ke=se.metadata.annotations)===null||ke===void 0?void 0:ke[n.Tf],st="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:st}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:st,disabled:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{const ke=Ze(se),Re=ke?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Re}),ke?(0,h.jsx)(he,{}):(0,h.jsx)(J.Z,{})]}),tooltip:Re,onClick:()=>we(se)}}],mt=nt.map(se=>{const ke=(0,I.hF)(se,n.cz,{kind:"system"}),Re=(0,I.hF)(se,n.S4);return{entity:se,resolved:{name:(0,I.$3)(se,{defaultKind:"Component"}),ownedByRelationsTitle:Re.map(st=>(0,I.$3)(st,{defaultKind:"group"})).join(", "),ownedByRelations:Re,partOfSystemRelationTitle:ke.map(st=>(0,I.$3)(st,{defaultKind:"system"})).join(", "),partOfSystemRelations:ke}}}),vt=(E||ze).find(se=>se.title==="Type");vt&&(vt.hidden=!Xe);const Ke=mt.length>20;return(0,h.jsx)(g.iA,{isLoading:We,columns:E||ze,options:{paging:Ke,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!We,padding:"dense",pageSizeOptions:[20,50,100],...ee},title:`${ct} (${nt.length})`,data:mt,actions:T||lt,subtitle:Ie,emptyContent:Qe})};ie.columns=_},24851:function(jt,Fe,t){"use strict";t.d(Fe,{s:function(){return he}});var h=t(52322),n=t(90348),g=t(11861),I=t(2784),W=t(79692),x=t(95544),l=t(90436),R=t(52160),ne=t(93414);const J=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function Q(ie){const{href:A,text:L,Icon:$}=ie,E=J();return(0,h.jsxs)(x.Z,{display:"flex",children:[(0,h.jsx)(x.Z,{mr:1,className:E.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:$?(0,h.jsx)($,{}):(0,h.jsx)(R.Z,{})})}),(0,h.jsx)(x.Z,{flexGrow:"1",children:(0,h.jsx)(ne.rU,{to:A,target:"_blank",rel:"noopener",children:L||A})})]})}var D=t(41156);const X={xs:1,sm:1,md:1,lg:2,xl:3};function _(ie){const A=[(0,D.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,D.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,D.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,D.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,D.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof ie=="number")L=ie;else{var $;const T=($=A.find(ee=>ee!==null))!==null&&$!==void 0?$:"xs";var E;L=(E=ie==null?void 0:ie[T])!==null&&E!==void 0?E:X[T]}return L}function he(ie){const{items:A,cols:L=void 0}=ie,$=_(L);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:$,children:A.map(({text:E,href:T,Icon:ee},Ie)=>(0,h.jsx)(g.Z,{children:(0,h.jsx)(Q,{href:T,text:E!=null?E:T,Icon:ee})},Ie))})}},19625:function(jt,Fe,t){"use strict";t.d(Fe,{_Z:function(){return I},jU:function(){return g},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),g=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),I=(0,h.NT)({id:"catalog"})},51666:function(jt,Fe,t){"use strict";t.d(Fe,{rG:function(){return h},Y2:function(){return $},J$:function(){return ne},g2:function(){return g}});var h;(function(E){E.DENY="DENY",E.ALLOW="ALLOW",E.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(E,T){return E.name===T.name}function g(E,T){return"resourceType"in E?!T||E.resourceType===T:!1}function I(E){return E.attributes.action==="create"}function W(E){return E.attributes.action==="read"}function x(E){return E.attributes.action==="update"}function l(E){return E.attributes.action==="delete"}function R(E){return{authorize:async(T,ee)=>await E.authorize(T,ee),authorizeConditional(T,ee){const Ie=T;return E.authorize(Ie,ee)}}}function ne({name:E,attributes:T,resourceType:ee}){return ee?{type:"resource",name:E,attributes:T,resourceType:ee}:{type:"basic",name:E,attributes:T}}var J=t(23054),Q=t(96279),D=t.n(Q),X=t(9571),_=t(30195);const he=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(he).nonempty()})).or(_.z.object({allOf:_.z.array(he).nonempty()})).or(_.z.object({not:he}))),ie=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),A=_.z.union([_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),_.z.object({result:_.z.literal(h.CONDITIONAL),pluginId:_.z.string(),resourceType:_.z.string(),conditions:he})]),L=(E,T)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),E)).refine(ee=>ee.length===T.size&&ee.every(({id:Ie})=>T.has(Ie)),{message:"Items in response do not match request"})});class ${async authorize(T,ee){return this.makeRequest(T,ie,ee)}async authorizeConditional(T,ee){return this.makeRequest(T,A,ee)}async makeRequest(T,ee,Ie){if(!this.enabled)return T.map(Me=>({result:h.ALLOW}));const Qe={items:T.map(Me=>({id:X.Z(),...Me}))},Ze=await this.discovery.getBaseUrl("permission"),we=await D()(`${Ze}/authorize`,{method:"POST",body:JSON.stringify(Qe),headers:{...this.getAuthorizationHeader(Ie==null?void 0:Ie.token),"content-type":"application/json"}});if(!we.ok)throw await J.VL.fromResponse(we);const We=await we.json(),nt=L(ee,new Set(Qe.items.map(({id:Me})=>Me))).parse(We).items.reduce((Me,ze)=>(Me[ze.id]=ze,Me),{});return Qe.items.map(Me=>nt[Me.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var ee;this.enabled=(ee=T.config.getOptionalBoolean("permission.enabled"))!==null&&ee!==void 0?ee:!1}}},25488:function(jt,Fe,t){"use strict";t.d(Fe,{iM:function(){return x},RV:function(){return I},gI:function(){return R}});var h=t(52322),n=t(2784),g=t(25248);const I=(0,g.T0)({id:"plugin.permission.api"});var W=t(51666);class x{static create(D){const{config:X,discovery:_,identity:he}=D,ie=new W.Y2({discovery:_,config:X});return new x(ie,he)}async authorize(D){return(await this.permissionClient.authorize([D],await this.identityApi.getCredentials()))[0]}constructor(D,X){this.permissionClient=D,this.identityApi=X}}var l=t(49857);function R(Q){const D=(0,g.h_)(I),{data:X,error:_}=(0,l.ZP)(Q,async he=>{if((0,W.g2)(he.permission)&&!he.resourceRef)return W.rG.DENY;const{result:ie}=await D.authorize(he);return ie});return _?{error:_,loading:!1,allowed:!1}:X===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:X===W.rG.ALLOW}}const ne=Q=>{const{permission:D,resourceRef:X,errorComponent:_,...he}=Q,ie=usePermission(isResourcePermission(D)?{permission:D,resourceRef:X}:{permission:D}),A=useApp(),{NotFoundErrorPage:L}=A.getComponents();let $=_===void 0?_jsx(L,{}):_;return ie.loading?$=null:ie.allowed&&($=Q.element),_jsx(Route,{...he,element:$})};function J(Q){const{permission:D,resourceRef:X}=Q,_=usePermission(isResourcePermission(D)?{permission:D,resourceRef:X}:{permission:D}),he=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:Q.children});if(Q.errorPage)return _jsx(_Fragment,{children:Q.errorPage});const{NotFoundErrorPage:ie}=he.getComponents();return _jsx(ie,{})}},65826:function(jt,Fe,t){"use strict";t.d(Fe,{FA:function(){return R},qO:function(){return rt},Nd:function(){return Ze},Rx:function(){return E}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class g{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(B){this.mockedResults=B}}var I=t(52322),W=t(2784),x=t(79692);const l=(0,x.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),R=({text:U,preTag:B,postTag:ce})=>{const pe=l(),Se=(0,W.useMemo)(()=>U.split(new RegExp(`(${B}.+?${ce})`)),[ce,B,U]);return(0,I.jsx)(I.Fragment,{children:Se.map(($e,Oe)=>$e.includes(B)?(0,I.jsx)("mark",{className:pe.highlight,children:$e.replace(new RegExp(`${B}|${ce}`,"g"),"")},Oe):$e)})};var ne=t(48760),J=t(50581),Q=t(61837),D=t(74603),X=t(21853),_=t(33375),he=t(76635),ie=t(64279),A=t(1849),L=t(51837);const $=(0,L.CT)("search-context"),E=()=>{const U=(0,W.useContext)($);if(!U)throw new Error("useSearch must be used within a SearchContextProvider");const B=U.atVersion(1);if(!B)throw new Error("No SearchContext v1 found");return B},T=()=>(0,W.useContext)($)!==void 0,ee={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Ie=(U=ee)=>{var B,ce,pe,Se;const $e=(0,h.h_)(n),[Oe,He]=(0,W.useState)(U.term),[ot,S]=(0,W.useState)(U.types),[H,me]=(0,W.useState)(U.filters),[ue,Ce]=(0,W.useState)(U.pageLimit),[Pe,Ne]=(0,W.useState)(U.pageCursor),it=(0,A.Z)(Oe),pt=(0,A.Z)(H),ut=(0,ie.default)(()=>$e.query({term:Oe,types:ot,filters:H,pageLimit:ue,pageCursor:Pe}),[Oe,ot,H,ue,Pe]),et=!ut.loading&&!ut.error&&((B=ut.value)===null||B===void 0?void 0:B.nextPageCursor),St=!ut.loading&&!ut.error&&((ce=ut.value)===null||ce===void 0?void 0:ce.previousPageCursor),at=(0,W.useCallback)(()=>{var Nt;Ne((Nt=ut.value)===null||Nt===void 0?void 0:Nt.nextPageCursor)},[(pe=ut.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Tt=(0,W.useCallback)(()=>{var Nt;Ne((Nt=ut.value)===null||Nt===void 0?void 0:Nt.previousPageCursor)},[(Se=ut.value)===null||Se===void 0?void 0:Se.previousPageCursor]);return(0,W.useEffect)(()=>{it!==void 0&&Oe!==it&&Ne(void 0)},[Oe,it,Ne]),(0,W.useEffect)(()=>{pt!==void 0&&!(0,he.isEqual)(H,pt)&&Ne(void 0)},[H,pt,Ne]),{result:ut,term:Oe,setTerm:He,types:ot,setTypes:S,filters:H,setFilters:me,pageLimit:ue,setPageLimit:Ce,pageCursor:Pe,setPageCursor:Ne,fetchNextPage:et?at:void 0,fetchPreviousPage:St?Tt:void 0}},Qe=U=>{const{initialState:B,children:ce}=U,pe=Ie(B);return(0,I.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,I.jsx)($.Provider,{value:(0,L.EI)({1:pe}),children:ce})})},Ze=U=>{const{initialState:B,inheritParentContextIfAvailable:ce,children:pe}=U;return T()&&ce?(0,I.jsx)(I.Fragment,{children:pe}):(0,I.jsx)(Qe,{initialState:B,children:pe})},we=({children:U})=>{const B=(0,h.z$)(),{term:ce}=E();return(0,W.useEffect)(()=>{ce&&B.captureEvent("search",ce)},[B,ce]),(0,I.jsx)(I.Fragment,{children:U})};function We(U){return(0,W.forwardRef)((B,ce)=>(0,I.jsx)(Ze,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(U,{...B,ref:ce})}))}const gt=We((0,W.forwardRef)((U,B)=>{const{onChange:ce,onKeyDown:pe=()=>{},onClear:Se=()=>{},onSubmit:$e=()=>{},debounceTime:Oe=200,clearButton:He=!0,fullWidth:ot=!0,value:S,placeholder:H,inputProps:me={},endAdornment:ue,...Ce}=U,Pe=(0,h.h_)(h.Ds),[Ne,it]=(0,W.useState)("");(0,W.useEffect)(()=>{it(Bt=>Bt!==S?String(S):Bt)},[S]),(0,ne.Z)(()=>ce(Ne),Oe,[Ne]);const pt=(0,W.useCallback)(Bt=>{it(Bt.target.value)},[it]),ut=(0,W.useCallback)(Bt=>{pe&&pe(Bt),$e&&Bt.key==="Enter"&&$e()},[pe,$e]),et=(0,W.useCallback)(()=>{ce(""),Se&&Se()},[ce,Se]),St=H!=null?H:`Search in ${Pe.getOptionalString("app.title")||"Backstage"}`,at=(0,I.jsx)(J.Z,{position:"start",children:(0,I.jsx)(Q.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,I.jsx)(X.Z,{})})}),Tt=(0,I.jsx)(J.Z,{position:"end",children:(0,I.jsx)(Q.Z,{"aria-label":"Clear",size:"small",onClick:et,children:(0,I.jsx)(_.Z,{})})});return(0,I.jsx)(we,{children:(0,I.jsx)(D.Z,{"data-testid":"search-bar-next",ref:B,value:Ne,placeholder:St,startAdornment:at,endAdornment:He?Tt:ue,inputProps:{"aria-label":"Search",...me},fullWidth:ot,onChange:pt,onKeyDown:ut,...Ce})})})),nt=We((0,W.forwardRef)((U,B)=>{const{value:ce="",onChange:pe,...Se}=U,{term:$e,setTerm:Oe}=E();(0,W.useEffect)(()=>{ce&&Oe(String(ce))},[ce,Oe]);const He=(0,W.useCallback)(ot=>{pe?pe(ot):Oe(ot)},[pe,Oe]);return(0,I.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,I.jsx)(gt,{...Se,ref:B,value:$e,onChange:He})})}));var Me=t(4614),ze=t(88013);const rt=(U=>B=>(0,I.jsx)(Ze,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(U,{...B})}))(function(B){const{loading:ce,value:pe,onChange:Se=()=>{},options:$e=[],getOptionLabel:Oe=et=>String(et),inputPlaceholder:He,inputDebounceTime:ot,freeSolo:S=!0,fullWidth:H=!0,clearOnBlur:me=!1,"data-testid":ue="search-autocomplete",...Ce}=B,{setTerm:Pe}=E(),Ne=(0,W.useCallback)(et=>et?typeof et=="string"?et:Oe(et):"",[Oe]),it=(0,W.useMemo)(()=>Ne(pe),[pe,Ne]),pt=(0,W.useCallback)((et,St,at,Tt)=>{Pe(Ne(St)),Se(et,St,at,Tt)},[Ne,Pe,Se]),ut=(0,W.useCallback)(({InputProps:{ref:et,endAdornment:St},InputLabelProps:at,...Tt})=>(0,I.jsx)(nt,{...Tt,ref:et,clearButton:!1,value:it,placeholder:He,debounceTime:ot,endAdornment:ce?(0,I.jsx)(Me.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):St}),[ce,it,He,ot]);return(0,I.jsx)(ze.ZP,{...Ce,"data-testid":ue,value:pe,onChange:pt,options:$e,getOptionLabel:Oe,renderInput:ut,freeSolo:S,fullWidth:H,clearOnBlur:me})}),ct=({icon:U,primaryText:B,primaryTextTypographyProps:ce,secondaryText:pe,secondaryTextTypographyProps:Se,disableTextTypography:$e})=>_jsxs(_Fragment,{children:[U?_jsx(ListItemIcon,{children:U}):null,_jsx(ListItemText,{primary:B,primaryTypographyProps:ce,secondary:pe,secondaryTypographyProps:Se,disableTypography:$e})]});var lt=t(42494),mt=t(84899),vt=t(5806),Ke=t(21324),se=t(56939),ke=t(73698),Re=t(12231),st=t(86619),xt=t(7089),Pt=t(69294);const ft=(U,B,ce=[],pe=250)=>{const Se=(0,W.useRef)({}),$e=U||(()=>Promise.resolve([])),[Oe,He]=(0,Pt.default)($e,[B],{loading:!0});if((0,ne.Z)(()=>{Se.current[B]===void 0&&(Se.current[B]=He(B).then(S=>(Se.current[B]=S,S)))},pe,[He,B]),ce.length)return{loading:!1,value:ce};const ot=Se.current[B];return Array.isArray(ot)?{loading:!1,value:ot}:Oe},Et=(U,B)=>{const{setFilters:ce}=E();(0,W.useEffect)(()=>{B&&[B].flat().length>0&&ce(pe=>({...pe,[U]:B}))},[])},wt=U=>{const{className:B,defaultValue:ce,name:pe,values:Se,valuesDebounceMs:$e,label:Oe,filterSelectedOptions:He,limitTags:ot,multiple:S}=U,[H,me]=(0,W.useState)("");Et(pe,ce);const ue=typeof Se=="function"?Se:void 0,Ce=typeof Se=="function"?void 0:Se,{value:Pe,loading:Ne}=ft(ue,H,Ce,$e),{filters:it,setFilters:pt}=E(),ut=it[pe]||(S?[]:null),et=(Tt,Bt)=>{pt(Nt=>{const{[pe]:mn,...Wn}=Nt;return Bt?{...Wn,[pe]:Bt}:{...Wn}})},St=Tt=>(0,I.jsx)(st.Z,{...Tt,name:"search",variant:"outlined",label:Oe,fullWidth:!0}),at=(Tt,Bt)=>Tt.map((Nt,mn)=>(0,I.jsx)(xt.Z,{label:Nt,color:"primary",...Bt({index:mn})}));return(0,I.jsx)(ze.ZP,{filterSelectedOptions:He,limitTags:ot,multiple:S,className:B,id:`${S?"multi-":""}select-filter-${pe}--select`,options:Pe||[],loading:Ne,value:ut,onChange:et,onInputChange:(Tt,Bt)=>me(Bt),renderInput:St,renderTags:at})},kt=(0,x.Z)({label:{textTransform:"capitalize"}}),Qt=U=>{const{className:B,defaultValue:ce,label:pe,name:Se,values:$e=[],valuesDebounceMs:Oe}=U,He=kt(),{filters:ot,setFilters:S}=E();Et(Se,ce);const H=typeof $e=="function"?$e:void 0,me=typeof $e=="function"?void 0:$e,{value:ue=[],loading:Ce}=ft(H,"",me,Oe),Pe=it=>{const{target:{value:pt,checked:ut}}=it;S(et=>{const{[Se]:St,...at}=et,Tt=(St||[]).filter(Nt=>Nt!==pt),Bt=ut?[...Tt,pt]:Tt;return Bt.length?{...at,[Se]:Bt}:at})};var Ne;return(0,I.jsxs)(lt.Z,{className:B,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,I.jsx)(mt.Z,{className:He.label,children:pe}):null,ue.map(it=>(0,I.jsx)(vt.Z,{control:(0,I.jsx)(Ke.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":it},value:it,name:it,onChange:Pe,checked:((Ne=ot[Se])!==null&&Ne!==void 0?Ne:[]).includes(it)}),label:it},it))]})},tn=U=>{const{className:B,defaultValue:ce,label:pe,name:Se,values:$e,valuesDebounceMs:Oe}=U,He=kt();Et(Se,ce);const ot=typeof $e=="function"?$e:void 0,S=typeof $e=="function"?void 0:$e,{value:H=[],loading:me}=ft(ot,"",S,Oe),{filters:ue,setFilters:Ce}=E(),Pe=Ne=>{const{target:{value:it}}=Ne;Ce(pt=>{const{[Se]:ut,...et}=pt;return it?{...et,[Se]:it}:et})};return(0,I.jsxs)(lt.Z,{disabled:me,className:B,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,I.jsx)(se.Z,{className:He.label,margin:"dense",children:pe}):null,(0,I.jsxs)(ke.Z,{variant:"outlined",value:ue[Se]||"",onChange:Pe,children:[(0,I.jsx)(Re.Z,{value:"",children:(0,I.jsx)("em",{children:"All"})}),H.map(Ne=>(0,I.jsx)(Re.Z,{value:Ne,children:Ne},Ne))]})]})},Ht=({component:U,...B})=>(0,I.jsx)(U,{...B});Ht.Checkbox=U=>(0,I.jsx)(Ht,{...U,component:Qt}),Ht.Select=U=>(0,I.jsx)(Ht,{...U,component:tn}),Ht.Autocomplete=U=>(0,I.jsx)(Ht,{...U,component:wt});var Gt=t(93414);const pn=U=>{const{children:B}=U,pe=useSearch().result;return B(pe)},_t=U=>{const{query:B,children:ce}=U,pe=useApi(searchApiRef),Se=useAsync(()=>{const{term:$e="",types:Oe=[],filters:He={},...ot}=B;return pe.query({...ot,term:$e,types:Oe,filters:He})},[B]);return ce(Se)},On=U=>{const{query:B,children:ce}=U;return B?_jsx(_t,{query:B,children:ce}):_jsx(pn,{children:ce})},ln=U=>{const{query:B,children:ce}=U;return _jsx(On,{query:B,children:({loading:pe,error:Se,value:$e})=>pe?_jsx(Progress,{}):Se?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Se}):$e!=null&&$e.results.length?ce($e):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},$n=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ln,{...U})}),fn=(0,x.Z)(U=>({root:{display:"flex",justifyContent:"space-between",gap:U.spacing(2),margin:U.spacing(2,0)}})),Kn=()=>{const{fetchNextPage:U,fetchPreviousPage:B}=useSearch(),ce=fn();return!U&&!B?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ce.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!B,onClick:B,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!U,onClick:U,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Kt=t(48834).lW;const In=U=>Kt.from(U.toString(),"utf-8").toString("base64"),Bn=U=>U?Number(Kt.from(U,"base64").toString("utf-8")):0,Yt=U=>{const{total:B=-1,cursor:ce,onCursorChange:pe,limit:Se=25,limitLabel:$e="Results per page:",limitText:Oe=({from:Ce,to:Pe})=>B>0?`of ${B}`:`${Ce}-${Pe}`,limitOptions:He,onLimitChange:ot,...S}=U,H=useMemo(()=>Bn(ce),[ce]),me=useCallback((Ce,Pe)=>{pe==null||pe(In(Pe))},[pe]),ue=useCallback(Ce=>{const Pe=Ce.target.value;ot==null||ot(parseInt(Pe,10))},[ot]);return _jsx(TablePagination,{...S,component:"div",count:B,page:H,onPageChange:me,rowsPerPage:Se,labelRowsPerPage:$e,labelDisplayedRows:Oe,rowsPerPageOptions:He,onRowsPerPageChange:ue})},gn=U=>{const{pageLimit:B,setPageLimit:ce,pageCursor:pe,setPageCursor:Se}=useSearch();return _jsx(Yt,{...U,limit:B,onLimitChange:ce,cursor:pe,onCursorChange:Se})},cn=({result:U,highlight:B,rank:ce,icon:pe,secondaryAction:Se,lineClamp:$e=5})=>{const Oe=useAnalytics(),He=()=>{Oe.captureEvent("discover",U.title,{attributes:{to:U.location},value:ce})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[pe&&_jsx(ListItemIcon,{children:pe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:U.location,onClick:He,children:B!=null&&B.fields.title?_jsx(HighlightedSearchResultText,{text:(B==null?void 0:B.fields.title)||"",preTag:(B==null?void 0:B.preTag)||"",postTag:(B==null?void 0:B.postTag)||""}):U.title}),secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:$e,overflow:"hidden"},children:B!=null&&B.fields.text?_jsx(HighlightedSearchResultText,{text:B.fields.text,preTag:B.preTag,postTag:B.postTag}):U.text})}),Se&&_jsx(Box,{alignItems:"flex-end",children:Se})]}),_jsx(Divider,{})]})},Rn=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(cn,{...U})}),Zn=U=>{const{loading:B,error:ce,resultItems:pe,renderResultItem:Se=He=>_jsx(DefaultResultListItem,{result:He.document},He.document.location),noResultsComponent:$e=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Oe}=U;return _jsxs(List,{...Oe,children:[B?_jsx(Progress,{}):null,!B&&ce?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ce}):null,!B&&!ce&&(pe==null?void 0:pe.length)?pe.map(Se):null,!B&&!ce&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:$e}):null]})},Cn=U=>{const{query:B,disableRenderingWithNoResults:ce,...pe}=U;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:B,children:({loading:Se,error:$e,value:Oe})=>{var He;return!(!(Oe==null||(He=Oe.results)===null||He===void 0)&&He.length)&&ce?null:_jsx(Zn,{...pe,loading:Se,error:$e,resultItems:Oe==null?void 0:Oe.results})}})})};var ge=t(19126);const te=(0,x.Z)(U=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:U.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:U.spacing(.5)}})),je=U=>{const B=te(),{label:ce,children:pe,...Se}=U;return _jsx(Chip,{...Se,className:B.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ce,": ",pe]})})},De=()=>null,qe=(0,x.Z)(U=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:U.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),bt=U=>{const B=qe(),{label:ce,value:pe="None",onChange:Se,onDelete:$e}=U,Oe=useCallback(He=>{Se(He.target.value)},[Se]);return _jsx(je,{label:ce,onDelete:$e,children:_jsx(Typography,{role:"textbox",component:"span",className:B.root,onChange:Oe,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},ae=(0,x.Z)(U=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),P=U=>{const B=ae(),{label:ce,value:pe="none",onChange:Se,onDelete:$e,children:Oe}=U,He=useCallback(ot=>{Se(ot.target.value)},[Se]);return _jsx(je,{label:ce,onDelete:$e,children:_jsxs(Select,{className:B.root,value:pe,onChange:He,input:_jsx(InputBase,{}),IconComponent:De,children:[_jsx(MenuItem,{value:"none",children:"None"}),Oe]})})};function q(U){const B=te(),[ce,pe]=useState(null),{loading:Se,error:$e,icon:Oe,title:He,titleProps:ot={},link:S=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:B.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:me,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:Ce,renderFilterField:Pe,resultItems:Ne,renderResultItem:it=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:pt=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ut}=U,et=useCallback(Tt=>{pe(Tt.currentTarget)},[]),St=useCallback(()=>{pe(null)},[]);var at;return _jsxs(List,{...ut,children:[_jsxs(ListSubheader,{className:B.listSubheader,children:[Oe,_jsx(Typography,{className:B.listSubheaderName,component:"strong",...ot,children:He}),me?_jsx(Chip,{className:B.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:et}):null,me?_jsx(Menu,{id:"filters-menu",anchorEl:ce,open:Boolean(ce),onClose:St,onClick:St,keepMounted:!0,children:me.map(ue)}):null,Ce==null?void 0:Ce.map(Tt=>(at=Pe==null?void 0:Pe(Tt))!==null&&at!==void 0?at:null),_jsx(Link,{className:B.listSubheaderLink,to:"/search",...H,children:S})]}),Se?_jsx(Progress,{}):null,!Se&&$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):null,!Se&&!$e&&(Ne==null?void 0:Ne.length)?Ne.map(it):null,!Se&&!$e&&!(Ne!=null&&Ne.length)?_jsx(ListItem,{children:pt}):null]})}function Ye(U){const{query:B,linkProps:ce={},disableRenderingWithNoResults:pe,...Se}=U,$e=`/search?${qs.stringify({query:B.term,types:B.types,filters:B.filters,pageCursor:B.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:B,children:({loading:Oe,error:He,value:ot})=>{var S;if(!(!(ot==null||(S=ot.results)===null||S===void 0)&&S.length)&&pe)return null;var H;return _jsx(q,{...Se,loading:Oe,error:He,linkProps:{to:$e,...ce},resultItems:ot==null?void 0:ot.results,filterFields:Object.keys((H=B.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(jt,Fe,t){"use strict";t.d(Fe,{Ox:function(){return Me},Zz:function(){return x},oZ:function(){return Ze},DR:function(){return l},ZS:function(){return Ie},VA:function(){return rt},KY:function(){return ne},gT:function(){return _},Dl:function(){return he},ux:function(){return Xe},$L:function(){return X},x1:function(){return Qe}});var h=t(52322),n=t(2784),g=t(73557),I=t(25248);const W="techdocs.addons.addon.v1",x="techdocs.addons.wrapper.v1",l=()=>null;(0,I.R5)(l,x,!0);const R=se=>`${W}.${se.toLocaleLowerCase("en-US")}`;function ne(se){const{name:ke,component:Re}=se;return(0,I.YO)({name:ke,component:{sync:st=>(0,h.jsx)(Re,{...st})},data:{[W]:se,[R(ke)]:!0}})}const J=(se,ke)=>se.selectByComponentData({key:ke}).getElements()[0],Q=se=>se.selectByComponentData({key:x}).selectByComponentData({key:W}),D=se=>se.selectByComponentData({key:x}).findComponentData({key:W}),X=()=>{const se=(0,g.pC)(),ke=(0,I.vJ)(se,Q),Re=(0,I.vJ)(se,D),st=(0,n.useCallback)(ft=>{if(!ke||!ft)return null;const Et=R(ft.name);var wt;return(wt=J(ke,Et))!==null&&wt!==void 0?wt:null},[ke]),xt=(0,n.useCallback)(ft=>{const Et=Re.find(wt=>wt.name===ft);return Et?st(Et):null},[Re,st]),Pt=(0,n.useCallback)(ft=>{const Et=Re.filter(wt=>wt.location===ft);return Et.length?Et.map(st):null},[Re,st]);return{renderComponentByName:xt,renderComponentsByLocation:Pt}},_=(0,I.T0)({id:"plugin.techdocs.service"}),he=(0,I.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),A=t(25271),L=t(51837);function $(se,ke){return ke.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const E=(se,ke)=>(0,A.eE)(se)===(0,A.eE)(ke),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ee=(0,L.CT)("techdocs-reader-page-context"),Ie=(0,n.memo)(({entityRef:se,children:ke})=>{const Re=(0,I.h_)(_),st=(0,I.h_)(I.Ds),xt=(0,ie.default)(async()=>Re.getTechDocsMetadata(se),[se]),Pt=(0,ie.default)(async()=>Re.getEntityMetadata(se),[se]),[ft,Et]=(0,n.useState)(T.title),[wt,kt]=(0,n.useState)(T.subtitle),[Qt,tn]=(0,n.useState)(T.shadowRoot),Ht={metadata:xt,entityRef:$(se,st),entityMetadata:Pt,shadowRoot:Qt,setShadowRoot:tn,title:ft,setTitle:Et,subtitle:wt,setSubtitle:kt},Gt=(0,L.EI)({1:Ht});return(0,h.jsx)(I.fC,{attributes:{entityRef:(0,A.eE)(se)},children:(0,h.jsx)(ee.Provider,{value:Gt,children:ke instanceof Function?ke(Ht):ke})})},(se,ke)=>E(se.entityRef,ke.entityRef)),Qe=()=>{const se=(0,n.useContext)(ee);if(se===void 0)return T;const ke=se.atVersion(1);if(ke===void 0)throw new Error("No context found for version 1.");return ke},Ze=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var we=t(70882),We=t(50236),gt=t(19219),nt=t(93414);const Me="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",ze=se=>{(0,n.useEffect)(()=>{if(!se)return()=>{};const ke=se.querySelectorAll('head > link[rel="stylesheet"]');var Re;let st=(Re=ke==null?void 0:ke.length)!==null&&Re!==void 0?Re:0;const xt=new CustomEvent(Me);if(!st)return se.dispatchEvent(xt),()=>{};const Pt=()=>{--st===0&&se.dispatchEvent(xt)};return ke==null||ke.forEach(ft=>{ft.addEventListener("load",Pt)}),()=>{ke==null||ke.forEach(ft=>{ft.removeEventListener("load",Pt)})}},[se])},Xe=se=>{const[ke,Re]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!se)return()=>{};Re(!0);const st=se.style;st.setProperty("opacity","0");const xt=()=>{Re(!1),st.setProperty("opacity","1")};return se.addEventListener(Me,xt),()=>{se.removeEventListener(Me,xt)}},[se]),ke},rt=({element:se,onAppend:ke,children:Re})=>{const[st,xt]=(0,n.useState)((0,we.Ue)({...(0,We.Z)(),insertionPoint:void 0}));ze(se);const Pt=Xe(se),ft=(0,n.useCallback)(Et=>{if(!se||!Et)return;xt((0,we.Ue)({...(0,We.Z)(),insertionPoint:se.querySelector("head")||void 0}));let wt=Et.shadowRoot;wt||(wt=Et.attachShadow({mode:"open"})),wt.replaceChildren(se),typeof ke=="function"&&ke(wt)},[se,ke]);return(0,h.jsxs)(h.Fragment,{children:[Pt&&(0,h.jsx)(nt.Ex,{}),(0,h.jsxs)(gt.ZP,{jss:st,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ft,"data-testid":"techdocs-native-shadowroot"}),Re]})]})};var ct=t(54073);const lt=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},mt=se=>{const ke=lt();return ke?se.map(Re=>ke==null?void 0:ke.querySelectorAll(Re)).filter(Re=>Re.length).map(Re=>Array.from(Re)).flat():[]},vt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,Ke=(se=0)=>{const ke=lt(),[Re,st]=useState(null),xt=useMemo(()=>debounce(()=>{const Pt=ke,ft=Pt.getSelection?Pt.getSelection():document.getSelection();ft&&vt(ft)?st(ft):st(null)},se),[ke,st,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",xt),()=>window.document.removeEventListener("selectionchange",xt)),[xt]),Re}},52943:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EmbeddedDocsRouter:function(){return ie},Router:function(){return he},isTechDocsAvailable:function(){return _}});var h=t(52322),n=t(2784),g=t(73557),I=t(43297),W=t(93414),x=t(25271),l=t(89258),R=t(65124),ne=t(67896);const J=({entity:A})=>{const L=(0,x.iB)(A);return(0,h.jsxs)(l.I6,{entityRef:L,children:[(0,h.jsx)(R.b,{}),(0,h.jsx)(ne.F,{withSearch:!1})]})};var Q=t(18662),D=t(7476);const X="backstage.io/techdocs-ref",_=A=>{var L,$;return Boolean(A==null||(L=A.metadata)===null||L===void 0||($=L.annotations)===null||$===void 0?void 0:$[X])},he=()=>(0,h.jsxs)(g.Z5,{children:[(0,h.jsx)(g.AW,{path:"/",element:(0,h.jsx)(Q.TechDocsIndexPage,{})}),(0,h.jsx)(g.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(D.TechDocsReaderPage,{})})]}),ie=A=>{var L;const{children:$}=A,{entity:E}=(0,I.X2)(),T=(0,g.V$)([{path:"/*",element:(0,h.jsx)(J,{entity:E}),children:[{path:"*",element:$}]}]);return((L=E.metadata.annotations)===null||L===void 0?void 0:L[X])?T:(0,h.jsx)(W.sk,{annotation:X})}},92077:function(jt,Fe,t){"use strict";t.d(Fe,{k:function(){return W},p:function(){return I}});var h=t(23054),n=t(76372),g=t.n(n);class I{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:R,namespace:ne,name:J}=l,D=`${await this.getApiOrigin()}/metadata/techdocs/${ne}/${R}/${J}`,X=await this.fetchApi.fetch(`${D}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}async getEntityMetadata(l){const{kind:R,namespace:ne,name:J}=l,D=`${await this.getApiOrigin()}/metadata/entity/${ne}/${R}/${J}`,X=await this.fetchApi.fetch(`${D}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class W{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,R){const{kind:ne,namespace:J,name:Q}=l,X=`${await this.getStorageUrl()}/${J}/${ne}/${Q}/${R}`,_=await this.fetchApi.fetch(`${X.endsWith("/")?X:`${X}/`}index.html`);let he="";switch(_.status){case 404:throw he="Page not found. ",R||(he+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(he);case 500:throw he="Could not generate documentation or an error in the TechDocs backend. ",new Error(he);default:break}return _.text()}async syncEntityDocs(l,R=()=>{}){const{kind:ne,namespace:J,name:Q}=l,X=`${await this.getApiOrigin()}/sync/${J}/${ne}/${Q}`,{token:_}=await this.identityApi.getCredentials();return new Promise((he,ie)=>{const A=new n.EventSourcePolyfill(X,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});A.addEventListener("log",L=>{L.data&&R(JSON.parse(L.data))}),A.addEventListener("finish",L=>{let $=!1;L.data&&({updated:$}=JSON.parse(L.data)),he($?"updated":"cached")}),A.onerror=L=>{switch(A.close(),L.status){case 404:ie(new h.dR(L.message));return;default:ie(new Error(L.data));return}}})}async getBaseUrl(l,R,ne){const{kind:J,namespace:Q,name:D}=R,_=`${await this.getApiOrigin()}/static/docs/${Q}/${J}/${D}/${ne}`;return new URL(l,_.endsWith("/")?_:`${_}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(jt,Fe,t){"use strict";t.d(Fe,{D:function(){return h}});function h(n,g){return g.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(jt,Fe,t){"use strict";t.d(Fe,{u:function(){return R}});var h=t(52322),n=t(2784),g=t(93414),I=t(43297),W=t(42081),x=t(48431),l=t(68435);const R=ne=>{const{initialFilter:J="owned",columns:Q,actions:D}=ne;return(0,h.jsx)(W.j,{children:(0,h.jsxs)(g.VY,{children:[(0,h.jsx)(g.yW,{title:"",children:(0,h.jsx)(g.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(I.UO,{children:(0,h.jsxs)(I._i,{children:[(0,h.jsxs)(I._i.Filters,{children:[(0,h.jsx)(x.f,{}),(0,h.jsx)(I.EW,{initialFilter:J}),(0,h.jsx)(I.dq,{}),(0,h.jsx)(I.xE,{})]}),(0,h.jsx)(I._i.Content,{children:(0,h.jsx)(l.n,{actions:D,columns:Q})})]})})]})})}},85478:function(jt,Fe,t){"use strict";t.d(Fe,{f:function(){return Q}});var h=t(52322),n=t(95573),g=t(51953),I=t(25248),W=t(93414),x=t(94339),l=t(16111),R=t(24579),ne=t(14503),J=t(2784);const Q=ie=>{const{entities:A}=ie,L=(0,I.tg)(n.Fw),$=(0,I.h_)(I.Ds);if(!A)return null;var E,T;return(0,h.jsx)(W.Oh,{"data-testid":"docs-explore",children:A!=null&&A.length?A.map((ee,Ie)=>(0,h.jsxs)(x.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(W.hu,{title:(E=ee.metadata.title)!==null&&E!==void 0?E:ee.metadata.name})}),(0,h.jsx)(R.Z,{children:ee.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(W.zx,{to:L({namespace:(0,g.D)((T=ee.metadata.namespace)!==null&&T!==void 0?T:"default",$),kind:(0,g.D)(ee.kind,$),name:(0,g.D)(ee.metadata.name,$)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Ie)):null})};var D=t(43297);const X={title:"All Documentation",filterPredicate:()=>!0},_=({entities:ie,group:A})=>{const{loading:L,isOwnedEntity:$}=useEntityOwnership(),E=ie.filter(ee=>A.filterPredicate==="ownedByUser"?L?!1:$(ee):typeof A.filterPredicate=="function"&&A.filterPredicate(ee)),T=(()=>typeof A.title=="string"?_jsx(ContentHeader,{title:A.title}):A.title)();return E.length===0?null:_jsxs(Content,{children:[T,_jsx(DocsCardGrid,{entities:E})]})},he=({groups:ie})=>{const{loading:A,error:L,entities:$}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(A)return _jsx(Progress,{});if($.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var E,T;return $.sort((ee,Ie)=>((E=ee.metadata.title)!==null&&E!==void 0?E:ee.metadata.name).localeCompare((T=Ie.metadata.title)!==null&&T!==void 0?T:Ie.metadata.name)),_jsx(Content,{children:(ie||[X]).map((ee,Ie)=>_jsx(_,{entities:$,group:ee},`${ee.title}-${Ie}`))})}},68435:function(jt,Fe,t){"use strict";t.d(Fe,{H:function(){return $},n:function(){return E}});var h=t(52322),n=t(2784),g=t(95074),I=t(76635),W=t(93414),x=t(43297),l=t(25248),R=t(25271),ne=t(95573),J=t(39981),Q=t(2337),D=t(11640),X=t(28347);const _=(0,Q.Z)({root:{color:"#f3ba37"}})(D.Z),he={createCopyDocsUrlAction(T){return ee=>({icon:()=>(0,h.jsx)(J.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${ee.resolved.docsUrl}`)})},createStarEntityAction(T,ee){return({entity:Ie})=>{const Qe=T(Ie);return{cellStyle:{paddingLeft:"1em"},icon:()=>Qe?(0,h.jsx)(_,{}):(0,h.jsx)(X.Z,{}),tooltip:Qe?"Remove from favorites":"Add to favorites",onClick:()=>ee(Ie)}}}};function ie(T){return T.metadata.title||T.metadata.name}const A={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(W.uw,{value:(0,h.jsx)(W.rU,{to:T.resolved.docsUrl,children:ie(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(x.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const $=T=>{const{entities:ee,title:Ie,loading:Qe,columns:Ze,actions:we}=T,[,We]=(0,g.Z)(),gt=(0,l.tg)(ne.Fw),nt=(0,l.h_)(l.Ds);if(!ee)return null;const Me=ee.map(rt=>{const ct=(0,x.hF)(rt,R.S4);var lt;return{entity:rt,resolved:{docsUrl:gt({namespace:(0,L.D)((lt=rt.metadata.namespace)!==null&<!==void 0?lt:"default",nt),kind:(0,L.D)(rt.kind,nt),name:(0,L.D)(rt.metadata.name,nt)}),ownedByRelations:ct,ownedByRelationsTitle:ct.map(mt=>(0,x.$3)(mt,{defaultKind:"group"})).join(", ")}}}),ze=[A.createNameColumn(),A.createOwnerColumn(),A.createTypeColumn()],Xe=[he.createCopyDocsUrlAction(We)];return(0,h.jsx)(h.Fragment,{children:Qe||Me&&Me.length>0?(0,h.jsx)(W.iA,{isLoading:Qe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Me,columns:Ze||ze,actions:we||Xe,title:Ie?`${Ie} (${Me.length})`:`All (${Me.length})`}):(0,h.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(W.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};$.columns=A,$.actions=he;const E=T=>{var ee;const{columns:Ie,actions:Qe}=T,{loading:Ze,error:we,entities:We,filters:gt}=(0,x.wp)(),{isStarredEntity:nt,toggleStarredEntity:Me}=(0,x.CR)(),[,ze]=(0,g.Z)();var Xe;const rt=(0,I.capitalize)((Xe=(ee=gt.user)===null||ee===void 0?void 0:ee.value)!==null&&Xe!==void 0?Xe:"all"),ct=[he.createCopyDocsUrlAction(ze),he.createStarEntityAction(nt,Me)];return we?(0,h.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(W.Oi,{language:"text",text:we.toString()})}):(0,h.jsx)($,{title:rt,entities:We,loading:Ze,actions:Qe||ct,columns:Ie})};E.columns=A,E.actions=he},18662:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsIndexPage:function(){return W}});var h=t(52322),n=t(2784),g=t(73557),I=t(3482);const W=x=>(0,g.pC)()||(0,h.jsx)(I.u,{...x})},42081:function(jt,Fe,t){"use strict";t.d(Fe,{j:function(){return W}});var h=t(52322),n=t(2784),g=t(93414),I=t(25248);const W=x=>{const{children:l}=x,R=(0,I.h_)(I.Ds);var ne;const J=`Documentation available in ${(ne=R.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Backstage"}`;return(0,h.jsx)(g.g9,{title:"Documentation",subtitle:J,themeId:"documentation",children:l})}},48431:function(jt,Fe,t){"use strict";t.d(Fe,{f:function(){return I}});var h=t(2784),n=t(43297);class g{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const I=()=>{const{updateFilters:W}=(0,n.wp)();return(0,h.useEffect)(()=>{W({techdocs:new g})},[W]),null}},89258:function(jt,Fe,t){"use strict";t.d(Fe,{I6:function(){return J},Jl:function(){return ne},s4:function(){return W}});var h=t(61886),n=t(92077),g=t(95573),I=t(25248);const W=(0,I.rx)({id:"techdocs",apis:[(0,I.ni)({api:h.Dl,deps:{configApi:I.Ds,discoveryApi:I.NW,identityApi:I.$4,fetchApi:I.gP},factory:({configApi:Q,discoveryApi:D,identityApi:X,fetchApi:_})=>new n.k({configApi:Q,discoveryApi:D,identityApi:X,fetchApi:_})}),(0,I.ni)({api:h.gT,deps:{configApi:I.Ds,discoveryApi:I.NW,fetchApi:I.gP},factory:({configApi:Q,discoveryApi:D,fetchApi:X})=>new n.p({configApi:Q,discoveryApi:D,fetchApi:X})})],routes:{root:g._Z,docRoot:g.Fw,entityContent:g.pd}}),x=W.provide((0,I.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.Router),mountPoint:g._Z})),l=W.provide((0,I.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.EmbeddedDocsRouter),mountPoint:g.pd})),R=W.provide((0,I.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(Q=>Q.TechDocsCustomHome),mountPoint:g._Z})),ne=W.provide((0,I.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(Q=>Q.TechDocsIndexPage),mountPoint:g._Z})),J=W.provide((0,I.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(Q=>Q.TechDocsReaderPage),mountPoint:g.Fw}))},7476:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsReaderLayout:function(){return Q},TechDocsReaderPage:function(){return D}});var h=t(52322),n=t(2784),g=t(73557),I=t(93414),W=t(61886),x=t(67896),l=t(93225),R=t(65124),ne=t(95573),J=t(25248);const Q=({withSearch:X,withHeader:_=!0})=>(0,h.jsxs)(I.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(l.S,{}),(0,h.jsx)(R.b,{}),(0,h.jsx)(x.F,{withSearch:X})]}),D=X=>{const{kind:_,name:he,namespace:ie}=(0,J.Oi)(ne.Fw),{children:A,entityRef:L={kind:_,name:he,namespace:ie}}=X,$=(0,g.pC)();if(!A){const T=$?n.Children.toArray($.props.children):[];var E;const Ie=T.flatMap(Qe=>{var Ze;return(E=Qe==null||(Ze=Qe.props)===null||Ze===void 0?void 0:Ze.children)!==null&&E!==void 0?E:[]}).find(Qe=>!(0,J.IY)(Qe,W.Zz));return(0,h.jsx)(W.ZS,{entityRef:L,children:Ie||(0,h.jsx)(Q,{})})}return(0,h.jsx)(W.ZS,{entityRef:L,children:({metadata:T,entityMetadata:ee,onReady:Ie})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(I.T3,{themeId:"documentation",children:A instanceof Function?A({entityRef:L,techdocsMetadataValue:T.value,entityMetadataValue:ee.value,onReady:Ie}):A})})})}},67896:function(jt,Fe,t){"use strict";t.d(Fe,{F:function(){return He}});var h=t(52322),n=t(2784),g=t(79692),I=t(60905),W=t(61886),x=t(93414),l=t(17339),R=t(4614),ne=t(77277),J=t(99688),Q=t(12420),D=t(90436),X=t(61837),_=t(4190),he=t(87685);const ie=(0,g.Z)(S=>(0,Q.Z)({paper:{width:"100%",[S.breakpoints.up("sm")]:{width:"75%"},[S.breakpoints.up("md")]:{width:"50%"},padding:S.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:S.palette.background.default}})),A=({buildLog:S,onClose:H})=>{const me=ie(),ue=S.length===0?"Waiting for logs...":S.join(`
|
|
34
|
+
`);return(0,h.jsxs)(I.Z,{container:!0,direction:"column",className:me.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(I.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)(X.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(he.Z,{})},"dismiss")]}),(0,h.jsx)(x.nU,{text:ue,classes:{root:me.logs}})]})},L=({buildLog:S})=>{const H=ie(),[me,ue]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:me,onClose:()=>ue(!1),children:(0,h.jsx)(A,{buildLog:S,onClose:()=>ue(!1)})})]})};var $=t(25248);const E=({errorMessage:S})=>{const H=(0,$.h_)($.Ds).getOptionalString("techdocs.builder");let me="";return H!=="local"&&(me="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)(x.mf,{status:"404",statusMessage:S||"Documentation not found",additionalInfo:me})};var T=t(95481);const ee=(0,g.Z)(S=>({root:{marginBottom:S.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Ie=()=>{let S=null;const H=ee(),{state:me,contentReload:ue,contentErrorMessage:Ce,syncErrorMessage:Pe,buildLog:Ne}=(0,T.DK)();return me==="INITIAL_BUILD"&&(S=(0,h.jsx)(J.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(R.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ne}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),me==="CONTENT_STALE_REFRESHING"&&(S=(0,h.jsx)(J.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(R.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),me==="CONTENT_STALE_READY"&&(S=(0,h.jsx)(J.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),me==="CONTENT_STALE_ERROR"&&(S=(0,h.jsxs)(J.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Pe]})),me==="CONTENT_NOT_FOUND"&&(S=(0,h.jsxs)(h.Fragment,{children:[Pe&&(0,h.jsxs)(J.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Pe]}),(0,h.jsx)(E,{errorMessage:Ce})]})),S};var Qe=t(73557),Ze=t(60364),we=t(41156),We=t(32838),gt=t(35368),nt=t.n(gt);const Me=/main\.[A-Fa-f0-9]{8}\.min\.css$/,ze=/^https:\/\/fonts\.googleapis\.com/,Xe=/^https:\/\/fonts\.gstatic\.com/,rt=S=>S.nodeName==="LINK",ct=S=>{const H=(S==null?void 0:S.getAttribute("href"))||"",me=H.match(Me),ue=H.match(ze),Ce=H.match(Xe);return me||ue||Ce},lt=S=>(rt(S)&&!ct(S)&&S.remove(),S),mt=S=>S.nodeName==="IFRAME",vt=(S,H)=>{const me=S.getAttribute("src")||"";try{const{host:ue}=new URL(me);return H.includes(ue)}catch{return!1}},Ke=S=>H=>(mt(H)&&!vt(H,S)&&H.remove(),H),se=()=>{const S=(0,$.h_)($.Ds);return(0,n.useMemo)(()=>S.getOptionalConfig("techdocs.sanitizer"),[S])},ke=()=>{const S=se();return(0,n.useCallback)(async H=>{const me=S==null?void 0:S.getOptionalStringArray("allowedIframeHosts");nt().addHook("beforeSanitizeElements",lt);const ue=["link"];return me&&(ue.push("iframe"),nt().addHook("beforeSanitizeElements",Ke(me))),nt().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[S])};var Re=t(41128),st=({theme:S})=>`
|
|
35
|
+
/*================== Variables ==================*/
|
|
36
|
+
/*
|
|
37
|
+
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.
|
|
38
|
+
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.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
:host {
|
|
42
|
+
/* FONT */
|
|
43
|
+
--md-default-fg-color: ${S.palette.text.primary};
|
|
44
|
+
--md-default-fg-color--light: ${S.palette.text.secondary};
|
|
45
|
+
--md-default-fg-color--lighter: ${(0,Re.$n)(S.palette.text.secondary,.7)};
|
|
46
|
+
--md-default-fg-color--lightest: ${(0,Re.$n)(S.palette.text.secondary,.3)};
|
|
47
|
+
|
|
48
|
+
/* BACKGROUND */
|
|
49
|
+
--md-default-bg-color:${S.palette.background.default};
|
|
50
|
+
--md-default-bg-color--light: ${S.palette.background.paper};
|
|
51
|
+
--md-default-bg-color--lighter: ${(0,Re.$n)(S.palette.background.paper,.7)};
|
|
52
|
+
--md-default-bg-color--lightest: ${(0,Re.$n)(S.palette.background.paper,.3)};
|
|
53
|
+
|
|
54
|
+
/* PRIMARY */
|
|
55
|
+
--md-primary-fg-color: ${S.palette.primary.main};
|
|
56
|
+
--md-primary-fg-color--light: ${S.palette.primary.light};
|
|
57
|
+
--md-primary-fg-color--dark: ${S.palette.primary.dark};
|
|
58
|
+
--md-primary-bg-color: ${S.palette.primary.contrastText};
|
|
59
|
+
--md-primary-bg-color--light: ${(0,Re.$n)(S.palette.primary.contrastText,.7)};
|
|
60
|
+
|
|
61
|
+
/* ACCENT */
|
|
62
|
+
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
63
|
+
|
|
64
|
+
/* SHADOW */
|
|
65
|
+
--md-shadow-z1: ${S.shadows[1]};
|
|
66
|
+
--md-shadow-z2: ${S.shadows[2]};
|
|
67
|
+
--md-shadow-z3: ${S.shadows[3]};
|
|
68
|
+
|
|
69
|
+
/* EXTENSIONS */
|
|
70
|
+
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
71
|
+
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
72
|
+
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
73
|
+
--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>');
|
|
74
|
+
--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>');
|
|
75
|
+
--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>');
|
|
76
|
+
--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>');
|
|
77
|
+
--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>');
|
|
78
|
+
--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>');
|
|
79
|
+
--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>');
|
|
80
|
+
--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>');
|
|
81
|
+
--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>');
|
|
82
|
+
--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>');
|
|
83
|
+
--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>');
|
|
84
|
+
--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>');
|
|
85
|
+
--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>');
|
|
86
|
+
--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>');
|
|
87
|
+
--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>');
|
|
88
|
+
--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>');
|
|
89
|
+
--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>');
|
|
90
|
+
--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>');
|
|
91
|
+
--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>');
|
|
92
|
+
--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>');
|
|
93
|
+
--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>');
|
|
94
|
+
--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>');
|
|
95
|
+
--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>');
|
|
96
|
+
--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>');
|
|
97
|
+
--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>');
|
|
98
|
+
--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>');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host > * {
|
|
102
|
+
/* CODE */
|
|
103
|
+
--md-code-fg-color: ${S.palette.text.primary};
|
|
104
|
+
--md-code-bg-color: ${S.palette.background.paper};
|
|
105
|
+
--md-code-hl-color: ${(0,Re.Fq)(S.palette.warning.main,.5)};
|
|
106
|
+
--md-code-hl-keyword-color: ${S.palette.type==="dark"?S.palette.primary.light:S.palette.primary.dark};
|
|
107
|
+
--md-code-hl-function-color: ${S.palette.type==="dark"?S.palette.secondary.light:S.palette.secondary.dark};
|
|
108
|
+
--md-code-hl-string-color: ${S.palette.type==="dark"?S.palette.success.light:S.palette.success.dark};
|
|
109
|
+
--md-code-hl-number-color: ${S.palette.type==="dark"?S.palette.error.light:S.palette.error.dark};
|
|
110
|
+
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
111
|
+
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
112
|
+
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
113
|
+
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
114
|
+
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
115
|
+
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
116
|
+
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
117
|
+
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
118
|
+
|
|
119
|
+
/* TYPESET */
|
|
120
|
+
--md-typeset-font-size: 1rem;
|
|
121
|
+
--md-typeset-color: var(--md-default-fg-color);
|
|
122
|
+
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
123
|
+
--md-typeset-table-color: ${S.palette.text.primary};
|
|
124
|
+
--md-typeset-del-color: ${S.palette.type==="dark"?(0,Re.Fq)(S.palette.error.dark,.5):(0,Re.Fq)(S.palette.error.light,.5)};
|
|
125
|
+
--md-typeset-ins-color: ${S.palette.type==="dark"?(0,Re.Fq)(S.palette.success.dark,.5):(0,Re.Fq)(S.palette.success.light,.5)};
|
|
126
|
+
--md-typeset-mark-color: ${S.palette.type==="dark"?(0,Re.Fq)(S.palette.warning.dark,.5):(0,Re.Fq)(S.palette.warning.light,.5)};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media screen and (max-width: 76.1875em) {
|
|
130
|
+
:host > * {
|
|
131
|
+
/* TYPESET */
|
|
132
|
+
--md-typeset-font-size: .9rem;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media screen and (max-width: 600px) {
|
|
137
|
+
:host > * {
|
|
138
|
+
/* TYPESET */
|
|
139
|
+
--md-typeset-font-size: .7rem;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`,xt=({theme:S})=>`
|
|
143
|
+
/*================== Reset ==================*/
|
|
144
|
+
|
|
145
|
+
body {
|
|
146
|
+
--md-text-color: var(--md-default-fg-color);
|
|
147
|
+
--md-text-link-color: var(--md-accent-fg-color);
|
|
148
|
+
--md-text-font-family: ${S.typography.fontFamily};
|
|
149
|
+
font-family: var(--md-text-font-family);
|
|
150
|
+
background-color: unset;
|
|
151
|
+
}
|
|
152
|
+
`;const Pt="224px";var ft=({theme:S,sidebar:H})=>`
|
|
153
|
+
/*================== Layout ==================*/
|
|
154
|
+
|
|
155
|
+
.md-grid {
|
|
156
|
+
max-width: 100%;
|
|
157
|
+
margin: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.md-nav {
|
|
161
|
+
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
162
|
+
}
|
|
163
|
+
.md-nav__link {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: space-between;
|
|
167
|
+
}
|
|
168
|
+
.md-nav__icon {
|
|
169
|
+
height: 20px !important;
|
|
170
|
+
width: 20px !important;
|
|
171
|
+
margin-left:${S.spacing(1)}px;
|
|
172
|
+
}
|
|
173
|
+
.md-nav__icon svg {
|
|
174
|
+
margin: 0;
|
|
175
|
+
width: 20px !important;
|
|
176
|
+
height: 20px !important;
|
|
177
|
+
}
|
|
178
|
+
.md-nav__icon:after {
|
|
179
|
+
width: 20px !important;
|
|
180
|
+
height: 20px !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
184
|
+
text-decoration: underline;
|
|
185
|
+
color: var(--md-typeset-a-color);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.md-main__inner {
|
|
189
|
+
margin-top: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.md-sidebar {
|
|
193
|
+
bottom: 75px;
|
|
194
|
+
position: fixed;
|
|
195
|
+
width: 16rem;
|
|
196
|
+
overflow-y: auto;
|
|
197
|
+
overflow-x: hidden;
|
|
198
|
+
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
199
|
+
scrollbar-width: thin;
|
|
200
|
+
}
|
|
201
|
+
.md-sidebar .md-sidebar__scrollwrap {
|
|
202
|
+
width: calc(12.1rem);
|
|
203
|
+
}
|
|
204
|
+
.md-sidebar--secondary {
|
|
205
|
+
right: ${S.spacing(3)}px;
|
|
206
|
+
}
|
|
207
|
+
.md-sidebar::-webkit-scrollbar {
|
|
208
|
+
width: 5px;
|
|
209
|
+
}
|
|
210
|
+
.md-sidebar::-webkit-scrollbar-button {
|
|
211
|
+
width: 5px;
|
|
212
|
+
height: 5px;
|
|
213
|
+
}
|
|
214
|
+
.md-sidebar::-webkit-scrollbar-track {
|
|
215
|
+
background: #eee;
|
|
216
|
+
border: 1 px solid rgb(250, 250, 250);
|
|
217
|
+
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
218
|
+
border-radius: 3px;
|
|
219
|
+
}
|
|
220
|
+
.md-sidebar::-webkit-scrollbar-thumb {
|
|
221
|
+
width: 5px;
|
|
222
|
+
background: rgb(193, 193, 193);
|
|
223
|
+
border: transparent;
|
|
224
|
+
border-radius: 3px;
|
|
225
|
+
}
|
|
226
|
+
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
227
|
+
background: rgb(125, 125, 125);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.md-content {
|
|
231
|
+
max-width: calc(100% - 16rem * 2);
|
|
232
|
+
margin-left: 16rem;
|
|
233
|
+
margin-bottom: 50px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.md-footer {
|
|
237
|
+
position: fixed;
|
|
238
|
+
bottom: 0px;
|
|
239
|
+
}
|
|
240
|
+
.md-footer__title {
|
|
241
|
+
background-color: unset;
|
|
242
|
+
}
|
|
243
|
+
.md-footer-nav__link {
|
|
244
|
+
width: 16rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.md-dialog {
|
|
248
|
+
background-color: unset;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@media screen and (min-width: 76.25em) {
|
|
252
|
+
.md-sidebar {
|
|
253
|
+
height: auto;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@media screen and (max-width: 76.1875em) {
|
|
258
|
+
.md-nav {
|
|
259
|
+
transition: none !important;
|
|
260
|
+
background-color: var(--md-default-bg-color)
|
|
261
|
+
}
|
|
262
|
+
.md-nav--primary .md-nav__title {
|
|
263
|
+
cursor: auto;
|
|
264
|
+
color: var(--md-default-fg-color);
|
|
265
|
+
font-weight: 700;
|
|
266
|
+
white-space: normal;
|
|
267
|
+
line-height: 1rem;
|
|
268
|
+
height: auto;
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-flow: column;
|
|
271
|
+
row-gap: 1.6rem;
|
|
272
|
+
padding: 1.2rem .8rem .8rem;
|
|
273
|
+
background-color: var(--md-default-bg-color);
|
|
274
|
+
}
|
|
275
|
+
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
276
|
+
box-shadow: none;
|
|
277
|
+
}
|
|
278
|
+
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
279
|
+
border-top: none;
|
|
280
|
+
}
|
|
281
|
+
.md-nav--primary .md-nav__title .md-nav__button {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
284
|
+
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
285
|
+
color: var(--md-default-fg-color);
|
|
286
|
+
position: static;
|
|
287
|
+
height: auto;
|
|
288
|
+
margin: 0 0 0 -0.2rem;
|
|
289
|
+
}
|
|
290
|
+
.md-nav--primary > .md-nav__title [for="none"] {
|
|
291
|
+
padding-top: 0;
|
|
292
|
+
}
|
|
293
|
+
.md-nav--primary .md-nav__item {
|
|
294
|
+
border-top: none;
|
|
295
|
+
}
|
|
296
|
+
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
297
|
+
font-size : var(--md-typeset-font-size);
|
|
298
|
+
}
|
|
299
|
+
.md-nav .md-source {
|
|
300
|
+
display: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.md-sidebar {
|
|
304
|
+
height: 100%;
|
|
305
|
+
}
|
|
306
|
+
.md-sidebar--primary {
|
|
307
|
+
width: 12.1rem !important;
|
|
308
|
+
z-index: 200;
|
|
309
|
+
left: ${H.isPinned?`calc(-12.1rem + ${Pt})`:"calc(-12.1rem + 72px)"} !important;
|
|
310
|
+
}
|
|
311
|
+
.md-sidebar--secondary:not([hidden]) {
|
|
312
|
+
display: none;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.md-content {
|
|
316
|
+
max-width: 100%;
|
|
317
|
+
margin-left: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.md-header__button {
|
|
321
|
+
margin: 0.4rem 0;
|
|
322
|
+
margin-left: 0.4rem;
|
|
323
|
+
padding: 0;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.md-overlay {
|
|
327
|
+
left: 0;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.md-footer {
|
|
331
|
+
position: static;
|
|
332
|
+
padding-left: 0;
|
|
333
|
+
}
|
|
334
|
+
.md-footer-nav__link {
|
|
335
|
+
/* footer links begin to overlap at small sizes without setting width */
|
|
336
|
+
width: 50%;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@media screen and (max-width: 600px) {
|
|
341
|
+
.md-sidebar--primary {
|
|
342
|
+
left: -12.1rem !important;
|
|
343
|
+
width: 12.1rem;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
`;const Et=["h1","h2","h3","h4","h5","h6"];var wt=({theme:S})=>`
|
|
347
|
+
/*================== Typeset ==================*/
|
|
348
|
+
|
|
349
|
+
.md-typeset {
|
|
350
|
+
font-size: var(--md-typeset-font-size);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
${Et.reduce((H,me)=>{var ue;const Ce=(ue=S.typography.htmlFontSize)!==null&&ue!==void 0?ue:16,Pe=S.typography[me],{lineHeight:Ne,fontFamily:it,fontWeight:pt,fontSize:ut}=Pe,et=St=>{let at=1;return typeof St=="number"&&(at=St/Ce*.6),typeof St=="string"&&(at=St.replace("rem","")),`calc(${at} * var(--md-typeset-font-size))`};return H.concat(`
|
|
354
|
+
.md-typeset ${me} {
|
|
355
|
+
color: var(--md-default-fg-color);
|
|
356
|
+
line-height: ${Ne};
|
|
357
|
+
font-family: ${it};
|
|
358
|
+
font-weight: ${pt};
|
|
359
|
+
font-size: ${et(ut)};
|
|
360
|
+
}
|
|
361
|
+
`)},"")}
|
|
362
|
+
|
|
363
|
+
.md-typeset .md-content__button {
|
|
364
|
+
color: var(--md-default-fg-color);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.md-typeset hr {
|
|
368
|
+
border-bottom: 0.05rem dotted ${S.palette.divider};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.md-typeset details {
|
|
372
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
373
|
+
}
|
|
374
|
+
.md-typeset details summary {
|
|
375
|
+
padding-left: 2.5rem !important;
|
|
376
|
+
}
|
|
377
|
+
.md-typeset details summary:before,
|
|
378
|
+
.md-typeset details summary:after {
|
|
379
|
+
top: 50% !important;
|
|
380
|
+
width: 20px !important;
|
|
381
|
+
height: 20px !important;
|
|
382
|
+
transform: rotate(0deg) translateY(-50%) !important;
|
|
383
|
+
}
|
|
384
|
+
.md-typeset details[open] > summary:after {
|
|
385
|
+
transform: rotate(90deg) translateX(-50%) !important;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.md-typeset blockquote {
|
|
389
|
+
color: var(--md-default-fg-color--light);
|
|
390
|
+
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.md-typeset table:not([class]) {
|
|
394
|
+
font-size: var(--md-typeset-font-size);
|
|
395
|
+
border: 1px solid var(--md-default-fg-color);
|
|
396
|
+
border-bottom: none;
|
|
397
|
+
border-collapse: collapse;
|
|
398
|
+
}
|
|
399
|
+
.md-typeset table:not([class]) th {
|
|
400
|
+
font-weight: bold;
|
|
401
|
+
}
|
|
402
|
+
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
403
|
+
border-bottom: 1px solid var(--md-default-fg-color);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
407
|
+
background-color: hsla(0, 0%, 0%, 0.32);
|
|
408
|
+
}
|
|
409
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
410
|
+
background-color: hsla(0, 0%, 0%, 0.87);
|
|
411
|
+
}
|
|
412
|
+
`,kt=()=>`
|
|
413
|
+
/*================== Animations ==================*/
|
|
414
|
+
/*
|
|
415
|
+
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
416
|
+
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
417
|
+
*/
|
|
418
|
+
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
419
|
+
transition: none;
|
|
420
|
+
}
|
|
421
|
+
`,Qt=({theme:S})=>`
|
|
422
|
+
/*================== Extensions ==================*/
|
|
423
|
+
|
|
424
|
+
/* HIGHLIGHT */
|
|
425
|
+
.highlight .md-clipboard:after {
|
|
426
|
+
content: unset;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.highlight .nx {
|
|
430
|
+
color: ${S.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* CODE HILITE */
|
|
434
|
+
.codehilite .gd {
|
|
435
|
+
background-color: ${S.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.codehilite .gi {
|
|
439
|
+
background-color: ${S.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* TABBED */
|
|
443
|
+
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
444
|
+
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
445
|
+
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
446
|
+
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
447
|
+
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
448
|
+
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
449
|
+
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
450
|
+
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
451
|
+
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
452
|
+
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
453
|
+
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
454
|
+
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
455
|
+
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
456
|
+
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
457
|
+
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
458
|
+
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
459
|
+
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
460
|
+
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
461
|
+
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
462
|
+
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
463
|
+
color: var(--md-accent-fg-color);
|
|
464
|
+
border-color: var(--md-accent-fg-color);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* TASK-LIST */
|
|
468
|
+
.task-list-control .task-list-indicator::before {
|
|
469
|
+
background-color: ${S.palette.action.disabledBackground};
|
|
470
|
+
}
|
|
471
|
+
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
472
|
+
background-color: ${S.palette.success.main};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/* ADMONITION */
|
|
476
|
+
.admonition {
|
|
477
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
478
|
+
}
|
|
479
|
+
.admonition .admonition-title {
|
|
480
|
+
padding-left: 2.5rem !important;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.admonition .admonition-title:before {
|
|
484
|
+
top: 50% !important;
|
|
485
|
+
width: 20px !important;
|
|
486
|
+
height: 20px !important;
|
|
487
|
+
transform: translateY(-50%) !important;
|
|
488
|
+
}
|
|
489
|
+
`;const tn=[st,xt,ft,wt,kt,Qt],Ht=()=>(0,x.Pf)(),Gt=()=>{const S=Ht(),H=(0,Ze.Z)();return(0,n.useMemo)(()=>{const me={theme:H,sidebar:S};return tn.reduce((ue,Ce)=>ue+Ce(me),"")},[H,S])},pn=()=>{const S=Gt();return(0,n.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${S}</style>`),H),[S])},_t=(S,H,me)=>{const ue=S==="src"&&H.endsWith(".svg"),Ce=!H.match(/^([a-z]*:)?\/\//i),Pe=H.startsWith(me);return ue&&(Ce||Pe)},On=({techdocsStorageApi:S,entityId:H,path:me})=>async ue=>{const Ce=await S.getApiOrigin(),Pe=async(Ne,it)=>{for(const pt of Ne)if(pt.hasAttribute(it)){const ut=pt.getAttribute(it);if(!ut)return;const et=await S.getBaseUrl(ut,H,me);if(_t(it,ut,Ce))try{const at=await(await fetch(et,{credentials:"include"})).text();pt.setAttribute(it,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(at)))}`)}catch{pt.setAttribute("alt",`Error: ${ut}`)}else pt.setAttribute(it,et)}};return await Promise.all([Pe(ue.querySelectorAll("img"),"src"),Pe(ue.querySelectorAll("script"),"src"),Pe(ue.querySelectorAll("source"),"src"),Pe(ue.querySelectorAll("link"),"href"),Pe(ue.querySelectorAll("a[download]"),"href")]),ue};var ln=t(79158),$n=t(67097),fn=t(28316),Kn=t(82717),Kt=t.n(Kn);const In=S=>H=>{var me;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const Ce=new URL(ue.href),Pe=S.byUrl(Ce);if((Pe==null?void 0:Pe.type)!=="github"&&(Pe==null?void 0:Pe.type)!=="gitlab")return H;const Ne=((me=H.querySelector("article>h1"))===null||me===void 0?void 0:me.childNodes[0].textContent)||"",it=encodeURIComponent(`Documentation Feedback: ${Ne}`),pt=encodeURIComponent(`Page source:
|
|
490
|
+
${ue.href}
|
|
491
|
+
|
|
492
|
+
Feedback:`),ut=(Pe==null?void 0:Pe.type)==="github"?(0,ln.BT)(Ce.href,"blob"):Ce.href,et=Kt()(ut),St=`/${et.organization}/${et.name}`,at=ue.cloneNode();switch(Pe==null?void 0:Pe.type){case"gitlab":at.href=`${Ce.origin}${St}/issues/new?issue[title]=${it}&issue[description]=${pt}`;break;case"github":at.href=`${Ce.origin}${St}/issues/new?title=${it}&body=${pt}`;break;default:return H}return fn.render(n.createElement($n.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",at),H};var Bn=t(44882);const Yt=()=>S=>{const H=S.querySelector('.md-header label[for="__drawer"]'),me=S.querySelector("article");if(!H||!me)return S;const ue=H.cloneNode();return fn.render(n.createElement(Bn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),me==null||me.prepend(ue),S},gn=()=>S=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const Pe=Ce.getAttribute(ue);if(Pe){Pe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ne=cn(window.location.href);Ce.setAttribute(ue,new URL(Pe,Ne).toString())}catch{Ce.replaceWith(Ce.textContent||Pe)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function cn(S){const H=new URL(S);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Rn=({baseUrl:S,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Ne=ue.getAttribute("href");!Ne||Ne.startsWith(S)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Ne))})}),me);var Zn=t(15459),Cn=t(80030),ge=t(72379),te=t(41547);const je=(0,Zn.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Cn.ZP),De=()=>(0,h.jsx)(ge.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"})}),qe=({text:S})=>{const[H,me]=(0,n.useState)(!1),ue=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(S),me(!0)},[S]),Ce=(0,n.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(je,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(De,{})})})},bt=S=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const Pe=Ce.textContent||"",Ne=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Ne),fn.render((0,h.jsx)(te.Z,{theme:S,children:(0,h.jsx)(qe,{text:Pe})}),Ne)}return H},ae=()=>S=>{var H;return(H=S.querySelector(".md-header"))===null||H===void 0||H.remove(),S},P=()=>S=>{var H,me;return(H=S.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=S.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),S},q=({onLoading:S,onLoaded:H})=>me=>(S(),me.addEventListener(W.Ox,function ue(){H(),me.removeEventListener(W.Ox,ue)}),me),Ye=()=>S=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=S==null?void 0:S.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),S),U=()=>S=>(setTimeout(()=>{const H=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const Ce=ue==null?void 0:ue.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),H[H.length-1].scrollIntoView())},200),S),B=async(S,H)=>{let me;if(typeof S=="string")me=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)me=S;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},ce="screen and (max-width: 76.1875em)",pe=S=>{const H=(0,Qe.s0)(),me=(0,Ze.Z)(),ue=(0,we.Z)(ce),Ce=ke(),Pe=pn(),Ne=(0,$.z$)(),it=(0,$.h_)(W.Dl),pt=(0,$.h_)(We.q3),{state:ut,path:et,content:St}=(0,T.DK)(),[at,Tt]=(0,n.useState)(null),Bt=(0,W.ux)(at),Nt=(0,n.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Ft=>{if(ue)Ft.style.top="0px";else{const jn=document==null?void 0:document.querySelector(".techdocs-reader-page");var dn;const Dn=(dn=jn==null?void 0:jn.getBoundingClientRect().top)!==null&&dn!==void 0?dn:0;var vn;let yn=(vn=at.getBoundingClientRect().top)!==null&&vn!==void 0?vn:0;const nn=at.querySelector(".md-container > .md-tabs");var Un;const En=(Un=nn==null?void 0:nn.getBoundingClientRect().height)!==null&&Un!==void 0?Un:0;yn<Dn&&(yn=Dn),Ft.style.top=`${Math.max(yn,0)+En}px`}Ft.style.setProperty("opacity","1")})},[at,ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",Nt),window.addEventListener("scroll",Nt,!0),()=>{window.removeEventListener("resize",Nt),window.removeEventListener("scroll",Nt,!0)}),[at,Nt]);const mn=(0,n.useCallback)(()=>{if(!at)return;const Ut=at.querySelector(".md-footer");Ut&&(Ut.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,n.useEffect)(()=>(window.addEventListener("resize",mn),()=>{window.removeEventListener("resize",mn)}),[at,mn]),(0,n.useEffect)(()=>{Bt||(mn(),Nt())},[ut,Bt,mn,Nt]);const Wn=(0,n.useCallback)((Ut,Ft)=>B(Ut,[Ce,On({techdocsStorageApi:it,entityId:S,path:Ft}),gn(),Yt(),ae(),P(),In(pt),Pe]),[S,pt,it,Ce,Pe]),wn=(0,n.useCallback)(async Ut=>B(Ut,[Ye(),U(),bt(me),Rn({baseUrl:window.location.origin,onClick:(Ft,dn)=>{var vn;const Un=Ft.ctrlKey||Ft.metaKey,jn=new URL(dn),Dn=`${jn.pathname}${jn.search}${jn.hash}`,yn=((vn=Ft.target)===null||vn===void 0?void 0:vn.innerText)||dn,nn=dn.replace(window.location.origin,"");if(Ne.captureEvent("click",yn,{attributes:{to:nn}}),jn.hash)if(Un)window.open(Dn,"_blank");else{var En;H(Dn),(En=Ut==null?void 0:Ut.querySelector(`[id="${jn.hash.slice(1)}"]`))===null||En===void 0||En.scrollIntoView()}else Un?window.open(Dn,"_blank"):H(Dn)}}),q({onLoading:()=>{},onLoaded:()=>{var Ft;(Ft=Ut.querySelector(".md-nav__title"))===null||Ft===void 0||Ft.removeAttribute("for")}}),q({onLoading:()=>{Array.from(Ut.querySelectorAll(".md-sidebar")).forEach(dn=>{dn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Ne]);return(0,n.useEffect)(()=>{if(!St)return()=>{};let Ut=!0;return Wn(St,et).then(async Ft=>{if(!(Ft!=null&&Ft.innerHTML)||!Ut)return;window.scroll({top:0});const dn=await wn(Ft);Tt(dn)}),()=>{Ut=!1}},[St,et,Wn,wn]),at};var Se=t(8560);const $e=()=>{const S=(0,W.$L)(),{shadowRoot:H}=(0,W.x1)(),me=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(Ce));const Pe=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ne=Pe==null?void 0:Pe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ne||(Ne=document.createElement("div"),Ne.setAttribute("data-techdocs-addons-location","secondary sidebar"),Pe==null||Pe.prepend(Ne)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Se.Z,{container:Ce,children:S.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,h.jsx)(Se.Z,{container:me,children:S.renderComponentsByLocation(W.oZ.Content)}),(0,h.jsx)(Se.Z,{container:Ne,children:S.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},Oe=(0,g.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),He=(0,T.m1)(S=>{var H;const{withSearch:me=!0,onReady:ue}=S,Ce=Oe(),{entityMetadata:{value:Pe,loading:Ne},entityRef:it,setShadowRoot:pt}=(0,W.x1)(),ut=pe(it),et=(0,n.useCallback)(St=>{pt(St),ue instanceof Function&&ue()},[pt,ue]);return Ne===!1&&!Pe?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ut?(0,h.jsx)(x.VY,{children:(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})}),me&&(0,h.jsx)(I.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:it,entityTitle:Pe==null||(H=Pe.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(W.VA,{element:ut,onAppend:et,children:(0,h.jsx)($e,{})})})]})}):(0,h.jsx)(x.VY,{children:(0,h.jsx)(I.Z,{container:!0,children:(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})})})})}),ot=null},93225:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return he}});var h=t(52322),n=t(2784),g=t(18671),I=t(60905),W=t(98069),x=t(73250),l=t(61886),R=t(43297),ne=t(25271),J=t(93414),Q=t(25248),D=t(76635),X=t(95573);const _=(0,h.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),he=ie=>{const{children:A}=ie,L=(0,l.$L)(),$=(0,Q.h_)(Q.Ds),{title:E,setTitle:T,subtitle:ee,setSubtitle:Ie,entityRef:Qe,metadata:{value:Ze,loading:we},entityMetadata:{value:We,loading:gt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Ze||(T(Ze.site_name),Ie(()=>{let{site_description:se}=Ze;return(!se||se==="None")&&(se=""),se}))},[Ze,T,Ie]);const nt=$.getOptional("app.title")||"Backstage",Me=[E,ee,nt].filter(Boolean).join(" | "),{locationMetadata:ze,spec:Xe}=We||{},rt=Xe==null?void 0:Xe.lifecycle,ct=We?(0,R.hF)(We,ne.S4):[],lt=(0,Q.tg)(X._Z)(),mt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(J.i9,{label:(0,D.capitalize)((We==null?void 0:We.kind)||"entity"),value:(0,h.jsx)(R.dx,{color:"inherit",entityRef:Qe,title:We==null?void 0:We.metadata.title,defaultKind:"Component"})}),ct.length>0&&(0,h.jsx)(J.i9,{label:"Owner",value:(0,h.jsx)(R.rI,{color:"inherit",entityRefs:ct,defaultKind:"group"})}),rt?(0,h.jsx)(J.i9,{label:"Lifecycle",value:rt}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?(0,h.jsx)(J.i9,{label:"",value:(0,h.jsxs)(I.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(I.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(x.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(I.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:ze.target}):null]});return!gt&&We===void 0||!we&&Ze===void 0?null:(0,h.jsxs)(J.h4,{type:"Documentation",typeLink:lt,title:E||_,subtitle:ee===""?void 0:ee||_,children:[(0,h.jsx)(g.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Me})}),mt,A,L.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(jt,Fe,t){"use strict";t.d(Fe,{b:function(){return D}});var h=t(52322),n=t(2784),g=t(79692),I=t(15223),W=t(95544),x=t(80030),l=t(61837),R=t(48348),ne=t(47603),J=t(61886);const Q=(0,g.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),D=X=>{const _=Q(),[he,ie]=(0,n.useState)(null),A=(0,n.useCallback)(Qe=>{ie(Qe.currentTarget)},[]),L=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:$,loading:E}}=(0,J.x1)(),T=(0,J.$L)(),ee=T.renderComponentsByLocation(J.oZ.Subheader),Ie=T.renderComponentsByLocation(J.oZ.Settings);return!ee&&!Ie||E===!1&&!$?null:(0,h.jsx)(I.Z,{classes:_,...X.toolbarProps,children:(0,h.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ee,Ie?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:A,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(R.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(he),onClose:L,keepMounted:!0,children:Ie})]}):null]})})}},95481:function(jt,Fe,t){"use strict";t.d(Fe,{DK:function(){return D},m1:function(){return _}});var h=t(52322),n=t(2784),g=t(73557),I=t(61886),W=t(25248),x=t(64279),l=t(77446);function R({contentLoading:he,content:ie,activeSyncState:A}){return he||A==="BUILD_READY_RELOAD"||!ie&&A==="CHECKING"?"CHECKING":!ie&&A==="BUILDING"?"INITIAL_BUILD":ie?A==="BUILDING"?"CONTENT_STALE_REFRESHING":A==="BUILD_READY"?"CONTENT_STALE_READY":A==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(he,ie){const A={...he};switch(ie.type){case"sync":ie.state==="CHECKING"&&(A.buildLog=[]),A.activeSyncState=ie.state,A.syncError=ie.syncError;break;case"contentLoading":A.contentLoading=!0,A.contentError=void 0;break;case"content":typeof ie.path=="string"&&(A.path=ie.path),A.contentLoading=!1,A.content=ie.content,A.contentError=ie.contentError;break;case"buildLog":A.buildLog=A.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(A.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(A.activeSyncState="UP_TO_DATE",A.buildLog=[]),A}function J(he,ie,A,L){var $,E;const[T,ee]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Ie=(0,W.h_)(I.Dl),{retry:Qe}=(0,l.Z)(async()=>{ee({type:"contentLoading"});try{const We=await Ie.getEntityDocs({kind:he,namespace:ie,name:A},L);return ee({type:"content",content:We,path:L}),We}catch(We){ee({type:"content",contentError:We,path:L})}},[Ie,he,ie,A,L]),Ze=(0,n.useRef)({content:void 0,reload:()=>{}});return Ze.current={content:T.content,reload:Qe},(0,x.default)(async()=>{ee({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{ee({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ie.syncEntityDocs({kind:he,namespace:ie,name:A},nt=>{ee({type:"buildLog",log:nt})})){case"updated":Ze.current.content?ee({type:"sync",state:"BUILD_READY"}):(Ze.current.reload(),ee({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ee({type:"sync",state:"UP_TO_DATE"});break;default:ee({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){ee({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(We)}},[he,A,ie,Ie,ee,Ze]),{state:(0,n.useMemo)(()=>R({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Qe,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(E=T.syncError)===null||E===void 0?void 0:E.toString(),buildLog:T.buildLog}}const Q=(0,n.createContext)({}),D=()=>(0,n.useContext)(Q),X=({children:he})=>{const{"*":ie=""}=(0,g.UO)(),{entityRef:A}=(0,I.x1)(),{kind:L,namespace:$,name:E}=A,T=J(L,$,E,ie);return(0,h.jsx)(Q.Provider,{value:T,children:he instanceof Function?he(T):he})},_=he=>ie=>(0,h.jsx)(X,{children:(0,h.jsx)(he,{...ie})})},95573:function(jt,Fe,t){"use strict";t.d(Fe,{Fw:function(){return g},_Z:function(){return n},pd:function(){return I}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),g=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),I=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return L}});var h=t(52322),n=t(2784),g=t(79692),I=t(49378),W=t(38402),x=t(86136),l=t(85256),R=t(93414),ne=t(25248),J=t(65826);const Q=(0,g.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),D=$=>{const{result:E,highlight:T,rank:ee,lineClamp:Ie=5,asListItem:Qe=!0,asLink:Ze=!0,title:we,icon:We}=$,gt=Q(),nt=(0,ne.z$)(),Me=()=>{nt.captureEvent("discover",E.title,{attributes:{to:E.location},value:ee})},ze=({children:ct})=>Ze?(0,h.jsx)(R.rU,{noTrack:!0,to:E.location,onClick:Me,children:ct}):(0,h.jsx)(h.Fragment,{children:ct}),Xe=()=>{const ct=T!=null&&T.fields.title?(0,h.jsx)(J.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):E.title,lt=T!=null&&T.fields.entityTitle?(0,h.jsx)(J.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):E.entityTitle,mt=T!=null&&T.fields.name?(0,h.jsx)(J.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):E.name;return(0,h.jsx)(I.Z,{className:gt.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(ze,{children:we||(0,h.jsxs)(h.Fragment,{children:[ct," | ",lt!=null?lt:mt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Ie,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(J.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):E.text})})},rt=({children:ct})=>Qe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(W.Z,{alignItems:"flex-start",children:[We&&(0,h.jsx)(x.Z,{children:We}),(0,h.jsx)("div",{className:gt.flexContainer,children:ct})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ct});return(0,h.jsx)(rt,{children:(0,h.jsx)(Xe,{})})};var X=t(27556),_=t(73557);const he=(0,g.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),ie=$=>$==null?void 0:$.document,A=$=>{const{entityId:E,entityTitle:T,debounceTime:ee=150}=$,[Ie,Qe]=(0,n.useState)(!1),Ze=(0,_.s0)(),{setFilters:we,result:{loading:We,value:gt}}=(0,J.Rx)(),nt=he(),[Me,ze]=(0,n.useState)([]);(0,n.useEffect)(()=>{let mt=!0;if(mt&>){const vt=gt.results.slice(0,10);ze(vt)}return()=>{mt=!1}},[We,gt]);const{kind:Xe,name:rt,namespace:ct}=E;(0,n.useEffect)(()=>{we(mt=>({...mt,kind:Xe,namespace:ct,name:rt}))},[Xe,ct,rt,we]);const lt=(mt,vt)=>{if(ie(vt)){const{location:Ke}=vt.document;Ze(Ke)}};return(0,h.jsx)(X.Z,{className:nt.bar,variant:"outlined",children:(0,h.jsx)(J.qO,{classes:{root:nt.root},"data-testid":"techdocs-search-bar",size:"small",open:Ie,getOptionLabel:()=>"",filterOptions:mt=>mt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!0)},onChange:lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Me,renderOption:({document:mt,highlight:vt})=>(0,h.jsx)(D,{result:mt,lineClamp:3,asListItem:!1,asLink:!1,title:mt.title,highlight:vt}),loading:We,inputDebounceTime:ee,inputPlaceholder:`Search ${T||E.name} docs`,freeSolo:!1})})},L=$=>{const E={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(J.Nd,{initialState:E,children:(0,h.jsx)(A,{...$})})}},53260:function(){}},function(jt){var Fe=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Fe(96215)});var t=jt.O()}]);})();
|
|
493
|
+
|
|
494
|
+
//# sourceMappingURL=main.8e467e32.js.map
|