@techdocs/cli 1.3.0-next.2 → 1.3.0
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 +16 -0
- package/dist/embedded-app/.config-schema.json +48 -48
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.8801032e.chunk.js → 1032.4eeed38c.chunk.js} +1 -1
- package/dist/embedded-app/static/{1032.8801032e.chunk.js.map → 1032.4eeed38c.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.9f693bc4.chunk.js → 1105.ea587869.chunk.js} +1 -1
- package/dist/embedded-app/static/{1105.9f693bc4.chunk.js.map → 1105.ea587869.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.23738c38.chunk.js → 184.c0ade3a9.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.23738c38.chunk.js.map → 184.c0ade3a9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.9c46cefb.chunk.js → 2440.82725a72.chunk.js} +1 -1
- package/dist/embedded-app/static/{2440.9c46cefb.chunk.js.map → 2440.82725a72.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.1bf7c942.chunk.js → 5458.ab22b201.chunk.js} +1 -1
- package/dist/embedded-app/static/{5458.1bf7c942.chunk.js.map → 5458.ab22b201.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5837.72318c15.chunk.js → 5837.9510a1b9.chunk.js} +1 -1
- package/dist/embedded-app/static/{5837.72318c15.chunk.js.map → 5837.9510a1b9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.716303b7.chunk.js +4 -0
- package/dist/embedded-app/static/6051.716303b7.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.dc9d791a.chunk.js → 732.d703f6a9.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.dc9d791a.chunk.js.map → 732.d703f6a9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.4d06ceca.chunk.js → 7560.1af568e5.chunk.js} +1 -1
- package/dist/embedded-app/static/{7560.4d06ceca.chunk.js.map → 7560.1af568e5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.0ea5fd01.chunk.js → 7750.1bdc8262.chunk.js} +1 -1
- package/dist/embedded-app/static/{7750.0ea5fd01.chunk.js.map → 7750.1bdc8262.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.12cb329f.chunk.js → 8951.3e2e38b8.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.12cb329f.chunk.js.map → 8951.3e2e38b8.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.6d4ef1f2.chunk.js → 9545.efced59f.chunk.js} +1 -1
- package/dist/embedded-app/static/{9545.6d4ef1f2.chunk.js.map → 9545.efced59f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.58bd6437.chunk.js → 9770.b9672083.chunk.js} +1 -1
- package/dist/embedded-app/static/{9770.58bd6437.chunk.js.map → 9770.b9672083.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.6fc07bc1.js +497 -0
- package/dist/embedded-app/static/main.6fc07bc1.js.map +1 -0
- package/dist/embedded-app/static/module-remix-run.b9acb514.js +12 -0
- package/dist/embedded-app/static/module-remix-run.b9acb514.js.map +1 -0
- package/dist/embedded-app/static/{runtime.c643eee1.js → runtime.6fc07bc1.js} +2 -2
- package/dist/embedded-app/static/{runtime.c643eee1.js.map → runtime.6fc07bc1.js.map} +1 -1
- package/dist/embedded-app/static/vendor.6fc07bc1.js +231 -0
- package/dist/embedded-app/static/vendor.6fc07bc1.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/6051.0cb12f85.chunk.js +0 -4
- package/dist/embedded-app/static/6051.0cb12f85.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.c643eee1.js +0 -494
- package/dist/embedded-app/static/main.c643eee1.js.map +0 -1
- package/dist/embedded-app/static/module-remix-run.e15d5a2e.js +0 -12
- package/dist/embedded-app/static/module-remix-run.e15d5a2e.js.map +0 -1
- package/dist/embedded-app/static/vendor.c643eee1.js +0 -231
- package/dist/embedded-app/static/vendor.c643eee1.js.map +0 -1
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(Rt,ze,t){"use strict";t.d(ze,{n3:function(){return g},MS:function(){return b}});var h=t(25271),r=t(23054),W=t(96279),Z=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,te){const{kind:Q,namespace:X,name:z}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(z)}/ancestry`,te)}async getLocationById(P,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,te)}async getEntities(P,te){const{filter:Q=[],fields:X=[],order:z,offset:M,limit:_,after:fe}=P!=null?P:{},le=[];for(const A of[Q].flat()){const S=[];for(const[q,Le]of Object.entries(A))for(const Xe of[Le].flat())Xe===g?S.push(encodeURIComponent(q)):typeof Xe=="string"&&S.push(`${encodeURIComponent(q)}=${encodeURIComponent(Xe)}`);S.length&&le.push(`filter=${S.join(",")}`)}if(X.length&&le.push(`fields=${X.map(encodeURIComponent).join(",")}`),z)for(const A of[z].flat())A&&le.push(`order=${encodeURIComponent(A.order)}:${encodeURIComponent(A.field)}`);M!==void 0&&le.push(`offset=${M}`),_!==void 0&&le.push(`limit=${_}`),fe!==void 0&&le.push(`after=${encodeURIComponent(fe)}`);const T=le.length?`?${le.join("&")}`:"",L=await this.requestRequired("GET",`/entities${T}`,te),N=(A,S)=>{var q,Le;if(((q=A.metadata)===null||q===void 0?void 0:q.name)===void 0||A.kind===void 0||((Le=S.metadata)===null||Le===void 0?void 0:Le.name)===void 0||S.kind===void 0)return 0;const Xe=(0,h.eE)(A),Qe=(0,h.eE)(S);return Xe<Qe?-1:Xe>Qe?1:0};return{items:L.sort(N)}}async getEntitiesByRefs(P,te){var Q;const X={entityRefs:P.entityRefs};!((Q=P.fields)===null||Q===void 0)&&Q.length&&(X.fields=P.fields);const M=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,_=await this.fetchApi.fetch(M,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify(X)});if(!_.ok)throw await r.VL.fromResponse(_);const{items:fe}=await _.json();return{items:fe}}async getEntityByRef(P,te){const{kind:Q,namespace:X,name:z}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(z)}`,te)}async getEntityByName(P,te){const{kind:Q,namespace:X="default",name:z}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(z)}`,te)}async refreshEntity(P,te){const Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(Q.status!==200)throw new Error(await Q.text())}async getEntityFacets(P,te){const{filter:Q=[],facets:X}=P,z=[];for(const _ of[Q].flat()){const fe=[];for(const[le,T]of Object.entries(_))for(const L of[T].flat())L===g?fe.push(encodeURIComponent(le)):typeof L=="string"&&fe.push(`${encodeURIComponent(le)}=${encodeURIComponent(L)}`);fe.length&&z.push(`filter=${fe.join(",")}`)}for(const _ of X)z.push(`facet=${encodeURIComponent(_)}`);const M=z.length?`?${z.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${M}`,te)}async addLocation(P,te){const{type:Q="url",target:X,dryRun:z}=P,M=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${z?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({type:Q,target:X})});if(M.status!==201)throw new Error(await M.text());const{location:_,entities:fe,exists:le}=await M.json();if(!_)throw new Error(`Location wasn't added: ${X}`);return{location:_,entities:fe,exists:le}}async getLocationByRef(P,te){return(await this.requestRequired("GET","/locations",te)).map(X=>X.data).find(X=>P===(0,h.NZ)(X))}async removeLocationById(P,te){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,te)}async removeEntityByUid(P,te){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,te)}async validateEntity(P,te,Q){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(Q==null?void 0:Q.token)&&{Authorization:`Bearer ${Q==null?void 0:Q.token}`}},method:"POST",body:JSON.stringify({entity:P,location:te})});if(X.ok)return{valid:!0};if(X.status!==400)throw await r.VL.fromResponse(X);const{errors:z=[]}=await X.json();return{valid:!1,errors:z}}async requestIgnored(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,z=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},M=await this.fetchApi.fetch(X,{method:P,headers:z});if(!M.ok)throw await r.VL.fromResponse(M)}async requestRequired(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,z=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},M=await this.fetchApi.fetch(X,{method:P,headers:z});if(!M.ok)throw await r.VL.fromResponse(M);return await M.json()}async requestOptional(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,z=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},M=await this.fetchApi.fetch(X,{method:P,headers:z});if(!M.ok){if(M.status===404)return;throw await r.VL.fromResponse(M)}return await M.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:Z()}}}},25271:function(Rt,ze,t){"use strict";t.d(ze,{Tf:function(){return W},P1:function(){return ge},q1:function(){return ee},M6:function(){return Re},l2:function(){return r},zG:function(){return h},w$:function(){return In},nP:function(){return Fn},aS:function(){return zn},S4:function(){return en},cz:function(){return Mn},iB:function(){return vt},CV:function(){return jt},of:function(){return rt},Ou:function(){return Ne},eE:function(){return ot},NZ:function(){return et}});const h="default",r="backstage.io/view-url",W="backstage.io/edit-url",Z="kubernetes.io/api-server",g="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var c=t(76635),P=t.n(c);class te{async enforce(k){return k.metadata.namespace?k:lodash.merge({metadata:{namespace:this.namespace}},k)}constructor(k=DEFAULT_NAMESPACE){this.namespace=k}}class Q{static isValidPrefixAndOrSuffix(k,ce,Be,D){if(typeof k!="string")return!1;const U=k.split(ce);return U.length===1?D(U[0]):U.length===2?Be(U[0])&&D(U[1]):!1}static isJsonSafe(k){try{return P().isEqual(k,JSON.parse(JSON.stringify(k)))}catch{return!1}}static isValidDnsSubdomain(k){return typeof k=="string"&&k.length>=1&&k.length<=253&&k.split(".").every(Q.isValidDnsLabel)}static isValidDnsLabel(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(k)}static isValidTag(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(k)}static isValidUrl(k){if(typeof k!="string")return!1;try{return new URL(k),!0}catch{return!1}}static isValidString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}}var X=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}}}}}'),z=t(27991),M=t.n(z),_=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"}}}`),fe=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}}}}}}'),le=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 T=new Map,L=[X,_,fe,le];function N(ie){if(!(ie!=null&&ie.length))throw new TypeError("Unknown error");const k=ie[0];throw new TypeError(`${k.instancePath||"<root>"} ${k.message}${k.params?` - ${Object.entries(k.params).map(([ce,Be])=>`${ce}: ${Be}`).join(", ")}`:""}`)}function A(ie,k={}){var ce;const Be=(ce=k==null?void 0:k.disableCache)!==null&&ce!==void 0?ce:!1,D=Be?"":JSON.stringify(ie);if(!Be){const be=T.get(D);if(be)return be}const U=S(ie),de=new(M())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});U.length&&de.addSchema(U,void 0,void 0,!0);const pe=de.compile(ie);return Be||T.set(D,pe),pe}function S(ie){if(typeof ie!="object")return[];const k=new Set;ie.$id&&k.add(ie.$id);const ce=new Array,Be=[ie];for(;Be.length;){const D=Be.pop();for(const U of q(D))if(!k.has(U)){k.add(U);const de=L.find(pe=>pe.$id===U);de&&(ce.push(de),Be.push(de))}}return ce}function*q(ie){const k=[ie];for(;k.length;){const ce=k.pop();if(typeof ce=="object"&&ce)for(const[Be,D]of Object.entries(ce))Be==="$ref"&&typeof D=="string"?yield D.split("#")[0]:k.push(D)}}function Le(ie){const k=compileAjvSchema(ie||entityEnvelopeSchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}function Xe(ie){const k=A(ie);return ce=>{var Be;if(k(ce)===!0)return ce;const U=(Be=k.errors)===null||Be===void 0?void 0:Be.filter(de=>["/kind","/apiVersion"].includes(de.instancePath));if((U==null?void 0:U.length)&&U.every(de=>de.keyword==="enum"))return!1;throw N(k.errors)}}function Qe(ie){const k=compileAjvSchema(ie||entitySchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}class qe{static isValidApiVersion(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(k)}static isValidObjectName(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(k)}static isValidNamespace(k){return Q.isValidDnsLabel(k)}static isValidLabelKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,qe.isValidObjectName)}static isValidLabelValue(k){return k===""||qe.isValidObjectName(k)}static isValidAnnotationKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,qe.isValidObjectName)}static isValidAnnotationValue(k){return typeof k=="string"}}const He={isValidApiVersion:qe.isValidApiVersion,isValidKind:qe.isValidKind,isValidEntityName:qe.isValidObjectName,isValidNamespace:qe.isValidNamespace,isValidLabelKey:qe.isValidLabelKey,isValidLabelValue:qe.isValidLabelValue,isValidAnnotationKey:qe.isValidAnnotationKey,isValidAnnotationValue:qe.isValidAnnotationValue,isValidTag:ie=>typeof ie=="string"&&ie.length>=1&&ie.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ie)};function mt(ie={}){return{...He,...ie}}class Te{async enforce(k){function ce(C,H,me){if(H==null)throw new Error(`${C} must have a value`);let ue;try{ue=me(H)}catch(Ce){throw new Error(`${C} 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 Oe=Ce?` expected ${Ce} but found "${H}".`:"";throw new Error(`"${C}" is not valid;${Oe} 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 Be(C,H,me){return H===void 0||ce(C,H,me)}ce("apiVersion",k.apiVersion,this.validators.isValidApiVersion),ce("kind",k.kind,this.validators.isValidKind),ce("metadata.name",k.metadata.name,this.validators.isValidEntityName),Be("metadata.namespace",k.metadata.namespace,this.validators.isValidNamespace);var D;for(const[C,H]of Object.entries((D=k.metadata.labels)!==null&&D!==void 0?D:[]))ce(`labels.${C}`,C,this.validators.isValidLabelKey),ce(`labels.${C}`,H,this.validators.isValidLabelValue);var U;for(const[C,H]of Object.entries((U=k.metadata.annotations)!==null&&U!==void 0?U:[]))ce(`annotations.${C}`,C,this.validators.isValidAnnotationKey),ce(`annotations.${C}`,H,this.validators.isValidAnnotationValue);var de;const pe=(de=k.metadata.tags)!==null&&de!==void 0?de:[];for(let C=0;C<pe.length;++C)ce(`tags.${C}`,pe[C],this.validators.isValidTag);var be;const $e=(be=k.metadata.links)!==null&&be!==void 0?be:[];for(let C=0;C<$e.length;++C){var Ee,Ue,nt;ce(`links.${C}.url`,(Ee=$e[C])===null||Ee===void 0?void 0:Ee.url,CommonValidatorFunctions.isValidUrl),Be(`links.${C}.title`,(Ue=$e[C])===null||Ue===void 0?void 0:Ue.title,CommonValidatorFunctions.isNonEmptyString),Be(`links.${C}.icon`,(nt=$e[C])===null||nt===void 0?void 0:nt.icon,KubernetesValidatorFunctions.isValidObjectName)}return k}constructor(k=makeValidator()){this.validators=k}}class Ye{async enforce(k){if(!this.validate){const D=new Ajv({allowUnionTypes:!0});this.validate=D.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(k)===!0)return k;const[Be]=this.validate.errors||[];throw Be?new Error(`Malformed envelope, ${Be.instancePath||"<root>"} ${Be.message}`):new Error("Malformed envelope, Unknown error")}}function st(ie){let k=ie.indexOf(":");const ce=ie.indexOf("/");ce!==-1&&ce<k&&(k=-1);const Be=k===-1?void 0:ie.slice(0,k),D=ce===-1?void 0:ie.slice(k+1,ce),U=ie.slice(Math.max(k+1,ce+1));if(Be===""||D===""||U==="")throw new TypeError(`Entity reference "${ie}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Be,namespace:D,name:U}}function vt(ie){return{kind:ie.kind,namespace:ie.metadata.namespace||h,name:ie.metadata.name}}function rt(ie,k){if(!ie)throw new Error("Entity reference must not be empty");const ce=k==null?void 0:k.defaultKind,Be=(k==null?void 0:k.defaultNamespace)||h;let D,U,de;if(typeof ie=="string"){const Ue=st(ie);var pe;D=(pe=Ue.kind)!==null&&pe!==void 0?pe:ce;var be;U=(be=Ue.namespace)!==null&&be!==void 0?be:Be,de=Ue.name}else{var $e;D=($e=ie.kind)!==null&&$e!==void 0?$e:ce;var Ee;U=(Ee=ie.namespace)!==null&&Ee!==void 0?Ee:Be,de=ie.name}if(D)if(U){if(!de){const Ue=JSON.stringify(ie);throw new Error(`Entity reference ${Ue} had missing or empty name`)}}else{const Ue=JSON.stringify(ie);throw new Error(`Entity reference ${Ue} had missing or empty namespace`)}else{const Ue=JSON.stringify(ie);throw new Error(`Entity reference ${Ue} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:U,name:de}}function ot(ie){let k,ce,Be;if("metadata"in ie){k=ie.kind;var D;ce=(D=ie.metadata.namespace)!==null&&D!==void 0?D:h,Be=ie.metadata.name}else{k=ie.kind;var U;ce=(U=ie.namespace)!==null&&U!==void 0?U:h,Be=ie.name}return`${k.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Be.toLocaleLowerCase("en-US")}`}class ct{async enforce(k){let ce=k;for(const Be of this.policies){const D=await Be.enforce(ce);if(!D)throw new Error(`Policy ${Be.constructor.name} did not return a result`);ce=D}return ce}constructor(k){this.policies=k}}class St{async enforce(k){for(const ce of this.policies){const Be=await ce.enforce(k);if(Be)return Be}throw new Error("The entity did not match any known policy")}constructor(k){this.policies=k}}const Lt={allOf(ie){return new ct(ie)},oneOf(ie){return new St(ie)}};var Ve=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 oe(ie){let k;return{async check(ce){return k||(k=Xe(ie)),k(ce)===ce}}}const Pe=oe(Ve);var ke=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 tt=oe(ke);var yt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const Zt=oe(yt);var ht=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 Tt=oe(ht);var It=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 Ot=oe(It),en="ownedBy",Vt="ownerOf",Ht="consumesApi",Qt="apiConsumedBy",hn="providesApi",dn="apiProvidedBy",Fn="dependsOn",In="dependencyOf",Un="parentOf",yn="childOf",pn="memberOf",Xt="hasMember",Mn="partOf",zn="hasPart";var fn=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 xn=oe(fn);var bn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const Pn=oe(bn);var kn=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 Sn=oe(kn),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Re="backstage.io/source-location";function Ne(ie){if(typeof ie!="string")throw new TypeError(`Unable to parse location ref '${ie}', unexpected argument ${typeof ie}`);const k=ie.indexOf(":");if(k<0)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=ie.substring(0,k).trim(),Be=ie.substring(k+1).trim();if(!ce||!Be)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${ie}', please prefix it with 'url:', e.g. 'url:${ie}'`);return{type:ce,target:Be}}function et(ie){const{type:k,target:ce}=ie;if(k){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${k}:${ce}`}function jt(ie){var k,ce,Be,D,U;const de=(U=(k=ie.metadata)===null||k===void 0||(ce=k.annotations)===null||ce===void 0?void 0:ce[Re])!==null&&U!==void 0?U:(Be=ie.metadata)===null||Be===void 0||(D=Be.annotations)===null||D===void 0?void 0:D[ge];if(!de)throw new Error(`Entity '${ot(ie)}' is missing location`);return Ne(de)}},93414:function(Rt,ze,t){"use strict";t.d(ze,{zx:function(){return mt},Oi:function(){return oe},VY:function(){return $i},yW:function(){return Xa},XF:function(){return tt},mn:function(){return jt},NX:function(){return h},ub:function(){return Ue},mf:function(){return nl},yu:function(){return gn},h4:function(){return Gi},M6:function(){return hr},i9:function(){return pl},aR:function(){return Zi},rJ:function(){return jr},Oh:function(){return xl},hu:function(){return ml},rU:function(){return qe},nU:function(){return fs},sk:function(){return dt},Or:function(){return Zr},T3:function(){return Ki},g9:function(){return Cl},Ex:function(){return Cs},Gk:function(){return w},tn:function(){return Di},Ph:function(){return Ge},YE:function(){return qo},v7:function(){return da},R6:function(){return cs},tR:function(){return tr},uw:function(){return wa},qt:function(){return so},iA:function(){return Hi},GB:function(){return wn},po:function(){return lr},mZ:function(){return Ns},Pf:function(){return Ur}});var h={};t.r(h),t.d(h,{Nm:function(){return yt},ht:function(){return Tt},LJ:function(){return ht}});var r=t(52322),W=t(25248),Z=t(19928),g=t(2784);function b(e){const[s,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const F=d.alert$().subscribe(he=>a(se=>se.concat(he)));return()=>{F.unsubscribe()}},[d]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const F=setTimeout(()=>{a(he=>{const se=he.filter(xe=>xe!==$);return se.length===he.length?he:se})},j);return()=>clearTimeout(F)}},[$,j]),s.length===0)return null;const K=()=>{a(F=>F.filter(he=>he!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:K,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var c=t(79692),P=t(12420);const te=(0,c.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Q(e){const{displayName:s,picture:a,customStyles:d}=e,p=te();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:a,className:p.avatar,style:v,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(s)})})}var X=t(77277),z=t(86689),M=t(90436),_=t(72779),fe=t.n(_),le=t(76635),T=t(79635),L=t(39857);function N(){const[e]=(0,T.is)((0,r.jsx)(T.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const A=(0,c.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"}),S=e=>/^([a-z+.-]+):/.test(e),q=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Le=()=>{const e="http://sample.dev";var s;const a=(s=q())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(a,e);return(0,le.trimEnd)(d,"/")},Xe=e=>{let s=String(e);const a=Le(),d=S(s),p=s.startsWith(a);return!d&&!p&&(s=a.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):""},qe=g.forwardRef(({onClick:e,noTrack:s,...a},d)=>{const p=A(),v=(0,W.z$)(),j=N()?Xe(a.to):a.to,$=Qe(a.children)||j,K=S(j),F=K&&!!/^https?:/.exec(j),he=se=>{e==null||e(se),s||v.captureEvent("click",$,{attributes:{to:j}})};return K?(0,r.jsxs)(z.Z,{...F?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:he,className:fe()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(M.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(z.Z,{...a,ref:d,component:L.rU,to:j,onClick:he})}),He=g.forwardRef((e,s)=>(0,r.jsx)(qe,{ref:s,...e,color:"initial"})),mt=g.forwardRef((e,s)=>(0,r.jsx)(X.Z,{ref:s,component:He,...e}));var Te=t(95544),Ye=t(60364),st=t(83229),vt=t(26639),rt=t(39595),ot=t(61837),ct=t(80030),St=t(19353),Lt=t(95074);function Ve(e){const{text:s,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,W.h_)(W.VE),[j,$]=(0,g.useState)(!1),[{error:K},F]=(0,Lt.Z)();(0,g.useEffect)(()=>{K&&v.post(K)},[K,v]);const he=se=>{se.stopPropagation(),$(!0),F(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ct.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>$(!1),open:j,children:(0,r.jsx)(ot.Z,{onClick:he,"aria-label":p,children:(0,r.jsx)(St.Z,{})})})})}function oe(e){const{text:s,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,$=(0,Ye.Z)(),K=$.palette.type==="dark"?vt.Z:rt.Z,F=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Te.Z,{position:"relative",children:[(0,r.jsx)(st.Z,{customStyle:v,language:a,style:K,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:he=>p!=null&&p.includes(he)?{style:{backgroundColor:F}}:{},children:s}),j&&(0,r.jsx)(Te.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(Ve,{text:s})})]})}var Pe=t(41156),ke=t(88188);function tt(e){const{title:s,to:a}=e,d=(0,Pe.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(ot.Z,{component:L.rU,color:"primary",title:s,size:"small",to:a,children:(0,r.jsx)(ke.Z,{})}):(0,r.jsx)(X.Z,{component:L.rU,variant:"contained",color:"primary",to:a,children:s}):null}var yt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(yt||(yt={}));var Zt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Zt||(Zt={}));var ht;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(ht||(ht={}));var Tt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Tt||(Tt={}));var It=t(27397),Ot=t(11105),en=t(97963),Vt=t(46506),Ht=t.n(Vt),Qt=t(54073),hn=t.n(Qt),dn=t(10368);const Fn=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function In({node:{id:e}}){const s=Fn(),[a,d]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:he,width:se}=j.current.getBBox();he=Math.round(he),se=Math.round(se),(he!==p||se!==a)&&(d(se),v(he))}},[a,p]);const $=10,K=a+$*2,F=p+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:K,height:F,rx:10}),(0,r.jsx)("text",{ref:j,className:s.text,y:F/2,x:K/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",yn="node",pn="edge",Xt="label",Mn=(0,dn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),zn=e=>(0,r.jsx)(In,{...e});function fn({render:e=zn,setNode:s,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,$=a,K=Mn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:he,width:se}=F.current.getBBox();he=Math.round(he),se=Math.round(se),(he!==p||se!==d)&&s(a.id,{...a,height:he,width:se})}},[a,d,p,s]),(0,r.jsx)("g",{ref:F,"data-testid":yn,className:K.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:$})})}var xn=t(76985),bn=t(39829),Pn=t(19574),kn=t.n(Pn);const Sn=(0,dn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ge({edge:{label:e}}){const s=Sn();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,dn.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"}),Re=e=>(0,r.jsx)(ge,{...e});function Ne({render:e=Re,setEdge:s,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:$,height:K,points:F}=d,he=d,se=ee(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:_e,width:Pt}=xe.current.getBBox();_e=Math.round(_e),Pt=Math.round(Pt),(_e!==K||Pt!==$)&&s(a,{...d,height:_e,width:Pt})}},[d,K,$,s,a]);let Ae="";const Ke=g.useMemo(()=>xn.Z().x(_e=>_e.x).y(_e=>_e.y).curve(bn[p]),[p]);if(F){const _e=F.filter(Pt=>kn()(Pt.x)&&kn()(Pt.y));Ae=Ke(_e)||""}return(0,r.jsxs)(r.Fragment,{children:[Ae&&(0,r.jsx)("path",{"data-testid":pn,className:se.path,d:Ae}),he.label?(0,r.jsx)("g",{ref:xe,"data-testid":Xt,className:se.label,transform:`translate(${v},${j})`,children:e({edge:he})}):null]})}const et="workspace";function jt(e){var s,a;const{edges:d,nodes:p,renderNode:v,direction:j=yt.TOP_BOTTOM,align:$,nodeMargin:K=50,edgeMargin:F=10,rankMargin:he=50,paddingX:se=0,paddingY:xe=0,acyclicer:Ae,ranker:Ke=ht.NETWORK_SIMPLEX,labelPosition:_e=Tt.RIGHT,labelOffset:Pt=10,edgeRanks:Kt=1,edgeWeight:tn=1,renderLabel:nn,defs:kt,zoom:_t="enabled",curve:Yt="curveMonotoneX",fit:yr="grow",...xr}=e,br=(0,en.Z)(),[Sr,li]=g.useState(100),[Tr,ci]=g.useState(100),Jt=g.useRef(new(Ht()).graphlib.Graph),[ds,Co]=g.useState(((s=Jt.current.graph())===null||s===void 0?void 0:s.width)||0),[Ir,di]=g.useState(((a=Jt.current.graph())===null||a===void 0?void 0:a.height)||0),[Dn,cr]=g.useState([]),[zr,Wr]=g.useState([]),ln=Math.max(ds,Sr),vn=Math.max(Ir,Tr),us=Math.min(Ir,Tr),Vr=yr==="grow"?vn:us,Ms=g.useMemo(()=>hn()(un=>{if(!un)return;const Nn=Ot.Z(un),cn=Ot.Z(un.getElementById(et));function sr(){Nn.call(It.sP().scaleExtent([1,10]).on("zoom",Cr=>{Cr.transform.x=Math.min(0,Math.max(Cr.transform.x,ln-ln*Cr.transform.k)),Cr.transform.y=Math.min(0,Math.max(Cr.transform.y,vn-vn*Cr.transform.k)),cn.attr("transform",Cr.transform)}))}_t==="enabled"?sr():_t==="enable-on-click"&&Nn.on("click",()=>sr());const{width:or,height:wo}=un.getBoundingClientRect();Sr!==or&&li(or),Tr!==wo&&ci(wo)},100),[Tr,Sr,ln,vn,_t]),ea=g.useCallback(()=>{const un=Jt.current.nodes(),Nn=Jt.current.edges();un.forEach(cn=>{p.some(or=>or.id===cn)||Jt.current.removeNode(cn)}),Nn.forEach(cn=>{d.some(or=>or.from===cn.v&&or.to===cn.w)||Jt.current.removeEdge(cn.v,cn.w)}),p.forEach(cn=>{const sr=Jt.current.nodes().find(or=>cn.id===or);if(sr&&Jt.current.node(sr)){const{width:or,height:wo,x:Cr,y:Ml}=Jt.current.node(sr);Jt.current.setNode(sr,{...cn,width:or,height:wo,x:Cr,y:Ml})}else Jt.current.setNode(cn.id,{...cn,width:0,height:0})}),d.forEach(cn=>{Jt.current.setEdge(cn.from,cn.to,{...cn,label:cn.label,width:0,height:0,labelpos:_e,labeloffset:Pt,weight:tn,minlen:Kt})})},[d,p,_e,Pt,tn,Kt]),zs=g.useMemo(()=>hn()(()=>{Ht().layout(Jt.current);const{height:un,width:Nn}=Jt.current.graph(),cn=Math.max(0,un||0),sr=Math.max(0,Nn||0);Co(sr),di(cn),cr(Jt.current.nodes()),Wr(Jt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Jt.current.setGraph({rankdir:j,align:$,nodesep:K,edgesep:F,ranksep:he,marginx:se,marginy:xe,acyclicer:Ae,ranker:Ke}),ea(),zs(),zs.cancel),[Ae,$,j,F,se,xe,K,he,Ke,ea,zs]);function Fl(un,Nn){return Jt.current.setNode(un,Nn),zs(),Jt.current}function Ul(un,Nn){return Jt.current.setEdge(un,Nn),zs(),Jt.current}return(0,r.jsxs)("svg",{ref:Ms,...xr,width:"100%",height:Vr,viewBox:`0 0 ${ln} ${vn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Un,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:br.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:et,children:(0,r.jsxs)("svg",{width:ds,height:Ir,y:vn/2-Ir/2,x:ln/2-ds/2,viewBox:`0 0 ${ds} ${Ir}`,children:[zr.map(un=>{const Nn=Jt.current.edge(un);return Nn?(0,r.jsx)(Ne,{id:un,setEdge:Ul,render:nn,edge:Nn,curve:Yt},`${un.v}-${un.w}`):null}),Dn.map(un=>{const Nn=Jt.current.node(un);return Nn?(0,r.jsx)(fn,{setNode:Fl,render:v,node:Nn},un):null})]})})]})}var ie;const k=(0,c.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},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:(ie=e.palette.banner.warning)!==null&&ie!==void 0?ie:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ce=e=>{const{variant:s,message:a,id:d,fixed:p=!1}=e,v=k(),$=useApi(storageApiRef).forBucket("notifications");var K;const F=(K=$.snapshot("dismissedBanners").value)!==null&&K!==void 0?K:[],[he,se]=useState(new Set(F)),xe=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Ke;const _e=(Ke=xe==null?void 0:xe.value)!==null&&Ke!==void 0?Ke:[];se(new Set(_e))}},[xe==null?void 0:xe.value]);const Ae=()=>{$.set("dismissedBanners",[...he,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!he.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ae,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",de=t.p+"static/createComponent.975d1e1e..svg",pe=t.p+"static/noBuild.1715fa71..svg";const be=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),$e=({missing:e})=>{const s=be();switch(e){case"field":return(0,r.jsx)("img",{src:D,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:U,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:de,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:pe,alt:"no Build",className:s.generalImg});default:return null}},Ee=(0,c.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 Ue(e){const{title:s,description:a,missing:d,action:p}=e,v=Ee();return(0,r.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(M.Z,{variant:"h5",children:s})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(M.Z,{variant:"body1",children:a})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)($e,{missing:d}):d.customImage})]})}const nt=`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`,C=/^.*ANNOTATION.*$/m,H=nt.match(C)[0],me=nt.split(`
|
|
12
|
-
`).findIndex(e=>C.test(e)),ue=(0,c.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function Ce(e){return Array.from(Array(e+1).keys(),s=>s+me)}function Oe(e){const s=e.map(a=>H.replace("ANNOTATION",a)).join(`
|
|
13
|
-
`);return nt.replace(H,s)}function Fe(e){const s=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(a=>(0,r.jsx)("code",{children:a})).reduce((a,d)=>(0,r.jsxs)(r.Fragment,{children:[a,", ",d]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function dt(e){const{annotation:s,readMoreUrl:a}=e,d=Array.isArray(s)?s:[s],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=ue();return(0,r.jsx)(Ue,{missing:"field",title:"Missing Annotation",description:Fe(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(Te.Z,{className:v.code,children:(0,r.jsx)(oe,{text:Oe(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:Ce(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(X.Z,{color:"primary",component:qe,to:p,children:"Read more"})]})})}var Et=t(11776),it=t(38402),ft=t(49378),xt=t(41128),at=t(27616),Bt=t(8284),Mt=t(70660),zt=t(91750),qt=t(38016);const Wn=(e,s)=>(s.palette.type==="light"?xt._j:xt.$n)(s.palette[e].light,.6),Cn=(e,s)=>(s.palette.type==="light"?xt.$n:xt._j)(s.palette[e].light,.9),Dt=(0,c.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Wn(s,e)}})),Nt=({severity:e})=>{const s=Dt({severity:e});return(0,r.jsx)(zt.Z,{classes:s})},rn=({severity:e})=>{const s=Dt({severity:e});return(0,r.jsx)(qt.Z,{classes:s})},On=(0,c.Z)(e=>({panel:{backgroundColor:({severity:s})=>Cn(s,e),color:({severity:s})=>Wn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Wn(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>Wn(s,e),backgroundColor:({severity:s})=>Cn(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"}),Qn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function wn(e){const{severity:s="warning",title:a,message:d,children:p,defaultExpanded:v}=e,j=On({severity:s}),$=Qn(s)+(a?`: ${a}`:"");return(0,r.jsxs)(at.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,r.jsxs)(Bt.Z,{expandIcon:(0,r.jsx)(rn,{severity:s}),className:j.summary,children:[(0,r.jsx)(Nt,{severity:s}),(0,r.jsx)(M.Z,{className:j.summaryText,variant:"subtitle1",children:$})]}),(d||p)&&(0,r.jsx)(Mt.Z,{children:(0,r.jsxs)(Be.Z,{container:!0,children:[d&&(0,r.jsx)(Be.Z,{item:!0,xs:12,children:(0,r.jsx)(M.Z,{className:j.message,variant:"body1",children:d})}),p&&(0,r.jsx)(Be.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const jn=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Gn=({error:e,message:s,stack:a,children:d})=>{const p=jn();return(0,r.jsxs)(Et.Z,{dense:!0,children:[(0,r.jsxs)(it.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(Ve,{text:e})]}),(0,r.jsxs)(it.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,r.jsx)(Ve,{text:s})]}),a&&(0,r.jsxs)(it.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(Ve,{text:a})]}),d]})};function gn(e){const{title:s,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(wn,{severity:"error",title:s!=null?s:a.message,defaultExpanded:d,children:(0,r.jsx)(Gn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var Rn=t(85256);const dr=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function w(e){var s;const{title:a,error:d,defaultExpanded:p}=e,v=dr();if(d.name!=="ResponseError")return(0,r.jsx)(gn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:j,cause:$}=d,{request:K,response:F}=j,he=`${F.statusCode}: ${$.name}`,se=K&&`${K.method} ${K.url}`,xe=$.message.replace(/\\n/g,`
|
|
14
|
-
`),Ae=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
-
`),Ke=JSON.stringify(j,void 0,2);return(0,r.jsxs)(gn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:he,message:xe,stack:Ae},children:[se&&(0,r.jsxs)(it.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:v.text},primary:"Request",secondary:K?`${se}`:void 0}),(0,r.jsx)(Ve,{text:se})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Rn.Z,{component:"li",className:v.divider}),(0,r.jsx)(it.Z,{alignItems:"flex-start",children:(0,r.jsx)(ft.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(oe,{language:"json",text:Ke,showCopyCodeButton:!0})]})]})}var u=t(28316);function x(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function E(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function J(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||x(e);return p||E(v),v.appendChild(s.current),function(){s.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return s.current||(s.current=document.createElement("div")),s.current}return a()}var ve=null;const ye="core.calloutSeen";function De(){const[e,s]=useState(()=>{const d=localStorage.getItem(ye);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(ye),$={...v?JSON.parse(v):{},[d]:p};s($),localStorage.setItem(ye,JSON.stringify($))},[]);return{states:e,setState:a}}function Je(e){const{states:s,setState:a}=De(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:s[e]===!0,markSeen:d}}function Ft(e){const{seen:s,markSeen:a}=Je(e);return{show:s===!1,hide:a}}const Gt=(0,c.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 Bn(e){const{featureId:s,title:a,description:d,children:p}=e,{show:v,hide:j}=useShowCallout(s),$=usePortal("core.callout"),K=useRef(null),[F,he]=useState(),se=Gt(),xe=useCallback(()=>{if(K.current){const Ae=K.current.getBoundingClientRect(),Ke=Math.max(Ae.width,Ae.height),_e=800,Pt=Ae.x-(Ke-Ae.width)/2-_e,Kt=Ae.y-(Ke-Ae.height)/2-_e,tn=Ke+2*_e,nn=450,kt=Ae.x+Ae.width/2-nn,_t=Ae.y-(Ke-Ae.height)/2+Ke+20;he({dotLeft:Pt,dotTop:Kt,dotSize:tn,borderWidth:_e,textTop:_t,textLeft:kt,textWidth:nn})}},[]);return useEffect(()=>(window.addEventListener("resize",xe),window.addEventListener("scroll",xe),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe)}),[xe]),useLayoutEffect(xe,[K.current,xe]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:se.featureWrapper,ref:K,children:p}),createPortal(_jsx(Box,{className:se.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:se.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(Box,{className:se.pulseCircle})}),_jsxs(Box,{className:se.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:a}),_jsx(Typography,{children:d})]})]})})}),$)]}):_jsx(_Fragment,{children:p})}var ur=t(35292);const hs=(0,c.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ps({color:e="primary",disabled:s=!1,href:a="#",icon:d=(0,r.jsx)(ur.Z,{}),label:p,onClick:v,title:j}){const $=hs();return s?(0,r.jsxs)(Te.Z,{title:j,className:fe()($.link,$.disabled),children:[d,(0,r.jsx)(M.Z,{variant:"caption",component:"span",className:$.label,children:p})]}):(0,r.jsxs)(qe,{title:j,className:fe()($.link,$[e]),to:a,onClick:v,children:[d,(0,r.jsx)(M.Z,{variant:"caption",component:"span",className:$.label,children:p})]})}const Rr=(0,c.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function hr(e){const{links:s}=e,a=Rr();return(0,r.jsx)("nav",{className:a.links,children:s.map((d,p)=>(0,r.jsx)(ps,{...d},p+1))})}const Lr=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
|
-
`},Hr=100,Pr=10,Kn=(0,c.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:Hr,height:`calc(100% + ${Pr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Pr,background:`linear-gradient(90deg, ${Lr(e.palette.type)})`},fadeRight:{right:-Pr,background:`linear-gradient(270deg, ${Lr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Xn(e){const[[s,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const j=p.scrollLeft,$=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([j,$])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,a]}function pr(e,s,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame($=>{if(!e.current)return;const K=$-v,F=Math.abs(d)*K/s,se=Math.max(a,F)*Math.sign(d);e.current.scrollBy({left:se});const xe=d-se;Math.sign(d)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(j)},[e,d,s,a]),p}function kr(e){const{scrollStep:s=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,j=Kn(e),$=React.useRef(),[K,F]=Xn($),he=pr($,a,d),se=xe=>{!$.current||he(xe?s:-s)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:$,children:p}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:K===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:F===0})}),K>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>se(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>se(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Gr=(0,c.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Ws(e){const s=Gr(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Or=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function fs(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(Or,{...e})})}const gs=(0,c.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"}),wr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(wr,e):e,mn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(wr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},ir={code:({inline:e,className:s,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,r.jsx)(oe,{language:v[1],text:p}):(0,r.jsx)("code",{className:s,...d,children:a})},h1:mn,h2:mn,h3:mn,h4:mn,h5:mn,h6:mn};function Br(e){const{content:s,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:j}=e,$=gs();return _jsx(ReactMarkdown,{remarkPlugins:a==="gfm"?[gfm]:[],className:`${$.markdown} ${j}`,children:s,components:ir,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var ms=t(23054);const $r=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),vs=({request:e,busy:s,setBusy:a})=>{const d=$r(),[p,v]=useState(),j=async()=>{a(!0);try{await e.trigger()}catch(K){v(isError(K)?K.message:"An unspecified error occurred")}finally{a(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{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 ys=null;const Kr=(0,c.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 Yr(e){const s=Kr(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach($=>$.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($=>_jsx(LoginRequestListItem,{request:$,busy:a,setBusy:d},$.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var ar=t(15277),xs=t.n(ar),Jr=t(29862);const bs=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Zr(e){const[s,a]=(0,g.useState)(!1),d=(0,Jr.t)(),p=bs(),v=$=>{d()&&a($)};var j;return(0,r.jsx)(ct.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(xs(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var Ss=t(67358);function Cs(e){const s=(0,Ye.Z)(),[a,d]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>d(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),a?(0,r.jsx)(Ss.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Te.Z,{display:"none"})}var Qr=t(94339),Xr=t(14503),qr=t(24579),Dr=t(32552),on=t(15459),Ut=t(27597);const ws=(0,c.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 js(e){const{link:s,title:a,onClick:d}=e,p=ws();return(0,r.jsxs)(Te.Z,{children:[(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(qe,{to:s,onClick:d,underline:"none",children:(0,r.jsxs)(Te.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(Te.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(M.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(Ut.Z,{className:p.arrow})]})})]})}const Es=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(M.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(M.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(mt,{to:s.href,variant:"contained",children:s.name})},_r=class extends g.Component{componentDidCatch(s,a){console.error(`ErrorBoundary, error: ${s}, info: ${a}`),this.setState({error:s,errorInfo:a})}render(){const{slackChannel:s,children:a}=this.props,{error:d}=this.state;return d?(0,r.jsx)(gn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Es,{slackChannel:s})}):a}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},As=(0,c.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ts=(0,on.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Xr.Z),es={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 jr(e){const{title:s,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:$,children:K,headerStyle:F,headerProps:he,icon:se,action:xe,actionsClassName:Ae,actions:Ke,cardClassName:_e,actionsTopRight:Pt,className:Kt,noPadding:tn,titleTypographyProps:nn}=e,kt=As();let _t={},Yt={};$&&$.split(/[\s]+/g).forEach(Sr=>{_t={..._t,...es.card[Sr]},Yt={...Yt,...es.cardContent[Sr]}});const yr=()=>!a&&!se?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:kt.subheader,children:a}),se]}),xr=j||(v?{slackChannel:v}:{});return(0,r.jsx)(Qr.Z,{style:_t,className:Kt,children:(0,r.jsxs)(_r,{...xr,children:[s&&(0,r.jsx)(Dr.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:yr(),action:xe,style:{...F},titleTypographyProps:nn,...he}),Pt&&(0,r.jsx)(Ts,{children:Pt}),d&&(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(qr.Z,{className:fe()(_e,{[kt.noPadding]:tn}),style:Yt,children:K}),Ke&&(0,r.jsx)(Xr.Z,{className:Ae,children:Ke}),p&&(0,r.jsx)(js,{...p})]})})}var Vs=t(39307);const Is=(0,c.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),ts={fractional:!0,inverse:!1,unit:"%",max:100},Rs=({palette:e,value:s,inverse:a,max:d})=>{if(isNaN(s))return"#ddd";const p=d||ts.max,v=a?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function Hs(e){const[s,a]=useState(null),{getColor:d=Rs}=e,p=Is(e),{palette:v}=useTheme(),{value:j,fractional:$,inverse:K,unit:F,max:he,description:se}={...ts,...e},xe=$?Math.round(j*he):j,Ae=he!==100?Math.round(j):xe,[Ke,_e]=useState(!1);return useEffect(()=>{const Pt=s,Kt=()=>_e(!0),tn=()=>_e(!1);return Pt&&se?(Pt.addEventListener("mouseenter",Kt),Pt.addEventListener("mouseleave",tn),()=>{Pt.removeEventListener("mouseenter",Kt),Pt.removeEventListener("mouseleave",tn)}):()=>{_e(!1)}},[se,s]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Ae,inverse:K,max:he}),className:p.circle}),se&&Ke?_jsx(Box,{className:p.description,children:se}):_jsx(Box,{className:p.overlay,children:isNaN(j)?"N/A":`${Ae}${F}`})]})}const Ls=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Gs(e){const s=Ls(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:j,description:$,icon:K,variant:F,getColor:he}=e,se={inverse:v,description:$,getColor:he,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:j,variant:F,icon:K,children:_jsx(Gauge,{...se})})})}function Ks(e){const{value:s,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var Ps=t(21324),Ys=t(7089),m=t(1292),y=t(42494),I=t(74603),O=t(56939),Y=t(12231),G=t(73698),ne=t(72379);const ae=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Ie=()=>{const e=ae();return(0,r.jsx)(ne.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const we=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Me=()=>{const e=we();return(0,r.jsx)(ne.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const gt=(0,on.Z)(e=>(0,P.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(I.Z),Ct=(0,c.Z)(e=>(0,P.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Ge(e){const{multiple:s,items:a,label:d,placeholder:p,selected:v,onChange:j,triggerReset:$,native:K=!1,disabled:F=!1,margin:he}=e,se=Ct(),[xe,Ae]=(0,g.useState)(v||(s?[]:"")),[Ke,_e]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Ae(s?[]:"")},[$,s]),(0,g.useEffect)(()=>{v!==void 0&&Ae(v)},[v]);const Pt=kt=>{Ae(kt.target.value),j(kt.target.value)},Kt=kt=>{if(F){kt.preventDefault();return}_e(_t=>s&&!(kt.target instanceof HTMLElement)?!0:!_t)},tn=()=>{_e(!1)},nn=kt=>()=>{const _t=xe.filter(Yt=>Yt!==kt);Ae(_t),j(_t)};return(0,r.jsx)(Te.Z,{className:se.root,children:(0,r.jsx)(m.Z,{onClickAway:tn,children:(0,r.jsxs)(y.Z,{className:se.formControl,children:[(0,r.jsx)(O.Z,{className:se.formLabel,children:d}),(0,r.jsxs)(G.Z,{"aria-label":d,value:xe,native:K,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:he,onChange:Pt,onClick:Kt,open:Ke,input:(0,r.jsx)(gt,{}),label:d,tabIndex:0,renderValue:kt=>{var _t;return s&&xe.length!==0?(0,r.jsx)(Te.Z,{className:se.chips,children:kt.map(Yt=>{var yr,xr;return(0,r.jsx)(Ys.Z,{label:(yr=a.find(br=>br.value===Yt))===null||yr===void 0?void 0:yr.label,clickable:!0,onDelete:nn(Yt),className:se.chip},(xr=a.find(br=>br.value===Yt))===null||xr===void 0?void 0:xr.value)})}):(0,r.jsx)(M.Z,{children:xe.length===0?p||"":(_t=a.find(Yt=>Yt.value===kt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>Ke?(0,r.jsx)(Me,{}):(0,r.jsx)(Ie,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,r.jsx)(Y.Z,{value:[],children:p}),K?a&&a.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):a&&a.map(kt=>(0,r.jsxs)(Y.Z,{value:kt.value,children:[s&&(0,r.jsx)(Ps.Z,{color:"primary",checked:xe.includes(kt.value)||!1,className:se.checkbox}),kt.label]},kt.value))]})]})})})}const ut=()=>{},Wt=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:ut,stepHistory:[],setStepHistory:ut,onStepChange:ut});function qn(e){const{children:s,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,j]=useState(p),[$,K]=useState([0]);useEffect(()=>{j(p)},[p]);const F=[];let he;return Children.forEach(s,se=>{isValidElement(se)&&(se.props.end?he=se:F.push(se))}),_jsxs(_Fragment,{children:[_jsx(Wt.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:$,setStepHistory:K,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:F})}),v>=Children.count(s)-1&&he]})}const an=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),_n=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),En=({text:e,handleClick:s,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),$n=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:s,children:e||"Skip"}),Vn=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Er=({actions:e={},children:s})=>{const a=an(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:$,onStepChange:K}=useContext(VerticalStepperContext),F=(Ae,Ke)=>{Ke&&Ke(),K&&K(p,Ae),v(Ae)},he=()=>{const Ae=e.nextStep?e.nextStep(p,d-1):p+1;F(Ae,e.onNext),$([...j,Ae])},se=()=>{j.pop(),F(j[j.length-1],e.onBack),$([...j])},xe=()=>{F(0,e.onRestart),$([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Vn,{text:e.backText,handleClick:se,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx($n,{text:e.skipText,handleClick:he,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(En,{text:e.nextText,handleClick:he,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(_n,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},fr=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function ns(e){const{title:s,children:a,end:d,actions:p,...v}=e,j=fr();return d?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const sn=(0,c.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Ln(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function gr(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ui(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function hi(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function ta(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Ar(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var pi=t(74600),An=t(15584);const fi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),gi={root:{border:"0",verticalAlign:"top"}},mi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),jo=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),vi=(0,on.Z)(fi,{name:"BackstageMetadataTableTitleCell"})(An.Z),yi=(0,on.Z)(gi,{name:"BackstageMetadataTableCell"})(An.Z),xi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),na=({title:e,children:s,...a})=>_jsxs(TableRow,{children:[e&&_jsx(vi,{children:e}),_jsx(yi,{colSpan:e?1:2,...a,children:s})]}),Eo=(0,on.Z)(mi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Et.Z,{disablePadding:!0,className:e.root,children:s})),Js=(0,on.Z)(jo,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(it.Z,{className:e.root,children:s})),Qs=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),rs=e=>(0,P.Z)({root:{...Qs.root,paddingLeft:e.spacing(1)}}),Nr=(0,on.Z)(Qs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Eo,{classes:e,children:s})),Fr=(0,on.Z)(rs,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Eo,{classes:e,children:s}));function Ao(e,s){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:ks(d)},p));return s?_jsx(Fr,{children:a}):_jsx(Nr,{children:a})}function Xs(e,s,a){const d=Object.keys(e).map(p=>{const v=ks(e[p],!0),j=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},p)});return s?_jsx(Fr,{children:d}):_jsx(Nr,{children:d})}function ks(e,s,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Xs(e,s,a):Array.isArray(e)?Ao(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const To=({value:e,options:s})=>_jsx(Fragment,{children:ks(e,s)}),Io=({title:e,value:s,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(To,{value:s,options:a})});function Ro(e,s){return Object.keys(e).map(a=>_jsx(Io,{title:a,value:e[a],options:s},a))}function bi(e){const{metadata:s,dense:a=!0,options:d}=e,p=Ro(s,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var mr=t(49429),Os=t(86136),_s=t(79784),Lo=t(19126),Bs=t.n(Lo);function Po(e){return qs.stringify(e,{strictNullHandling:!0})}function eo(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function to(e,s){return eo(e)[s]}function ko(e,s,a){const d={...eo(e),[s]:a};return Po(d)}function ra(e,s=250){const[a,d]=useSearchParams(),p=a.toString(),[v,j]=useState(to(p,e));return useEffect(()=>{const $=to(p,e);j(K=>isEqual($,K)?K:$)},[p,j,e]),useDebouncedEffect(()=>{const $=ko(p,e,v);p!==$&&d($,{replace:!0})},[d,v,p,e],s),[v,j]}const Oo={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 no(){const s=(0,W.I_)().get(W.Ds),a=s==null?void 0:s.getOptionalConfig("app.support");if(!a)return Oo;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var Bo=t(80079);function er(e,s){const d=(0,W.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...s}):(0,r.jsx)(Bo.Z,{...s})}function $o(e){return er("brokenImage",e)}function ro(e){return er("catalog",e)}function Si(e){return er("chat",e)}function Ci(e){return er("dashboard",e)}function wi(e){return er("docs",e)}function ji(e){return er("email",e)}function sa(e){return er("github",e)}function oa(e){return er("group",e)}function vr(e){return er("help",e)}function ia(e){return er("user",e)}function aa(e){return er("warning",e)}const Zo=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Do=({icon:e})=>{const s=(0,W.qD)();var a;const d=e&&(a=s.getSystemIcon(e))!==null&&a!==void 0?a:vr;return(0,r.jsx)(d,{})};var ss;const Ei=({link:e})=>(0,r.jsx)(qe,{to:e.url,children:(ss=e.title)!==null&&ss!==void 0?ss:e.url}),Ai=({item:e})=>{var s;return(0,r.jsxs)(it.Z,{children:[(0,r.jsx)(Os.Z,{children:(0,r.jsx)(Do,{icon:e.icon})}),(0,r.jsx)(ft.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(Ei,{link:d},d.url)],[])})]})};function so(e){const{title:s,items:a,children:d}=e,{items:p}=no(),[v,j]=(0,g.useState)(!1),[$,K]=(0,g.useState)(null),F=Zo(),he=(0,Pe.Z)(Ae=>Ae.breakpoints.down("sm")),se=Ae=>{K(Ae.currentTarget),j(!0)},xe=()=>{j(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Te.Z,{display:"flex",ml:1,children:he?(0,r.jsx)(ot.Z,{color:"primary",size:"small",onClick:se,"data-testid":"support-button",children:(0,r.jsx)(vr,{})}):(0,r.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:se,startIcon:(0,r.jsx)(vr,{}),children:"Support"})}),(0,r.jsxs)(_s.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,r.jsxs)(Et.Z,{className:F.popoverList,children:[s&&(0,r.jsx)(it.Z,{alignItems:"flex-start",children:(0,r.jsx)(M.Z,{variant:"subtitle1",children:s})}),g.Children.map(d,(Ae,Ke)=>(0,r.jsx)(it.Z,{alignItems:"flex-start",children:Ae},`child-${Ke}`)),(a!=null?a:p).map((Ae,Ke)=>(0,r.jsx)(Ai,{item:Ae},`item-${Ke}`))]}),(0,r.jsx)(mr.Z,{children:(0,r.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var os=t(18671),$s=t(16060);const is=72,No=24,Fo=18,lr={drawerWidthClosed:is,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:is,iconSize:is-No*2,iconPadding:No,selectedIndicatorWidth:3,userBadgePadding:Fo,userBadgeDiameter:is-Fo*2,mobileSidebarHeight:56},Yn=e=>({...lr,...e,iconContainerWidth:lr.drawerWidthClosed,iconSize:lr.drawerWidthClosed-lr.iconPadding*2,userBadgeDiameter:lr.drawerWidthClosed-lr.userBadgePadding*2}),Uo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:lr.defaultOpenDelayMs+200},Mo=e=>({...Uo,...e}),la="@backstage/core/sidebar-intro-dismissed",nr=(0,g.createContext)({sidebarConfig:lr,submenuConfig:Uo}),zo=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ti=t(50023),Ii=t(4190),Ri=t(87685),Li=t(44882),Zs=t(51837);const Wo={isOpen:!1,setOpen:()=>{}},Vo=(0,g.createContext)(Wo),Ds=(0,Zs.CT)("sidebar-open-state-context");function oo(e){const{children:s,value:a}=e;return(0,r.jsx)(Vo.Provider,{value:a,children:(0,r.jsx)(Ds.Provider,{value:(0,Zs.EI)({1:a}),children:s})})}const Ns=()=>{const e=(0,g.useContext)(Ds),s=(0,g.useContext)(Vo);if(e===void 0)return s||Wo;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var Ho=t(57998);const io={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ao=(0,g.createContext)(io),lo=(0,Zs.CT)("sidebar-pin-state-context");function Go(e){const{children:s,value:a}=e;return(0,r.jsx)(ao.Provider,{value:a,children:(0,r.jsx)(lo.Provider,{value:(0,Zs.EI)({1:a}),children:s})})}const Ur=()=>{const e=(0,g.useContext)(lo),s=(0,g.useContext)(ao);if(e===void 0)return s||io;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Ko=(0,c.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"}})),Pi=e=>{const{to:s,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(nr),j=Ko({sidebarConfig:v}),$=(0,T.TH)(),{selectedMenuItemIndex:K,setSelectedMenuItemIndex:F}=(0,g.useContext)(ho),he=(xe,Ae)=>{F(Ae===K?-1:Ae)},se=p===K&&K>=0||p!==K&&!(K>=0)&&s===$.pathname;return(0,r.jsx)(Ho.Z,{label:a,icon:d,component:qe,to:s||$.pathname,onChange:he,value:p,selected:se,classes:j})},co=e=>{const{children:s,to:a,label:d,icon:p,value:v}=e,{isMobile:j}=Ur();return j?(0,r.jsx)(Pi,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:s})},uo=(0,c.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`})})),ki=e=>(0,le.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Yo=g.createElement(co).type,Jo=({children:e,label:s="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,g.useContext)(nr),v=uo({sidebarConfig:p});return(0,r.jsxs)(Ii.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(Te.Z,{className:v.overlayHeader,children:[(0,r.jsx)(M.Z,{variant:"h3",children:s}),(0,r.jsx)(ot.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Ri.Z,{})})]}),(0,r.jsx)(Te.Z,{component:"nav",children:e})]})},ho=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Qo=e=>{const{sidebarConfig:s}=(0,g.useContext)(nr),{children:a}=e,d=uo({sidebarConfig:s}),p=(0,T.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let $=(0,W.vJ)(a,F=>F.getElements().filter(he=>he.type===Yo));if(a)$.length?$=ki($):$.push((0,r.jsx)(co,{icon:(0,r.jsx)(Li.Z,{}),children:a},"default_menu"));else return null;const K=v>=0&&!$[v].props.to;return(0,r.jsx)(oo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ho.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,r.jsx)(Jo,{label:$[v]&&$[v].props.label,open:K,onClose:()=>j(-1),children:$[v]&&$[v].props.children}),(0,r.jsx)(Ti.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var as;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(as||(as={}));const po={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(as.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(as.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Xo=(0,c.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 tr(e){const[s,a]=(0,g.useState)(()=>po.getSidebarPinState()),{sidebarConfig:d}=(0,g.useContext)(nr),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{po.setSidebarPinState(s)},[s]);const j=(0,Pe.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),$=()=>a(!s),K=Xo({isPinned:s,sidebarConfig:d});return(0,r.jsx)(Go,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:j},children:(0,r.jsx)(fo.Provider,{value:v,children:(0,r.jsx)(Te.Z,{className:K.root,children:e.children})})})}function go(){const{content:e}=(0,g.useContext)(fo);return{focusContent:(0,g.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const mo=(0,c.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"},"& .MuiButtonBase-root":{textTransform:"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 Hn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Hn||(Hn={}));const vo=e=>{const{sidebarConfig:s}=(0,g.useContext)(nr),{openDelayMs:a=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=mo({sidebarConfig:s}),$=(0,Pe.Z)(Kt=>Kt.breakpoints.down("md"),{noSsr:!0}),[K,F]=(0,g.useState)(Hn.Closed),he=(0,g.useRef)(),{isPinned:se,toggleSidebarPinState:xe}=Ur(),Ae=()=>{se||p||(he.current&&(clearTimeout(he.current),he.current=void 0),K!==Hn.Open&&!$&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Hn.Open)},a),F(Hn.Idle)))},Ke=()=>{se||p||(he.current&&(clearTimeout(he.current),he.current=void 0),K===Hn.Idle?F(Hn.Closed):K===Hn.Open&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Hn.Closed)},d)))},_e=K===Hn.Open&&!$||se,Pt=Kt=>{Kt?(F(Hn.Open),xe()):(F(Hn.Closed),xe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(_o,{}),(0,r.jsx)(oo,{value:{isOpen:_e,setOpen:Pt},children:(0,r.jsx)(Te.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ae,onFocus:p?()=>{}:Ae,onMouseLeave:p?()=>{}:Ke,onBlur:p?()=>{}:Ke,children:(0,r.jsx)(Te.Z,{className:fe()(j.drawer,{[j.drawerOpen]:_e}),children:v})})})]})},qo=e=>{var s;const a=Yn((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=Mo((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:$,closeDelayMs:K}=e,{isMobile:F}=Ur();return F?(0,r.jsx)(Qo,{children:v}):(0,r.jsx)(nr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(vo,{openDelayMs:$,closeDelayMs:K,disableExpandOnHover:j,children:v})})};function _o(){const{sidebarConfig:e}=(0,g.useContext)(nr),{focusContent:s,contentRef:a}=go(),d=mo({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(X.Z,{onClick:s,variant:"contained",className:fe()(d.visuallyHidden),children:"Skip to content"}):null}function yo(e,s){const a=new URLSearchParams(s.search).toString(),d=Bs().parse(a),p=new URLSearchParams(e.search).toString(),v=Bs().parse(p);return(0,le.isEqual)(s.pathname,e.pathname)&&(0,le.isMatch)(v,d)}const ei=(0,c.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:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),ca=e=>{const{title:s,subtitle:a,to:d,icon:p,dropdownItems:v}=e,j=ei(),{setIsHoveredOn:$}=useContext(SidebarItemWithSubmenuContext),K=()=>{$(!1)},F=useResolvedPath(d!=null?d:""),he=useLocation();let se=isLocationMatch(he,F);const[xe,Ae]=useState(!1),Ke=()=>{Ae(!xe)};return v!==void 0?(v.some(_e=>{const Pt=resolvePath(_e.to);return se=isLocationMatch(he,Pt),se}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ke,onTouchStart:_e=>_e.stopPropagation(),className:classnames(j.item,se?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]}),xe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&xe&&_jsx(Box,{className:j.dropdown,children:v.map((_e,Pt)=>_jsx(Tooltip,{title:_e.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:_e.to,underline:"none",className:j.dropdownItem,onClick:K,onTouchStart:Kt=>Kt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:_e.title})})},Pt))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,se?j.selected:void 0),onClick:K,onTouchStart:_e=>_e.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]})]})})})};var Fs;const i=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var a;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:(Fs=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Fs!==void 0?Fs:"#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:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),n=e=>{const{isOpen:s}=Ns(),{sidebarConfig:a,submenuConfig:d}=(0,g.useContext)(nr),p=s?a.drawerWidthOpen:a.drawerWidthClosed,v=i({left:p,submenuConfig:d}),{isHoveredOn:j}=(0,g.useContext)(zo),[$,K]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{K(j)},[j]),(0,r.jsxs)(Te.Z,{className:fe()(v.drawer,{[v.drawerOpen]:$}),children:[(0,r.jsx)(M.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var o=t(26739),l=t(76600),f=t(83543),R=t(59797),B=t(98989);const V=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),re=()=>{const e=V();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var We=null;const Ze=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),pt=()=>{const e=Ze();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var lt=null,bt,wt;const $t=e=>(0,c.Z)(s=>{var a,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(bt=(a=s.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&bt!==void 0?bt:"#404040"}},highlighted:{background:(wt=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&wt!==void 0?wt:"#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",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,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 At(e){return(0,g.useMemo)(()=>$t(e),[e])()}const Tn=(e,s)=>(0,W.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:j})=>d=d||yo(s,(0,$s.i3)(j)));return}p&&(d=yo(s,(0,$s.i3)(p)))}}),d},[s.pathname]);function Zn(e){return e.to===void 0}const rr=g.createElement(n).type,ls=g.forwardRef(function({to:s,end:a,style:d,className:p,activeStyle:v,caseSensitive:j,activeClassName:$="active","aria-current":K="page",...F},he){let{pathname:se}=(0,T.TH)(),{pathname:xe}=(0,T.WU)(s);j||(se=se.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Ae=se===xe;!Ae&&!a&&(Ae=se.startsWith(`${xe}/`));const Ke=Ae?K:void 0;return(0,r.jsx)(L.rU,{...F,to:s,ref:he,"aria-current":Ke,style:{...d,...Ae?v:void 0},className:fe()([p,Ae?$:void 0])})}),xo=(0,g.forwardRef)((e,s)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:$,children:K,className:F,...he}=e,{sidebarConfig:se}=(0,g.useContext)(nr),xe=At(se),{isOpen:Ae}=Ns(),Ke=!Ae&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},_e=(0,r.jsxs)(Te.Z,{style:Ke,children:[(0,r.jsx)(a,{fontSize:"small"}),!Ae&&v?(0,r.jsx)(B.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(o.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:fe()({[xe.closedItemIcon]:!Ae}),children:_e}),Kt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Te.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Pt}),d&&(0,r.jsx)(M.Z,{variant:"subtitle2",className:xe.label,children:d}),(0,r.jsx)("div",{className:xe.secondaryAction,children:K})]}),tn=Ae?Kt:Pt,nn={onClick:$,className:fe()(F,xe.root,Ae?xe.open:xe.closed,Zn(e)&&xe.buttonItem,{[xe.highlightable]:!j})};return Zn(e)?(0,r.jsx)(X.Z,{role:"button","aria-label":d,...nn,ref:s,children:tn}):(0,r.jsx)(ls,{...nn,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...he,children:tn})}),ti=({children:e,...s})=>{const{sidebarConfig:a}=(0,g.useContext)(nr),d=At(a),[p,v]=(0,g.useState)(!1),j=(0,T.TH)(),$=Tn(e,j),K=(0,Pe.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{v(!0)},he=()=>{v(!1)},se=()=>K?p?(0,r.jsx)(R.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(f.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(B.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(zo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:he,onTouchStart:p?he:F,onMouseEnter:F,className:fe()(p&&d.highlighted),children:[(0,r.jsx)(xo,{hasSubmenu:!0,className:$?d.selected:"",...s,children:se()}),p&&e]})})},cs=(0,g.forwardRef)((e,s)=>{const[a]=(0,W.vJ)(e.children,d=>d.getElements().filter(p=>p.type===rr));return a?(0,r.jsx)(ti,{...e,children:a}):(0,r.jsx)(xo,{...e,ref:s})});function Oi(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[a,d]=useState(""),p=At(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(a),d("")},$=se=>{se.key==="Enter"&&(se.preventDefault(),j())},K=se=>{d(se.target.value)},F=se=>{se.preventDefault(),se.stopPropagation()},he=se=>{j(),se.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(cs,{icon:v,to:e.to,onClick:he,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:F,onChange:K,onKeyDown:$,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Mr=(0,l.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),zl=(0,l.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),da=(0,l.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ua=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Wl=(0,l.Z)("div")(({theme:e})=>{const s=ua(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Vl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=At(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ha=(0,c.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function pa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),a=ha({sidebarConfig:s}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Bi=e=>{const{text:s,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(pa,{text:s,onClose:v})})},fa=null,ga="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},$=()=>{p(F=>({...a,...F,starredItemsDismissed:!0}))},K=()=>{p(F=>({...a,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Bi,{text:fa,onDismiss:$}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Bi,{text:ga,onDismiss:K})]}):null}const ma=(0,c.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 $i(e){const{className:s,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:j}=go(),$=ma();return(0,r.jsx)("article",{ref:j,tabIndex:-1,...v,className:fe()($.root,s,{[$.stretch]:a,[$.noPadding]:d}),children:p})}var va=t(6487),ya=t(99152);const xa=(0,c.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Zi(e){const{tabs:s,onChange:a,selectedIndex:d}=e,[p,v]=(0,g.useState)(d!=null?d:0),j=xa(),$=(0,g.useCallback)((K,F)=>{d===void 0&&v(F),a&&d!==F&&a(F)},[d,a]);return(0,g.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(Te.Z,{className:j.tabsWrapper,children:(0,r.jsx)(ya.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:$,value:p,children:s.map((K,F)=>(0,g.createElement)(va.Z,{...K.tabProps,"data-testid":`header-tab-${F}`,label:K.label,key:K.id,value:F,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function ba(e){const s=(0,T.UO)(),d=e.map(({path:xe,children:Ae})=>({caseSensitive:!1,path:`${xe}/*`,element:Ae})).sort((xe,Ae)=>Ae.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,T.V$)(d))!==null&&p!==void 0?p:e[0].children;var j;let $=(j=s["*"])!==null&&j!==void 0?j:"";$.startsWith("/")||($=`/${$}`);var K;const[F]=(K=(0,$s.fp)(d,$))!==null&&K!==void 0?K:[],he=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var se;return{index:he===-1?0:he,element:v,route:(se=e[he])!==null&&se!==void 0?se:e[0]}}function Di(e){const{routes:s}=e,a=(0,T.s0)(),{index:d,route:p,element:v}=ba(s),j=(0,g.useMemo)(()=>s.map(K=>({id:K.path,label:K.title,tabProps:K.tabProps})),[s]),$=K=>{let{path:F}=s[K];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),a(F)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zi,{tabs:j,selectedIndex:d,onChange:$}),(0,r.jsxs)($i,{children:[(0,r.jsx)(os.q,{title:p.title}),v]})]})}const ni=()=>null;(0,W.R5)(ni,"core.gatherMountPoints",!0);function Ni(e){const s=(0,r.jsx)(ni,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(a=>{if(!(0,g.isValidElement)(a))return[];if(a.type===g.Fragment)return Ni(a.props.children);if(a.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:j}=a.props;return[{path:d,title:p,children:v,tabProps:j}]})}function Sa(e){const s=Ni(e.children);return(0,r.jsx)(Di,{routes:s})}Sa.Route=ni;const Ca=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function wa(e){const{value:s,subvalue:a}=e,d=Ca();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Te.Z,{className:d.value,children:s}),(0,r.jsx)(Te.Z,{className:d.subvalue,children:a})]})}var bo=t(67222),ja=t(21070),Ea=t(90324),Aa=t(98281),Ta=t(48049),Fi=t(51209),Ui=t(33375),Ia=t(44233),Ra=t(27604),ri=t(36444),La=t(37971),Pa=t(59709),ka=t(17373),Oa=t(3702),Ba=t(93111);const $a=(0,c.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Za=e=>{var s;const a=$a(),{onChangeFilters:d}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,$]=(0,g.useState)(!1),K=()=>{v({}),$(F=>!F)};return(0,g.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(Te.Z,{className:a.root,children:[(0,r.jsxs)(Te.Z,{className:a.header,children:[(0,r.jsx)(Te.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(X.Z,{color:"primary",onClick:K,children:"Clear all"})]}),(0,r.jsx)(Te.Z,{className:a.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(F=>(0,r.jsx)(Ge,{triggerReset:j,...F.element,selected:p[F.element.label],onChange:he=>v({...p,[F.element.label]:he})},F.element.label))})]})},Mi={Add:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ja.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Aa.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ia.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ra.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Oa.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ri.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(La.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Pa.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ta.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ri.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ea.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ka.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ba.Z,{...e,ref:s}))};function zi(e,s){const a=s.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Da=(0,on.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"})(bo.W$),Wi=(0,on.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(bo.UW),Na=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Fa=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ua(e,s){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const v=p;p=(j,$,K)=>({...v(j,$,K),fontWeight:s.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function Ma(e,s){return(0,le.transform)(e,(a,d,p)=>{(0,le.isEqual)(d,s[p])||(a[p]=d)})}const Vi={search:"",filtersOpen:!1,filters:{}};function za(e){const{toolbarRef:s,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,j=Na(),$=(0,g.useCallback)(K=>{e.onSearchChanged(K),a(K)},[e,a]);return d?(0,r.jsxs)(Te.Z,{className:j.root,children:[(0,r.jsxs)(Te.Z,{className:j.root,children:[(0,r.jsx)(ot.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(ri.Z,{})}),(0,r.jsxs)(M.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:$})}function Hi(e){const{data:s,columns:a,options:d,title:p,subtitle:v,filters:j,initialState:$,emptyContent:K,onStateChange:F,components:he,...se}=e,xe=Fa(),Ae=(0,Ye.Z)(),Ke={...Vi,...$},[_e,Pt]=(0,g.useState)(Ke.filtersOpen),Kt=(0,g.useCallback)(()=>Pt(Dn=>!Dn),[Pt]),[tn,nn]=(0,g.useState)(0),[kt,_t]=(0,g.useState)(s),[Yt,yr]=(0,g.useState)(Ke.filters),xr=Ua(a,Ae),[br,Sr]=(0,g.useState)(Ke.search);(0,g.useEffect)(()=>{if(F){const Dn=Ma({search:br,filtersOpen:_e,filters:Yt},Vi);F(Dn)}},[br,_e,Yt,F]);const li={headerStyle:{textTransform:"uppercase"}},Tr=(0,g.useCallback)(Dn=>{var cr;return(cr=a.find(zr=>zr.title===Dn))===null||cr===void 0?void 0:cr.field},[a]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Yt){_t(s);return}const Dn=Object.values(Yt);if(s&&Dn.flat().length){const cr=s.filter(zr=>!!Object.entries(Yt).filter(([,Wr])=>!!Wr.length).every(([Wr,ln])=>{const vn=zi(zr,Tr(Wr));return Array.isArray(vn)&&Array.isArray(ln)?vn.some(us=>ln.includes(us)):Array.isArray(vn)?vn.includes(ln):Array.isArray(ln)?ln.includes(vn):vn===ln}));_t(cr)}else _t(s);nn(Dn.flat().length)},[s,Yt,Tr]);const ci=(Dn,cr)=>{const zr=ln=>{const vn=new Set,us=Vr=>{Vr!=null&&vn.add(Vr)};return cr&&cr.forEach(Vr=>{const Ms=zi(Vr,Tr(ln));Array.isArray(Ms)?Ms.forEach(us):us(Ms)}),vn},Wr=ln=>({placeholder:"All results",label:ln.column,multiple:ln.type==="multiple-select",items:[...zr(ln.column)].sort().map(vn=>({label:vn,value:vn}))});return Dn.map(ln=>({type:ln.type,element:Wr(ln)}))},Jt=!!(j!=null&&j.length),ds=(0,g.useCallback)(Dn=>(0,r.jsx)(za,{setSearch:Sr,hasFilters:Jt,selectedFiltersLength:tn,toggleFilters:Kt,...Dn}),[Kt,Jt,tn,Sr]),Co=typeof s!="function"&&s.length===0,Ir=a.length,di=(0,g.useCallback)(Dn=>K&&Co?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Ir,children:K})})}):(0,r.jsx)(bo.os,{...Dn}),[Co,K,Ir]);return(0,r.jsxs)(Te.Z,{className:xe.root,children:[_e&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,r.jsx)(Za,{filters:ci(j,s),selectedFilters:Yt,onChangeFilters:yr}),(0,r.jsx)(bo.ZP,{components:{Header:Da,Toolbar:ds,Body:di,...he},options:{...li,...d},columns:xr,icons:Mi,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(M.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...se})]})}Hi.icons=Object.freeze(Mi);const Gl=e=>{const{children:s,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:s})})},Wa=(0,c.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:s=>s.isNext?"auto":"0",marginRight:s=>s.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Kl=e=>{const s=Wa(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},Va=(e,s)=>s?e?"20px":"0":"40px",Ha=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Va(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Ha(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ga=(0,c.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Jl=e=>{const s=Ga(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ka=(0,c.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function Ql(e){const{tabs:s}=e,a=Ka(),[d,p]=useState([0,0]),[v,j]=useState(0),[$,K]=useState(0),[F,he]=useState([[]]),se=useRef(),{width:xe}=useWindowSize(),Ae=(tn,nn)=>{p([v,nn])},Ke=()=>{j(v-1)},_e=()=>{j(v+1)},Pt=()=>v+1<F.length;useEffect(()=>{const nn=v===0?1:2,kt=se.current.offsetWidth-20-nn*30,_t=d[0]*$+d[1],Yt=Math.floor(kt/170);K(Yt),he(chunkArray(s,Yt)),p([Math.floor(_t/Yt),_t%Yt])},[xe,s]);const Kt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:se,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Kt,onChange:Ae,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Ke,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[v].map((tn,nn)=>_jsx(StyledTab,{value:nn,isFirstIndex:nn===0,isFirstNav:v===0,icon:tn.icon||void 0,label:tn.label||void 0},nn)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:_e,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Kt!==!1?F[v].map((tn,nn)=>_jsx(TabPanel,{value:nn,index:Kt,children:tn.content},nn)):_jsx(TabPanel,{value:d[1],index:d[1],children:F[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ya(e,s){const a=e[e.length-1];if(!!a)return a>=.9?s.palette.status.ok:a>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:Ya(e.data,s)})]})}const Ja=e=>(0,c.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"}),Qa=({title:e="Unknown page",className:s})=>(0,r.jsx)(M.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Xa(e){const{description:s,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,j=Ja({textAlign:v})(),$=d||(0,r.jsx)(Qa,{title:a,className:j.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{title:a}),(0,r.jsxs)(Te.Z,{className:j.container,children:[(0,r.jsxs)(Te.Z,{className:j.leftItemsBox,children:[$,s&&(0,r.jsx)(M.Z,{className:j.description,variant:"body2",children:s})]}),(0,r.jsx)(Te.Z,{className:j.rightItemsBox,children:p})]})]})}var qa=t.p+"static/mic-drop.fe3ef4d0..svg";const _a=(0,c.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"}),el=()=>{const e=_a();return(0,r.jsx)("img",{src:qa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},tl=(0,c.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function nl(e){const{status:s,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=tl(),j=(0,T.s0)(),$=no();return(0,r.jsxs)(Be.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Be.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(M.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",a]}),(0,r.jsx)(M.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(M.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(M.Z,{variant:"h6",children:[(0,r.jsx)(qe,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(qe,{to:p||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(el,{})]})}var rl=t(16173);const sl=(0,on.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(M.Z),si=(0,on.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Te.Z);function ol(e){const{children:s,...a}=e,[d,p]=g.useState(null),v=g.Children.toArray(s),[j,$,...K]=v,F=K.length?K.pop():v[v.length-1],he=v.length>3,se=Ke=>{p(Ke.currentTarget)},xe=()=>{p(null)},Ae=Boolean(d);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(rl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(si,{clone:!0,children:j}),v.length>2&&(0,r.jsx)(si,{clone:!0,children:$}),he&&(0,r.jsx)(sl,{onClick:se,children:"..."}),(0,r.jsx)(Te.Z,{style:{fontStyle:"italic"},children:F})]}),(0,r.jsx)(_s.ZP,{open:Ae,anchorEl:d,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Et.Z,{children:K.map((Ke,_e)=>(0,r.jsx)(it.Z,{button:!0,children:(0,r.jsx)(si,{clone:!0,children:Ke})},_e))})})]})}const il=(0,c.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"}),al=({type:e,typeLink:s,classes:a,pageTitle:d})=>e?s?(0,r.jsxs)(ol,{className:a.breadcrumb,children:[(0,r.jsx)(qe,{to:s,children:e}),(0,r.jsx)(M.Z,{children:d})]}):(0,r.jsx)(M.Z,{className:a.type,children:e}):null,ll=({pageTitle:e,classes:s,tooltip:a})=>{const d=(0,r.jsx)(M.Z,{className:s.title,variant:"h1",children:e});return a?(0,r.jsx)(ct.ZP,{title:a,placement:"top-start",children:d}):d},cl=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(M.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Gi(e){const{children:s,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:j,type:$,typeLink:K}=e,F=il(),se=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=a||v,Ae=v||a,Ke=`${xe} | %s | ${se}`,_e=`${xe} | ${se}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{titleTemplate:Ke,defaultTitle:_e}),(0,r.jsxs)("header",{style:d,className:F.header,children:[(0,r.jsxs)(Te.Z,{className:F.leftItemsBox,children:[(0,r.jsx)(al,{classes:F,type:$,typeLink:K,pageTitle:Ae}),(0,r.jsx)(ll,{classes:F,pageTitle:Ae,tooltip:j}),(0,r.jsx)(cl,{classes:F,subtitle:p})]}),(0,r.jsx)(Be.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const dl=({label:e,secondaryLabel:s,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[a,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!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:a,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((v,j)=>_jsx(dl,{...v},`header-action-menu-${j}`))})})]})}const ul=(0,c.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,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"}),hl=({value:e,className:s})=>(0,r.jsx)(M.Z,{className:s,children:e});function pl(e){const{label:s,value:a,url:d}=e,p=ul(),v=(0,r.jsx)(hl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Be.Z,{item:!0,children:(0,r.jsxs)(M.Z,{component:"span",className:p.root,children:[(0,r.jsx)(M.Z,{className:p.label,children:s}),d?(0,r.jsx)(qe,{to:d,children:v}):v]})})}const fl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),gl=(0,c.Z)(fl,{name:"BackstageItemCardHeader"});function ml(e){const{title:s,subtitle:a,children:d}=e,p=gl(e);return(0,r.jsxs)(Te.Z,{className:p.root,children:[a&&(0,r.jsx)(M.Z,{variant:"subtitle2",component:"h3",children:a}),s&&(0,r.jsx)(M.Z,{variant:"h6",component:"h4",children:s}),d]})}function ec(e){const{description:s,tags:a,title:d,type:p,subtitle:v,label:j,onClick:$,href:K}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((F,he)=>_jsx(Chip,{size:"small",label:F},he))}):null,s]}),_jsxs(CardActions,{children:[!K&&_jsx(Button,{to:"#",onClick:$,color:"primary",children:j}),K&&_jsx(Button,{to:K,color:"primary",children:j})]})]})}const vl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),yl=(0,c.Z)(vl,{name:"BackstageItemCardGrid"});function xl(e){const{children:s,...a}=e,d=yl(a);return(0,r.jsx)(Te.Z,{className:d.root,...a,children:s})}var bl=t(41547);const Sl=(0,c.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 Ki(e){const{themeId:s,children:a}=e,{isMobile:d}=Ur(),p=Sl({isMobile:d});return(0,r.jsx)(bl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:p.root,children:a})})}function Cl(e){const{themeId:s,children:a,...d}=e;return(0,r.jsxs)(Ki,{themeId:s,children:[(0,r.jsx)(Gi,{...d}),a]})}var Jn=t(30195);const tc=Jn.z.object({providerInfo:Jn.z.object({}).catchall(Jn.z.unknown()).optional(),profile:Jn.z.object({email:Jn.z.string().optional(),displayName:Jn.z.string().optional(),picture:Jn.z.string().optional()}),backstageIdentity:Jn.z.object({token:Jn.z.string(),identity:Jn.z.object({type:Jn.z.literal("user"),userEntityRef:Jn.z.string(),ownershipEntityRefs:Jn.z.array(Jn.z.string())})})}),Yi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function wl(e){const s=new Date(Date.now()+Yi.defaultTokenExpiryMillis);if(!e)return s;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?s:new Date(v.exp*1e3-Yi.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),a=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:wl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:s},a}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const rc=e=>{const s=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},jl=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),oi=({children:e})=>{const s=jl();return(0,r.jsx)(Be.Z,{component:"li",item:!0,classes:s,children:e})};class ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function El(e){const[s,a,d]=e.split(".");return JSON.parse(window.atob(a))}class ai{getUserId(){return this.result.userId}static fromResult(s){return new ai(s)}async getIdToken(){var s,a;return(a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.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:a,ent:d}=El(s);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,a;return{token:await((a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.call(s))}}async signOut(){var s,a;return(a=(s=this.result).signOut)===null||a===void 0?void 0:a.call(s)}constructor(s){this.result=s}}class Us{static createGuest(){return new ii}static fromLegacy(s){return ai.fromResult(s)}static create(s){return new Us(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!a)throw new TypeError(`Invalid user entity reference "${s}"`);return a[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,a,d){this.identity=s,this.authApi=a,this.profile=d}}const Al={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:a,title:d,message:p}=e,v=(0,W.h_)(a),j=(0,W.h_)(W.VE),$=async()=>{try{const K=await v.getBackstageIdentity({instantPopup:!0});if(!K)throw new Error(`The ${d} provider is not configured to support sign-in`);const F=await v.getProfile();s(Us.create({identity:K.identity,profile:F,authApi:v}))}catch(K){j.post(new ms.SP("Login failed",K))}};return(0,r.jsx)(oi,{children:(0,r.jsx)(jr,{variant:"fullHeight",title:d,actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:$,children:"Sign In"}),children:(0,r.jsx)(M.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const a=e.get(s),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Us.create({identity:d.identity,profile:p,authApi:a})}},Tl={Component:({onSignInSuccess:e})=>(0,r.jsx)(oi,{children:(0,r.jsx)(jr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ii),children:"Enter"}),children:(0,r.jsxs)(M.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ii};var Il=t(63955),Ji=t(86619),Qi=t(74828),Rl=t(45455),Ll=t.n(Rl);const Pl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,kl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Xi=e=>{const{ref:s,...a}=e;return{inputRef:s,...a}},Ol={Component:({onSignInSuccess:e})=>{const s=kl(),{register:a,handleSubmit:d,formState:p}=(0,Il.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:$})=>{e(Us.fromLegacy({userId:$,profile:{email:`${$}@example.com`}}))};return(0,r.jsx)(oi,{children:(0,r.jsxs)(jr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(M.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:s.form,onSubmit:d(j),children:[(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,r.jsx)(Qi.Z,{error:!0,children:v.userId.message})]}),(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(a("idToken",{required:!1,validate:$=>!$||Pl.test($)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,r.jsx)(Qi.Z,{error:!0,children:v.idToken.message})]}),(0,r.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Ll()(v),children:"Continue"})]})]})})},loader:async()=>{}},So="@backstage/core:SignInPage:provider",qi={guest:Tl,custom:Ol,common:Al};function _i(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((a,d)=>{if(typeof d=="string")return _i(d,a),a[d]={components:qi[d],id:d},a;const{id:p}=d;return _i(p,a),a[p]={components:qi.common,id:p,config:d},a},{})}const uc=(e,s)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),j=useCallback(K=>{s(IdentityApiSignOutProxy.from({identityApi:K,signOut:async()=>{var F;localStorage.removeItem(So),await((F=K.signOut)===null||F===void 0?void 0:F.call(K))}}))},[s]);useLayoutEffect(()=>{var K;if(!p)return;const F=localStorage.getItem(So);if(F===null){v(!1);return}const he=e[F];if(!he){v(!1);return}let se=!1;return he.components.loader(d,(K=he.config)===null||K===void 0?void 0:K.apiRef).then(xe=>{se||(xe?j(xe):v(!1))}).catch(xe=>{se||(localStorage.removeItem(So),a.post(xe),v(!1))}),()=>{se=!0}},[p,a,s,d,e,j]);const $=useMemo(()=>Object.keys(e).map(K=>{const F=e[K],{Component:he}=F.components,se=xe=>{localStorage.setItem(So,F.id),j(xe)};return _jsx(he,{config:F.config,onSignInSuccess:se},F.id)}),[e,j]);return[p,$]},Bl=({onSignInSuccess:e,providers:s=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[$,K]=useSignInProviders(j,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:K})]})]})},$l=({provider:e,auto:s,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,$]=useState(),[K,F]=useState(!1),he=async({checkExisting:se,showPopup:xe})=>{try{let Ae;if(se&&(Ae=await p.getBackstageIdentity({optional:!0})),!Ae&&(xe||s)&&(F(!0),Ae=await p.getBackstageIdentity({instantPopup:!0}),!Ae))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ae){F(!0);return}const Ke=await p.getProfile();a(UserIdentity.create({identity:Ae.identity,authApi:p,profile:Ke}))}catch(Ae){$(Ae),F(!0)}};return useMountEffect(()=>he({checkExisting:!0})),K?_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:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{he({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($l,{...e}):_jsx(Bl,{...e})}const Zl=(0,c.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"}),Dl=(0,on.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Dr.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:j,onChange:$}=e,K=Zl(),[F,he]=useState(0),se=$||((Ke,_e)=>he(_e));let xe;j?React.Children.map(d,Ke=>{if(React.isValidElement(Ke)&&(Ke==null?void 0:Ke.props.value)===j){var _e;xe=Ke==null||(_e=Ke.props)===null||_e===void 0?void 0:_e.children}}):React.Children.map(d,(Ke,_e)=>{React.isValidElement(Ke)&&_e===F&&(xe=Ke==null?void 0:Ke.props.children)});const Ae=a||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ae,children:[p&&_jsx(Dl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:K,value:j||F,onChange:se,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),v&&_jsx(BottomLink,{...v})]})})}const Nl=(0,c.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function fc(e){const{children:s,...a}=e,d=Nl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},25248:function(Rt,ze,t){"use strict";t.d(ze,{fC:function(){return b},CL:function(){return Te},sM:function(){return _},$v:function(){return Le},v_:function(){return Xe},hg:function(){return Qe},uB:function(){return q},R5:function(){return Zt},bq:function(){return S},Ds:function(){return qe},ni:function(){return M},T0:function(){return z},CO:function(){return zn},x8:function(){return In},rx:function(){return Sn},YO:function(){return fn},P4:function(){return Mn},NT:function(){return en},NW:function(){return He},VE:function(){return mt},W0:function(){return Ye},gP:function(){return st},IY:function(){return ht},F4:function(){return le},ux:function(){return L},Kp:function(){return fe},$4:function(){return vt},p_:function(){return N},ZM:function(){return rt},D:function(){return T},gW:function(){return A},E6:function(){return ot},z$:function(){return Lt},h_:function(){return te},I_:function(){return P},qD:function(){return ke},vJ:function(){return Pn},yx:function(){return Pe},tg:function(){return yn},Oi:function(){return pn}});var h=t(52322),r=t(51837),W=t(2784);const Z=(0,r.CT)("analytics-context"),g=()=>{const ge=(0,W.useContext)(Z);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ee=ge.atVersion(1);if(ee===void 0)throw new Error("No context found for version 1.");return ee},b=ge=>{const{attributes:ee,children:Re}=ge,et={...g(),...ee},jt=(0,r.EI)({1:et});return(0,h.jsx)(Z.Provider,{value:jt,children:Re})};function c(ge,ee){const Re=Ne=>_jsx(b,{attributes:ee,children:_jsx(ge,{...Ne})});return Re.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Re}function P(){const ge=(0,r.Vt)("api-context");if(!ge)throw new Error("API context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("ApiContext v1 not available");return ee}function te(ge){const Re=P().get(ge);if(!Re)throw new Error(`No implementation available for ${ge}`);return Re}function Q(ge){return function(Re){const Ne=jt=>{const ie=P(),k={};for(const ce in ge)if(ge.hasOwnProperty(ce)){const Be=ge[ce],D=ie.get(Be);if(!D)throw new Error(`No implementation available for ${Be}`);k[ce]=D}return _jsx(Re,{...jt,...k})},et=Re.displayName||Re.name||"Component";return Ne.displayName=`withApis(${et})`,Ne}}class X{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(ee){if(this.config=ee,!ee.id.split(".").flatMap(Ne=>Ne.split("-")).every(Ne=>Ne.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ee.id}'`)}}function z(ge){return new X(ge)}function M(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const fe=z({id:"core.auth.google"}),le=z({id:"core.auth.github"}),T=z({id:"core.auth.okta"}),L=z({id:"core.auth.gitlab"}),N=z({id:"core.auth.microsoft"}),A=z({id:"core.auth.onelogin"}),S=z({id:"core.auth.bitbucket"}),q=z({id:"core.auth.atlassian"}),Le=z({id:"core.alert"}),Xe=z({id:"core.analytics"}),Qe=z({id:"core.apptheme"}),qe=z({id:"core.config"}),He=z({id:"core.discovery"}),mt=z({id:"core.error"});var Te;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Te||(Te={}));const Ye=z({id:"core.featureflags"}),st=z({id:"core.fetch"}),vt=z({id:"core.identity"}),rt=z({id:"core.oauthrequest"}),ot=z({id:"core.storage"});class ct{setContext(ee){this.context=ee}captureEvent(ee,Re,{value:Ne,attributes:et}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Re,value:Ne,attributes:et,context:this.context})}catch(jt){console.warn("Error during analytics event capture. %o",jt)}}constructor(ee,Re={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Re}}function St(){try{return te(Xe)}catch{return{captureEvent:()=>{}}}}function Lt(){const ge=(0,W.useRef)(null),ee=g(),Re=St();function Ne(){return ge.current===null&&(ge.current=new ct(Re)),ge.current}const et=Ne();return et.setContext(ee),et}const Ve="plugin-context",oe=ge=>{const{children:ee,plugin:Re}=ge,{Provider:Ne}=(0,r.CT)(Ve);return(0,h.jsx)(Ne,{value:(0,r.EI)({1:{plugin:Re}}),children:ee})};function Pe(){const ge=(0,r.Vt)(Ve);if(!ge)throw new Error("Plugin Options context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("Plugin Options v1 is not available");return ee.plugin.getPluginOptions()}const ke=()=>{const ge=(0,r.Vt)("app-context");if(!ge)throw new Error("App context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("AppContext v1 not available");return ee},tt=(0,r.uW)("component-data-store",()=>new WeakMap),yt="__backstage_data";function Zt(ge,ee,Re){const Ne=ge;var et;let jt=(et=Ne[yt])!==null&&et!==void 0?et:tt.get(ge);if(jt||(jt={map:new Map},Object.defineProperty(Ne,yt,{enumerable:!1,configurable:!0,writable:!1,value:jt}),tt.set(ge,jt)),jt.map.has(ee)){const ie=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${ee}" to component "${ie}"`)}jt.map.set(ee,Re)}function ht(ge,ee){if(!ge)return;const Re=ge.type;if(!Re)return;var Ne;const et=(Ne=Re[yt])!==null&&Ne!==void 0?Ne:tt.get(Re);if(!!et)return et.map.get(ee)}const Tt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let It=Tt;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Re){this.id=ee,this.params=Re,this[It]="absolute"}}function en(ge){var ee;return new Ot(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const Vt=/^\w+$/;let Ht=null;class Qt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Re,Ne,et){this.id=ee,this.path=Re,this.parent=Ne,this.params=et,this[Ht]="sub"}}function hn(ge){const{id:ee,path:Re,parent:Ne}=ge,et=Re.split("/").filter(k=>k.startsWith(":")).map(k=>k.substring(1)),jt=[...Ne.params,...et];if(Ne.params.some(k=>et.includes(k)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Re.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Re}'`);if(Re.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Re}'`);for(const k of et)if(!Vt.test(k))throw new Error(`SubRouteRef path has invalid param, got '${k}'`);return new Qt(ee,Re,Ne,jt)}let dn=Tt;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Re,Ne){this.id=ee,this.params=Re,this.optional=Ne,this[dn]="external"}}function In(ge){var ee;return new Fn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var Un=t(79635);function yn(ge){const{pathname:ee}=(0,Un.TH)(),Re=(0,r.Vt)("routing-context");if(!Re)throw new Error("Routing context is not available");const Ne=Re.atVersion(1),et=(0,W.useMemo)(()=>Ne&&Ne.resolve(ge,{pathname:ee}),[Ne,ge,ee]);if(!Re)throw new Error("useRouteRef used outside of routing context");if(!Ne)throw new Error("RoutingContext v1 not available");const jt="optional"in ge&&ge.optional;if(!et&&!jt)throw new Error(`No path for ${ge}`);return et}function pn(ge){return(0,Un.UO)()}class Xt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Re,plugin:Ne}=this.props,{ErrorBoundaryFallback:et}=Re.getComponents();return ee?(0,h.jsx)(et,{error:ee,resetError:this.handleErrorReset,plugin:Ne}):this.props.children}constructor(...ee){super(...ee),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Mn(ge){const{component:ee,mountPoint:Re,name:Ne}=ge;return fn({component:{lazy:()=>ee().then(et=>{const jt=k=>{try{yn(Re)}catch(ce){if(typeof ce=="object"&&ce!==null){const{message:Be}=ce;if(typeof Be=="string"&&Be.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Re} 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 ce}return(0,h.jsx)(et,{...k})},ie=Ne||et.displayName||et.name||"LazyComponent";return jt.displayName=`RoutableExtension(${ie})`,jt},et=>ie=>{const k=ke(),{BootErrorPage:ce}=k.getComponents();return(0,h.jsx)(ce,{step:"load-chunk",error:et})})},data:{"core.mountPoint":Re},name:Ne})}function zn(ge){const{component:ee,name:Re}=ge;return fn({component:ee,name:Re})}function fn(ge){const{data:ee={},name:Re}=ge;Re||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ne;if("lazy"in ge.component){const jt=ge.component.lazy;Ne=(0,W.lazy)(()=>jt().then(ie=>({default:ie})))}else Ne=ge.component.sync;const et=Re||Ne.displayName||Ne.name||"Component";return{expose(jt){const ie=k=>{const ce=ke(),{Progress:Be}=ce.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Be,{}),children:(0,h.jsx)(Xt,{app:ce,plugin:jt,children:(0,h.jsx)(b,{attributes:{pluginId:jt.getId(),...Re&&{extension:Re},...D&&{routeRef:D.id}},children:(0,h.jsx)(oe,{plugin:jt,children:(0,h.jsx)(Ne,{...k})})})})})};Zt(ie,"core.plugin",jt);for(const[k,ce]of Object.entries(ee))Zt(ie,k,ce);return ie.displayName=`Extension(${et})`,ie}}}function xn(ge,ee,Re,Ne){return W.Children.toArray(ge).flatMap(et=>{if(!(0,W.isValidElement)(et))return[];if(et.type===W.Fragment)return xn(et.props.children,ee,Re,Ne);if(ht(et,"core.featureFlagged")){const jt=et.props;return("with"in jt?ee.isActive(jt.with):!ee.isActive(jt.without))?xn(et.props.children,ee,Re,Ne):[]}if(Re===void 0||Re(et))return[et];if(Ne)throw new Error(Ne);return xn(et.props.children,ee,Re,Ne)})}class bn{selectByComponentData(ee){const Re=xn(this.node,this.featureFlagsApi,Ne=>ht(Ne,ee.key)!==void 0,ee.withStrictError);return new bn(Re,this.featureFlagsApi)}findComponentData(ee){return xn(this.node,this.featureFlagsApi,Ne=>ht(Ne,ee.key)!==void 0).map(Ne=>ht(Ne,ee.key)).filter(Ne=>Ne!==void 0)}getElements(){return xn(this.node,this.featureFlagsApi)}constructor(ee,Re){this.node=ee,this.featureFlagsApi=Re}}function Pn(ge,ee,Re=[]){const Ne=te(Ye),et=new bn(ge,Ne);return(0,W.useMemo)(()=>ee(et),[ge,...Re])}class kn{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Re;return(Re=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Re!==void 0?Re:[]}get routes(){var ee;return(ee=this.config.routes)!==null&&ee!==void 0?ee:{}}get externalRoutes(){var ee;return(ee=this.config.externalRoutes)!==null&&ee!==void 0?ee:{}}provide(ee){return ee.expose(this)}__experimentalReconfigure(ee){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ee))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ee;return(ee=this.options)!==null&&ee!==void 0?ee:{}}toString(){return`plugin{${this.config.id}}`}constructor(ee){this.config=ee,this.options=void 0}}function Sn(ge){return new kn(ge)}},23054:function(Rt,ze,t){"use strict";t.d(ze,{SP:function(){return _},dR:function(){return X},VL:function(){return le},BD:function(){return r}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const L=T;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function r(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const L=T;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(24852);function Z(T,L){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return L!=null&&L.includeStack||delete A.stack,A}function g(T){const L=(0,W.deserializeError)(T);return T.stack||(L.stack=void 0),L}function b(T){if(h(T)){const L=String(T);return L!=="[object Object]"?L:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class c extends Error{constructor(L,N){var A;let S=L;if(N!==void 0){const q=b(N);S?S+=`; caused by ${q}`:S=`caused by ${q}`}super(S),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(N)?N:void 0}}class P extends null{}class te extends null{}class Q extends null{}class X extends c{}class z extends null{}class M extends null{}class _ extends c{constructor(L,N){super(L,N),this.name=h(N)?N.name:"Error"}}async function fe(T){try{const N=await T.text();if(N){var L;if(!((L=T.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const A=JSON.parse(N);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${N}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class le extends Error{static async fromResponse(L){const N=await fe(L),A=N.response.statusCode||L.status,S=N.error.name||L.statusText,q=`Request failed with ${A} ${S}`,Le=g(N.error);return new le({message:q,response:L,data:N,cause:Le})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(Rt,ze,t){"use strict";t.d(ze,{nW:function(){return le},ae:function(){return X},q3:function(){return z}});var h=t(25248);const r=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class Z{async getCredentials(L){const N=new URL(L.url),A=_class_private_field_get(this,W).find(S=>S.isUrlSupported(N));if(!A)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return A.getCredentials(L)}constructor(L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,L)}}var g=new WeakMap,b=new WeakMap,c=new WeakMap,P=new WeakMap;class te{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:L,gitlab:N,azure:A,bitbucket:S})=>te.merge(te.forGithub(L),te.forGitlab(N),te.forAzure(A),te.forBitbucket(S))})}static forAuthApi(L,N){return new te("generic",L,N.host,N.scopeMapping)}static forGithub(L,N){var A;const S=(A=N==null?void 0:N.host)!==null&&A!==void 0?A:"github.com";return new te("github",L,S,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,N){var A;const S=(A=N==null?void 0:N.host)!==null&&A!==void 0?A:"gitlab.com";return new te("gitlab",L,S,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,N){var A;const S=(A=N==null?void 0:N.host)!==null&&A!==void 0?A:"dev.azure.com";return new te("azure",L,S,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,N){var A;const S=(A=N==null?void 0:N.host)!==null&&A!==void 0?A:"bitbucket.org";return new te("bitbucket",L,S,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new Z(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(L){var N;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,P)==="generic")return[];var A;return(A=(N=L.customScopes)===null||N===void 0?void 0:N[_class_private_field_get(this,P)])!==null&&A!==void 0?A:[]}async getCredentials(L){const{url:N,additionalScope:A,...S}=L,q=_class_private_field_get(this,c).default.slice();A!=null&&A.repoWrite&&q.push(..._class_private_field_get(this,c).repoWrite);const Le=this.getAdditionalScopesForProvider(A);Le.length&&q.push(...Le);const Xe=[...new Set(q)],Qe=await _class_private_field_get(this,g).getAccessToken(Xe,S);return{token:Qe,headers:{Authorization:`Bearer ${Qe}`}}}constructor(L,N,A,S){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,g,N),_class_private_field_set(this,b,A),_class_private_field_set(this,c,S),_class_private_field_set(this,P,L)}}var Q=t(79158);class X{static fromConfig(L){return Q.Lx.fromConfig(L)}}const z=(0,h.T0)({id:"integration.scmintegrations"});var M=t(52322),_=t(73250),fe=t(2784);const le=T=>{const{type:L}=T,N=(0,h.qD)(),A=_.Z;var S;const q=L&&(S=N.getSystemIcon(L))!==null&&S!==void 0?S:A;return(0,M.jsx)(q,{})}},79158:function(Rt,ze,t){"use strict";t.d(ze,{Lx:function(){return dr},BT:function(){return at}});var h=t(82717),r=t.n(h),W=t(76635);function Z(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function g(w){try{return new URL(w),!0}catch{return!1}}function b(w,u){return{list(){return w},byUrl(x){try{const E=typeof x=="string"?new URL(x):x;return w.find(J=>u(J)===E.host)}catch{return}},byHost(x){return w.find(E=>u(E)===x)}}}function c(w){const{url:u,base:x,lineNumber:E}=w;try{return new URL(u),u}catch{}let J;if(u.startsWith("/")){const{filepath:ve}=r()(x);J=new URL(x);const ye=(0,W.trimEnd)(J.pathname.substring(0,J.pathname.length-ve.length),"/");J.pathname=`${ye}${u}`}else J=new URL(u,x);return J.search=new URL(x).search,E&&(J.hash=`L${E}`),J.toString()}const P="amazonaws.com";function te(w){const u=w.getOptionalString("endpoint");var x;const E=(x=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let J,ve;if(u){try{const Gt=new URL(u);J=Gt.host,ve=Gt.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else J=P;const ye=w.getOptionalString("accessKeyId"),De=w.getOptionalString("secretAccessKey"),Je=w.getOptionalString("roleArn"),Ft=w.getOptionalString("externalId");return{host:J,endpoint:u,s3ForcePathStyle:E,accessKeyId:ye,secretAccessKey:De,roleArn:Je,externalId:Ft}}function Q(w){const u=w.map(te);return u.some(x=>x.host===P)||u.push({host:P}),u}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}X.factory=({config:w})=>{var u;const x=Q((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new X(E)),E=>E.config.host)};var z=t(90383),M=t(22504),_=t(69866);const fe="GB";var le=new WeakMap,T=new WeakMap,L=new WeakMap,N=new WeakMap,A=new WeakMap,S=new WeakMap,q=new WeakMap;class Le{static fromRepoUrl(u){const x=new URL(u);let E,J,ve;const ye=x.pathname.split("/").map(Bn=>decodeURIComponent(Bn));if(ye[2]==="_git"?(E=ye[1],J=ve=ye[3]):ye[3]==="_git"?(E=ye[1],J=ye[2],ve=ye[4]):ye[4]==="_git"&&(E=`${ye[1]}/${ye[2]}`,J=ye[3],ve=ye[5]),!E||!J||!ve)throw new Error("Azure URL must point to a git repository");var De;const Je=(De=x.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Ft;const Gt=x.searchParams.get("version");if(Gt){if(Gt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ft=Gt.slice(2)}return new Le(x.origin,E,J,ve,Je,Ft)}toRepoUrl(){let u;return(0,z.Z)(this,L)===(0,z.Z)(this,N)?u=(0,z.Z)(this,q).call(this,(0,z.Z)(this,T),"_git",(0,z.Z)(this,N)):u=(0,z.Z)(this,q).call(this,(0,z.Z)(this,T),(0,z.Z)(this,L),"_git",(0,z.Z)(this,N)),(0,z.Z)(this,A)&&u.searchParams.set("path",(0,z.Z)(this,A)),(0,z.Z)(this,S)&&u.searchParams.set("version",fe+(0,z.Z)(this,S)),u.toString()}toFileUrl(){if(!(0,z.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,z.Z)(this,q).call(this,(0,z.Z)(this,T),(0,z.Z)(this,L),"_apis","git","repositories",(0,z.Z)(this,N),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,z.Z)(this,A)),(0,z.Z)(this,S)&&u.searchParams.set("version",(0,z.Z)(this,S)),u.toString()}toArchiveUrl(){const u=(0,z.Z)(this,q).call(this,(0,z.Z)(this,T),(0,z.Z)(this,L),"_apis","git","repositories",(0,z.Z)(this,N),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,z.Z)(this,A)&&u.searchParams.set("scopePath",(0,z.Z)(this,A)),(0,z.Z)(this,S)&&u.searchParams.set("version",(0,z.Z)(this,S)),u.toString()}toCommitsUrl(){const u=(0,z.Z)(this,q).call(this,(0,z.Z)(this,T),(0,z.Z)(this,L),"_apis","git","repositories",(0,z.Z)(this,N),"commits");return u.searchParams.set("api-version","6.0"),(0,z.Z)(this,S)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,z.Z)(this,S)),u.toString()}getOwner(){return(0,z.Z)(this,T)}getProject(){return(0,z.Z)(this,L)}getRepo(){return(0,z.Z)(this,N)}getPath(){return(0,z.Z)(this,A)}getRef(){return(0,z.Z)(this,S)}constructor(u,x,E,J,ve,ye){(0,M.Z)(this,le,{writable:!0,value:void 0}),(0,M.Z)(this,T,{writable:!0,value:void 0}),(0,M.Z)(this,L,{writable:!0,value:void 0}),(0,M.Z)(this,N,{writable:!0,value:void 0}),(0,M.Z)(this,A,{writable:!0,value:void 0}),(0,M.Z)(this,S,{writable:!0,value:void 0}),(0,M.Z)(this,q,{writable:!0,value:(...De)=>{const Je=new URL((0,z.Z)(this,le));return Je.pathname=De.map(Ft=>encodeURIComponent(Ft)).join("/"),Je}}),(0,_.Z)(this,le,u),(0,_.Z)(this,T,x),(0,_.Z)(this,L,E),(0,_.Z)(this,N,J),(0,_.Z)(this,A,ve),(0,_.Z)(this,S,ye)}}const Xe="dev.azure.com";function Qe(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Xe,E=w.getOptionalString("token");if(!Z(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:E}}function qe(w){const u=w.map(Qe);return u.some(x=>x.host===Xe)||u.push({host:Xe}),u}class He{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E}=u;if(g(x))return x;try{const ve=Le.fromRepoUrl(E),ye=new URL(E);var J;const De=new URL(`https://a.com${(J=ve.getPath())!==null&&J!==void 0?J:""}`),Je=new URL(x,De).pathname;return ye.searchParams.set("path",Je),u.lineNumber&&(ye.searchParams.set("line",String(u.lineNumber)),ye.searchParams.set("lineEnd",String(u.lineNumber+1)),ye.searchParams.set("lineStartColumn","1"),ye.searchParams.set("lineEndColumn","1")),ye.toString()}catch{return new URL(x,E).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}He.factory=({config:w})=>{var u;const x=qe((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new He(E)),E=>E.config.host)};var mt=t(48834).lW;function Te(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Ye(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function st(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function vt(w,u){const x=u?{...u}:{};if(w.token){const E=mt.from(`:${w.token}`,"utf8");x.Authorization=`Basic ${E.toString("base64")}`}return{headers:x}}const rt="bitbucket.org",ot="https://api.bitbucket.org/2.0";function ct(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:rt;let E=w.getOptionalString("apiBaseUrl");const J=w.getOptionalString("token"),ve=w.getOptionalString("username"),ye=w.getOptionalString("appPassword");if(!Z(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return E?E=(0,W.trimEnd)(E,"/"):x===rt?E=ot:E=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:E,token:J,username:ve,appPassword:ye}}function St(w){const u=w.map(ct);return u.some(x=>x.host===rt)||u.push({host:rt,apiBaseUrl:ot}),u}class Lt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(!u.lineNumber)return x;const E=new URL(x);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${u.lineNumber}`:E.hash=`${u.lineNumber}`,E.toString()}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:w})=>{var u,x,E;const J=St((E=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return b(J.map(ve=>new Lt(ve)),ve=>ve.config.host)};var Ve=t(96279),oe=t(48834).lW;async function Pe(w,u){const{name:x,owner:E,resource:J}=parseGitUrl(w),ve=J==="bitbucket.org";let ye=ve?`${u.apiBaseUrl}/repositories/${E}/${x}`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,De=await fetch(ye,yt(u));if(De.status===404&&!ve&&(ye=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,De=await fetch(ye,yt(u))),!De.ok){const Ft=`Failed to retrieve default branch from ${ye}, ${De.status} ${De.statusText}`;throw new Error(Ft)}let Je;if(ve)Je=(await De.json()).mainbranch.name;else{const{displayId:Ft}=await De.json();Je=Ft}if(!Je)throw new Error(`Failed to read default branch from ${ye}. Response ${De.status} ${De.json()}`);return Je}async function ke(w,u){const{name:x,owner:E,ref:J,protocol:ve,resource:ye,filepath:De}=parseGitUrl(w),Je=ye==="bitbucket.org";let Ft=J;Ft||(Ft=await Pe(w,u));const Gt=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return Je?`${ve}://${ye}/${E}/${x}/get/${Ft}.tar.gz`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Ft}&prefix=${E}-${x}${Gt}`}function tt(w,u){try{const{owner:x,name:E,ref:J,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=ye.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${J}/${De}`}return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${De}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function yt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const x=oe.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const Zt="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Tt(w){const u=Zt,x=ht,E=w.getString("username"),J=w.getString("appPassword");return{host:u,apiBaseUrl:x,username:E,appPassword:J}}function It(w){const u=w.map(Tt);return u.length===0&&u.push({host:Zt,apiBaseUrl:ht}),u}class Ot{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=`lines-${u.lineNumber}`,E.toString()}return x}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}Ot.factory=({config:w})=>{var u;const x=It((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new Ot(E)),E=>E.config.host)};var en=t(48834).lW;async function Vt(w,u){const{name:x,owner:E}=parseGitUrl(w),J=`${u.apiBaseUrl}/repositories/${E}/${x}`,ve=await fetch(J,hn(u));if(!ve.ok){const Je=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const De=(await ve.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return De}async function Ht(w,u){const{name:x,owner:E,ref:J,protocol:ve,resource:ye}=parseGitUrl(w);let De=J;return De||(De=await Vt(w,u)),`${ve}://${ye}/${E}/${x}/get/${De}.tar.gz`}function Qt(w,u){try{const{owner:x,name:E,ref:J,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=ye.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${J}/${De}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function hn(w){const u={};if(w.username&&w.appPassword){const x=en.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function dn(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token"),J=w.getOptionalString("username"),ve=w.getOptionalString("password");if(!Z(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:E,username:J,password:ve}}function Fn(w){return w.map(dn)}class In{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=u.lineNumber.toString(),E.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}In.factory=({config:w})=>{var u;const x=Fn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new In(E)),E=>E.config.host)};var Un=t(48834).lW;async function yn(w,u){const{name:x,owner:E}=parseGitUrl(w);let J=`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,ve=await fetch(J,Mn(u));if(ve.status===404&&(J=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,ve=await fetch(J,Mn(u))),!ve.ok){const Je=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const{displayId:ye}=await ve.json(),De=ye;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return De}async function pn(w,u){const{name:x,owner:E,ref:J,filepath:ve}=parseGitUrl(w);let ye=J;ye||(ye=await yn(w,u));const De=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${ye}&prefix=${E}-${x}${De}`}function Xt(w,u){try{const{owner:x,name:E,ref:J,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=ye.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${De}?at=${J}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function Mn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const x=Un.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function zn(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl"),E=w.getOptionalString("cloneUrl"),J=w.getOptionalString("gitilesBaseUrl");const ve=w.getOptionalString("username"),ye=w.getOptionalString("password");if(Z(u)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(J&&!g(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,J?J=(0,W.trimEnd)(J,"/"):J=`https://${u}`,E?E=(0,W.trimEnd)(E,"/"):E=x,{host:u,baseUrl:x,cloneUrl:E,gitilesBaseUrl:J,username:ve,password:ye}}function fn(w){return w.map(zn)}var xn=t(48834).lW;const bn=")]}'";function Pn(w,u){const E=u.replace(w.gitilesBaseUrl,"").split("/").filter(Ft=>!!Ft),J=E.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${u}`);const ve=(0,W.trimStart)(E.slice(0,J).join("/"),"/"),ye=E.indexOf("heads");if(ye<=0)throw new Error(`Unable to parse branch from url: ${u}`);const De=E[ye+1],Je=E.slice(ye+2).join("/");return{branch:De,filePath:Je===""?"/":Je,project:ve}}function kn(w,u,x,E){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,W.trimStart)(E,"/")}`}function Sn(w){return w.password?"/a/":"/"}function ge(w,u){const{branch:x,project:E}=Pn(w,u);return`${w.baseUrl}${Sn(w)}projects/${encodeURIComponent(E)}/branches/${x}`}function ee(w,u){const{project:x}=Pn(w,u);return`${w.cloneUrl}${Sn(w)}${x}`}function Re(w,u){const{branch:x,filePath:E,project:J}=Pn(w,u);return`${w.baseUrl}${Sn(w)}projects/${encodeURIComponent(J)}/branches/${x}/files/${encodeURIComponent(E)}/content`}function Ne(w){return`${w.baseUrl}${Sn(w)}projects/`}function et(w){const u={};if(!w.password)return u;const x=xn.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function jt(w){const u=await w.text();if(u.startsWith(bn))try{return JSON.parse(u.slice(bn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class ie{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E,lineNumber:J}=u;let ve;if(x.startsWith("/")){const{branch:ye,project:De}=Pn(this.config,E);return kn(this.config,De,ye,x)}return x?ve=new URL(x,E):ve=new URL(E),J&&(ve.hash=J.toString()),ve.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}ie.factory=({config:w})=>{var u;const x=fn((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new ie(E)),E=>E.config.host)};function k(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl");const E=w.getOptionalString("username"),J=w.getOptionalString("password");if(!Z(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,{host:u,baseUrl:x,username:E,password:J}}var ce=t(48834).lW;function Be(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[J,ve,ye,De,Je,Ft,...Gt]=u.replace(E,"").split("/"),Bn=Gt.join("/").replace(/^\//,"");return`${E}/${ve}/${ye}/_edit/${Ft}/${Bn}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function D(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[J,ve,ye,De,Je,Ft,...Gt]=u.replace(E,"").split("/"),Bn=Gt.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ve}/${ye}/contents/${Bn}?ref=${Ft}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function U(w){const u={},{username:x,password:E}=w;return E?(x?u.Authorization=`basic ${ce.from(`${x}:${E}`).toString("base64")}`:u.Authorization=`token ${E}`,{headers:u}):u}class de{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return c(u)}resolveEditUrl(u){return Be(this.config,u)}constructor(u){this.config=u}}de.factory=({config:w})=>{var u;const E=((u=w.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(J=>k(J));return b(E.map(J=>new de(J)),J=>J.config.host)};const pe="github.com",be="https://api.github.com",$e="https://raw.githubusercontent.com";function Ee(w){var u,x;const E=(x=w.getOptionalString("host"))!==null&&x!==void 0?x:pe;let J=w.getOptionalString("apiBaseUrl"),ve=w.getOptionalString("rawBaseUrl");const ye=w.getOptionalString("token"),De=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Je=>({appId:Je.getNumber("appId"),clientId:Je.getString("clientId"),clientSecret:Je.getString("clientSecret"),webhookSecret:Je.getString("webhookSecret"),privateKey:Je.getString("privateKey"),allowedInstallationOwners:Je.getOptionalStringArray("allowedInstallationOwners")}));if(!Z(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return J?J=(0,W.trimEnd)(J,"/"):E===pe&&(J=be),ve?ve=(0,W.trimEnd)(ve,"/"):E===pe&&(ve=$e),{host:E,apiBaseUrl:J,rawBaseUrl:ve,token:ye,apps:De}}function Ue(w){const u=w.map(Ee);return u.some(x=>x.host===pe)||u.push({host:pe,apiBaseUrl:be,rawBaseUrl:$e}),u}function nt(w,u,x){try{const{owner:E,name:J,ref:ve,filepathtype:ye,filepath:De}=parseGitUrl(w);if(!E||!J||!ve||ye!=="blob"&&ye!=="raw"&&ye!=="tree")throw new Error("Invalid GitHub URL or file path");const Je=De.replace(/^\//,"");return H(u,x)==="api"?`${u.apiBaseUrl}/repos/${E}/${J}/contents/${Je}?ref=${ve}`:`${u.rawBaseUrl}/${E}/${J}/${ve}/${Je}`}catch(E){throw new Error(`Incorrect URL: ${w}, ${E}`)}}function C(w,u){const x={};return H(w,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function H(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var me=t(42822),ue=t(89393),Ce=t(26228);class Oe{async getOrCreateToken(u,x,E){let J=this.tokenCache.get(u);if((!J||this.isExpired(J.expiresAt))&&(J=await E(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(u,J)),!this.appliesToRepo(J,x))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${x}`);return{accessToken:J.token}}appliesToRepo(u,x){return x===void 0?!0:u.repositories!==void 0?u.repositories.includes(x):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>Ce.ou.local()>u}}const Fe={Accept:"application/vnd.github.machine-man-preview+json"};class dt{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:J,suspended:ve}=await this.getInstallationData(u);if(ve)throw new Error(`The GitHub application for ${u} is suspended`);const ye=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:Fe});let De;if(ye.data.repository_selection==="selected"){const Ft=new ue.v({baseUrl:this.baseUrl,auth:ye.data.token}),Gt=await Ft.paginate(Ft.apps.listReposAccessibleToInstallation);var Je;De=((Je=Gt.repositories)!==null&&Je!==void 0?Je:Gt).map(ur=>ur.name)}return{token:ye.data.token,expiresAt:Ce.ou.fromISO(ye.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const E=(await this.getInstallations()).find(ve=>{var ye,De;return((ye=ve.account)===null||ye===void 0||(De=ye.login)===null||De===void 0?void 0:De.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const J=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(u,x){this.cache=new Oe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new ue.v({baseUrl:x,headers:Fe,authStrategy:me.i,auth:this.baseAuthConfig})}}class Et{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(u,x){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(u,x).then(Je=>({credentials:Je,error:void 0}),Je=>({credentials:void 0,error:Je})))),J=E.find(De=>De.credentials);if(J)return J.credentials.accessToken;const ye=E.map(De=>De.error).find(De=>De.name!=="NotFoundError");if(ye)throw ye}constructor(u){var x,E;this.apps=(E=(x=u.apps)===null||x===void 0?void 0:x.map(J=>new dt(J,u.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class it{async getCredentials(u){const x=r()(u.url),E=x.owner||x.name,J=x.owner?x.name:void 0;let ve="app",ye=await this.githubAppCredentialsMux.getAppToken(E,J);return ye||(ve="token",ye=this.token),{headers:ye?{Authorization:`Bearer ${ye}`}:void 0,token:ye,type:ve}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}it.create=w=>new it(new Et(w),w.token);class ft{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);x.set(E.config.host,J)}),new ft(x)}async getCredentials(u){const x=new URL(u.url),E=this.providers.get(x.host);if(!E)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return E.getCredentials(u)}constructor(u){this.providers=u}}class xt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return at(c(u),"tree")}resolveEditUrl(u){return at(u,"edit")}constructor(u){this.integrationConfig=u}}xt.factory=({config:w})=>{var u;const x=Ue((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new xt(E)),E=>E.config.host)};function at(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,E,J,ve)=>`//${E}/${J}/${ve}/${u}/`)}const Bt=null;class Mt extends xt{get config(){return super.config}constructor(u){super(u)}}Mt.factory=xt.factory;const zt=null,qt=null,Wn=null,Cn="gitlab.com",Dt="https://gitlab.com/api/v4";function Nt(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token");let J=w.getOptionalString("baseUrl");if(x?x=(0,W.trimEnd)(x,"/"):u===Cn&&(x=Dt),J?J=(0,W.trimEnd)(J,"/"):J=`https://${u}`,Z(u)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!g(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:E,apiBaseUrl:x,baseUrl:J}}function rn(w){const u=w.map(Nt);return u.some(x=>x.host===Cn)||u.push({host:Cn,apiBaseUrl:Dt,baseUrl:`https://${Cn}`}),u}function On(w){let u="";return w.host!==Cn&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function Qn(w,u){const x=await Gn(w,u);return jn(w,x,u).toString()}function wn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function jn(w,u,x){try{const E=new URL(w),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...ye]=J.split("/"),De=getGitLabIntegrationRelativePath(x);return E.pathname=[...De?[De]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(ye.join("/"))),"raw"].join("/"),E.search=`?ref=${ve}`,E}catch(E){throw new Error(`Incorrect url: ${w}, ${E}`)}}async function Gn(w,u){const x=new URL(w);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(u);J&&(E=E.replace(J,""));const ve=new URL(`${x.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),ye=await fetch(ve.toString(),wn(u)),De=await ye.json();if(!ye.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${w}, ${E}`)}}class gn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return Rn(u,"edit")}constructor(u){this.integrationConfig=u}}gn.factory=({config:w})=>{var u;const x=rn((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new gn(E)),E=>E.config.host)};function Rn(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class dr{static fromConfig(u){return new dr({awsS3:X.factory({config:u}),azure:He.factory({config:u}),bitbucket:Lt.factory({config:u}),bitbucketCloud:Ot.factory({config:u}),bitbucketServer:In.factory({config:u}),gerrit:ie.factory({config:u}),github:xt.factory({config:u}),gitlab:gn.factory({config:u}),gitea:de.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(E=>E.byUrl(u)).filter(Boolean);if(x.length>1){const E=x.filter(J=>!(J instanceof Lt));E.length!==0&&(x=E)}return x[0]}byHost(u){return Object.values(this.byType).map(x=>x.byHost(u)).find(Boolean)}resolveUrl(u){const x=this.byUrl(u.base);return x?x.resolveUrl(u):c(u)}resolveEditUrl(u){const x=this.byUrl(u);return x?x.resolveEditUrl(u):u}constructor(u){this.byType=u}}},51102:function(Rt,ze,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return S.s4}});var r=t(52322),W=t(2784),Z=t(28316),g=t(79635),b=t(25248);const c=(0,b.T0)({id:"plugin.techdocs.storageservice"}),P=(0,b.T0)({id:"plugin.techdocs.service"});var te=t(92077),Q=t(95481),X=t(7476),z=t(93225),M=t(67896),_=t(65124),fe=t(17339),le=t(85478),T=t(68435),L=t(3482),N=t(42081),A=t(48431),S=t(89258),q=t(52943),Le=t(61886),Xe=t(13980),Qe=t.n(Xe);class qe{get(n){for(const o of this.holders){const l=o.get(n);if(l)return l}}constructor(...n){this.holders=n}}var He=t(51837);const mt=(0,He.CT)("api-context"),Te=i=>{var n;const{apis:o,children:l}=i,f=(n=(0,W.useContext)(mt))===null||n===void 0?void 0:n.atVersion(1),R=f?new qe(o,f):o;return(0,r.jsx)(mt.Provider,{value:(0,He.EI)({1:R}),children:l})};Te.propTypes={apis:Qe().shape({get:Qe().func.isRequired}).isRequired,children:Qe().node};class Ye{static validateFactories(n,o){for(const l of o){const f=[l],R=new Set;for(;f.length;){const B=f.shift(),V=n.get(B);if(!!V)for(const re of Object.values(V.deps)){if(re.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);R.has(re)||(R.add(re),f.push(re))}}}}get(n){return this.load(n)}load(n,o=[]){const l=this.apis.get(n.id);if(l)return l;const f=this.factories.get(n);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const R=this.loadDeps(n,f.deps,[...o,f.api]),B=f.factory(R);return this.apis.set(n.id,B),B}loadDeps(n,o,l){const f={};for(const R in o)if(o.hasOwnProperty(R)){const B=o[R],V=this.load(B,l);if(!V)throw new Error(`No API factory available for dependency ${B} of dependent ${n}`);f[R]=V}return f}constructor(n){this.factories=n,this.apis=new Map}}var st;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(st||(st={}));class vt{register(n,o){const l=st[n],f=this.factories.get(o.api.id);return f&&f.priority>=l?!1:(this.factories.set(o.api.id,{priority:l,factory:o}),!0)}get(n){const o=this.factories.get(n.id);if(!!o)return o.factory}getAllApis(){const n=new Set;for(const{factory:o}of this.factories.values())n.add(o.api);return n}constructor(){this.factories=new Map}}function rt(i){return new Promise((n,o)=>{const l=i.width||500,f=i.height||700,R=window.screen.width/2-l/2,B=window.screen.height/2-f/2,V=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${B},left=${R}`);let re="";if(!V||typeof V.closed=="undefined"||V.closed){const lt=new Error("Failed to open auth popup.");lt.name="PopupRejectedError",o(lt);return}const We=lt=>{if(lt.source!==V||lt.origin!==i.origin)return;const{data:bt}=lt;if(bt.type==="config_info"){re=bt.targetOrigin;return}if(bt.type!=="authorization_response")return;const wt=bt;if("error"in wt){const $t=new Error(wt.error.message);$t.name=wt.error.name,o($t)}else n(wt.response);pt()},Ze=setInterval(()=>{if(V.closed){const lt=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,bt=new Error(lt);bt.name="PopupClosedError",o(bt),pt()}},100);function pt(){window.removeEventListener("message",We),clearInterval(Ze)}window.addEventListener("message",We)})}function ot(i){return[...i].join(" ")}class ct{async createSession(n){return n.instantPopup?this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(l=>{throw new Error(`Auth refresh request failed, ${l}`)});if(!n.ok){const l=new Error(`Auth refresh request failed, ${n.statusText}`);throw l.status=n.status,l}const o=await n.json();if(o.error){const l=new Error(o.error.message);throw o.error.name&&(l.name=o.error.name),l}return await this.sessionTransform(o)}async removeSession(){const n=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(!n.ok){const o=new Error(`Logout request failed, ${n.statusText}`);throw o.status=n.status,o}}async showPopup(n){const o=this.joinScopesFunc(n),l=await this.buildUrl("/start",{scope:o,origin:window.location.origin}),f=await rt({url:l,name:`${this.provider.title} Login`,origin:new URL(l).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(n,o){const l=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${l}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const o=Object.entries(n).map(([l,f])=>{if(typeof f=="string")return`${encodeURIComponent(l)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(l)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(n){const{discoveryApi:o,environment:l,provider:f,joinScopes:R=ot,oauthRequestApi:B,sessionTransform:V=re=>re}=n;this.authRequester=B.createAuthRequester({provider:f,onAuthRequest:re=>this.showPopup(re)}),this.discoveryApi=o,this.environment=l,this.provider=f,this.joinScopesFunc=R,this.sessionTransform=V}}function St(i,n){for(const o of n)if(!i.has(o))return!1;return!0}class Lt{sessionExistsAndHasScope(n,o){if(!n)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return St(l,o)}getExtendedScope(n,o){const l=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const R of f)l.add(R)}if(o)for(const f of o)l.add(f);return l}constructor(n){this.options=n}}var Ve=t(82394),oe=t.n(Ve);let Pe=Symbol.observable;class ke{[Pe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(oe())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)})),this.subscribers=new Set}}let tt=Symbol.observable;class yt{[tt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(n){this.subscribers=new Set,this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(oe())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Zt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new yt(b.sM.SignedOut),this.signedIn=!1}}class ht{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const l=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),R=this.sessionScopesFunc(l);return St(R,f)&&(this.currentSession=l),l}catch(l){if(n.optional)return;throw l}}if(!this.currentSession&&!n.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){this.stateTracker=new Zt;const{connector:o,defaultScopes:l=new Set,sessionScopes:f,sessionShouldRefresh:R}=n;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=R,this.helper=new Lt({sessionScopes:f,defaultScopes:l})}}class Tt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:l=new Set,sessionScopes:f}=n;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:l})}}const It={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ot{static create(n){const{discoveryApi:o,environment:l="development",provider:f=It,oauthRequestApi:R,defaultScopes:B=[],scopeTransform:V=Ze=>Ze}=n,re=new ct({discoveryApi:o,environment:l,provider:f,oauthRequestApi:R,sessionTransform(Ze){return{...Ze,providerInfo:{idToken:Ze.providerInfo.idToken,accessToken:Ze.providerInfo.accessToken,scopes:Ot.normalizeScopes(V,Ze.providerInfo.scope),expiresAt:new Date(Date.now()+Ze.providerInfo.expiresInSeconds*1e3)}}}}),We=new ht({connector:re,defaultScopes:new Set(B),sessionScopes:Ze=>Ze.providerInfo.scopes,sessionShouldRefresh:Ze=>(Ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Ot({sessionManager:We,scopeTransform:V})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,o){const l=Ot.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...o,scopes:l});var R;return(R=f==null?void 0:f.providerInfo.accessToken)!==null&&R!==void 0?R:""}async getIdToken(n={}){const o=await this.sessionManager.getSession(n);var l;return(l=o==null?void 0:o.providerInfo.idToken)!==null&&l!==void 0?l:""}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}static normalizeScopes(n,o){if(!o)return new Set;const l=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(n(l))}constructor(n){this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class Vt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=en,oauthRequestApi:R,defaultScopes:B=["read:user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:B})}}const Ht={id:"gitlab",title:"GitLab",icon:()=>null};class Qt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ht,oauthRequestApi:R,defaultScopes:B=["read_user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:B})}}const hn={id:"google",title:"Google",icon:()=>null},dn="https://www.googleapis.com/auth/";class Fn{static create(n){const{discoveryApi:o,oauthRequestApi:l,environment:f="development",provider:R=hn,defaultScopes:B=["openid",`${dn}userinfo.email`,`${dn}userinfo.profile`]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:l,provider:R,environment:f,defaultScopes:B,scopeTransform(V){return V.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${dn}userinfo.${re}`:re.startsWith(dn)?re:`${dn}${re}`)}})}}const In={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),yn="okta.";class pn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=In,oauthRequestApi:R,defaultScopes:B=["openid","email","profile","offline_access"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:B,scopeTransform(V){return V.map(re=>Un.has(re)||re.startsWith(yn)?re:`${yn}${re}`)}})}}var Xt=t(30195);const Mn=Xt.z.object({profile:Xt.z.object({email:Xt.z.string().optional(),displayName:Xt.z.string().optional(),picture:Xt.z.string().optional()}),backstageIdentity:Xt.z.object({token:Xt.z.string(),identity:Xt.z.object({type:Xt.z.literal("user"),userEntityRef:Xt.z.string(),ownershipEntityRefs:Xt.z.array(Xt.z.string())})})}),zn={id:"saml",title:"SAML",icon:()=>null};class fn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=zn}=n,R=new DirectAuthConnector({discoveryApi:o,environment:l,provider:f}),B=new StaticAuthSessionManager({connector:R}),V=new AuthSessionStore({manager:B,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new fn(V)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}constructor(n){this.sessionManager=n}}const xn={id:"microsoft",title:"Microsoft",icon:()=>null};class bn{static create(n){const{environment:o="development",provider:l=xn,oauthRequestApi:f,discoveryApi:R,defaultScopes:B=["openid","offline_access","profile","email","User.Read"]}=n;return Ot.create({discoveryApi:R,oauthRequestApi:f,provider:l,environment:o,defaultScopes:B})}}const Pn={id:"onelogin",title:"onelogin",icon:()=>null},kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Sn="onelogin.";class ge{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Pn,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(B){return B.map(V=>kn.has(V)||V.startsWith(Sn)?V:`${Sn}${V}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Re{static create(n){const{discoveryApi:o,environment:l="development",provider:f=ee,oauthRequestApi:R,defaultScopes:B=["team"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:B})}}const Ne={id:"atlassian",title:"Atlassian",icon:()=>null};class et{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ne,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l})}}class jt{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new ke}}class ie{captureEvent(n){}}const k="theme";class ce{static createWithStorage(n){const o=new ce(n);if(!window.localStorage)return o;var l;const f=(l=window.localStorage.getItem(k))!==null&&l!==void 0?l:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(R=>{R?window.localStorage.setItem(k,R):window.localStorage.removeItem(k)}),window.addEventListener("storage",R=>{if(R.key===k){var B;const V=(B=localStorage.getItem(k))!==null&&B!==void 0?B:void 0;o.setActiveThemeId(V)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){this.themes=n,this.subject=new yt(void 0)}}var Be=t(9850),D=t.n(Be),U=t(12782),de=t.n(U);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function $e(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const Ee={type(i,n,o,l){return`Invalid type in config for key '${i}' in '${n}', got ${o}, wanted ${l}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,o){return`Unable to convert config value for key '${i}' in '${n}' to a ${o}`}};class Ue{static fromConfigs(n){return n.length===0?new Ue(void 0):n.reduce((o,{data:l,context:f,filteredKeys:R,deprecatedKeys:B})=>{const V=new Ue(l,f,o);if(V.filteredKeys=R,B)for(const{key:re,description:We}of B)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${We||""}`);return V},void 0)}has(n){var o;if(this.readValue(n)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const o=this.data?Object.keys(this.data):[];var l;const f=(l=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&l!==void 0?l:[];return[...new Set([...o,...f])]}get(n){const o=this.getOptional(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n!=null?n:"")));return o}getOptional(n){var o;const l=D()(this.readValue(n)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(n);if(l===void 0){if(!1)var R;return f}else if(f===void 0)return l;return de()({},{value:f},{value:l},(B,V)=>!be(V)||!be(B)?V:void 0).value}getConfig(n){const o=this.getOptionalConfig(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalConfig(n){var o;const l=this.readValue(n),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(n);if(be(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(Ee.type(this.fullKey(n),this.context,$e(l),"object"));return f}getConfigArray(n){const o=this.getOptionalConfigArray(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalConfigArray(n){const o=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[R,B]of f.entries())if(!be(B))return{expected:"object-array",value:B,key:`${n}[${R}]`};return!0});if(!o){if(!1)var l;return}return o.map((f,R)=>this.copy(f,`${n}[${R}]`))}getNumber(n){const o=this.getOptionalNumber(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalNumber(n){const o=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const l=Number(o);if(!Number.isFinite(l))throw new Error(Ee.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const o=this.getOptionalBoolean(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalBoolean(n){const o=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const l=String(o).trim();if(/^(?:y|yes|true|1|on)$/i.test(l))return!0;if(/^(?:n|no|false|0|off)$/i.test(l))return!1;throw new Error(Ee.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const o=this.getOptionalString(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalString(n){return this.readConfigValue(n,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(n){const o=this.getOptionalStringArray(n);if(o===void 0)throw new Error(Ee.missing(this.fullKey(n)));return o}getOptionalStringArray(n){return this.readConfigValue(n,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[l,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${l}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,o,l){const f=new Ue(n,this.context,l,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,o){const l=this.readValue(n);if(l===void 0){var f;if(!1)var R;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,o)}const B=o(l);if(B!==!0){const{key:V=n,value:re=l,expected:We}=B;throw new TypeError(Ee.type(this.fullKey(V),this.context,$e(re),We))}return l}readValue(n){const o=n?n.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,R]of o.entries())if(be(l))l=l[R];else if(l!==void 0){const B=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Ee.type(B,this.context,$e(l),"object"))}return l}constructor(n,o="mock-config",l,f=""){this.data=n,this.context=o,this.fallback=l,this.prefix=f,this.notifiedFilteredKeys=new Set}}const nt="Invalid discovery URL pattern,";class C{static compile(n){const o=n.split(/\{\{\s*pluginId\s*\}\}/),l=o.join("pluginId");let f;try{f=new URL(l)}catch{throw new Error(`${nt} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${nt} URL must not have a hash`);if(f.search)throw new Error(`${nt} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${nt} URL must not end with a slash`);return new C(o)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class H{post(n,o){return o!=null&&o.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,o)}error$(){return this.errorApi.error$()}constructor(n,o){this.alertApi=n,this.errorApi=o}}class me{post(n,o){this.subject.next({error:n,context:o})}error$(){return this.subject}constructor(){this.subject=new ke}}class ue{static forward(n,o){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,o)})}}function Ce(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(n){Ce(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===b.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[l,f]of Object.entries(n.states))this.flags.set(l,f);const o=Array.from(this.flags.entries()).filter(([,l])=>l===b.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const o=JSON.parse(n);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const l=Object.entries(o).filter(([f,R])=>(Ce(f),R===b.CL.Active));return new Map(l)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Fe(i){let n=i.baseImplementation||t.g.fetch;var o;const l=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class dt{static create(n){var o,l;const f=Et(n),R=((o=n.header)===null||o===void 0?void 0:o.name)||"authorization",B=((l=n.header)===null||l===void 0?void 0:l.value)||(V=>`Bearer ${V}`);return new dt(n.identityApi,f,R,B)}apply(n){return async(o,l)=>{const f=new Request(o,l),{token:R}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof R!="string"||!R||!this.allowUrl(f.url)?n(o,l):(f.headers.set(this.headerName,this.headerValue(R)),n(f))}}constructor(n,o,l,f){this.identityApi=n,this.allowUrl=o,this.headerName=l,this.headerValue=f}}function Et(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?it(i.urlPrefixAllowlist):i.config?it([i.config.getString("backend.baseUrl")]):()=>!1}function it(i){const n=i.map(o=>o.replace(/\/$/,""));return o=>n.some(l=>o===l||o.startsWith(`${l}/`))}function ft(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class xt{apply(n){return async(o,l)=>{const f=new Request(o,l),R="plugin://";if(!f.url.startsWith(R))return n(o,l);const{hostname:B,pathname:V,search:re,hash:We,username:Ze,password:pt}=new URL(`http://${f.url.substring(R.length)}`);let lt=await this.discoveryApi.getBaseUrl(B);if(Ze||pt){const wt=new URL(lt),$t=`${Ze}${pt?`:${pt}`:""}@`;lt=`${wt.protocol}//${$t}${wt.host}${wt.pathname}`}const bt=`${ft(lt,V)}${re}${We}`;return n(bt,typeof o=="string"||at(o)?l:o)}}constructor(n){this.discoveryApi=n}}function at(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Bt{static resolvePluginProtocol(n){return new xt(n.discoveryApi)}static injectIdentityAuth(n){return dt.create(n)}constructor(){}}function Mt(i,n){for(const o of n)if(!i.has(o))return!1;return!0}function zt(i,...n){const o=new Set(i);for(const l of n)for(const f of l)o.add(f);return o}class qt{request(n){return new Promise((o,l)=>{this.requests.push({scopes:n,resolve:o,reject:l}),this.subject.next(this.getCurrentPending())})}resolve(n,o){this.requests=this.requests.filter(l=>Mt(n,l.scopes)?(l.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(o=>o.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,l)=>zt(o,l.scopes),this.requests[0].scopes);return{scopes:n,resolve:o=>{n&&this.resolve(n,o)},reject:o=>{n&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new yt(this.getCurrentPending())}}class Wn{createAuthRequester(n){const o=new qt,l=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const R=this.currentRequests.slice(),B=this.makeAuthRequest(f,n);B?R[l]=B:delete R[l],this.currentRequests=R,this.subject.next(R.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(n,o){const{scopes:l}=n;if(!!l)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(l);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new yt([]),this.currentRequests=[],this.handlerCount=0}}const Cn=new Map;class Dt{static create(n){var o;return new Dt((o=n.namespace)!==null&&o!==void 0?o:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of Cn.entries()){var o;!((o=n.key)===null||o===void 0)&&o.startsWith(l)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let o,l="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(o=JSON.parse(f,(R,B)=>(typeof B=="object"&&B!==null&&Object.freeze(B),B)),l="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:o,presence:l}}forBucket(n){const o=`${this.namespace}/${n}`;return Cn.has(o)||Cn.set(o,new Dt(o,this.errorApi)),Cn.get(o)}async set(n,o){localStorage.setItem(this.getKeyName(n),JSON.stringify(o)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Dt.hasSubscribed||(Dt.addStorageEventListener(),Dt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const o=n==null?void 0:n.slice(`${this.namespace}/`.length);o.includes("/")||this.notifyChanges(decodeURIComponent(o))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const o=this.snapshot(n);for(const l of this.subscribers)l.next(o)}constructor(n,o){this.namespace=n,this.errorApi=o,this.subscribers=new Set,this.observable=new(oe())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}Dt.hasSubscribed=!1;const Nt=(0,W.createContext)(void 0);function rn(){const[i]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var On=t(16060);const Qn=(i,n)=>{try{var o,l;const f=(0,On.fp)(n,{pathname:i}),R=(o=f==null?void 0:f.filter(V=>{var re;return((re=V==null?void 0:V.route.routeRefs)===null||re===void 0?void 0:re.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!R)return{};let B;return R.routeRefs.size===1&&(B=R.routeRefs.values().next().value),{extension:"App",pluginId:((l=R.plugin)===null||l===void 0?void 0:l.getId())||"root",...B?{routeRef:B.id}:{}}}catch{return{}}},wn=({pathname:i,search:n,hash:o})=>{const l=(0,b.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${i}${n}${o}`)},[l,i,n,o]),null},jn=({routeObjects:i})=>{const{pathname:n,search:o,hash:l}=(0,g.TH)();return(0,r.jsx)(b.fC,{attributes:Qn(n,i),children:(0,r.jsx)(wn,{pathname:n,search:o,hash:l})})};function Gn(i){return rn()?gn(i):""}function gn(i){var n;let{pathname:o}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Rn({component:i,appIdentityProxy:n,children:o}){const[l,f]=(0,W.useState)(),R=(0,b.h_)(b.Ds),B=Gn(R);return l?(n.setTarget(l,{signOutTargetUrl:B||"/"}),(0,r.jsx)(r.Fragment,{children:o})):(0,r.jsx)(i,{onSignInSuccess:f})}function dr(i){const{Router:n,SignInPage:o}=(0,b.qD)().getComponents(),l=(0,b.h_)(b.Ds),f=gn(l),R=`${f}/*`,B=(0,W.useContext)(Nt);if(!B)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:V,appIdentityProxy:re}=B;return o?rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(jn,{routeObjects:V}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:re,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(jn,{routeObjects:V}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:re,children:i.children})]}):(re.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:f||"/"}),rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(jn,{routeObjects:V}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(jn,{routeObjects:V}),i.children]}))}var w=t(90383),u=t(22504),x=t(69866),E=t(64279);function J(i){const n={};for(const l in i.collectors)i.collectors.hasOwnProperty(l)&&(n[l]=i.collectors[l]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:l,parent:f,contexts:R}=o.shift();W.Children.forEach(l,B=>{if(!(0,W.isValidElement)(B))return;const V={};for(const re in n)if(n.hasOwnProperty(re)){const We=n[re];V[re]=We.visit(We.accumulator,B,f,R[re])}for(const re of i.discoverers){const We=re(B);We&&o.push({node:We,parent:B,contexts:V})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function ve(i,n){return()=>({accumulator:i(),visit:n})}function ye(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function De(i){var n,o;if(((n=i.props)===null||n===void 0?void 0:n.path)&&((o=i.props)===null||o===void 0?void 0:o.element)){var l;return(l=i.props)===null||l===void 0?void 0:l.element}}const Je=ve(()=>new Set,(i,n)=>{const o=(0,b.IY)(n,"core.plugin");o&&i.add(o)}),Ft=i=>{const{children:n}=i,o=(0,b.h_)(b.W0),l="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,b.R5)(Ft,"core.featureFlagged",!0);const Gt={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Bn(i){const n=i;if(n!=null&&n.type){var o,l;return(l=(o=n.type.displayName)!==null&&o!==void 0?o:n.type.name)!==null&&l!==void 0?l:String(n.type)}return String(n)}function ur(i,n=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const l=(0,b.IY)(o,"core.mountPoint");if(l){const f=(0,b.IY)(o,"core.plugin");n.push({routeRef:l,plugin:f})}ur(o.props.children,n)}),n}const hs=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,R;if(l!=null&&l.isElementAncestor)return l;if((o==null?void 0:o.props.element)===n)return{...l,isElementAncestor:!0};const B=(f=n.props)===null||f===void 0?void 0:f.path,V=(0,b.IY)(n,"core.mountPoint");if(V&&B)throw new Error(`Path property may not be set directly on a routable extension "${Bn(n)}"`);var re;const We=(re=l==null||(R=l.obj)===null||R===void 0?void 0:R.children)!==null&&re!==void 0?re:i.objects;if(B!==void 0){if(typeof B!="string")throw new Error(`Element path must be a string at "${Bn(n)}"`);const bt=B.startsWith("/")?B.slice(1):B,wt=n.props.element;if((0,b.IY)(n,"core.gatherMountPoints")){var Ze;if(wt)throw new Error(`Mount point gatherers may not have an element prop "${Bn(n)}"`);const $t={path:bt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ze=n.props)===null||Ze===void 0?void 0:Ze.caseSensitive),children:[Gt],plugin:void 0};return We.push($t),{obj:$t,gatherPath:bt,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(wt){var pt;const[$t,...At]=ur(wt);if(At.length>0)throw new Error(`Route element with path "${B}" may not contain multiple routable extensions`);if(!$t)return l;const{routeRef:Tn,plugin:Zn}=$t,rr={path:bt,element:"mounted",routeRefs:new Set([Tn]),caseSensitive:Boolean((pt=n.props)===null||pt===void 0?void 0:pt.caseSensitive),children:[Gt],plugin:Zn};return We.push(rr),i.paths.set(Tn,bt),i.parents.set(Tn,l==null?void 0:l.routeRef),{obj:rr,routeRef:Tn!=null?Tn:l==null?void 0:l.routeRef,gatherPath:bt,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(V){var lt;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${Bn(n)}" with mount point "${V}" must be assigned a path`);return l==null||(lt=l.obj)===null||lt===void 0||lt.routeRefs.add(V),i.paths.set(V,l.gatherPath),i.parents.set(V,l==null?void 0:l.gatherRouteRef),{...l,routeRef:V}}return l}),ps=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,R,B;if((o==null?void 0:o.props.element)===n)return l;let V=l==null?void 0:l.obj,re=l==null?void 0:l.routeRef,We=l==null?void 0:l.sticky;const Ze=(f=n.props)===null||f===void 0?void 0:f.path;var pt;const lt=(pt=V==null?void 0:V.children)!==null&&pt!==void 0?pt:i.objects,bt=Boolean((R=n.props)===null||R===void 0?void 0:R.caseSensitive);let wt=l==null?void 0:l.path;if((0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");wt=Ze}const $t=(B=n.props)===null||B===void 0?void 0:B.element;let At=(0,b.IY)(n,"core.mountPoint");if(!At&&(0,W.isValidElement)($t)&&(At=(0,b.IY)($t,"core.mountPoint")),At){let rr=Ze;if(wt&&(rr?wt=void 0:rr=wt),!rr)throw new Error("Mounted routable extension must have a path");i.paths.set(At,rr),re&&We?(i.parents.set(At,re),Ze&&(re=At,We=!1)):(i.parents.set(At,re),re=At),Ze?(V={caseSensitive:bt,path:Ze,element:"mounted",routeRefs:new Set([At]),children:[Gt],plugin:(0,b.IY)(n.props.element,"core.plugin")},lt.push(V)):V==null||V.routeRefs.add(At)}if((0,b.IY)(n,"core.gatherMountPoints")&&(We=!0),(0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");if(!At){var Zn;V={caseSensitive:bt,path:Ze,element:"gathered",routeRefs:new Set,children:[Gt],plugin:l==null||(Zn=l.obj)===null||Zn===void 0?void 0:Zn.plugin},lt.push(V)}}return{obj:V,path:wt,routeRef:re,sticky:We}}),Rr=ve(()=>new Set,(i,n)=>{if(n.type===Ft){const o=n.props;i.add("with"in o?o.with:o.without)}}),hr=(0,He.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Lr(i){return i[hr]==="absolute"}function Hr(i){return i[hr]==="sub"}function Pr(i){return i[hr]==="external"}function Kn(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function Xn(i,n,o){let l,f="";if(Lr(i))l=i;else if(Hr(i))l=i.parent,f=i.path;else if(Pr(i)){const V=o.get(i);if(!V)return[void 0,""];if(Lr(V))l=V;else if(Hr(V))l=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw i[hr]?new Error(`Unknown or invalid route ref type, ${i[hr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!l)return[void 0,""];const R=n.get(l);if(R===void 0)return[void 0,""];const B=Kn(R,f);return[l,B]}function pr(i,n,o,l,f){var R;const B=(R=(0,On.fp)(f,n))!==null&&R!==void 0?R:[],V=Array();let re=-1;for(let pt=i;pt&&(re=B.findIndex(lt=>lt.route.routeRefs.has(pt)),re===-1);pt=l.get(pt))V.unshift(pt);V.length===0&&(re-=1);const We=re===-1?"":B[re].pathname,Ze=V.slice(0,-1).map(pt=>{const lt=o.get(pt);if(lt===void 0)throw new Error(`No path for ${pt}`);if(lt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${pt} as it has parameters`);return lt});return`${Kn(We,...Ze)}/`}class kr{resolve(n,o){const[l,f]=Xn(n,this.routePaths,this.routeBindings);if(!l)return;let R;typeof o=="string"?R=this.trimPath(o):o.pathname?R={...o,pathname:this.trimPath(o.pathname)}:R=o;const B=this.appBasePath+pr(l,R,this.routePaths,this.routeParents,this.routeObjects);return(...[re])=>Kn(B,(0,On.Gn)(f,re))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,o,l,f,R){this.routePaths=n,this.routeParents=o,this.routeObjects=l,this.routeBindings=f,this.appBasePath=R}}const Gr=(0,He.CT)("routing-context"),Ws=({routePaths:i,routeParents:n,routeObjects:o,routeBindings:l,basePath:f="",children:R})=>{const B=new kr(i,n,o,l,f),V=(0,He.EI)({1:B});return(0,r.jsx)(Gr.Provider,{value:V,children:R})};function Or(i,n){const o=new Set(n.values());o.delete(void 0);for(const l of n.keys()){if(o.has(l))continue;let f=l,R="";for(;f;){const V=i.get(f);if(V===void 0)throw new Error(`No path for ${f}`);R=Kn(V,R),f=n.get(f)}const B=R.match(/:(\w+)/g);if(B){for(let V=0;V<B.length;V++)for(let re=V+1;re<B.length;re++)if(B[re]===B[V])throw new Error(`Parameter ${B[re]} is duplicated in path ${R}`)}}}function fs(i,n){for(const o of n)if(!!o.externalRoutes){for(const[l,f]of Object.entries(o.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${l}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const gs=(0,He.CT)("app-context"),wr=({appContext:i,children:n})=>{const o=(0,He.EI)({1:i});return(0,r.jsx)(gs.Provider,{value:o,children:n})};function mn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function ir(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Br{setTarget(n,o){this.target=n,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw mn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ir("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw mn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ir("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(o=>o.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ir("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var ms=t(72164);function $r(i,n,o){if(i!==void 0){const f=o.find(R=>R.id===i);if(f)return f}if(n){const f=o.find(R=>R.variant==="dark");if(f)return f}const l=o.find(f=>f.variant==="light");return l||o[0]}const vs=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const l=f=>{o(f.matches)};return i.addListener(l),()=>{i.removeListener(l)}},[i]),n};function ys({children:i}){const n=(0,b.h_)(b.hg),o=(0,ms.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?vs():!1,f=$r(o,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const Kr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const o=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const l=window.__APP_CONFIG__;return l&&o.push({context:"window",data:l}),o};class Yr{add(n,o){return this.apis.push([n.id,o]),o}build(){return new ar(new Map(this.apis))}constructor(){this.apis=[]}}class ar{static builder(){return new Yr}static from(n){return new ar(new Map(n.map(([o,l])=>[o.id,l])))}static with(n,o){return new ar(new Map([[n.id,o]]))}with(n,o){return new ar(new Map([...this.apis,[n.id,o]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function xs(i){const n=new Map;return i&&i({bind:(l,f)=>{for(const[R,B]of Object.entries(f)){const V=l[R];if(!V)throw new Error(`Key ${R} is not an existing external route`);if(!B&&!V.optional)throw new Error(`External route ${R} is required but was undefined`);B&&n.set(V,B)}}}),n}function Jr(i,n,o){var l;const f=Boolean(i),R=(0,E.default)(i||(()=>Promise.resolve([])));let B;if(f&&R.loading){const{Progress:We}=n;B=(0,r.jsx)(We,{})}else if(R.error){const{BootErrorPage:We}=n;B=(0,r.jsx)(We,{step:"load-config",error:R.error})}const{ThemeProvider:V=ys}=n;if(B)return{node:(0,r.jsx)(Te,{apis:ar.with(b.hg,o),children:(0,r.jsx)(V,{children:B})})};let re;if(!((l=R.value)===null||l===void 0)&&l.length){const We=Ue.fromConfigs(R.value),Ze=At=>new URL(At).origin,pt=At=>new URL(At.replace(Ze(At),""),document.location.origin).href.replace(/\/$/,""),lt=We.getOptionalString("app.baseUrl"),bt=We.getOptionalString("backend.baseUrl");let wt=R.value;const $t={data:{},context:"relative-resolver"};if(lt&&bt){const At=Ze(lt),Tn=Ze(bt);if(At===Tn){const Zn=pt(bt);bt!==Zn&&($t.data.backend={baseUrl:Zn})}}if(lt){const At=pt(lt);lt!==At&&($t.data.app={baseUrl:At})}Object.keys($t.data).length&&(wt=wt.concat([$t])),re=Ue.fromConfigs(wt)}else re=Ue.fromConfigs([]);return{api:re}}class bs{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){this.app=n}}var Zr=new WeakMap;class Ss{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const o=this.getProvider();return()=>(0,r.jsx)(o,{children:n})}getProvider(){if((0,w.Z)(this,Zr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,x.Z)(this,Zr,!0);const n=new bs(this);let o=!1;return({children:f})=>{const R=(0,W.useRef)(!0),B=(0,W.useMemo)(()=>ce.createWithStorage(this.themes),[]),{routing:V,featureFlags:re,routeBindings:We}=(0,W.useMemo)(()=>{const bt=J({root:f,discoverers:[ye,De],collectors:{routing:rn()?ps:hs,collectedPlugins:Je,featureFlags:Rr}});return bt.collectedPlugins.forEach(wt=>this.plugins.add(wt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...bt,routeBindings:xs(this.bindRoutes)}},[f]);o||(o=!0,Or(V.paths,V.parents),fs(We,this.plugins));const Ze=Jr(this.configLoader,this.components,B),pt="api"in Ze;if(pt){const{api:bt}=Ze;this.configApi=bt}if("node"in Ze)return Ze.node;if(pt&&R.current){R.current=!1;const bt=this.getApiHolder().get(b.W0);if(bt){for(const At of this.featureFlags)bt.registerFlag({...At,pluginId:""});for(const At of this.plugins.values())if("getFeatureFlags"in At)for(const Tn of At.getFeatureFlags())bt.registerFlag({name:Tn.name,pluginId:At.getId()});else for(const Tn of At.output())Tn.type==="feature-flag"&&bt.registerFlag({name:Tn.name,pluginId:At.getId()});const wt=bt.getRegisteredFlags(),$t=new Set(wt.map(At=>At.name));for(const At of re)$t.has(At)||bt.registerFlag({name:At,pluginId:""})}}const{ThemeProvider:lt=ys}=this.components;return(0,r.jsx)(Te,{apis:this.getApiHolder(),children:(0,r.jsx)(wr,{appContext:n,children:(0,r.jsx)(lt,{children:(0,r.jsx)(Ws,{routePaths:V.paths,routeParents:V.parents,routeObjects:V.objects,routeBindings:We,basePath:Gn(Ze.api),children:(0,r.jsx)(Nt.Provider,{value:{routeObjects:V.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return dr}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const o of n.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Ye.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>ce.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new Oe});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const o of n.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Ye.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ye(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const o=new Set;for(const l of n){const f=l.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(n){this.appIdentityProxy=new Br,(0,u.Z)(this,Zr,{writable:!0,value:!1});var o;this.apis=(o=n.apis)!==null&&o!==void 0?o:[],this.icons=n.icons;var l;this.plugins=new Set((l=n.plugins)!==null&&l!==void 0?l:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var R;this.configLoader=(R=n.configLoader)!==null&&R!==void 0?R:Kr;var B;this.defaultApis=(B=n.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new vt}}function Cs(i){return new Ss(i)}let Qr=!1;const Xr=i=>{const n=(0,b.qD)(),{NotFoundErrorPage:o}=n.getComponents(),l=(0,W.useMemo)(()=>rn(),[]),R=[...(0,b.vJ)(i.children,B=>B.getElements().flatMap(V=>{let re=V.props.path;if(re==="")return[];var We;re=(We=re==null?void 0:re.replace(/\/\*$/,""))!==null&&We!==void 0?We:"/";let Ze=l?V:V.props.element;return!l&&!Ze&&(Ze=V,Qr||(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] />} />."),Qr=!0)),[{path:re,element:Ze,children:V.props.children?[{path:re==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,re)=>re.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,r.jsx)(o,{})}];return(0,g.V$)(R)};var qr=t(25488);const Dr=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:i})=>C.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new jt}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new ie}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:i})=>{const n=new H(i,new me);return ue.forward(n,{hidden:!1}),n}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:i})=>Dt.create({errorApi:i})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:i,identityApi:n,discoveryApi:o})=>Fe({middleware:[Bt.resolvePluginProtocol({discoveryApi:o}),Bt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Wn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Fn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>bn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Vt.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>pn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Qt.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>ge.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Re.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>et.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:qr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:i,discovery:n,identity:o})=>qr.iM.create({config:i,discovery:n,identity:o})})];var on=t(77277),Ut=t(93414),ws=t(39857);function js({children:i}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(g.VA,{children:i})}const Es=()=>(0,r.jsx)(Ut.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),_r=({step:i,error:n})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(js,{children:(0,r.jsx)(Ut.mf,{status:"501",statusMessage:o})})},As=({error:i,resetError:n,plugin:o})=>(0,r.jsx)(Ut.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(on.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Ts={Progress:Ut.Ex,Router:ws.VK,NotFoundErrorPage:Es,BootErrorPage:_r,ErrorBoundaryFallback:As};var es=t(43642),jr=t(80079),Vs=t(90941),Is=t(32915),ts=t(40562),Rs=t(21853),Hs=t(60744),Ls=t(66569),Gs=t(30254),Ks=t(13384),Ps=t(15933),Ys=t(58838),m=t(86737),y=t(4989),I=t(44407),O=t(18628),Y=t(84219),G=t(98685),ne=t(39781);const ae={brokenImage:jr.Z,catalog:O.Z,scaffolder:Is.Z,techdocs:ts.Z,search:Rs.Z,chat:Hs.Z,dashboard:Ls.Z,docs:Gs.Z,email:Ks.Z,github:Ys.Z,group:Y.Z,help:m.Z,"kind:api":Ps.Z,"kind:component":I.Z,"kind:domain":es.Z,"kind:group":Y.Z,"kind:location":y.Z,"kind:system":Vs.Z,"kind:user":G.Z,user:G.Z,warning:ne.Z};var Se=t(73689),Ie=t(48032);const we={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")`},je={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 Me(i){const{colors:n,shape:o,options:l}=i,R=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,B=`${o}, ${R}`;var V;const re=(V=l==null?void 0:l.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:n,shape:o,backgroundImage:B,fontColor:re}}const gt={home:Me({colors:je.teal,shape:we.wave}),documentation:Me({colors:je.pinkSea,shape:we.wave2}),tool:Me({colors:je.purpleSky,shape:we.round}),service:Me({colors:je.marineBlue,shape:we.wave}),website:Me({colors:je.veryBlue,shape:we.wave}),library:Me({colors:je.rubyRed,shape:we.wave}),other:Me({colors:je.darkGrey,shape:we.wave}),app:Me({colors:je.toastyOrange,shape:we.wave}),apis:Me({colors:je.teal,shape:we.wave2}),card:Me({colors:je.greens,shape:we.wave})},Ct=16,Ge='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function ut(i){const{palette:n,htmlFontSize:o=Ct,fontFamily:l=Ge,defaultPageTheme:f,pageTheme:R=gt}=i;if(!R[f])throw new Error(`${f} is not defined in pageTheme.`);var B;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:l,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:R[f],getPageTheme:({themeId:V})=>(B=R[V])!==null&&B!==void 0?B:R[f]}}function Wt(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ie.darken)(i.palette.link,.3),background:(0,Ie.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function qn(i){const n=ut(i),o=(0,Se.Z)(n),l=Wt(o);return{...o,overrides:l}}var an=t(34505);const _n=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:an.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:gt}),En=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:an.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:gt});var $n=t(98192),Vn=t(15222),Er=t(41547),fr=t(87561);const ns=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(Vn.Z,{}),Provider:({children:i})=>(0,r.jsx)(Er.Z,{theme:_n,children:(0,r.jsx)(fr.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)($n.Z,{}),Provider:({children:i})=>(0,r.jsx)(Er.Z,{theme:En,children:(0,r.jsx)(fr.ZP,{children:i})})}];function sn(i){var n,o,l,f;return Cs({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Ts,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Dr,icons:{...ae,...i==null?void 0:i.icons},plugins:(o=i==null?void 0:i.plugins)!==null&&o!==void 0?o:[],featureFlags:(l=i==null?void 0:i.featureFlags)!==null&&l!==void 0?l:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:ns})}var Ln=t(25271),gr=t(76635);async function ui({storageApi:i}){const n=i.forBucket("settings"),o=i.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,gr.isArray)(l))return;var f;const R=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(gr.isString).map(B=>B.split(":")).filter(B=>B.length===4&&B[0]==="entity").map(([B,V,re,We])=>(0,Ln.eE)({kind:V,namespace:re,name:We})).forEach(B=>R.add(B)),await o.set("entityRefs",Array.from(R)),await n.remove("starredEntities")}class hi{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){this.subscribers=new Set,this.observable=new(oe())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)})),ui(n).then(),this.settingsStore=n.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:l=>{var f;this.starredEntities=new Set((f=l.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var ta=t(33414),Ar=t(79692),pi=t(12420),An=t(56941),fi=t(19928);function gi(){const i=useApi(catalogApiRef),{error:n,loading:o,value:l}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(R=>{var B;return((B=R.facets.kind)===null||B===void 0?void 0:B.map(V=>V.value).sort())||[]}),[i]);return{loading:o,error:n,allKinds:l!=null?l:[]}}function mi(i,n,o){let l=i;return n&&(l=l.filter(R=>n.some(B=>B.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US")))),o&&!i.some(R=>R.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(l=l.concat([o])),l.sort().reduce((R,B)=>(R[B.toLocaleLowerCase("en-US")]=B,R),{})}const jo=(0,Ar.Z)(i=>(0,pi.Z)({root:{...i.typography.h4}}));function vi(i){var n;const{initialFilter:o="component",allowedKinds:l}=i,f=jo(),{allKinds:R}=useAllKinds(),{filters:B,updateFilters:V,queryParameters:{kind:re}}=useEntityList(),We=useMemo(()=>[re].flat()[0],[re]);var Ze;const[pt,lt]=useState((Ze=We!=null?We:(n=B.kind)===null||n===void 0?void 0:n.value)!==null&&Ze!==void 0?Ze:o);useEffect(()=>{We&<(We)},[We]),useEffect(()=>{var wt;if(!((wt=B.kind)===null||wt===void 0)&&wt.value){var $t;lt(($t=B.kind)===null||$t===void 0?void 0:$t.value)}},[B.kind]),useEffect(()=>{V({kind:pt?new EntityKindFilter(pt):void 0})},[pt,V]);const bt=filterKinds(R,l,pt);return _jsx(Select,{input:_jsx(InputBase,{}),value:pt.toLocaleLowerCase("en-US"),onChange:wt=>lt(wt.target.value),classes:f,children:Object.keys(bt).map(wt=>_jsx(MenuItem,{value:wt,children:`${pluralize(bt[wt])}`},wt))})}var yi=t(65826);const xi=(0,Ar.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function na(i){const n=i.result,o=i.highlight,l=xi(),f=useAnalytics(),R=()=>{f.captureEvent("discover",n.title,{attributes:{to:n.location},value:i.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[i.icon&&_jsx(ListItemIcon,{children:i.icon}),_jsxs("div",{className:l.flexContainer,children:[_jsx(ListItemText,{className:l.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:n.location,onClick:R,children:o!=null&&o.fields.title?_jsx(HighlightedSearchResultText,{text:o.fields.title,preTag:o.preTag,postTag:o.postTag}):n.title}),secondary:o!=null&&o.fields.text?_jsx(HighlightedSearchResultText,{text:o.fields.text,preTag:o.preTag,postTag:o.postTag}):n.text}),_jsxs(Box,{children:[n.kind&&_jsx(Chip,{label:`Kind: ${n.kind}`,size:"small"}),n.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${n.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var Eo=t(86359),Js=t(95544),Qs=t(99688),rs=t(12231),Nr=t(86136),Fr=t(49378),Ao=t(85256),Xs=t(61837),ks=t(79784),To=t(50758),Io=t(31654),Ro=t(43054),bi=t(65759),mr=t(51666);const Os="catalog-entity",_s=(0,mr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Os}),Lo=(0,mr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Bs=(0,mr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Os}),Po=(0,mr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Os}),eo=(0,mr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),to=(0,mr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),ko=(0,mr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ra=[_s,Lo,Bs,Po,eo,to,ko];var Oo=t(49166);function no(i){const{unregisterEntityOptions:n,isUnregisterAllowed:o,onUnregisterEntity:l,onClose:f}=i,R=typeof(n==null?void 0:n.disableUnregister)=="boolean";var B;const V=(B=!o||(R?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&B!==void 0?B:!1;let re=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(re=(0,r.jsxs)(rs.Z,{onClick:()=>{f(),l()},disabled:V,children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Oo.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:re})}const Bo=(0,Ar.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function er(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:l,onInspectEntity:f}=i,[R,B]=(0,W.useState)(),V=Bo(),We=(0,An.N$)(Bs).allowed,Ze=$t=>{B($t.currentTarget)},pt=()=>{B(void 0)},lt=(0,b.h_)(b.$v),bt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>lt.post({message:"Copied!",severity:"info"}))},[lt]),wt=n&&[...n.map($t=>(0,r.jsxs)(rs.Z,{onClick:()=>{pt(),$t.onClick()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)($t.Icon,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:$t.title})]},$t.title)),(0,r.jsx)(Ao.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!R,role:"button",onClick:Ze,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,r.jsx)(Ro.Z,{})}),(0,r.jsx)(ks.ZP,{open:Boolean(R),onClose:pt,anchorEl:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(To.Z,{children:[wt,(0,r.jsx)(no,{unregisterEntityOptions:o,isUnregisterAllowed:We,onUnregisterEntity:l,onClose:pt}),(0,r.jsxs)(rs.Z,{onClick:()=>{pt(),f()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Io.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(rs.Z,{onClick:()=>{pt(),bt()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(bi.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Copy entity URL"})]})]})})]})}const $o="plugin.catalog.entityLayoutRoute",ro=()=>null;(0,b.R5)(ro,$o,!0),(0,b.R5)(ro,"core.gatherMountPoints",!0);function Si(i){const{entity:n,title:o}=i;return(0,r.jsxs)(Js.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Js.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),n&&(0,r.jsx)(An.LH,{entity:n})]})}function Ci(i,n,o,l){var f;const R=(f=i!=null?i:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var B;const V=(B=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&B!==void 0?B:"";var re,We,Ze;return{headerTitle:`${(Ze=(We=(re=l==null?void 0:l.metadata.title)!==null&&re!==void 0?re:o)!==null&&We!==void 0?We:l==null?void 0:l.metadata.name)!==null&&Ze!==void 0?Ze:""}${V&&V!==Ln.zG?` in ${V}`:""}`,headerType:(()=>{let lt=R.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(lt+=" \u2014 ",lt+=l.spec.type.toLocaleLowerCase("en-US")),lt})()}}function wi(i){var n;const{entity:o}=i,l=(0,An.hF)(o,Ln.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(Ut.i9,{label:"Owner",value:(0,r.jsx)(An.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=o.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(Ut.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const ji=i=>{var n,o;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:R,NotFoundComponent:B}=i,{kind:V,namespace:re,name:We}=(0,b.Oi)(An.wi),{entity:Ze,loading:pt,error:lt}=(0,An.ce)(),bt=(0,g.TH)(),wt=(0,b.vJ)(R,Oi=>Oi.selectByComponentData({key:$o,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Mr})=>{if(Ze){if(Mr.if&&!Mr.if(Ze))return[]}else return[];return[{path:Mr.path,title:Mr.title,children:Mr.children,tabProps:Mr.tabProps}]}),[Ze]),{headerTitle:$t,headerType:At}=Ci(V,re,We,Ze),[Tn,Zn]=(0,W.useState)(!1),[rr,ls]=(0,W.useState)(!1),xo=(0,g.s0)(),ti=async()=>{Zn(!1),ls(!1),xo("/")};(0,W.useEffect)(()=>{Zn(!1),ls(!1)},[bt.pathname]);var cs;return(0,r.jsxs)(Ut.T3,{themeId:(cs=Ze==null||(n=Ze.spec)===null||n===void 0||(o=n.type)===null||o===void 0?void 0:o.toString())!==null&&cs!==void 0?cs:"home",children:[(0,r.jsx)(Ut.h4,{title:(0,r.jsx)(Si,{title:$t,entity:Ze}),pageTitleOverride:$t,type:At,children:Ze&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(wi,{entity:Ze}),(0,r.jsx)(er,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Zn(!0),onInspectEntity:()=>ls(!0)})]})}),pt&&(0,r.jsx)(Ut.Ex,{}),Ze&&(0,r.jsx)(Ut.tn,{routes:wt}),lt&&(0,r.jsx)(Ut.VY,{children:(0,r.jsx)(Qs.Z,{severity:"error",children:lt.toString()})}),!pt&&!lt&&!Ze&&(0,r.jsx)(Ut.VY,{children:B||(0,r.jsxs)(Ut.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,r.jsx)(Ut.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(An.pp,{open:Tn,entity:Ze,onConfirm:ti,onClose:()=>Zn(!1)}),(0,r.jsx)(An.U_,{open:rr,entity:Ze,onClose:()=>ls(!1)})]})};ji.Route=ro;var sa=t(23054);function oa(i){const{open:n,onClose:o,onConfirm:l,entity:f}=i,[R,B]=useState(!1),V=useApi(catalogApiRef),re=useApi(alertApiRef),We=async()=>{B(!0);try{const Ze=f.metadata.uid;await V.removeEntityByUid(Ze),l()}catch(Ze){assertError(Ze),re.post({message:Ze.message})}finally{B(!1)}};return _jsxs(Dialog,{open:n,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:R,onClick:We,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var vr=t(19625);function ia(i){var n,o;return(i==null||(n=i.metadata)===null||n===void 0||(o=n.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function aa(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[o,l]=useState(!1),{entity:f}=useEntity(),R=async()=>{l(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>l(!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:R,onClose:()=>l(!1)})]})}var Zo=t(29644);const Do=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function ss(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var R,B;return{errors:((B=(R=f.entity.status)===null||R===void 0?void 0:R.items)!==null&&B!==void 0?B:[]).filter(Do).map(We=>We.error).filter(We=>Boolean(We)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ei(i,n){const o=n.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await ss(stringifyEntityRef(i),o)).items.length>0}function Ai(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:l,error:f,value:R}=useAsync(async()=>ss(n,o),[n,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!R?null:_jsx(_Fragment,{children:R.items.map((B,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(B.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:B.entity})]}),B.errors.map((re,We)=>_jsx(ResponseErrorPanel,{error:re},We))]},V))})}const so="core.backstage.entitySwitch",os=i=>null;(0,b.R5)(os,so,!0);const $s=i=>{var n;const{entity:o,loading:l}=(0,An.ce)(),f=(0,b.I_)(),R=(0,b.vJ)(i.children,re=>re.selectByComponentData({key:so,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(We=>{if(l)return[];const{if:Ze,children:pt}=We.props;if(!o)return[{if:Ze===void 0,children:pt}];var lt;return[{if:(lt=Ze==null?void 0:Ze(o,{apis:f}))!==null&<!==void 0?lt:!0,children:pt}]}),[f,o,l]);if(R.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,r.jsx)(is,{results:R});var V;return(V=(n=R.find(re=>re.if))===null||n===void 0?void 0:n.children)!==null&&V!==void 0?V:null};function is({results:i}){const{loading:n,value:o}=(0,E.default)(async()=>{const l=i.map(async({if:R,children:B})=>{try{if(await R)return B}catch{}return null});var f;return(f=(await Promise.all(l)).find(Boolean))!==null&&f!==void 0?f:null},[i]);return n||!o?null:o}$s.Case=os;const No=null,Fo=An._i.Filters,lr=An._i.Content,Yn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:An.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:i,fetchApi:n})=>new Zo.MS({discoveryApi:i,fetchApi:n})}),(0,b.ni)({api:An.p3,deps:{storageApi:b.E6},factory:({storageApi:i})=>new hi({storageApi:i})})],routes:{catalogIndex:vr._Z,catalogEntity:An.wi},externalRoutes:{createComponent:vr.yw,viewTechDoc:vr.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Uo=Yn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(i=>i.CatalogPage),mountPoint:vr._Z})),Mo=Yn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:An.wi})),la=Yn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),nr=Yn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),zo=Yn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),Ti=Yn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),Ii=Yn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),Ri=Yn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),Li=Yn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),Zs=Yn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),Wo=Yn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),Vo=Yn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}}));var Ds=t(32838);class oo{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,o){const f=`${await this.getApiOrigin()}/${o}`,R=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(R.status===404)throw new Error("Page not found");return R.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,o,l){const f=await this.getApiOrigin();return new URL(n,`${f}/${l}`).toString()}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}class Ns{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}const Ho=[(0,b.ni)({api:Le.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new oo({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Le.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new Ns({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Ds.q3,deps:{configApi:b.Ds},factory:({configApi:i})=>Ds.ae.fromConfig(i)})],io={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ao={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function lo(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Go(){const i=await Kr(),n=await lo();return[...i,{context:"detected",data:n?io:ao}]}var Ur=t(58845);const Ko=(0,Ar.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var co=()=>{const i=Ko();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const uo=(0,Ar.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Yo=()=>{const i=uo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Jo=(0,Ar.Z)({root:{width:Ut.po.drawerWidthClosed,height:3*Ut.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Ut.po.drawerWidthClosed,marginLeft:24}}),ho=()=>{const i=Jo(),{isOpen:n}=(0,Ut.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(Ut.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(co,{}):(0,r.jsx)(Yo,{})})})},Qo=({children:i})=>(0,r.jsxs)(Ut.tR,{children:[(0,r.jsxs)(Ut.YE,{children:[(0,r.jsx)(ho,{}),(0,r.jsx)(Ut.v7,{}),(0,r.jsx)(Ut.R6,{icon:Ur.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var as=t(80030),po=t(32388),Xo=t(4142);const fo=(0,Ar.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var tr;(function(i){i.LIGHT="light",i.DARK="dark"})(tr||(tr={}));const go=()=>{const i=(0,b.h_)(b.hg),n=fo(),[o,l]=(0,W.useState)(i.getActiveThemeId()===tr.DARK?tr.DARK:tr.LIGHT),f={[tr.LIGHT]:{icon:Xo.Z,title:"Dark theme"},[tr.DARK]:{icon:po.Z,title:"Light theme"}},{title:R,icon:B}=f[o],V=()=>{l(re=>{const We=re===tr.LIGHT?tr.DARK:tr.LIGHT;return i.setActiveThemeId(We),We})};return(0,r.jsx)(Js.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(as.ZP,{title:R,arrow:!0,children:(0,r.jsx)(Xs.Z,{size:"small",onClick:V,children:(0,r.jsx)(B,{className:n.headerIcon})})})})},mo=()=>(0,r.jsxs)(S.I6,{children:[(0,r.jsx)(z.S,{}),(0,r.jsx)(M.F,{withSearch:!1})]}),Hn=(0,r.jsx)(mo,{}),vo=sn({apis:Ho,configLoader:Go,plugins:Object.values(h)}),qo=vo.getProvider(),_o=vo.getRouter(),yo=S.s4.provide((0,Le.KY)({name:"ThemeToggleAddon",component:go,location:Le.oZ.Header})),ei=(0,r.jsxs)(Xr,{children:[(0,r.jsx)(g.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(g.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(Mo,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(S.Jl,{}),children:(0,r.jsx)(L.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(S.I6,{}),children:[Hn,(0,r.jsx)(Le.DR,{children:(0,r.jsx)(yo,{})})]})]});var Fs=()=>(0,r.jsx)(qo,{children:(0,r.jsx)(_o,{children:(0,r.jsx)(Qo,{children:ei})})});Z.render((0,r.jsx)(Fs,{}),document.getElementById("root"))},51837:function(Rt,ze,t){"use strict";t.d(ze,{CT:function(){return b},EI:function(){return te},uW:function(){return Z},Vt:function(){return c}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=h(),W=Q=>`__@backstage/${Q}__`;function Z(Q,X){const z=W(Q);let M=r[z];return M||(M=X(),r[z]=M,M)}var g=t(2784);function b(Q){return Z(Q,()=>(0,g.createContext)(void 0))}function c(Q){return(0,g.useContext)(b(Q))}function P(Q){return{set(X){globalThis[`__@backstage/${Q}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${Q}__`]}}}function te(Q){Object.freeze(Q);const X={atVersion(z){return Q[z]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return Q}}),X}},56941:function(Rt,ze,t){"use strict";t.d(ze,{h$:function(){return Tt},n3:function(){return h.n3},_i:function(){return N},tW:function(){return Be},df:function(){return me},UO:function(){return yn},dq:function(){return Fe},nl:function(){return Ps},dx:function(){return He},rI:function(){return Ye},u3:function(){return Nt},xE:function(){return wn},sL:function(){return jn},LH:function(){return u},U_:function(){return ws},pp:function(){return es},EW:function(){return Hs},Ah:function(){return W},wi:function(){return Le},hF:function(){return rt},CV:function(){return ot},$3:function(){return Qe},p3:function(){return Z},ce:function(){return en},X2:function(){return Ot},wp:function(){return pn},ZW:function(){return Ne},N$:function(){return jt},eK:function(){return Pn},CR:function(){return ge}});var h=t(29644),r=t(25248);const W=(0,r.T0)({id:"plugin.catalog.service"}),Z=(0,r.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(y){this.starredEntities.delete(y)||this.starredEntities.add(y);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(y=>(y.next(new Set(this.starredEntities)),this.subscribers.add(y),()=>{this.subscribers.delete(y)}))}}var c=t(52322),P=t(2784),te=t(41156),Q=t(60364),X=t(77277),z=t(4190),M=t(95544),_=t(90436),fe=t(60905),le=t(36444);const T=m=>{const y=(0,te.Z)(G=>G.breakpoints.down("md")),I=(0,Q.Z)(),[O,Y]=(0,P.useState)(!1);return y?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(X.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>Y(!0),startIcon:(0,c.jsx)(le.Z,{}),children:"Filters"}),(0,c.jsx)(z.ZP,{open:O,onClose:()=>Y(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(M.Z,{m:2,children:[(0,c.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),m.children]})})]}):(0,c.jsx)(fe.Z,{item:!0,lg:2,children:m.children})},L=m=>(0,c.jsx)(fe.Z,{item:!0,xs:12,lg:10,children:m.children}),N=m=>(0,c.jsx)(fe.Z,{container:!0,style:{position:"relative"},children:m.children});N.Filters=T,N.Content=L;var A=t(93414),S=t(25271),q=t(51837);const Le=(0,q.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Xe(m){var y,I;return{kind:m.kind.toLocaleLowerCase("en-US"),namespace:(I=(y=m.metadata.namespace)===null||y===void 0?void 0:y.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:m.metadata.name}}function Qe(m,y){const I=y==null?void 0:y.defaultKind;let O,Y,G;return"metadata"in m?(O=m.kind,Y=m.metadata.namespace,G=m.metadata.name):(O=m.kind,Y=m.namespace,G=m.name),(Y===void 0||Y==="")&&(Y=S.zG),(y==null?void 0:y.defaultNamespace)!==void 0?(y==null?void 0:y.defaultNamespace)===Y&&(Y=void 0):Y===S.zG&&(Y=void 0),O=O.toLocaleLowerCase("en-US"),O=I&&I.toLocaleLowerCase("en-US")===O?void 0:O,`${O?`${O}:`:""}${Y?`${Y}/`:""}${G}`}var qe=t(80030);const He=(0,P.forwardRef)((m,y)=>{const{entityRef:I,defaultKind:O,title:Y,children:G,...ne}=m,ae=(0,r.tg)(Le);let Se,Ie,we;if(typeof I=="string"){const Ge=(0,S.of)(I);Se=Ge.kind,Ie=Ge.namespace,we=Ge.name}else"metadata"in I?(Se=I.kind,Ie=I.metadata.namespace,we=I.metadata.name):(Se=I.kind,Ie=I.namespace,we=I.name);Se=Se.toLocaleLowerCase("en-US");var je;Ie=(je=Ie==null?void 0:Ie.toLocaleLowerCase("en-US"))!==null&&je!==void 0?je:S.zG;const Me={kind:Se,namespace:Ie,name:we},gt=Qe({kind:Se,namespace:Ie,name:we},{defaultKind:O}),Ct=(0,c.jsxs)(A.rU,{...ne,ref:y,to:ae(Me),children:[G,!G&&(Y!=null?Y:gt)]});return Y?(0,c.jsx)(qe.ZP,{title:gt,children:Ct}):Ct});var mt=t(64279);function Te(m){const{entityRefs:y,defaultKind:I,getTitle:O,...Y}=m,G=(0,r.h_)(W),{value:ne=new Array,loading:ae,error:Se}=(0,mt.default)(async()=>{const Ie=y.reduce((je,Me)=>"metadata"in Me?je:[...je,(0,S.of)(Me)],new Array),we=y.filter(je=>"metadata"in je);return Ie.length>0?[...(await G.getEntities({filter:Ie.map(je=>({kind:je.kind,"metadata.namespace":je.namespace,"metadata.name":je.name}))})).items,...we]:we},[y]);return ae?(0,c.jsx)(A.Ex,{}):Se?(0,c.jsx)(A.yu,{error:Se}):(0,c.jsx)(c.Fragment,{children:ne.map((Ie,we)=>(0,c.jsxs)(P.Fragment,{children:[we>0&&", ",(0,c.jsx)(He,{...Y,defaultKind:I,entityRef:Ie,title:O(Ie)})]},we))})}function Ye(m){const{entityRefs:y,defaultKind:I,fetchEntities:O,getTitle:Y,...G}=m;return O?(0,c.jsx)(Te,{...G,defaultKind:I,entityRefs:y,getTitle:Y}):(0,c.jsx)(c.Fragment,{children:y.map((ne,ae)=>(0,c.jsxs)(P.Fragment,{children:[ae>0&&", ",(0,c.jsx)(He,{...G,defaultKind:I,entityRef:ne,title:Y?Y(ne):void 0})]},ae))})}function st(m){return m.reduce((y,I)=>({...y,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function vt(m){return y=>m.every(I=>!I.filterEntity||I.filterEntity(y))}function rt(m,y,I){var O;let Y=(m==null||(O=m.relations)===null||O===void 0?void 0:O.filter(G=>G.type===y).map(G=>(0,S.of)(G.targetRef)))||[];return I!=null&&I.kind&&(Y=Y.filter(G=>G.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),Y}function ot(m,y){var I;const O=(I=m.metadata.annotations)===null||I===void 0?void 0:I[S.M6];if(!!O)try{const Y=(0,S.Ou)(O),G=y.byUrl(Y.target);return{locationTargetUrl:Y.target,integrationType:G==null?void 0:G.type}}catch{return}}function ct(m,y){const I=new Set([...getEntityRelations(m,RELATION_MEMBER_OF,{kind:"group"}),...m?[getCompoundEntityRef(m)]:[]].map(stringifyEntityRef)),O=getEntityRelations(y,RELATION_OWNED_BY).map(stringifyEntityRef);for(const Y of O)if(I.has(Y))return!0;return!1}class St{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(y){this.value=y}}class Lt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(y){this.value=y}}class Ve{filterEntity(y){var I;return this.values.every(O=>((I=y.metadata.tags)!==null&&I!==void 0?I:[]).includes(O))}toQueryValue(){return this.values}constructor(y){this.values=y}}class oe{filterEntity(y){const I=this.toUpperArray(this.value.split(/\s/)),O=this.toUpperArray([y.metadata.tags]),Y=this.toUpperArray([y.metadata.name,y.metadata.title]);for(const G of I)if(O.every(ne=>ne!==G)&&Y.every(ne=>!ne.includes(G)))return!1;return!0}toUpperArray(y){return y.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(y){this.value=y}}class Pe{filterEntity(y){return this.values.some(I=>rt(y,S.S4).some(O=>Qe(O,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(y){this.values=y}}class ke{filterEntity(y){return this.values.some(I=>{var O;return((O=y.spec)===null||O===void 0?void 0:O.lifecycle)===I})}toQueryValue(){return this.values}constructor(y){this.values=y}}class tt{filterEntity(y){switch(this.value){case"owned":return this.isOwnedEntity(y);case"starred":return this.isStarredEntity(y);default:return!0}}toQueryValue(){return this.value}constructor(y,I,O){this.value=y,this.isOwnedEntity=I,this.isStarredEntity=O}}class yt{filterEntity(y){var I;const O=(I=y.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return O!==void 0&&this.value.toString()===O}constructor(y){this.value=y}}class Zt{filterEntity(y){var I,O;const Y=(y==null||(I=y.status)===null||I===void 0||(O=I.items)===null||O===void 0?void 0:O.length)>0;return Y!==void 0&&this.value===Y}constructor(y){this.value=y}}const ht=(0,q.CT)("entity-context"),Tt=({children:m,entity:y,loading:I,error:O,refresh:Y})=>{const G={entity:y,loading:I,error:O,refresh:Y};return(0,c.jsx)(ht.Provider,{value:(0,q.EI)({1:G}),children:(0,c.jsx)(r.fC,{attributes:{...y?{entityRef:(0,S.eE)(y)}:void 0},children:m})})},It=m=>_jsx(Tt,{entity:m.entity,loading:!Boolean(m.entity),error:void 0,refresh:void 0,children:m.children});function Ot(){const m=(0,q.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");if(!y.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:y.entity}}function en(){const m=(0,q.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");const{entity:I,loading:O,error:Y,refresh:G}=y;return{entity:I,loading:O,error:Y,refresh:G}}var Vt=t(76635),Ht=t(19126),Qt=t.n(Ht),hn=t(79635),dn=t(69294),Fn=t(48760),In=t(90736);const Un=(0,P.createContext)(void 0),yn=({children:m})=>{const y=(0,In.default)(),I=(0,r.h_)(W),[O,Y]=(0,P.useState)({}),G=(0,hn.TH)();var ne;const ae=(0,P.useMemo)(()=>(ne=Qt().parse(G.search,{ignoreQueryPrefix:!0}).filters)!==null&&ne!==void 0?ne:{},[G]),[Se,Ie]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:we,error:je},Me]=(0,dn.default)(async()=>{const Ge=(0,Vt.compact)(Object.values(O)),ut=vt(Ge),Wt=st(Ge),qn=st((0,Vt.compact)(Object.values(Se.appliedFilters))),an=Object.keys(O).reduce((En,$n)=>{const Vn=O[$n];return Vn!=null&&Vn.toQueryValue&&(En[$n]=Vn.toQueryValue()),En},{});if((0,Vt.isEqual)(qn,Wt))Ie({appliedFilters:O,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(ut)});else{const En=await I.getEntities({filter:Wt});Ie({appliedFilters:O,backendEntities:En.items,entities:En.items.filter(ut)})}if(y()){var _n;const En=Qt().parse(G.search,{ignoreQueryPrefix:!0}),$n=Qt().stringify({...En,filters:an},{addQueryPrefix:!0,arrayFormat:"repeat"}),Vn=`${window.location.pathname}${$n}`;(_n=window.history)===null||_n===void 0||_n.replaceState(null,document.title,Vn)}},[I,ae,O,Se],{loading:!0});(0,Fn.Z)(Me,10,[O]);const gt=(0,P.useCallback)(Ge=>{Y(ut=>{const Wt=typeof Ge=="function"?Ge(ut):Ge;return{...ut,...Wt}})},[]),Ct=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:gt,queryParameters:ae,loading:we,error:je}),[Se,gt,ae,we,je]);return(0,c.jsx)(Un.Provider,{value:Ct,children:m})};function pn(){const m=(0,P.useContext)(Un);if(!m)throw new Error("useEntityList must be used within EntityListProvider");return m}var Xt=t(18149),Mn=t.n(Xt),zn=t(829),fn=t.n(zn);function xn(){const m=(0,r.h_)(W),{filters:{kind:y,type:I},queryParameters:{type:O},updateFilters:Y}=pn(),G=(0,P.useMemo)(()=>[O].flat().filter(Boolean),[O]);var ne;const[ae,Se]=(0,P.useState)(G.length?G:(ne=I==null?void 0:I.getTypes())!==null&&ne!==void 0?ne:[]);(0,P.useEffect)(()=>{G.length&&Se(G)},[G]);const[Ie,we]=(0,P.useState)([]),je=(0,P.useMemo)(()=>y==null?void 0:y.value,[y]),{error:Me,loading:gt,value:Ct}=(0,mt.default)(async()=>je?await m.getEntityFacets({filter:{kind:je},facets:["spec.type"]}).then(Wt=>Wt.facets["spec.type"]||[]):[],[je,m]),Ge=(0,P.useRef)(Ct);return(0,P.useEffect)(()=>{const ut=Ge.current;if(Ge.current=Ct,gt||!je||ut===Ct||!Ct)return;const Wt=[...new Set(fn()(Ct,an=>-an.count).map(an=>an.value.toLocaleLowerCase("en-US")))];we(Wt);const qn=ae.filter(an=>Wt.includes(an));Mn()(ae,qn)||Se(qn)},[gt,je,ae,Se,Ct]),(0,P.useEffect)(()=>{Y({type:ae.length?new Lt(ae):void 0})},[ae,Y]),{loading:gt,error:Me,availableTypes:Ie,selectedTypes:ae,setSelectedTypes:Se}}const bn=20;function Pn(m,y){var I,O;const Y=y==null||(I=y.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),G=y==null||(O=y.kind)===null||O===void 0?void 0:O.toLocaleLowerCase("en-US"),ne=(0,r.h_)(W),{loading:ae,value:Se,error:Ie}=(0,mt.default)(async()=>{var we;const je=(we=m.relations)===null||we===void 0?void 0:we.map(Ge=>({type:Ge.type,target:(0,S.of)(Ge.targetRef)})).filter(Ge=>(!Y||Ge.type.toLocaleLowerCase("en-US")===Y)&&(!G||Ge.target.kind===G));if(!je)return[];const Me=Object.values((0,Vt.groupBy)(je,({target:Ge})=>`${Ge.kind}:${Ge.namespace}`.toLocaleLowerCase("en-US"))),gt=[];for(const Ge of Me)gt.push({kind:Ge[0].target.kind,namespace:Ge[0].target.namespace,nameBatches:(0,Vt.chunk)(Ge.map(ut=>ut.target.name),bn)});return(await Promise.all(gt.flatMap(Ge=>Ge.nameBatches.map(ut=>ne.getEntities({filter:{kind:Ge.kind,"metadata.namespace":Ge.namespace,"metadata.name":ut}}))))).flatMap(Ge=>Ge.items)},[m,Y,G]);return{entities:Se,loading:ae,error:Ie}}var kn=t(72164);function Sn(m){return typeof m=="string"?m:(0,S.eE)(m)}function ge(){const m=(0,r.h_)(Z),y=(0,kn.Z)(m.starredEntitie$(),new Set),I=(0,P.useCallback)(Y=>y.has(Sn(Y)),[y]),O=(0,P.useCallback)(Y=>m.toggleStarred(Sn(Y)).then(),[m]);return{starredEntities:y,toggleStarredEntity:O,isStarredEntity:I}}function ee(m){return typeof m=="string"?m:(0,S.eE)(m)}function Re(m){const y=(0,r.h_)(Z),[I,O]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const G=y.starredEntitie$().subscribe({next(ne){O(ne.has(ee(m)))}});return()=>{G.unsubscribe()}},[m,y]),{toggleStarredEntity:(0,P.useCallback)(()=>y.toggleStarred(ee(m)).then(),[m,y]),isStarredEntity:I}}function Ne(){const m=(0,r.h_)(r.$4),{loading:y,value:I}=(0,mt.default)(async()=>{const{ownershipEntityRefs:Y}=await m.getBackstageIdentity();return Y},[]),O=(0,P.useMemo)(()=>{const Y=new Set(I!=null?I:[]);return G=>{const ne=rt(G,S.S4).map(S.eE);for(const ae of ne)if(Y.has(ae))return!0;return!1}},[I]);return(0,P.useMemo)(()=>({loading:y,isOwnedEntity:O}),[y,O])}var et=t(25488);function jt(m){const{entity:y,loading:I,error:O}=en(),{allowed:Y,loading:G,error:ne}=(0,et.gI)({permission:m,resourceRef:y?(0,S.eE)(y):void 0});return I||G?{loading:!0,allowed:!1}:O?{loading:!1,allowed:!1,error:O}:{loading:!1,allowed:Y,error:ne}}function ie(){const m=(0,r.h_)(W),{error:y,loading:I,value:O}=(0,mt.default)(async()=>await m.getEntityFacets({facets:["kind"]}).then(G=>{var ne;return((ne=G.facets.kind)===null||ne===void 0?void 0:ne.map(ae=>ae.value).sort())||[]}),[m]);return{loading:I,error:y,allKinds:O!=null?O:[]}}function k(m,y,I){let O=m;return y&&(O=O.filter(G=>y.some(ne=>ne.toLocaleLowerCase("en-US")===G.toLocaleLowerCase("en-US")))),I&&!m.some(G=>G.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(O=O.concat([I])),O.sort().reduce((G,ne)=>(G[ne.toLocaleLowerCase("en-US")]=ne,G),{})}function ce(m){var y;const{filters:I,queryParameters:{kind:O},updateFilters:Y}=pn(),G=(0,P.useMemo)(()=>[O].flat()[0],[O]);var ne;const[ae,Se]=(0,P.useState)((ne=G!=null?G:(y=I.kind)===null||y===void 0?void 0:y.value)!==null&&ne!==void 0?ne:m.initialFilter);(0,P.useEffect)(()=>{G&&Se(G)},[G]),(0,P.useEffect)(()=>{var Me;if(!((Me=I.kind)===null||Me===void 0)&&Me.value){var gt;Se((gt=I.kind)===null||gt===void 0?void 0:gt.value)}},[I.kind]),(0,P.useEffect)(()=>{Y({kind:ae?new St(ae):void 0})},[ae,Y]);const{allKinds:Ie,loading:we,error:je}=ie();return{loading:we,error:je,allKinds:Ie!=null?Ie:[],selectedKind:ae,setSelectedKind:Se}}const Be=m=>{const{allowedKinds:y,hidden:I,initialFilter:O="component"}=m,Y=(0,r.h_)(r.$v),{error:G,allKinds:ne,selectedKind:ae,setSelectedKind:Se}=ce({initialFilter:O});if((0,P.useEffect)(()=>{G&&Y.post({message:"Failed to load entity kinds",severity:"error"})},[G,Y]),G)return null;const Ie=k(ne,y,ae),we=Object.keys(Ie).map(je=>({value:je,label:Ie[je]}));return I?null:(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Kind",items:we,selected:ae.toLocaleLowerCase("en-US"),onChange:je=>Se(String(je))})})};var D=t(79692),U=t(5806),de=t(21324),pe=t(86619),be=t(19996),$e=t(25505),Ee=t(38016),Ue=t(88013);const nt=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),C=(0,c.jsx)($e.Z,{fontSize:"small"}),H=(0,c.jsx)(be.Z,{fontSize:"small"}),me=()=>{var m;const y=nt(),{updateFilters:I,backendEntities:O,filters:Y,queryParameters:{lifecycles:G}}=pn(),ne=(0,P.useMemo)(()=>[G].flat().filter(Boolean),[G]);var ae;const[Se,Ie]=(0,P.useState)(ne.length?ne:(ae=(m=Y.lifecycles)===null||m===void 0?void 0:m.values)!==null&&ae!==void 0?ae:[]);(0,P.useEffect)(()=>{ne.length&&Ie(ne)},[ne]);const we=(0,P.useMemo)(()=>[...new Set(O.map(je=>{var Me;return(Me=je.spec)===null||Me===void 0?void 0:Me.lifecycle}).filter(Boolean))].sort(),[O]);return(0,P.useEffect)(()=>{I({lifecycles:Se.length&&we.length?new ke(Se):void 0})},[Se,I,we]),we.length?(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(Ue.ZP,{multiple:!0,options:we,value:Se,onChange:(je,Me)=>Ie(Me),renderOption:(je,{selected:Me})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:C,checkedIcon:H,checked:Me}),label:je}),size:"small",popupIcon:(0,c.jsx)(Ee.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:je=>(0,c.jsx)(pe.Z,{...je,className:y.input,variant:"outlined"})})]})}):null},ue=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ce=(0,c.jsx)($e.Z,{fontSize:"small"}),Oe=(0,c.jsx)(be.Z,{fontSize:"small"}),Fe=()=>{var m;const y=ue(),{updateFilters:I,backendEntities:O,filters:Y,queryParameters:{owners:G}}=pn(),ne=(0,P.useMemo)(()=>[G].flat().filter(Boolean),[G]);var ae;const[Se,Ie]=(0,P.useState)(ne.length?ne:(ae=(m=Y.owners)===null||m===void 0?void 0:m.values)!==null&&ae!==void 0?ae:[]);(0,P.useEffect)(()=>{ne.length&&Ie(ne)},[ne]);const we=(0,P.useMemo)(()=>[...new Set(O.flatMap(je=>rt(je,S.S4).map(Me=>Qe(Me,{defaultKind:"group"}))).filter(Boolean))].sort(),[O]);return(0,P.useEffect)(()=>{I({owners:Se.length&&we.length?new Pe(Se):void 0})},[Se,I,we]),we.length?(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(Ue.ZP,{multiple:!0,options:we,value:Se,onChange:(je,Me)=>Ie(Me),renderOption:(je,{selected:Me})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Ce,checkedIcon:Oe,checked:Me}),label:je}),size:"small",popupIcon:(0,c.jsx)(Ee.Z,{"data-testid":"owner-picker-expand"}),renderInput:je=>(0,c.jsx)(pe.Z,{...je,className:y.input,variant:"outlined"})})]})}):null},dt=({entity:m})=>{const y=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:y({name:m.metadata.name,namespace:m.metadata.namespace||"default",kind:m.kind.toLocaleLowerCase("en-US")}),children:_jsx(InfoIcon,{})})},Et=({email:m})=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${m}`,to:`mailto:${m}`,target:"_blank",children:_jsx(EmailIcon,{})}),it=({entity:m})=>{var y;return _jsx(_Fragment,{children:((y=m.spec.profile)===null||y===void 0?void 0:y.email)&&_jsx(EmailCardAction,{email:m.spec.profile.email})})},ft=({entity:m})=>{var y;return _jsx(_Fragment,{children:((y=m.spec.profile)===null||y===void 0?void 0:y.email)&&_jsx(EmailCardAction,{email:m.spec.profile.email})})},xt=(0,D.Z)(()=>({trigger:{display:"inline-block"},popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),at=4,Bt=m=>{var y,I,O;const{entityRef:Y,children:G,delayTime:ne=500}=m,ae=xt(),Se=useApiHolder(),Ie=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),we=parseEntityRef(Y),[je,Me]=useState(!1),gt=debounce(()=>Me(!0),ne),[{loading:Ct,error:Ge,value:ut},Wt]=useAsyncFn(async()=>{const an=Se.get(catalogApiRef);if(an){const _n=await an.getEntityByRef(we);if(!_n)throw new Error(`${we.name} was not found`);return _n}},[Se,we]),qn=()=>{Me(!1),gt.cancel()};return useEffect(()=>{Ie.isOpen&&!ut&&!Ge&&!Ct&&Wt()},[Ie.isOpen,Wt,ut,Ge,Ct]),_jsxs(_Fragment,{children:[_jsx("span",{onMouseEnter:gt,children:_jsx("span",{"data-testid":"trigger",...bindHover(Ie),children:G})}),je&&_jsx(HoverPopover,{PaperProps:{className:ae.popoverPaper},...bindPopover(Ie),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:qn,children:_jsxs(_Fragment,{children:[Ge&&_jsx(ResponseErrorPanel,{error:Ge}),_jsxs(Card,{children:[Ct&&_jsx(Progress,{}),_jsx(CardContent,{children:ut&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:we.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:we.name}),_jsx(Typography,{color:"textSecondary",children:ut.kind}),_jsx(Typography,{className:ae.descriptionTypography,paragraph:!0,children:ut.metadata.description}),_jsx(Typography,{children:(y=ut.spec)===null||y===void 0?void 0:y.type}),_jsxs(Box,{marginTop:"0.5em",children:[(ut.metadata.tags||[]).slice(0,at).map(an=>_jsx(Chip,{size:"small",label:an},an)),((I=ut.metadata.tags)===null||I===void 0?void 0:I.length)&&((O=ut.metadata.tags)===null||O===void 0?void 0:O.length)>at&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})}),!Ge&&_jsx(CardActions,{children:ut&&_jsxs(_Fragment,{children:[isUserEntity(ut)&&_jsx(UserCardActions,{entity:ut}),isGroupEntity(ut)&&_jsx(GroupCardActions,{entity:ut}),_jsx(EntityCardActions,{entity:ut})]})})]})]})})]})},Mt=(0,D.Z)(m=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),zt=()=>{var m;const y=Mt(),{filters:I,updateFilters:O}=useEntityList();var Y;const[G,ne]=useState((Y=(m=I.text)===null||m===void 0?void 0:m.value)!==null&&Y!==void 0?Y:"");return useDebounce(()=>{O({text:G.length?new EntityTextFilter(G):void 0})},250,[G,O]),_jsx(Toolbar,{className:y.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:y.input,placeholder:"Search",autoComplete:"off",onChange:ae=>ne(ae.target.value),value:G,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ne(""),edge:"end",disabled:G.length===0,children:_jsx(Clear,{})})})})})})},qt=Object.freeze({createEntityRefColumn(m){const{defaultKind:y}=m;function I(O){var Y;return((Y=O.metadata)===null||Y===void 0?void 0:Y.title)||Qe(O,{defaultKind:y})}return{title:"Name",highlight:!0,customFilterAndSearch(O,Y){return I(Y).includes(O)},customSort(O,Y){return I(O).localeCompare(I(Y))},render:O=>{var Y;return(0,c.jsx)(He,{entityRef:O,defaultKind:y,title:(Y=O.metadata)===null||Y===void 0?void 0:Y.title})}}},createEntityRelationColumn(m){const{title:y,relation:I,defaultKind:O,filter:Y}=m;function G(ae){return rt(ae,I,Y)}function ne(ae){return G(ae).map(Se=>Qe(Se,{defaultKind:O})).join(", ")}return{title:y,customFilterAndSearch(ae,Se){return ne(Se).includes(ae)},customSort(ae,Se){return ne(ae).localeCompare(ne(Se))},render:ae=>(0,c.jsx)(Ye,{entityRefs:G(ae),defaultKind:O})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:S.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:S.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:S.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:m=>(0,c.jsx)(A.Or,{text:m.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Wn=[qt.createEntityRefColumn({defaultKind:"system"}),qt.createDomainColumn(),qt.createOwnerColumn(),qt.createMetadataDescriptionColumn()],Cn=[qt.createEntityRefColumn({defaultKind:"component"}),qt.createSystemColumn(),qt.createOwnerColumn(),qt.createSpecTypeColumn(),qt.createSpecLifecycleColumn(),qt.createMetadataDescriptionColumn()],Dt=(0,D.Z)(m=>({empty:{padding:m.spacing(2),display:"flex",justifyContent:"center"}})),Nt=m=>{const{entities:y,title:I,emptyContent:O,variant:Y="gridItem",columns:G}=m,ne=Dt(),ae={minWidth:"0",width:"100%"};return Y==="gridItem"&&(ae.height="calc(100% - 10px)"),(0,c.jsx)(A.iA,{columns:G,title:I,style:ae,emptyContent:O&&(0,c.jsx)("div",{className:ne.empty,children:O}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:y})};Nt.columns=qt,Nt.systemEntityColumns=Wn,Nt.componentEntityColumns=Cn;const rn=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),On=(0,c.jsx)($e.Z,{fontSize:"small"}),Qn=(0,c.jsx)(be.Z,{fontSize:"small"}),wn=m=>{var y;const I=rn(),{updateFilters:O,filters:Y,queryParameters:{tags:G}}=pn(),ne=(0,r.h_)(W),{value:ae}=(0,mt.default)(async()=>{var Me;const gt="metadata.tags",{facets:Ct}=await ne.getEntityFacets({facets:[gt],filter:(Me=Y.kind)===null||Me===void 0?void 0:Me.getCatalogFilters()});return Object.fromEntries(Ct[gt].map(({value:Ge,count:ut})=>[Ge,ut]))},[Y.kind]),Se=(0,P.useMemo)(()=>[G].flat().filter(Boolean),[G]);var Ie;const[we,je]=(0,P.useState)(Se.length?Se:(Ie=(y=Y.tags)===null||y===void 0?void 0:y.values)!==null&&Ie!==void 0?Ie:[]);return(0,P.useEffect)(()=>{Se.length&&je(Se)},[Se]),(0,P.useEffect)(()=>{const Me=Object.keys(ae!=null?ae:{});O({tags:we.length&&Me.length?new Ve(we):void 0})},[we,O,ae]),Object.keys(ae!=null?ae:{}).length?(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,c.jsx)(Ue.ZP,{multiple:!0,options:Object.keys(ae!=null?ae:{}),value:we,onChange:(Me,gt)=>je(gt),renderOption:(Me,{selected:gt})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:On,checkedIcon:Qn,checked:gt}),label:m.showCounts?`${Me} (${ae==null?void 0:ae[Me]})`:Me}),size:"small",popupIcon:(0,c.jsx)(Ee.Z,{"data-testid":"tag-picker-expand"}),renderInput:Me=>(0,c.jsx)(pe.Z,{...Me,className:I.input,variant:"outlined"})})]})}):null},jn=m=>{const{hidden:y,initialFilter:I}=m,O=(0,r.h_)(r.$v),{error:Y,availableTypes:G,selectedTypes:ne,setSelectedTypes:ae}=xn();if((0,P.useEffect)(()=>{Y&&O.post({message:"Failed to load entity types",severity:"error"}),I&&ae([I])},[Y,O,I,ae]),G.length===0||Y)return null;const Se=[{value:"all",label:"all"},...G.map(we=>({value:we,label:we}))];var Ie;return y?null:(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Type",items:Se,selected:(Ie=Se.length>1?ne[0]:void 0)!==null&&Ie!==void 0?Ie:"all",onChange:we=>ae(we==="all"?[]:[String(we)])})})};var Gn=t(15459),gn=t(61837),Rn=t(11640),dr=t(28347);const w=(0,Gn.Z)({root:{color:"#f3ba37"}})(Rn.Z),u=m=>{const{toggleStarredEntity:y,isStarredEntity:I}=Re(m.entity);return(0,c.jsx)(gn.Z,{"aria-label":"favorite",color:"inherit",...m,onClick:()=>y(),children:(0,c.jsx)(qe.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(w,{}):(0,c.jsx)(dr.Z,{})})})};var x=t(8629),E=t(79249),J=t(38724),ve=t(99152),ye=t(6487),De=t(49429),Je=t(55999),Ft=t(72779),Gt=t.n(Ft),Bn=t(39412);const ur=Bn.Z;function hs(m,y){if(m)return m.toLocaleLowerCase("en-US");if(y)try{return(0,S.of)(y).kind.toLocaleLowerCase("en-US")}catch{return}}function ps(m,y){const I=(0,r.qD)(),O=hs(m,y);return O&&I.getSystemIcon(`kind:${O}`)||ur}function Rr(m){const{kind:y,entityRef:I,...O}=m,Y=ps(y,I);return(0,c.jsx)(Y,{...O})}const hr=(0,D.Z)(m=>({node:{fill:m.palette.grey[300],stroke:m.palette.grey[300],"&.primary":{fill:m.palette.primary.light,stroke:m.palette.primary.light},"&.secondary":{fill:m.palette.secondary.light,stroke:m.palette.secondary.light}},text:{fill:m.palette.getContrastText(m.palette.grey[300]),"&.primary":{fill:m.palette.primary.contrastText},"&.secondary":{fill:m.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Lr(m){const y=(0,r.h_)(W),I=(0,S.eE)(m),{loading:O,error:Y,value:G}=(0,mt.default)(async()=>{const ne=await y.getEntityAncestors({entityRef:I}),ae=new Array,Se=new Array;for(const Ie of ne.items){const we=(0,S.eE)(Ie.entity),je=we===ne.rootEntityRef;ae.push({id:we,root:je,...Ie.entity});for(const Me of Ie.parentEntityRefs)Se.push({from:we,to:Me})}return{nodes:ae,edges:Se}},[I]);return{loading:O,error:Y,nodes:(G==null?void 0:G.nodes)||[],edges:(G==null?void 0:G.edges)||[]}}function Hr({node:m}){const y=hr(),I=(0,hn.s0)(),O=(0,r.tg)(Le),[Y,G]=(0,P.useState)(0),[ne,ae]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:ut,width:Wt}=Se.current.getBBox();ut=Math.round(ut),Wt=Math.round(Wt),(ut!==ne||Wt!==Y)&&(G(Wt),ae(ut))}},[Y,ne]);const Ie=10,we=ne,je=we+Ie,Me=je+Y+Ie*2,gt=ne+Ie*2,Ct=m.metadata.title||(m.kind&&m.metadata.name&&m.metadata.namespace?Qe({kind:m.kind,name:m.metadata.name,namespace:m.metadata.namespace||""}):m.id),Ge=()=>{I(O({kind:m.kind,namespace:m.metadata.namespace||S.zG,name:m.metadata.name}))};return(0,c.jsxs)("g",{onClick:Ge,className:y.clickable,children:[(0,c.jsx)("rect",{className:Gt()(y.node,m.root?"secondary":"primary"),width:Me,height:gt,rx:10}),(0,c.jsx)(Rr,{kind:m.kind,y:Ie,x:Ie,width:we,height:we,className:Gt()(y.text,m.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Se,className:Gt()(y.text,m.root?"secondary":"primary"),y:gt/2,x:je+(Y+Ie*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ct})]})}function Pr(m){const{loading:y,error:I,nodes:O,edges:Y}=Lr(m.entity);return y?(0,c.jsx)(A.Ex,{}):I?(0,c.jsx)(A.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(Je.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,c.jsx)(A.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,c.jsx)(M.Z,{mt:4,children:(0,c.jsx)(A.mn,{nodes:O,edges:Y,renderNode:Hr,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Kn=t(11776),Xn=t(38402),pr=t(86136),kr=t(99688),Gr=t(49378),Ws=t(54506),Or=t(94339),fs=t(24579),gs=t(27685);const wr=(0,D.Z)(m=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:m.spacing(2)},helpIcon:{marginLeft:m.spacing(1),color:m.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function mn(m){const y=wr();return(0,c.jsx)(Gr.Z,{...m,primaryTypographyProps:{className:y.monospace},secondaryTypographyProps:{className:y.monospace}})}function ir(m){const y=wr();return(0,c.jsx)(Ws.Z,{className:y.monospace,children:m.children})}function Br(m){return(0,c.jsx)(M.Z,{mt:2,children:(0,c.jsx)(Or.Z,{variant:"outlined",children:(0,c.jsxs)(fs.Z,{children:[(0,c.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[m.title,m.helpLink&&(0,c.jsx)(vs,{to:m.helpLink})]}),m.children]})})})}function ms(m){if(m.match(/^url:https?:\/\//))return m.slice(4);if(m.match(/^https?:\/\//))return m}function $r(m){const[y,I]=m.entry,O=ms(I);return(0,c.jsxs)(Xn.Z,{children:[m.indent&&(0,c.jsx)(pr.Z,{}),(0,c.jsx)(mn,{primary:y,secondary:O?(0,c.jsx)(A.rU,{to:O,children:I}):I})]})}function vs(m){const y=wr();return(0,c.jsx)(A.rU,{to:m.to,className:y.helpIcon,children:(0,c.jsx)(gs.Z,{fontSize:"inherit"})})}const ys=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Kr(m){var y,I;const O=(0,r.h_)(W),Y=(0,S.eE)(m),G=(y=m.metadata.annotations)===null||y===void 0?void 0:y[S.P1],ne=(I=m.metadata.annotations)===null||I===void 0?void 0:I[S.q1],{loading:ae,error:Se,value:Ie}=(0,mt.default)(async()=>!G&&!ne?[]:(await O.getEntities({filter:[...G?[{[`metadata.annotations.${S.P1}`]:G}]:[],...ne?[{[`metadata.annotations.${S.q1}`]:ne}]:[]]})).items,[G,ne]);return{loading:ae,error:Se,location:G,originLocation:ne,colocatedEntities:Ie==null?void 0:Ie.filter(we=>(0,S.eE)(we)!==Y)}}function Yr(m){return(0,c.jsxs)(Kn.Z,{dense:!0,children:[m.header&&(0,c.jsx)($r,{entry:m.header},"header"),m.entities.map(y=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{kind:y.kind})}),(0,c.jsx)(mn,{primary:(0,c.jsx)(He,{entityRef:y})})]},(0,S.eE)(y)))]})}function ar(m){const{entity:y}=m,{loading:I,error:O,location:Y,originLocation:G,colocatedEntities:ne}=Kr(y);if(I)return(0,c.jsx)(A.Ex,{});if(O)return(0,c.jsx)(A.Gk,{error:O});if(!Y&&!G)return(0,c.jsx)(kr.Z,{severity:"warning",children:"Entity had no location information."});if(!(ne!=null&&ne.length))return(0,c.jsx)(kr.Z,{severity:"info",children:"There were no other entities on this location."});if(Y===G)return(0,c.jsx)(Yr,{entities:ne});const ae=ne.filter(Ie=>{var we;return((we=Ie.metadata.annotations)===null||we===void 0?void 0:we[S.P1])===Y}),Se=ne.filter(Ie=>{var we;return((we=Ie.metadata.annotations)===null||we===void 0?void 0:we[S.q1])===G});return(0,c.jsxs)(c.Fragment,{children:[ae.length>0&&(0,c.jsx)(Yr,{entities:ae,header:["At the same location",Y]}),Se.length>0&&(0,c.jsx)(Yr,{entities:Se,header:["At the same origin",G]})]})}function xs(m){const y=ys();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(Je.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,c.jsx)("div",{className:y.root,children:(0,c.jsx)(ar,{entity:m.entity})})]})}function Jr(m){return Object.fromEntries([...Object.entries(m)].sort((y,I)=>y[0]<I[0]?-1:1))}function bs(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:JSON.stringify(Jr(m.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zr=t(3440),Ss=t.n(Zr);const Cs=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Qr(m){var y,I;const O=Cs(),{apiVersion:Y,kind:G,metadata:ne,spec:ae,relations:Se=[],status:Ie={}}=m.entity,we=Ss()(fn()(Se,je=>je.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:O.root,children:[(0,c.jsx)(Br,{title:"Identity",children:(0,c.jsxs)(Kn.Z,{dense:!0,children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(mn,{primary:"apiVersion",secondary:Y})}),(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(mn,{primary:"kind",secondary:G})}),(ae==null?void 0:ae.type)&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(mn,{primary:"spec.type",secondary:ae.type})}),ne.uid&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(mn,{primary:"uid",secondary:ne.uid})}),ne.etag&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(mn,{primary:"etag",secondary:ne.etag})})]})}),(0,c.jsxs)(Br,{title:"Metadata",children:[!!Object.keys(ne.annotations||{}).length&&(0,c.jsx)(Kn.Z,{dense:!0,subheader:(0,c.jsxs)(ir,{children:["Annotations",(0,c.jsx)(vs,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ne.annotations).map(je=>(0,c.jsx)($r,{indent:!0,entry:je},je[0]))}),!!Object.keys(ne.labels||{}).length&&(0,c.jsx)(Kn.Z,{dense:!0,subheader:(0,c.jsx)(ir,{children:"Labels"}),children:Object.entries(ne.labels).map(je=>(0,c.jsx)($r,{indent:!0,entry:je},je[0]))}),!!(!((y=ne.tags)===null||y===void 0)&&y.length)&&(0,c.jsx)(Kn.Z,{dense:!0,subheader:(0,c.jsx)(ir,{children:"Tags"}),children:ne.tags.map((je,Me)=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{}),(0,c.jsx)(mn,{primary:je})]},`${je}-${Me}`))})]}),!!Se.length&&(0,c.jsx)(Br,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(we).map(([je,Me],gt)=>(0,c.jsx)("div",{children:(0,c.jsx)(Kn.Z,{dense:!0,subheader:(0,c.jsx)(ir,{children:je}),children:Me.map(Ct=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{entityRef:Ct.targetRef})}),(0,c.jsx)(mn,{primary:(0,c.jsx)(He,{entityRef:Ct.targetRef})})]},Ct.targetRef))})},gt))}),!!(!((I=Ie.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Br,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ie.items.map((je,Me)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(_.Z,{children:[je.level,": ",je.type]}),(0,c.jsx)(M.Z,{ml:2,children:je.message})]},Me))})]})]})}var Xr=t(72847);function qr(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:Xr.ZP.stringify(Jr(m.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Dr=(0,D.Z)(m=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:m.palette.background.paper},tabs:{borderRight:`1px solid ${m.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function on(m){const{children:y,value:I,index:O,...Y}=m,G=Dr();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==O,id:`vertical-tabpanel-${O}`,"aria-labelledby":`vertical-tab-${O}`,className:G.tabContents,...Y,children:I===O&&(0,c.jsx)(M.Z,{pl:3,pr:3,children:y})})}function Ut(m){return{id:`vertical-tab-${m}`,"aria-controls":`vertical-tabpanel-${m}`}}function ws(m){const y=Dr(),[I,O]=P.useState(0);return(0,P.useEffect)(()=>{O(0)},[m.open]),m.entity?(0,c.jsxs)(x.Z,{fullWidth:!0,maxWidth:"xl",open:m.open,onClose:m.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:y.fullHeightDialog},children:[(0,c.jsx)(E.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(J.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:y.root,children:[(0,c.jsxs)(ve.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(Y,G)=>O(G),"aria-label":"Inspector options",className:y.tabs,children:[(0,c.jsx)(ye.Z,{label:"Overview",...Ut(0)}),(0,c.jsx)(ye.Z,{label:"Ancestry",...Ut(1)}),(0,c.jsx)(ye.Z,{label:"Colocated",...Ut(2)}),(0,c.jsx)(ye.Z,{label:"Raw JSON",...Ut(3)}),(0,c.jsx)(ye.Z,{label:"Raw YAML",...Ut(4)})]}),(0,c.jsx)(on,{value:I,index:0,children:(0,c.jsx)(Qr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:1,children:(0,c.jsx)(Pr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:2,children:(0,c.jsx)(xs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:3,children:(0,c.jsx)(bs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:4,children:(0,c.jsx)(qr,{entity:m.entity})})]})}),(0,c.jsx)(De.Z,{children:(0,c.jsx)(X.Z,{onClick:m.onClose,color:"primary",children:"Close"})})]}):null}var js=t(85256);function Es(m){var y;const I=(0,r.h_)(W),O=(y=m.metadata.annotations)===null||y===void 0?void 0:y[S.q1],Y=m.metadata.uid,G=O==="bootstrap:bootstrap",ne=(0,mt.default)(async()=>{const Ct=I.getLocationByRef(O);let Ge;if(!O)Ge=Promise.resolve([]);else{const ut=`metadata.annotations.${S.q1}`;Ge=I.getEntities({filter:{[ut]:O},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Wt=>Wt.items)}return Promise.all([Ct,Ge]).then(([ut,Wt])=>({location:ut,colocatedEntities:Wt}))},[I,m]),ae=(0,P.useCallback)(async function(){const{location:Ge}=ne.value;await I.removeLocationById(Ge.id)},[I,ne]),Se=(0,P.useCallback)(async function(){await I.removeEntityByUid(Y)},[I,Y]);if(G)return{type:"bootstrap",location:O,deleteEntity:Se};const{loading:Ie,error:we,value:je}=ne;if(Ie)return{type:"loading"};if(we)return{type:"error",error:we};const{location:Me,colocatedEntities:gt}=je;return Me?{type:"unregister",location:O,colocatedEntities:gt.map(S.iB),unregisterLocation:ae,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var _r=t(23054);const As=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),Ts=({entity:m,onConfirm:y})=>{const I=(0,r.h_)(r.$v),O=(0,r.h_)(r.Ds),Y=As(),G=Es(m),[ne,ae]=(0,P.useState)(!1),[Se,Ie]=(0,P.useState)(!1);var we;const je=(we=O.getOptionalString("app.title"))!==null&&we!==void 0?we:"Backstage",Me=(0,P.useCallback)(async function(){if("unregisterLocation"in G){Ie(!0);try{await G.unregisterLocation(),y()}catch(Ge){(0,_r.BD)(Ge),I.post({message:Ge.message})}finally{Ie(!1)}}},[I,y,G]),gt=(0,P.useCallback)(async function(){if("deleteEntity"in G){Ie(!0);try{await G.deleteEntity(),y()}catch(Ge){(0,_r.BD)(Ge),I.post({message:Ge.message})}finally{Ie(!1)}}},[I,y,G]);return G.type==="loading"?(0,c.jsx)(A.Ex,{}):G.type==="error"?(0,c.jsx)(A.Gk,{error:G.error}):G.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(kr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',G.location,'"). If you believe this is in error, please contact the ',je," ","integrator."]}),(0,c.jsxs)(M.Z,{marginTop:2,children:[!ne&&(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Y.advancedButton,onClick:()=>ae(!0),children:"Advanced Options"}),ne&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.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,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:gt,children:"Delete Entity"})]})]})]}):G.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.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,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:gt,children:"Delete Entity"})]}):G.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(Je.Z,{component:"ul",children:G.colocatedEntities.map(Ct=>(0,c.jsx)("li",{children:(0,c.jsx)(He,{entityRef:Ct})},`${Ct.kind}:${Ct.namespace}/${Ct.name}`))}),(0,c.jsx)(Je.Z,{children:"Located at the following location:"}),(0,c.jsx)(Je.Z,{component:"ul",children:(0,c.jsx)("li",{children:G.location})}),(0,c.jsxs)(Je.Z,{children:["To undo, just re-register the entity in ",je,"."]}),(0,c.jsxs)(M.Z,{marginTop:2,children:[(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Me,children:"Unregister Location"}),!ne&&(0,c.jsx)(M.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Y.advancedButton,onClick:()=>ae(!0),children:"Advanced Options"})})]}),ne&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(M.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(js.Z,{})}),(0,c.jsx)(Je.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,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:gt,children:"Delete Entity"})]})]}):(0,c.jsx)(kr.Z,{severity:"error",children:"Internal error: Unknown state"})},es=m=>{const{open:y,onConfirm:I,onClose:O,entity:Y}=m;return(0,c.jsxs)(x.Z,{open:y,onClose:O,children:[(0,c.jsx)(E.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(J.Z,{children:(0,c.jsx)(Ts,{entity:Y,onConfirm:I})}),(0,c.jsx)(De.Z,{children:(0,c.jsx)(X.Z,{onClick:O,color:"primary",children:"Cancel"})})]})};var jr=t(12231),Vs=t(9520),Is=t(47603);const ts=(0,D.Z)(m=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:m.spacing(1,0,1,0)},title:{margin:m.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:m.palette.text.primary},menuItem:{minHeight:m.spacing(6)},groupWrapper:{margin:m.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Rs(m){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Is.Z},{id:"starred",label:"Starred",icon:Rn.Z}]},{name:m!=null?m:"Company",items:[{id:"all",label:"All"}]}]}const Hs=m=>{const{initialFilter:y,availableFilters:I}=m,O=ts(),Y=(0,r.h_)(r.Ds);var G;const ne=(G=Y.getOptionalString("organization.name"))!==null&&G!==void 0?G:"Company",{filters:ae,updateFilters:Se,backendEntities:Ie,queryParameters:{kind:we,user:je},loading:Me}=pn(),gt=["starred","all"],Ct=Rs(ne).map(sn=>({...sn,items:sn.items.filter(({id:Ln})=>["group","user"].some(gr=>gr===we)?gt.includes(Ln):!I||I.includes(Ln))})).filter(({items:sn})=>!!sn.length),{isStarredEntity:Ge}=ge(),{isOwnedEntity:ut,loading:Wt}=Ne(),qn=Me||Wt,an=(0,P.useMemo)(()=>new tt("owned",ut,Ge),[ut,Ge]),_n=(0,P.useMemo)(()=>new tt("starred",ut,Ge),[ut,Ge]),En=(0,P.useMemo)(()=>[je].flat()[0],[je]),[$n,Vn]=(0,P.useState)(En!=null?En:y),Er=(0,P.useMemo)(()=>Ie.filter(vt((0,Vt.compact)(Object.values({...ae,user:void 0})))),[ae,Ie]),fr=(0,P.useMemo)(()=>({all:Er.length,starred:Er.filter(sn=>_n.filterEntity(sn)).length,owned:Er.filter(sn=>an.filterEntity(sn)).length}),[Er,_n,an]);(0,P.useEffect)(()=>{En&&Vn(En)},[En]),(0,P.useEffect)(()=>{!qn&&!!$n&&$n!=="all"&&fr[$n]===0&&Vn("all")},[qn,fr,$n,Vn]),(0,P.useEffect)(()=>{Se({user:$n?new tt($n,ut,Ge):void 0})},[$n,ut,Ge,Se]);var ns;return(0,c.jsx)(Or.Z,{className:O.root,children:Ct.map(sn=>(0,c.jsxs)(P.Fragment,{children:[(0,c.jsx)(_.Z,{variant:"subtitle2",component:"span",className:O.title,children:sn.name}),(0,c.jsx)(Or.Z,{className:O.groupWrapper,children:(0,c.jsx)(Kn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":sn.name,children:sn.items.map(Ln=>{var gr;return(0,c.jsxs)(jr.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Vn(Ln.id),selected:Ln.id===((gr=ae.user)===null||gr===void 0?void 0:gr.value),className:O.menuItem,disabled:fr[Ln.id]===0,"data-testid":`user-picker-${Ln.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Ln.icon&&(0,c.jsx)(pr.Z,{className:O.listIcon,children:(0,c.jsx)(Ln.icon,{fontSize:"small"})}),(0,c.jsx)(Gr.Z,{children:(0,c.jsxs)(_.Z,{variant:"body1",children:[Ln.label," "]})}),(0,c.jsx)(Vs.Z,{children:(ns=fr[Ln.id])!==null&&ns!==void 0?ns:"-"})]},Ln.id)})})})]},sn.name))})},Ls=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Gs=(0,c.jsx)($e.Z,{fontSize:"small"}),Ks=(0,c.jsx)(be.Z,{fontSize:"small"}),Ps=()=>{const m=Ls(),{updateFilters:y}=pn(),[I,O]=(0,P.useState)([]);function Y(ae){y({orphan:ae?new yt(ae):void 0})}function G(ae){y({error:ae?new Zt(ae):void 0})}const ne=["Is Orphan","Has Error"];return(0,c.jsx)(M.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(Ue.ZP,{multiple:!0,options:ne,value:I,onChange:(ae,Se)=>{O(Se),Y(Se.includes("Is Orphan")),G(Se.includes("Has Error"))},renderOption:(ae,{selected:Se})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Gs,checkedIcon:Ks,checked:Se}),label:ae}),size:"small",popupIcon:(0,c.jsx)(Ee.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ae=>(0,c.jsx)(pe.Z,{...ae,className:m.input,variant:"outlined"})})]})})},Ys=({children:m,value:y})=>{var I;const[O,Y]=useState((I=y==null?void 0:y.filters)!==null&&I!==void 0?I:{}),G=useCallback(gt=>{Y(Ct=>{const Ge=typeof gt=="function"?gt(Ct):gt;return{...Ct,...Ge}})},[]),ne=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var ae,Se,Ie,we,je;const Me=useMemo(()=>({entities:(ae=y==null?void 0:y.entities)!==null&&ae!==void 0?ae:ne.entities,backendEntities:(Se=y==null?void 0:y.backendEntities)!==null&&Se!==void 0?Se:ne.backendEntities,updateFilters:(Ie=y==null?void 0:y.updateFilters)!==null&&Ie!==void 0?Ie:G,filters:O,loading:(we=y==null?void 0:y.loading)!==null&&we!==void 0?we:!1,queryParameters:(je=y==null?void 0:y.queryParameters)!==null&&je!==void 0?je:ne.queryParameters,error:y==null?void 0:y.error}),[y,ne,O,G]);return _jsx(EntityListContext.Provider,{value:Me,children:m})}},33414:function(Rt,ze,t){"use strict";t.r(ze),t.d(ze,{AboutCard:function(){return mt},AboutContent:function(){return qe},AboutField:function(){return q}});var h=t(52322),r=t(25271),W=t(93414),Z=t(25248),g=t(32838),b=t(56941),c=t(79692),P=t(94339),te=t(32552),Q=t(61837),X=t(85256),z=t(24579),M=t(52866),_=t(30254),fe=t(27604),le=t(2784),T=t(19625),L=t(60905),N=t(90436),A=t(7089);const S=(0,c.Z)(Te=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Te.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function q(Te){const{label:Ye,value:st,gridSizes:vt,children:rt}=Te,ot=S(),ct=(0,Z.vJ)(rt,Lt=>Lt.getElements()),St=ct.length>0?ct:(0,h.jsx)(N.Z,{variant:"body2",className:ot.value,children:st||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...vt,children:[(0,h.jsx)(N.Z,{variant:"h2",className:ot.label,children:Ye}),St]})}var Le=t(24851);const Xe=(0,c.Z)({description:{wordBreak:"break-word"}});function Qe(Te,Ye,st){if(Ye==="url"||Te.includes("://"))return Te;const vt=st.type==="file"?`file://${st.target}`:st.target;return Ye==="file"||st.type==="file"?new URL(Te,vt).href:vt}function qe(Te){var Ye,st,vt,rt,ot,ct,St,Lt;const{entity:Ve}=Te,oe=Xe(),Pe=Ve.kind.toLocaleLowerCase("en-US")==="system",ke=Ve.kind.toLocaleLowerCase("en-US")==="resource",tt=Ve.kind.toLocaleLowerCase("en-US")==="component",yt=Ve.kind.toLocaleLowerCase("en-US")==="api",Zt=Ve.kind.toLocaleLowerCase("en-US")==="template",ht=Ve.kind.toLocaleLowerCase("en-US")==="location",Tt=Ve.kind.toLocaleLowerCase("en-US")==="group",It=(0,b.hF)(Ve,r.cz,{kind:"system"}),Ot=(0,b.hF)(Ve,r.cz,{kind:"component"}),en=(0,b.hF)(Ve,r.cz,{kind:"domain"}),Vt=(0,b.hF)(Ve,r.S4);let Ht;try{Ht=(0,r.CV)(Ve)}catch{Ht=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(q,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(N.Z,{variant:"body2",paragraph:!0,className:oe.description,children:(Ve==null||(Ye=Ve.metadata)===null||Ye===void 0?void 0:Ye.description)||"No description"})}),(0,h.jsx)(q,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Vt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Vt,defaultKind:"group"})}),(Pe||en.length>0)&&(0,h.jsx)(q,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(b.rI,{entityRefs:en,defaultKind:"domain"})}),(yt||tt||ke||It.length>0)&&(0,h.jsx)(q,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:It.length>0&&(0,h.jsx)(b.rI,{entityRefs:It,defaultKind:"system"})}),tt&&Ot.length>0&&(0,h.jsx)(q,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Ot,defaultKind:"component"})}),(yt||tt||ke||Zt||Tt||ht||typeof(Ve==null||(st=Ve.spec)===null||st===void 0?void 0:st.type)=="string")&&(0,h.jsx)(q,{label:"Type",value:Ve==null||(vt=Ve.spec)===null||vt===void 0?void 0:vt.type,gridSizes:{xs:12,sm:6,lg:4}}),(yt||tt||typeof(Ve==null||(rt=Ve.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(q,{label:"Lifecycle",value:Ve==null||(ot=Ve.spec)===null||ot===void 0?void 0:ot.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(q,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ve==null||(ct=Ve.metadata)===null||ct===void 0?void 0:ct.tags)||[]).map(Qt=>(0,h.jsx)(A.Z,{size:"small",label:Qt},Qt))}),ht&&((Ve==null||(St=Ve.spec)===null||St===void 0?void 0:St.targets)||(Ve==null||(Lt=Ve.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(q,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Le.s,{cols:1,items:(Ve.spec.targets||[Ve.spec.target]).map(Qt=>Qt).map(Qt=>{var hn;return{text:Qt,href:Qe(Qt,(Ve==null||(hn=Ve.spec)===null||hn===void 0?void 0:hn.type)||"unknown",Ht)}})})})]})}const He=(0,c.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 mt(Te){var Ye,st,vt;const{variant:rt}=Te,ot=He(),{entity:ct}=(0,b.X2)(),St=(0,Z.h_)(g.q3),Lt=(0,Z.h_)(b.Ah),Ve=(0,Z.h_)(Z.$v),oe=(0,Z.h_)(Z.VE),Pe=(0,Z.tg)(T.jU),ke=(0,b.CV)(ct,St),tt=(Ye=ct.metadata.annotations)===null||Ye===void 0?void 0:Ye[r.Tf],yt={label:"View Source",disabled:!ke,icon:(0,h.jsx)(g.nW,{type:ke==null?void 0:ke.integrationType}),href:ke==null?void 0:ke.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((st=ct.metadata.annotations)===null||st===void 0)&&st["backstage.io/techdocs-ref"])||!Pe,icon:(0,h.jsx)(_.Z,{}),href:Pe&&Pe({namespace:ct.metadata.namespace||r.zG,kind:ct.kind,name:ct.metadata.name})};let ht="";rt==="gridItem"?ht=ot.gridItemCard:rt==="fullHeight"&&(ht=ot.fullHeightCard);let Tt="";rt==="gridItem"?Tt=ot.gridItemCardContent:rt==="fullHeight"&&(Tt=ot.fullHeightCardContent);const It=(vt=ct.metadata.annotations)===null||vt===void 0?void 0:vt[r.P1],Ot=(It==null?void 0:It.startsWith("url:"))||(It==null?void 0:It.startsWith("file:")),en=(0,le.useCallback)(async()=>{try{await Lt.refreshEntity((0,r.eE)(ct)),Ve.post({message:"Refresh scheduled",severity:"info"})}catch(Vt){oe.post(Vt)}},[Lt,Ve,oe,ct]);return(0,h.jsxs)(P.Z,{className:ht,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(Q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:en,children:(0,h.jsx)(M.Z,{})}),(0,h.jsx)(Q.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(fe.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[yt,Zt]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(z.Z,{className:Tt,children:(0,h.jsx)(qe,{entity:ct})})]})}},86359:function(Rt,ze,t){"use strict";t.d(ze,{E:function(){return le}});var h=t(52322),r=t(25271),W=t(93414),Z=t(56941),g=t(90436),b=t(15459),c=t(27604),P=t(2997),te=t(11640),Q=t(28347),X=t(76635),z=t(2784),M=t(7089);const _=Object.freeze({createNameColumn(T){function L(N){var A;return((A=N.metadata)===null||A===void 0?void 0:A.title)||(0,Z.$3)(N,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:N},{entity:A}){return L(N).localeCompare(L(A))},render:({entity:N})=>{var A;return(0,h.jsx)(Z.dx,{entityRef:N,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(A=N.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(Z.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(Z.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var L,N;return(0,h.jsx)(h.Fragment,{children:((T==null||(L=T.spec)===null||L===void 0?void 0:L.targets)||(T==null||(N=T.spec)===null||N===void 0?void 0:N.target))&&(0,h.jsx)(W.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,h.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,h.jsx)(h.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(L=>(0,h.jsx)(M.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:N})=>{var A;const S=(A=N.metadata)===null||A===void 0?void 0:A.labels,q=S&&S[T]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:q&&(0,h.jsx)(M.Z,{label:q,size:"small",variant:"outlined"},q)})},width:"auto"}}}),fe=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),le=T=>{var L,N;const{columns:A,actions:S,tableOptions:q,subtitle:Le,emptyContent:Xe}=T,{isStarredEntity:Qe,toggleStarredEntity:qe}=(0,Z.CR)(),{loading:He,error:mt,entities:Te,filters:Ye}=(0,Z.wp)(),st=(0,z.useMemo)(()=>{var oe;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(oe=Ye.kind)===null||oe===void 0?void 0:oe.value}),...Pe(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Pe(){var ke;switch((ke=Ye.kind)===null||ke===void 0?void 0:ke.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=Ye.kind)===null||L===void 0?void 0:L.value]),vt=Ye.type===void 0;var rt;const ot=(0,X.capitalize)((rt=(N=Ye.user)===null||N===void 0?void 0:N.value)!==null&&rt!==void 0?rt:"all");if(mt)return(0,h.jsx)("div",{children:(0,h.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(W.Oi,{language:"text",text:mt.toString()})})});const ct=[({entity:oe})=>{var Pe;const ke=(Pe=oe.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.l2],tt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:oe})=>{var Pe;const ke=(Pe=oe.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.Tf],tt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(c.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:oe})=>{const Pe=Qe(oe),ke=Pe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:ke}),Pe?(0,h.jsx)(fe,{}):(0,h.jsx)(Q.Z,{})]}),tooltip:ke,onClick:()=>qe(oe)}}],St=Te.map(oe=>{const Pe=(0,Z.hF)(oe,r.cz,{kind:"system"}),ke=(0,Z.hF)(oe,r.S4);return{entity:oe,resolved:{name:(0,Z.$3)(oe,{defaultKind:"Component"}),ownedByRelationsTitle:ke.map(tt=>(0,Z.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:ke,partOfSystemRelationTitle:Pe.map(tt=>(0,Z.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Pe}}}),Lt=(A||st).find(oe=>oe.title==="Type");Lt&&(Lt.hidden=!vt);const Ve=St.length>20;return(0,h.jsx)(W.iA,{isLoading:He,columns:A||st,options:{paging:Ve,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!He,padding:"dense",pageSizeOptions:[20,50,100],...q},title:`${ot} (${Te.length})`,data:St,actions:S||ct,subtitle:Le,emptyContent:Xe})};le.columns=_},24851:function(Rt,ze,t){"use strict";t.d(ze,{s:function(){return fe}});var h=t(52322),r=t(90348),W=t(11861),Z=t(2784),g=t(79692),b=t(95544),c=t(90436),P=t(52160),te=t(93414);const Q=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(le){const{href:T,text:L,Icon:N}=le,A=Q();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:A.svgIcon,children:(0,h.jsx)(c.Z,{component:"div",children:N?(0,h.jsx)(N,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(te.rU,{to:T,target:"_blank",rel:"noopener",children:L||T})})]})}var z=t(41156);const M={xs:1,sm:1,md:1,lg:2,xl:3};function _(le){const T=[(0,z.Z)(S=>S.breakpoints.up("xl"))?"xl":null,(0,z.Z)(S=>S.breakpoints.up("lg"))?"lg":null,(0,z.Z)(S=>S.breakpoints.up("md"))?"md":null,(0,z.Z)(S=>S.breakpoints.up("sm"))?"sm":null,(0,z.Z)(S=>S.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof le=="number")L=le;else{var N;const S=(N=T.find(q=>q!==null))!==null&&N!==void 0?N:"xs";var A;L=(A=le==null?void 0:le[S])!==null&&A!==void 0?A:M[S]}return L}function fe(le){const{items:T,cols:L=void 0}=le,N=_(L);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:N,children:T.map(({text:A,href:S,Icon:q},Le)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:S,text:A!=null?A:S,Icon:q})},Le))})}},19625:function(Rt,ze,t){"use strict";t.d(ze,{_Z:function(){return Z},jU:function(){return W},yw:function(){return r}});var h=t(25248);const r=(0,h.x8)({id:"create-component",optional:!0}),W=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),Z=(0,h.NT)({id:"catalog"})},51666:function(Rt,ze,t){"use strict";t.d(ze,{rG:function(){return h},Y2:function(){return N},J$:function(){return te},g2:function(){return W}});var h;(function(A){A.DENY="DENY",A.ALLOW="ALLOW",A.CONDITIONAL="CONDITIONAL"})(h||(h={}));function r(A,S){return A.name===S.name}function W(A,S){return"resourceType"in A?!S||A.resourceType===S:!1}function Z(A){return A.attributes.action==="create"}function g(A){return A.attributes.action==="read"}function b(A){return A.attributes.action==="update"}function c(A){return A.attributes.action==="delete"}function P(A){return{authorize:async(S,q)=>await A.authorize(S,q),authorizeConditional(S,q){const Le=S;return A.authorize(Le,q)}}}function te({name:A,attributes:S,resourceType:q}){return q?{type:"resource",name:A,attributes:S,resourceType:q}:{type:"basic",name:A,attributes:S}}var Q=t(23054),X=t(96279),z=t.n(X),M=t(9571),_=t(30195);const fe=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(fe).nonempty()})).or(_.z.object({allOf:_.z.array(fe).nonempty()})).or(_.z.object({not:fe}))),le=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),T=_.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:fe})]),L=(A,S)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),A)).refine(q=>q.length===S.size&&q.every(({id:Le})=>S.has(Le)),{message:"Items in response do not match request"})});class N{async authorize(S,q){return this.makeRequest(S,le,q)}async authorizeConditional(S,q){return this.makeRequest(S,T,q)}async makeRequest(S,q,Le){if(!this.enabled)return S.map(Ye=>({result:h.ALLOW}));const Xe={items:S.map(Ye=>({id:M.Z(),...Ye}))},Qe=await this.discovery.getBaseUrl("permission"),qe=await z()(`${Qe}/authorize`,{method:"POST",body:JSON.stringify(Xe),headers:{...this.getAuthorizationHeader(Le==null?void 0:Le.token),"content-type":"application/json"}});if(!qe.ok)throw await Q.VL.fromResponse(qe);const He=await qe.json(),Te=L(q,new Set(Xe.items.map(({id:Ye})=>Ye))).parse(He).items.reduce((Ye,st)=>(Ye[st.id]=st,Ye),{});return Xe.items.map(Ye=>Te[Ye.id])}getAuthorizationHeader(S){return S?{Authorization:`Bearer ${S}`}:{}}constructor(S){this.discovery=S.discovery;var q;this.enabled=(q=S.config.getOptionalBoolean("permission.enabled"))!==null&&q!==void 0?q:!1}}},25488:function(Rt,ze,t){"use strict";t.d(ze,{iM:function(){return b},RV:function(){return Z},gI:function(){return P}});var h=t(52322),r=t(2784),W=t(25248);const Z=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(z){const{config:M,discovery:_,identity:fe}=z,le=new g.Y2({discovery:_,config:M});return new b(le,fe)}async authorize(z){return(await this.permissionClient.authorize([z],await this.identityApi.getCredentials()))[0]}constructor(z,M){this.permissionClient=z,this.identityApi=M}}var c=t(69984);function P(X){const z=(0,W.h_)(Z),{data:M,error:_}=(0,c.ZP)(X,async fe=>{if((0,g.g2)(fe.permission)&&!fe.resourceRef)return g.rG.DENY;const{result:le}=await z.authorize(fe);return le});return _?{error:_,loading:!1,allowed:!1}:M===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:M===g.rG.ALLOW}}const te=X=>{const{permission:z,resourceRef:M,errorComponent:_,...fe}=X,le=usePermission(isResourcePermission(z)?{permission:z,resourceRef:M}:{permission:z}),T=useApp(),{NotFoundErrorPage:L}=T.getComponents();let N=_===void 0?_jsx(L,{}):_;return le.loading?N=null:le.allowed&&(N=X.element),_jsx(Route,{...fe,element:N})};function Q(X){const{permission:z,resourceRef:M}=X,_=usePermission(isResourcePermission(z)?{permission:z,resourceRef:M}:{permission:z}),fe=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:le}=fe.getComponents();return _jsx(le,{})}},65826:function(Rt,ze,t){"use strict";t.d(ze,{FA:function(){return P},qO:function(){return rt},Nd:function(){return Qe},Rx:function(){return A}});var h=t(25248);const r=(0,h.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(U){this.mockedResults=U}}var Z=t(52322),g=t(2784),b=t(79692);const c=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:U,postTag:de})=>{const pe=c(),be=(0,g.useMemo)(()=>D.split(new RegExp(`(${U}.+?${de})`)),[de,U,D]);return(0,Z.jsx)(Z.Fragment,{children:be.map(($e,Ee)=>$e.includes(U)?(0,Z.jsx)("mark",{className:pe.highlight,children:$e.replace(new RegExp(`${U}|${de}`,"g"),"")},Ee):$e)})};var te=t(48760),Q=t(50581),X=t(61837),z=t(74603),M=t(21853),_=t(33375),fe=t(76635),le=t(64279),T=t(1849),L=t(51837);const N=(0,L.CT)("search-context"),A=()=>{const D=(0,g.useContext)(N);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const U=D.atVersion(1);if(!U)throw new Error("No SearchContext v1 found");return U},S=()=>(0,g.useContext)(N)!==void 0,q={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(D=q)=>{var U,de,pe,be;const $e=(0,h.h_)(r),[Ee,Ue]=(0,g.useState)(D.term),[nt,C]=(0,g.useState)(D.types),[H,me]=(0,g.useState)(D.filters),[ue,Ce]=(0,g.useState)(D.pageLimit),[Oe,Fe]=(0,g.useState)(D.pageCursor),dt=(0,T.Z)(Ee),Et=(0,T.Z)(H),it=(0,le.default)(()=>$e.query({term:Ee,types:nt,filters:H,pageLimit:ue,pageCursor:Oe}),[Ee,nt,H,ue,Oe]),ft=!it.loading&&!it.error&&((U=it.value)===null||U===void 0?void 0:U.nextPageCursor),xt=!it.loading&&!it.error&&((de=it.value)===null||de===void 0?void 0:de.previousPageCursor),at=(0,g.useCallback)(()=>{var zt;Fe((zt=it.value)===null||zt===void 0?void 0:zt.nextPageCursor)},[(pe=it.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Bt=(0,g.useCallback)(()=>{var zt;Fe((zt=it.value)===null||zt===void 0?void 0:zt.previousPageCursor)},[(be=it.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,g.useEffect)(()=>{dt!==void 0&&Ee!==dt&&Fe(void 0)},[Ee,dt,Fe]),(0,g.useEffect)(()=>{Et!==void 0&&!(0,fe.isEqual)(H,Et)&&Fe(void 0)},[H,Et,Fe]),{result:it,term:Ee,setTerm:Ue,types:nt,setTypes:C,filters:H,setFilters:me,pageLimit:ue,setPageLimit:Ce,pageCursor:Oe,setPageCursor:Fe,fetchNextPage:ft?at:void 0,fetchPreviousPage:xt?Bt:void 0}},Xe=D=>{const{initialState:U,children:de}=D,pe=Le(U);return(0,Z.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,Z.jsx)(N.Provider,{value:(0,L.EI)({1:pe}),children:de})})},Qe=D=>{const{initialState:U,inheritParentContextIfAvailable:de,children:pe}=D;return S()&&de?(0,Z.jsx)(Z.Fragment,{children:pe}):(0,Z.jsx)(Xe,{initialState:U,children:pe})},qe=({children:D})=>{var U;const de=H=>(0,T.Z)(H)!==H,pe=(0,h.z$)(),{term:be,result:$e}=A();var Ee;const Ue=(Ee=(U=$e.value)===null||U===void 0?void 0:U.numberOfResults)!==null&&Ee!==void 0?Ee:void 0,C=de($e.loading)&&!$e.loading;return(0,g.useEffect)(()=>{be&&C&&pe.captureEvent("search",be,{value:Ue})},[pe,be,Ue,C]),(0,Z.jsx)(Z.Fragment,{children:D})};function He(D){return(0,g.forwardRef)((U,de)=>(0,Z.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,Z.jsx)(D,{...U,ref:de})}))}const mt=He((0,g.forwardRef)((D,U)=>{const{onChange:de,onKeyDown:pe=()=>{},onClear:be=()=>{},onSubmit:$e=()=>{},debounceTime:Ee=200,clearButton:Ue=!0,fullWidth:nt=!0,value:C,placeholder:H,inputProps:me={},endAdornment:ue,...Ce}=D,Oe=(0,h.h_)(h.Ds),[Fe,dt]=(0,g.useState)("");(0,g.useEffect)(()=>{dt(Mt=>Mt!==C?String(C):Mt)},[C]),(0,te.Z)(()=>de(Fe),Ee,[Fe]);const Et=(0,g.useCallback)(Mt=>{dt(Mt.target.value)},[dt]),it=(0,g.useCallback)(Mt=>{pe&&pe(Mt),$e&&Mt.key==="Enter"&&$e()},[pe,$e]),ft=(0,g.useCallback)(()=>{de(""),be&&be()},[de,be]),xt=H!=null?H:`Search in ${Oe.getOptionalString("app.title")||"Backstage"}`,at=(0,Z.jsx)(Q.Z,{position:"start",children:(0,Z.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,Z.jsx)(M.Z,{})})}),Bt=(0,Z.jsx)(Q.Z,{position:"end",children:(0,Z.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:ft,children:(0,Z.jsx)(_.Z,{})})});return(0,Z.jsx)(qe,{children:(0,Z.jsx)(z.Z,{"data-testid":"search-bar-next",ref:U,value:Fe,placeholder:xt,startAdornment:at,endAdornment:Ue?Bt:ue,inputProps:{"aria-label":"Search",...me},fullWidth:nt,onChange:Et,onKeyDown:it,...Ce})})})),Te=He((0,g.forwardRef)((D,U)=>{const{value:de="",onChange:pe,...be}=D,{term:$e,setTerm:Ee}=A();(0,g.useEffect)(()=>{de&&Ee(String(de))},[de,Ee]);const Ue=(0,g.useCallback)(nt=>{pe?pe(nt):Ee(nt)},[pe,Ee]);return(0,Z.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,Z.jsx)(mt,{...be,ref:U,value:$e,onChange:Ue})})}));var Ye=t(4614),st=t(88013);const rt=(D=>U=>(0,Z.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,Z.jsx)(D,{...U})}))(function(U){const{loading:de,value:pe,onChange:be=()=>{},options:$e=[],getOptionLabel:Ee=ft=>String(ft),inputPlaceholder:Ue,inputDebounceTime:nt,freeSolo:C=!0,fullWidth:H=!0,clearOnBlur:me=!1,"data-testid":ue="search-autocomplete",...Ce}=U,{setTerm:Oe}=A(),Fe=(0,g.useCallback)(ft=>ft?typeof ft=="string"?ft:Ee(ft):"",[Ee]),dt=(0,g.useMemo)(()=>Fe(pe),[pe,Fe]),Et=(0,g.useCallback)((ft,xt,at,Bt)=>{Oe(Fe(xt)),be(ft,xt,at,Bt)},[Fe,Oe,be]),it=(0,g.useCallback)(({InputProps:{ref:ft,endAdornment:xt},InputLabelProps:at,...Bt})=>(0,Z.jsx)(Te,{...Bt,ref:ft,clearButton:!1,value:dt,placeholder:Ue,debounceTime:nt,endAdornment:de?(0,Z.jsx)(Ye.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):xt}),[de,dt,Ue,nt]);return(0,Z.jsx)(st.ZP,{...Ce,"data-testid":ue,value:pe,onChange:Et,options:$e,getOptionLabel:Ee,renderInput:it,freeSolo:C,fullWidth:H,clearOnBlur:me})}),ot=({icon:D,primaryText:U,primaryTextTypographyProps:de,secondaryText:pe,secondaryTextTypographyProps:be,disableTextTypography:$e})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:U,primaryTypographyProps:de,secondary:pe,secondaryTypographyProps:be,disableTypography:$e})]});var ct=t(42494),St=t(84899),Lt=t(5806),Ve=t(21324),oe=t(56939),Pe=t(73698),ke=t(12231),tt=t(86619),yt=t(7089),Zt=t(69294);const ht=(D,U,de=[],pe=250)=>{const be=(0,g.useRef)({}),$e=D||(()=>Promise.resolve([])),[Ee,Ue]=(0,Zt.default)($e,[U],{loading:!0});if((0,te.Z)(()=>{be.current[U]===void 0&&(be.current[U]=Ue(U).then(C=>(be.current[U]=C,C)))},pe,[Ue,U]),de.length)return{loading:!1,value:de};const nt=be.current[U];return Array.isArray(nt)?{loading:!1,value:nt}:Ee},Tt=(D,U)=>{const{setFilters:de}=A();(0,g.useEffect)(()=>{U&&[U].flat().length>0&&de(pe=>({...pe,[D]:U}))},[])},It=D=>{const{className:U,defaultValue:de,name:pe,values:be,valuesDebounceMs:$e,label:Ee,filterSelectedOptions:Ue,limitTags:nt,multiple:C}=D,[H,me]=(0,g.useState)("");Tt(pe,de);const ue=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:Oe,loading:Fe}=ht(ue,H,Ce,$e),{filters:dt,setFilters:Et}=A(),it=dt[pe]||(C?[]:null),ft=(Bt,Mt)=>{Et(zt=>{const{[pe]:qt,...Wn}=zt;return Mt?{...Wn,[pe]:Mt}:{...Wn}})},xt=Bt=>(0,Z.jsx)(tt.Z,{...Bt,name:"search",variant:"outlined",label:Ee,fullWidth:!0}),at=(Bt,Mt)=>Bt.map((zt,qt)=>(0,Z.jsx)(yt.Z,{label:zt,color:"primary",...Mt({index:qt})}));return(0,Z.jsx)(st.ZP,{filterSelectedOptions:Ue,limitTags:nt,multiple:C,className:U,id:`${C?"multi-":""}select-filter-${pe}--select`,options:Oe||[],loading:Fe,value:it,onChange:ft,onInputChange:(Bt,Mt)=>me(Mt),renderInput:xt,renderTags:at})},Ot=(0,b.Z)({label:{textTransform:"capitalize"}}),en=D=>{const{className:U,defaultValue:de,label:pe,name:be,values:$e=[],valuesDebounceMs:Ee}=D,Ue=Ot(),{filters:nt,setFilters:C}=A();Tt(be,de);const H=typeof $e=="function"?$e:void 0,me=typeof $e=="function"?void 0:$e,{value:ue=[],loading:Ce}=ht(H,"",me,Ee),Oe=dt=>{const{target:{value:Et,checked:it}}=dt;C(ft=>{const{[be]:xt,...at}=ft,Bt=(xt||[]).filter(zt=>zt!==Et),Mt=it?[...Bt,Et]:Bt;return Mt.length?{...at,[be]:Mt}:at})};var Fe;return(0,Z.jsxs)(ct.Z,{className:U,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,Z.jsx)(St.Z,{className:Ue.label,children:pe}):null,ue.map(dt=>(0,Z.jsx)(Lt.Z,{control:(0,Z.jsx)(Ve.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":dt},value:dt,name:dt,onChange:Oe,checked:((Fe=nt[be])!==null&&Fe!==void 0?Fe:[]).includes(dt)}),label:dt},dt))]})},Vt=D=>{const{className:U,defaultValue:de,label:pe,name:be,values:$e,valuesDebounceMs:Ee}=D,Ue=Ot();Tt(be,de);const nt=typeof $e=="function"?$e:void 0,C=typeof $e=="function"?void 0:$e,{value:H=[],loading:me}=ht(nt,"",C,Ee),{filters:ue,setFilters:Ce}=A(),Oe=Fe=>{const{target:{value:dt}}=Fe;Ce(Et=>{const{[be]:it,...ft}=Et;return dt?{...ft,[be]:dt}:ft})};return(0,Z.jsxs)(ct.Z,{disabled:me,className:U,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,Z.jsx)(oe.Z,{className:Ue.label,margin:"dense",children:pe}):null,(0,Z.jsxs)(Pe.Z,{variant:"outlined",value:ue[be]||"",onChange:Oe,children:[(0,Z.jsx)(ke.Z,{value:"",children:(0,Z.jsx)("em",{children:"All"})}),H.map(Fe=>(0,Z.jsx)(ke.Z,{value:Fe,children:Fe},Fe))]})]})},Ht=({component:D,...U})=>(0,Z.jsx)(D,{...U});Ht.Checkbox=D=>(0,Z.jsx)(Ht,{...D,component:en}),Ht.Select=D=>(0,Z.jsx)(Ht,{...D,component:Vt}),Ht.Autocomplete=D=>(0,Z.jsx)(Ht,{...D,component:It});var Qt=t(93414);const hn=D=>{const{children:U}=D,pe=useSearch().result;return U(pe)},dn=D=>{const{query:U,children:de}=D,pe=useApi(searchApiRef),be=useAsync(()=>{const{term:$e="",types:Ee=[],filters:Ue={},...nt}=U;return pe.query({...nt,term:$e,types:Ee,filters:Ue})},[U]);return de(be)},Fn=D=>{const{query:U,children:de}=D;return U?_jsx(dn,{query:U,children:de}):_jsx(hn,{children:de})},In=D=>{const{query:U,children:de,noResultsComponent:pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})}=D;return _jsx(Fn,{query:U,children:({loading:be,error:$e,value:Ee})=>be?_jsx(Progress,{}):$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):Ee!=null&&Ee.results.length?de(Ee):pe})},Un=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(In,{...D})}),yn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),pn=()=>{const{fetchNextPage:D,fetchPreviousPage:U}=useSearch(),de=yn();return!D&&!U?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:de.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!U,onClick:U,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Xt=t(48834).lW;const Mn=D=>Xt.from(D.toString(),"utf-8").toString("base64"),zn=D=>D?Number(Xt.from(D,"base64").toString("utf-8")):0,fn=D=>{const{total:U=-1,cursor:de,onCursorChange:pe,limit:be=25,limitLabel:$e="Results per page:",limitText:Ee=({from:Ce,to:Oe})=>U>0?`of ${U}`:`${Ce}-${Oe}`,limitOptions:Ue,onLimitChange:nt,...C}=D,H=useMemo(()=>zn(de),[de]),me=useCallback((Ce,Oe)=>{pe==null||pe(Mn(Oe))},[pe]),ue=useCallback(Ce=>{const Oe=Ce.target.value;nt==null||nt(parseInt(Oe,10))},[nt]);return _jsx(TablePagination,{...C,component:"div",count:U,page:H,onPageChange:me,rowsPerPage:be,labelRowsPerPage:$e,labelDisplayedRows:Ee,rowsPerPageOptions:Ue,onRowsPerPageChange:ue})},xn=D=>{const{pageLimit:U,setPageLimit:de,pageCursor:pe,setPageCursor:be}=useSearch();return _jsx(fn,{...D,limit:U,onLimitChange:de,cursor:pe,onCursorChange:be})},bn=({result:D,highlight:U,rank:de,icon:pe,secondaryAction:be,lineClamp:$e=5})=>{const Ee=useAnalytics(),Ue=()=>{Ee.captureEvent("discover",D.title,{attributes:{to:D.location},value:de})};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:D.location,onClick:Ue,children:U!=null&&U.fields.title?_jsx(HighlightedSearchResultText,{text:(U==null?void 0:U.fields.title)||"",preTag:(U==null?void 0:U.preTag)||"",postTag:(U==null?void 0:U.postTag)||""}):D.title}),secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:$e,overflow:"hidden"},children:U!=null&&U.fields.text?_jsx(HighlightedSearchResultText,{text:U.fields.text,preTag:U.preTag,postTag:U.postTag}):D.text})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},Pn=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(bn,{...D})}),kn=D=>{const{loading:U,error:de,resultItems:pe,renderResultItem:be=Ue=>_jsx(DefaultResultListItem,{result:Ue.document},Ue.document.location),noResultsComponent:$e=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ee}=D;return _jsxs(List,{...Ee,children:[U?_jsx(Progress,{}):null,!U&&de?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:de}):null,!U&&!de&&(pe==null?void 0:pe.length)?pe.map(be):null,!U&&!de&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:$e}):null]})},Sn=D=>{const{query:U,disableRenderingWithNoResults:de,...pe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:U,children:({loading:be,error:$e,value:Ee})=>{var Ue;return!(!(Ee==null||(Ue=Ee.results)===null||Ue===void 0)&&Ue.length)&&de?null:_jsx(kn,{...pe,loading:be,error:$e,resultItems:Ee==null?void 0:Ee.results})}})})};var ge=t(19126);const ee=(0,b.Z)(D=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:D.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:D.spacing(.5)}})),Re=D=>{const U=ee(),{label:de,children:pe,...be}=D;return _jsx(Chip,{...be,className:U.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[de,": ",pe]})})},Ne=()=>null,et=(0,b.Z)(D=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:D.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),jt=D=>{const U=et(),{label:de,value:pe="None",onChange:be,onDelete:$e}=D,Ee=useCallback(Ue=>{be(Ue.target.value)},[be]);return _jsx(Re,{label:de,onDelete:$e,children:_jsx(Typography,{role:"textbox",component:"span",className:U.root,onChange:Ee,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},ie=(0,b.Z)(D=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),k=D=>{const U=ie(),{label:de,value:pe="none",onChange:be,onDelete:$e,children:Ee}=D,Ue=useCallback(nt=>{be(nt.target.value)},[be]);return _jsx(Re,{label:de,onDelete:$e,children:_jsxs(Select,{className:U.root,value:pe,onChange:Ue,input:_jsx(InputBase,{}),IconComponent:Ne,children:[_jsx(MenuItem,{value:"none",children:"None"}),Ee]})})};function ce(D){const U=ee(),[de,pe]=useState(null),{loading:be,error:$e,icon:Ee,title:Ue,titleProps:nt={},link:C=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:U.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:me,renderFilterOption:ue=Bt=>_jsx(MenuItem,{value:String(Bt),children:Bt},String(Bt)),filterFields:Ce,renderFilterField:Oe,resultItems:Fe,renderResultItem:dt=Bt=>_jsx(DefaultResultListItem,{result:Bt.document},Bt.document.location),noResultsComponent:Et=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...it}=D,ft=useCallback(Bt=>{pe(Bt.currentTarget)},[]),xt=useCallback(()=>{pe(null)},[]);var at;return _jsxs(List,{...it,children:[_jsxs(ListSubheader,{className:U.listSubheader,children:[Ee,_jsx(Typography,{className:U.listSubheaderName,component:"strong",...nt,children:Ue}),me?_jsx(Chip,{className:U.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:ft}):null,me?_jsx(Menu,{id:"filters-menu",anchorEl:de,open:Boolean(de),onClose:xt,onClick:xt,keepMounted:!0,children:me.map(ue)}):null,Ce==null?void 0:Ce.map(Bt=>(at=Oe==null?void 0:Oe(Bt))!==null&&at!==void 0?at:null),_jsx(Link,{className:U.listSubheaderLink,to:"/search",...H,children:C})]}),be?_jsx(Progress,{}):null,!be&&$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):null,!be&&!$e&&(Fe==null?void 0:Fe.length)?Fe.map(dt):null,!be&&!$e&&!(Fe!=null&&Fe.length)?_jsx(ListItem,{children:Et}):null]})}function Be(D){const{query:U,linkProps:de={},disableRenderingWithNoResults:pe,...be}=D,$e=`/search?${qs.stringify({query:U.term,types:U.types,filters:U.filters,pageCursor:U.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:U,children:({loading:Ee,error:Ue,value:nt})=>{var C;if(!(!(nt==null||(C=nt.results)===null||C===void 0)&&C.length)&&pe)return null;var H;return _jsx(ce,{...be,loading:Ee,error:Ue,linkProps:{to:$e,...de},resultItems:nt==null?void 0:nt.results,filterFields:Object.keys((H=U.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(Rt,ze,t){"use strict";t.d(ze,{Ox:function(){return Ye},jM:function(){return g},Zz:function(){return b},oZ:function(){return Qe},DR:function(){return c},ZS:function(){return Le},VA:function(){return rt},KY:function(){return te},gT:function(){return _},Dl:function(){return fe},ux:function(){return vt},$L:function(){return M},x1:function(){return Xe}});var h=t(52322),r=t(2784),W=t(79635),Z=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",c=()=>null;(0,Z.R5)(c,b,!0);const P=oe=>`${g}.${oe.toLocaleLowerCase("en-US")}`;function te(oe){const{name:Pe,component:ke}=oe;return(0,Z.YO)({name:Pe,component:{sync:tt=>(0,h.jsx)(ke,{...tt})},data:{[g]:oe,[P(Pe)]:!0}})}const Q=(oe,Pe)=>oe.selectByComponentData({key:Pe}).getElements()[0],X=oe=>oe.selectByComponentData({key:b}).selectByComponentData({key:g}),z=oe=>oe.selectByComponentData({key:b}).findComponentData({key:g}),M=()=>{const oe=(0,W.pC)(),Pe=(0,Z.vJ)(oe,X),ke=(0,Z.vJ)(oe,z),tt=(0,r.useCallback)(ht=>{if(!Pe||!ht)return null;const Tt=P(ht.name);var It;return(It=Q(Pe,Tt))!==null&&It!==void 0?It:null},[Pe]),yt=(0,r.useCallback)(ht=>{const Tt=ke.find(It=>It.name===ht);return Tt?tt(Tt):null},[ke,tt]),Zt=(0,r.useCallback)(ht=>{const Tt=ke.filter(It=>It.location===ht);return Tt.length?Tt.map(tt):null},[ke,tt]);return{renderComponentByName:yt,renderComponentsByLocation:Zt}},_=(0,Z.T0)({id:"plugin.techdocs.service"}),fe=(0,Z.T0)({id:"plugin.techdocs.storageservice"});var le=t(64279),T=t(25271),L=t(51837);function N(oe,Pe){return Pe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(oe.kind=oe.kind.toLocaleLowerCase(),oe.name=oe.name.toLocaleLowerCase(),oe.namespace=oe.namespace.toLocaleLowerCase()),oe}const A=(oe,Pe)=>(0,T.eE)(oe)===(0,T.eE)(Pe),S={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},q=(0,L.CT)("techdocs-reader-page-context"),Le=(0,r.memo)(({entityRef:oe,children:Pe})=>{const ke=(0,Z.h_)(_),tt=(0,Z.h_)(Z.Ds),yt=(0,le.default)(async()=>ke.getTechDocsMetadata(oe),[oe]),Zt=(0,le.default)(async()=>ke.getEntityMetadata(oe),[oe]),[ht,Tt]=(0,r.useState)(S.title),[It,Ot]=(0,r.useState)(S.subtitle),[en,Vt]=(0,r.useState)(S.shadowRoot),Ht={metadata:yt,entityRef:N(oe,tt),entityMetadata:Zt,shadowRoot:en,setShadowRoot:Vt,title:ht,setTitle:Tt,subtitle:It,setSubtitle:Ot},Qt=(0,L.EI)({1:Ht});return(0,h.jsx)(Z.fC,{attributes:{entityRef:(0,T.eE)(oe)},children:(0,h.jsx)(q.Provider,{value:Qt,children:Pe instanceof Function?Pe(Ht):Pe})})},(oe,Pe)=>A(oe.entityRef,Pe.entityRef)),Xe=()=>{const oe=(0,r.useContext)(q);if(oe===void 0)return S;const Pe=oe.atVersion(1);if(Pe===void 0)throw new Error("No context found for version 1.");return Pe},Qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var qe=t(70882),He=t(50236),mt=t(19219),Te=t(93414);const Ye="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",st=oe=>{(0,r.useEffect)(()=>{if(!oe)return()=>{};const Pe=oe.querySelectorAll('head > link[rel="stylesheet"]');var ke;let tt=(ke=Pe==null?void 0:Pe.length)!==null&&ke!==void 0?ke:0;const yt=new CustomEvent(Ye);if(!tt)return oe.dispatchEvent(yt),()=>{};const Zt=()=>{--tt===0&&oe.dispatchEvent(yt)};return Pe==null||Pe.forEach(ht=>{ht.addEventListener("load",Zt)}),()=>{Pe==null||Pe.forEach(ht=>{ht.removeEventListener("load",Zt)})}},[oe])},vt=oe=>{const[Pe,ke]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!oe)return()=>{};ke(!0);const tt=oe.style;tt.setProperty("opacity","0");const yt=()=>{ke(!1),tt.setProperty("opacity","1")};return oe.addEventListener(Ye,yt),()=>{oe.removeEventListener(Ye,yt)}},[oe]),Pe},rt=({element:oe,onAppend:Pe,children:ke})=>{const[tt,yt]=(0,r.useState)((0,qe.Ue)({...(0,He.Z)(),insertionPoint:void 0}));st(oe);const Zt=vt(oe),ht=(0,r.useCallback)(Tt=>{if(!oe||!Tt)return;yt((0,qe.Ue)({...(0,He.Z)(),insertionPoint:oe.querySelector("head")||void 0}));let It=Tt.shadowRoot;It||(It=Tt.attachShadow({mode:"open"})),It.replaceChildren(oe),typeof Pe=="function"&&Pe(It)},[oe,Pe]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(Te.Ex,{}),(0,h.jsxs)(mt.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ht,"data-testid":"techdocs-native-shadowroot"}),ke]})]})};var ot=t(54073);const ct=()=>{const{shadowRoot:oe}=useTechDocsReaderPage();return oe},St=oe=>{const Pe=ct();return Pe?oe.map(ke=>Pe==null?void 0:Pe.querySelectorAll(ke)).filter(ke=>ke.length).map(ke=>Array.from(ke)).flat():[]},Lt=oe=>oe.toString()&&oe.rangeCount&&oe.getRangeAt(0).getBoundingClientRect().top,Ve=(oe=0)=>{const Pe=ct(),[ke,tt]=useState(null),yt=useMemo(()=>debounce(()=>{const Zt=Pe,ht=Zt.getSelection?Zt.getSelection():document.getSelection();ht&&Lt(ht)?tt(ht):tt(null)},oe),[Pe,tt,oe]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>window.document.removeEventListener("selectionchange",yt)),[yt]),ke}},52943:function(Rt,ze,t){"use strict";t.r(ze),t.d(ze,{EmbeddedDocsRouter:function(){return le},Router:function(){return fe},isTechDocsAvailable:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),Z=t(56941),g=t(93414),b=t(25271),c=t(89258),P=t(65124),te=t(67896);const Q=({entity:T})=>{const L=(0,b.iB)(T);return(0,h.jsxs)(c.I6,{entityRef:L,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var X=t(18662),z=t(7476);const M="backstage.io/techdocs-ref",_=T=>{var L,N;return Boolean(T==null||(L=T.metadata)===null||L===void 0||(N=L.annotations)===null||N===void 0?void 0:N[M])},fe=()=>(0,h.jsxs)(W.Z5,{children:[(0,h.jsx)(W.AW,{path:"/",element:(0,h.jsx)(X.TechDocsIndexPage,{})}),(0,h.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(z.TechDocsReaderPage,{})})]}),le=T=>{var L;const{children:N}=T,{entity:A}=(0,Z.X2)(),S=(0,W.V$)([{path:"/*",element:(0,h.jsx)(Q,{entity:A}),children:[{path:"*",element:N}]}]);return((L=A.metadata.annotations)===null||L===void 0?void 0:L[M])?S:(0,h.jsx)(g.sk,{annotation:M})}},92077:function(Rt,ze,t){"use strict";t.d(ze,{k:function(){return g},p:function(){return Z}});var h=t(23054),r=t(76372),W=t.n(r);class Z{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(c){const{kind:P,namespace:te,name:Q}=c,z=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${P}/${Q}`,M=await this.fetchApi.fetch(`${z}`);if(!M.ok)throw await h.VL.fromResponse(M);return await M.json()}async getEntityMetadata(c){const{kind:P,namespace:te,name:Q}=c,z=`${await this.getApiOrigin()}/metadata/entity/${te}/${P}/${Q}`,M=await this.fetchApi.fetch(`${z}`);if(!M.ok)throw await h.VL.fromResponse(M);return await M.json()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var c;return(c=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&c!==void 0?c:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(c,P){const{kind:te,namespace:Q,name:X}=c,M=`${await this.getStorageUrl()}/${Q}/${te}/${X}/${P}`,_=await this.fetchApi.fetch(`${M.endsWith("/")?M:`${M}/`}index.html`);let fe="";switch(_.status){case 404:throw fe="Page not found. ",P||(fe+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(fe);case 500:throw fe="Could not generate documentation or an error in the TechDocs backend. ",new Error(fe);default:break}return _.text()}async syncEntityDocs(c,P=()=>{}){const{kind:te,namespace:Q,name:X}=c,M=`${await this.getApiOrigin()}/sync/${Q}/${te}/${X}`,{token:_}=await this.identityApi.getCredentials();return new Promise((fe,le)=>{const T=new r.EventSourcePolyfill(M,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});T.addEventListener("log",L=>{L.data&&P(JSON.parse(L.data))}),T.addEventListener("finish",L=>{let N=!1;L.data&&({updated:N}=JSON.parse(L.data)),fe(N?"updated":"cached")}),T.onerror=L=>{switch(T.close(),L.status){case 404:le(new h.dR(L.message));return;default:le(new Error(L.data));return}}})}async getBaseUrl(c,P,te){const{kind:Q,namespace:X,name:z}=P,_=`${await this.getApiOrigin()}/static/docs/${X}/${Q}/${z}/${te}`;return new URL(c,_.endsWith("/")?_:`${_}/`).toString()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.identityApi=c.identityApi,this.fetchApi=c.fetchApi}}},51953:function(Rt,ze,t){"use strict";t.d(ze,{D:function(){return h}});function h(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(Rt,ze,t){"use strict";t.d(ze,{u:function(){return P}});var h=t(52322),r=t(2784),W=t(93414),Z=t(56941),g=t(42081),b=t(48431),c=t(68435);const P=te=>{const{initialFilter:Q="owned",columns:X,actions:z}=te;return(0,h.jsx)(g.j,{children:(0,h.jsxs)(W.VY,{children:[(0,h.jsx)(W.yW,{title:"",children:(0,h.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(Z.UO,{children:(0,h.jsxs)(Z._i,{children:[(0,h.jsxs)(Z._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(Z.EW,{initialFilter:Q}),(0,h.jsx)(Z.dq,{}),(0,h.jsx)(Z.xE,{})]}),(0,h.jsx)(Z._i.Content,{children:(0,h.jsx)(c.n,{actions:z,columns:X})})]})})]})})}},85478:function(Rt,ze,t){"use strict";t.d(ze,{f:function(){return X}});var h=t(52322),r=t(95573),W=t(51953),Z=t(25248),g=t(93414),b=t(94339),c=t(16111),P=t(24579),te=t(14503),Q=t(2784);const X=le=>{const{entities:T}=le,L=(0,Z.tg)(r.Fw),N=(0,Z.h_)(Z.Ds);if(!T)return null;var A,S;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((q,Le)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(c.Z,{children:(0,h.jsx)(g.hu,{title:(A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name})}),(0,h.jsx)(P.Z,{children:q.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(g.zx,{to:L({namespace:(0,W.D)((S=q.metadata.namespace)!==null&&S!==void 0?S:"default",N),kind:(0,W.D)(q.kind,N),name:(0,W.D)(q.metadata.name,N)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Le)):null})};var z=t(56941);const M={title:"All Documentation",filterPredicate:()=>!0},_=({entities:le,group:T})=>{const{loading:L,isOwnedEntity:N}=useEntityOwnership(),A=le.filter(q=>T.filterPredicate==="ownedByUser"?L?!1:N(q):typeof T.filterPredicate=="function"&&T.filterPredicate(q)),S=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return A.length===0?null:_jsxs(Content,{children:[S,_jsx(DocsCardGrid,{entities:A})]})},fe=({groups:le})=>{const{loading:T,error:L,entities:N}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(T)return _jsx(Progress,{});if(N.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 A,S;return N.sort((q,Le)=>((A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name).localeCompare((S=Le.metadata.title)!==null&&S!==void 0?S:Le.metadata.name)),_jsx(Content,{children:(le||[M]).map((q,Le)=>_jsx(_,{entities:N,group:q},`${q.title}-${Le}`))})}},68435:function(Rt,ze,t){"use strict";t.d(ze,{H:function(){return N},n:function(){return A}});var h=t(52322),r=t(2784),W=t(95074),Z=t(76635),g=t(93414),b=t(56941),c=t(25248),P=t(25271),te=t(95573),Q=t(39981),X=t(2337),z=t(11640),M=t(28347);const _=(0,X.Z)({root:{color:"#f3ba37"}})(z.Z),fe={createCopyDocsUrlAction(S){return q=>({icon:()=>(0,h.jsx)(Q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>S(`${window.location.origin}${q.resolved.docsUrl}`)})},createStarEntityAction(S,q){return({entity:Le})=>{const Xe=S(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>Xe?(0,h.jsx)(_,{}):(0,h.jsx)(M.Z,{}),tooltip:Xe?"Remove from favorites":"Add to favorites",onClick:()=>q(Le)}}}};function le(S){return S.metadata.title||S.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:S=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:S.resolved.docsUrl,children:le(S.entity)}),subvalue:S.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:S})=>(0,h.jsx)(b.rI,{entityRefs:S.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const N=S=>{const{entities:q,title:Le,loading:Xe,columns:Qe,actions:qe}=S,[,He]=(0,W.Z)(),mt=(0,c.tg)(te.Fw),Te=(0,c.h_)(c.Ds);if(!q)return null;const Ye=q.map(rt=>{const ot=(0,b.hF)(rt,P.S4);var ct;return{entity:rt,resolved:{docsUrl:mt({namespace:(0,L.D)((ct=rt.metadata.namespace)!==null&&ct!==void 0?ct:"default",Te),kind:(0,L.D)(rt.kind,Te),name:(0,L.D)(rt.metadata.name,Te)}),ownedByRelations:ot,ownedByRelationsTitle:ot.map(St=>(0,b.$3)(St,{defaultKind:"group"})).join(", ")}}}),st=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],vt=[fe.createCopyDocsUrlAction(He)];return(0,h.jsx)(h.Fragment,{children:Xe||Ye&&Ye.length>0?(0,h.jsx)(g.iA,{isLoading:Xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ye,columns:Qe||st,actions:qe||vt,title:Le?`${Le} (${Ye.length})`:`All (${Ye.length})`}):(0,h.jsx)(g.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(g.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};N.columns=T,N.actions=fe;const A=S=>{var q;const{columns:Le,actions:Xe}=S,{loading:Qe,error:qe,entities:He,filters:mt}=(0,b.wp)(),{isStarredEntity:Te,toggleStarredEntity:Ye}=(0,b.CR)(),[,st]=(0,W.Z)();var vt;const rt=(0,Z.capitalize)((vt=(q=mt.user)===null||q===void 0?void 0:q.value)!==null&&vt!==void 0?vt:"all"),ot=[fe.createCopyDocsUrlAction(st),fe.createStarEntityAction(Te,Ye)];return qe?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:qe.toString()})}):(0,h.jsx)(N,{title:rt,entities:He,loading:Qe,actions:Xe||ot,columns:Le})};A.columns=T,A.actions=fe},18662:function(Rt,ze,t){"use strict";t.r(ze),t.d(ze,{TechDocsIndexPage:function(){return g}});var h=t(52322),r=t(2784),W=t(79635),Z=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)(Z.u,{...b})},42081:function(Rt,ze,t){"use strict";t.d(ze,{j:function(){return g}});var h=t(52322),r=t(2784),W=t(93414),Z=t(25248);const g=b=>{const{children:c}=b,P=(0,Z.h_)(Z.Ds);var te;const Q=`Documentation available in ${(te=P.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:Q,themeId:"documentation",children:c})}},48431:function(Rt,ze,t){"use strict";t.d(ze,{f:function(){return Z}});var h=t(2784),r=t(56941);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const Z=()=>{const{updateFilters:g}=(0,r.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(Rt,ze,t){"use strict";t.d(ze,{I6:function(){return Q},Jl:function(){return te},s4:function(){return g}});var h=t(61886),r=t(92077),W=t(95573),Z=t(25248);const g=(0,Z.rx)({id:"techdocs",apis:[(0,Z.ni)({api:h.Dl,deps:{configApi:Z.Ds,discoveryApi:Z.NW,identityApi:Z.$4,fetchApi:Z.gP},factory:({configApi:X,discoveryApi:z,identityApi:M,fetchApi:_})=>new r.k({configApi:X,discoveryApi:z,identityApi:M,fetchApi:_})}),(0,Z.ni)({api:h.gT,deps:{configApi:Z.Ds,discoveryApi:Z.NW,fetchApi:Z.gP},factory:({configApi:X,discoveryApi:z,fetchApi:M})=>new r.p({configApi:X,discoveryApi:z,fetchApi:M})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,Z.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),c=g.provide((0,Z.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,Z.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),te=g.provide((0,Z.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),Q=g.provide((0,Z.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(Rt,ze,t){"use strict";t.r(ze),t.d(ze,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return z}});var h=t(52322),r=t(2784),W=t(79635),Z=t(93414),g=t(61886),b=t(67896),c=t(93225),P=t(65124),te=t(95573),Q=t(25248);const X=({withSearch:M,withHeader:_=!0})=>(0,h.jsxs)(Z.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(c.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:M})]}),z=M=>{const{kind:_,name:fe,namespace:le}=(0,Q.Oi)(te.Fw),{children:T,entityRef:L={kind:_,name:fe,namespace:le}}=M,N=(0,W.pC)();if(!T){const S=N?r.Children.toArray(N.props.children):[];var A;const Le=S.flatMap(Xe=>{var Qe;return(A=Xe==null||(Qe=Xe.props)===null||Qe===void 0?void 0:Qe.children)!==null&&A!==void 0?A:[]}).find(Xe=>!(0,Q.IY)(Xe,g.Zz)&&!(0,Q.IY)(Xe,g.jM));return(0,h.jsx)(g.ZS,{entityRef:L,children:Le||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:L,children:({metadata:S,entityMetadata:q,onReady:Le})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(Z.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:L,techdocsMetadataValue:S.value,entityMetadataValue:q.value,onReady:Le}):T})})})}},67896:function(Rt,ze,t){"use strict";t.d(ze,{F:function(){return Ue}});var h=t(52322),r=t(2784),W=t(79692),Z=t(60905),g=t(61886),b=t(93414),c=t(17339),P=t(4614),te=t(77277),Q=t(99688),X=t(12420),z=t(90436),M=t(61837),_=t(4190),fe=t(87685);const le=(0,W.Z)(C=>(0,X.Z)({paper:{width:"100%",[C.breakpoints.up("sm")]:{width:"75%"},[C.breakpoints.up("md")]:{width:"50%"},padding:C.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:C.palette.background.default}})),T=({buildLog:C,onClose:H})=>{const me=le(),ue=C.length===0?"Waiting for logs...":C.join(`
|
|
34
|
-
`);return(0,h.jsxs)(Z.Z,{container:!0,direction:"column",className:me.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(Z.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(z.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(M.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(fe.Z,{})},"dismiss")]}),(0,h.jsx)(Z.Z,{item:!0,xs:!0,children:(0,h.jsx)(b.nU,{text:ue,classes:{root:me.logs}})})]})},L=({buildLog:C})=>{const H=le(),[me,ue]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.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)(T,{buildLog:C,onClose:()=>ue(!1)})})]})};var N=t(25248);const A=({errorMessage:C})=>{const H=(0,N.h_)(N.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)(b.mf,{status:"404",statusMessage:C||"Documentation not found",additionalInfo:me})};var S=t(95481);const q=(0,W.Z)(C=>({root:{marginBottom:C.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Le=()=>{let C=null;const H=q(),{state:me,contentReload:ue,contentErrorMessage:Ce,syncErrorMessage:Oe,buildLog:Fe}=(0,S.DK)();return me==="INITIAL_BUILD"&&(C=(0,h.jsx)(Q.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),me==="CONTENT_STALE_REFRESHING"&&(C=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),me==="CONTENT_STALE_READY"&&(C=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(te.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"&&(C=(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]})),me==="CONTENT_NOT_FOUND"&&(C=(0,h.jsxs)(h.Fragment,{children:[Oe&&(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]}),(0,h.jsx)(A,{errorMessage:Ce})]})),C};var Xe=t(79635),Qe=t(60364),qe=t(41156),He=t(32838),mt=t(35368),Te=t.n(mt);const Ye=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,vt=/^https:\/\/fonts\.gstatic\.com/,rt=C=>C.nodeName==="LINK",ot=C=>{const H=(C==null?void 0:C.getAttribute("href"))||"",me=H.match(Ye),ue=H.match(st),Ce=H.match(vt);return me||ue||Ce},ct=C=>(rt(C)&&!ot(C)&&C.remove(),C),St=C=>C.nodeName==="IFRAME",Lt=(C,H)=>{const me=C.getAttribute("src")||"";try{const{host:ue}=new URL(me);return H.includes(ue)}catch{return!1}},Ve=C=>H=>(St(H)&&!Lt(H,C)&&H.remove(),H),oe=()=>{const C=(0,N.h_)(N.Ds);return(0,r.useMemo)(()=>C.getOptionalConfig("techdocs.sanitizer"),[C])},Pe=()=>{const C=oe();return(0,r.useCallback)(async H=>{const me=C==null?void 0:C.getOptionalStringArray("allowedIframeHosts");Te().addHook("beforeSanitizeElements",ct);const ue=["link"];return me&&(ue.push("iframe"),Te().addHook("beforeSanitizeElements",Ve(me))),Te().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[C])};var ke=t(41128),tt=({theme:C})=>`
|
|
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: ${C.palette.text.primary};
|
|
44
|
-
--md-default-fg-color--light: ${C.palette.text.secondary};
|
|
45
|
-
--md-default-fg-color--lighter: ${(0,ke.$n)(C.palette.text.secondary,.7)};
|
|
46
|
-
--md-default-fg-color--lightest: ${(0,ke.$n)(C.palette.text.secondary,.3)};
|
|
47
|
-
|
|
48
|
-
/* BACKGROUND */
|
|
49
|
-
--md-default-bg-color:${C.palette.background.default};
|
|
50
|
-
--md-default-bg-color--light: ${C.palette.background.paper};
|
|
51
|
-
--md-default-bg-color--lighter: ${(0,ke.$n)(C.palette.background.paper,.7)};
|
|
52
|
-
--md-default-bg-color--lightest: ${(0,ke.$n)(C.palette.background.paper,.3)};
|
|
53
|
-
|
|
54
|
-
/* PRIMARY */
|
|
55
|
-
--md-primary-fg-color: ${C.palette.primary.main};
|
|
56
|
-
--md-primary-fg-color--light: ${C.palette.primary.light};
|
|
57
|
-
--md-primary-fg-color--dark: ${C.palette.primary.dark};
|
|
58
|
-
--md-primary-bg-color: ${C.palette.primary.contrastText};
|
|
59
|
-
--md-primary-bg-color--light: ${(0,ke.$n)(C.palette.primary.contrastText,.7)};
|
|
60
|
-
|
|
61
|
-
/* ACCENT */
|
|
62
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
63
|
-
|
|
64
|
-
/* SHADOW */
|
|
65
|
-
--md-shadow-z1: ${C.shadows[1]};
|
|
66
|
-
--md-shadow-z2: ${C.shadows[2]};
|
|
67
|
-
--md-shadow-z3: ${C.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: ${C.palette.text.primary};
|
|
104
|
-
--md-code-bg-color: ${C.palette.background.paper};
|
|
105
|
-
--md-code-hl-color: ${(0,ke.Fq)(C.palette.warning.main,.5)};
|
|
106
|
-
--md-code-hl-keyword-color: ${C.palette.type==="dark"?C.palette.primary.light:C.palette.primary.dark};
|
|
107
|
-
--md-code-hl-function-color: ${C.palette.type==="dark"?C.palette.secondary.light:C.palette.secondary.dark};
|
|
108
|
-
--md-code-hl-string-color: ${C.palette.type==="dark"?C.palette.success.light:C.palette.success.dark};
|
|
109
|
-
--md-code-hl-number-color: ${C.palette.type==="dark"?C.palette.error.light:C.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: ${C.palette.text.primary};
|
|
124
|
-
--md-typeset-del-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.error.dark,.5):(0,ke.Fq)(C.palette.error.light,.5)};
|
|
125
|
-
--md-typeset-ins-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.success.dark,.5):(0,ke.Fq)(C.palette.success.light,.5)};
|
|
126
|
-
--md-typeset-mark-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.warning.dark,.5):(0,ke.Fq)(C.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
|
-
`,yt=({theme:C})=>`
|
|
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: ${C.typography.fontFamily};
|
|
149
|
-
font-family: var(--md-text-font-family);
|
|
150
|
-
background-color: unset;
|
|
151
|
-
}
|
|
152
|
-
`;const Zt="224px";var ht=({theme:C,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:${C.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: ${C.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 + ${Zt})`:"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 Tt=["h1","h2","h3","h4","h5","h6"];var It=({theme:C})=>`
|
|
347
|
-
/*================== Typeset ==================*/
|
|
348
|
-
|
|
349
|
-
.md-typeset {
|
|
350
|
-
font-size: var(--md-typeset-font-size);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
${Tt.reduce((H,me)=>{var ue;const Ce=(ue=C.typography.htmlFontSize)!==null&&ue!==void 0?ue:16,Oe=C.typography[me],{lineHeight:Fe,fontFamily:dt,fontWeight:Et,fontSize:it}=Oe,ft=xt=>{let at=1;return typeof xt=="number"&&(at=xt/Ce*.6),typeof xt=="string"&&(at=xt.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: ${Fe};
|
|
357
|
-
font-family: ${dt};
|
|
358
|
-
font-weight: ${Et};
|
|
359
|
-
font-size: ${ft(it)};
|
|
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 ${C.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
|
-
`,Ot=()=>`
|
|
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
|
-
`,en=({theme:C})=>`
|
|
422
|
-
/*================== Extensions ==================*/
|
|
423
|
-
|
|
424
|
-
/* HIGHLIGHT */
|
|
425
|
-
.highlight .md-clipboard:after {
|
|
426
|
-
content: unset;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
.highlight .nx {
|
|
430
|
-
color: ${C.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
/* CODE HILITE */
|
|
434
|
-
.codehilite .gd {
|
|
435
|
-
background-color: ${C.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.codehilite .gi {
|
|
439
|
-
background-color: ${C.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: ${C.palette.action.disabledBackground};
|
|
470
|
-
}
|
|
471
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
472
|
-
background-color: ${C.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 Vt=[tt,yt,ht,It,Ot,en],Ht=()=>(0,b.Pf)(),Qt=()=>{const C=Ht(),H=(0,Qe.Z)();return(0,r.useMemo)(()=>{const me={theme:H,sidebar:C};return Vt.reduce((ue,Ce)=>ue+Ce(me),"")},[H,C])},hn=()=>{const C=Qt();return(0,r.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${C}</style>`),H),[C])},dn=(C,H,me)=>{const ue=C==="src"&&H.endsWith(".svg"),Ce=!H.match(/^([a-z]*:)?\/\//i),Oe=H.startsWith(me);return ue&&(Ce||Oe)},Fn=({techdocsStorageApi:C,entityId:H,path:me})=>async ue=>{const Ce=await C.getApiOrigin(),Oe=async(Fe,dt)=>{for(const Et of Fe)if(Et.hasAttribute(dt)){const it=Et.getAttribute(dt);if(!it)return;const ft=await C.getBaseUrl(it,H,me);if(dn(dt,it,Ce))try{const at=await(await fetch(ft,{credentials:"include"})).text();Et.setAttribute(dt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(at)))}`)}catch{Et.setAttribute("alt",`Error: ${it}`)}else Et.setAttribute(dt,ft)}};return await Promise.all([Oe(ue.querySelectorAll("img"),"src"),Oe(ue.querySelectorAll("script"),"src"),Oe(ue.querySelectorAll("source"),"src"),Oe(ue.querySelectorAll("link"),"href"),Oe(ue.querySelectorAll("a[download]"),"href")]),ue};var In=t(79158),Un=t(67097),yn=t(28316),pn=t(82717),Xt=t.n(pn);const Mn=C=>H=>{var me;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const Ce=new URL(ue.href),Oe=C.byUrl(Ce);if((Oe==null?void 0:Oe.type)!=="github"&&(Oe==null?void 0:Oe.type)!=="gitlab")return H;const Fe=((me=H.querySelector("article>h1"))===null||me===void 0?void 0:me.childNodes[0].textContent)||"",dt=encodeURIComponent(`Documentation Feedback: ${Fe}`),Et=encodeURIComponent(`Page source:
|
|
490
|
-
${ue.href}
|
|
491
|
-
|
|
492
|
-
Feedback:`),it=(Oe==null?void 0:Oe.type)==="github"?(0,In.BT)(Ce.href,"blob"):Ce.href,ft=Xt()(it),xt=`/${ft.organization}/${ft.name}`,at=ue.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":at.href=`${Ce.origin}${xt}/issues/new?issue[title]=${dt}&issue[description]=${Et}`;break;case"github":at.href=`${Ce.origin}${xt}/issues/new?title=${dt}&body=${Et}`;break;default:return H}return yn.render(r.createElement(Un.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 zn=t(44882);const fn=()=>C=>{const H=C.querySelector('.md-header label[for="__drawer"]'),me=C.querySelector("article");if(!H||!me)return C;const ue=H.cloneNode();return yn.render(r.createElement(zn.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),C},xn=()=>C=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const Oe=Ce.getAttribute(ue);if(Oe){Oe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Fe=bn(window.location.href);Ce.setAttribute(ue,new URL(Oe,Fe).toString())}catch{Ce.replaceWith(Ce.textContent||Oe)}}})})(Array.from(C.getElementsByTagName("a")),"href"),C);function bn(C){const H=new URL(C);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Pn=({baseUrl:C,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Fe=ue.getAttribute("href");!Fe||Fe.startsWith(C)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Fe))})}),me);var kn=t(15459),Sn=t(80030),ge=t(72379),ee=t(41547);const Re=(0,kn.Z)(C=>({tooltip:{fontSize:"inherit",color:C.palette.text.primary,margin:0,padding:C.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Sn.ZP),Ne=()=>(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"})}),et=({text:C})=>{const[H,me]=(0,r.useState)(!1),ue=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(C),me(!0)},[C]),Ce=(0,r.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Re,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Ne,{})})})},jt=C=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const Oe=Ce.textContent||"",Fe=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Fe),yn.render((0,h.jsx)(ee.Z,{theme:C,children:(0,h.jsx)(et,{text:Oe})}),Fe)}return H},ie=()=>C=>{var H;return(H=C.querySelector(".md-header"))===null||H===void 0||H.remove(),C},k=()=>C=>{var H,me;return(H=C.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=C.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),C},ce=({onLoading:C,onLoaded:H})=>me=>(C(),me.addEventListener(g.Ox,function ue(){H(),me.removeEventListener(g.Ox,ue)}),me),Be=()=>C=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=C==null?void 0:C.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),C),D=()=>C=>(setTimeout(()=>{const H=C==null?void 0:C.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),C),U=async(C,H)=>{let me;if(typeof C=="string")me=new DOMParser().parseFromString(C,"text/html").documentElement;else if(C instanceof Element)me=C;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},de="screen and (max-width: 76.1875em)",pe=C=>{const H=(0,Xe.s0)(),me=(0,Qe.Z)(),ue=(0,qe.Z)(de),Ce=Pe(),Oe=hn(),Fe=(0,N.z$)(),dt=(0,N.h_)(g.Dl),Et=(0,N.h_)(He.q3),{state:it,path:ft,content:xt}=(0,S.DK)(),[at,Bt]=(0,r.useState)(null),Mt=(0,g.ux)(at),zt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Nt=>{if(ue)Nt.style.top="0px";else{const wn=document==null?void 0:document.querySelector(".techdocs-reader-page");var rn;const jn=(rn=wn==null?void 0:wn.getBoundingClientRect().top)!==null&&rn!==void 0?rn:0;var On;let Gn=(On=at.getBoundingClientRect().top)!==null&&On!==void 0?On:0;const gn=at.querySelector(".md-container > .md-tabs");var Qn;const Rn=(Qn=gn==null?void 0:gn.getBoundingClientRect().height)!==null&&Qn!==void 0?Qn:0;Gn<jn&&(Gn=jn),Nt.style.top=`${Math.max(Gn,0)+Rn}px`}Nt.style.setProperty("opacity","1")})},[at,ue]);(0,r.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[at,zt]);const qt=(0,r.useCallback)(()=>{if(!at)return;const Dt=at.querySelector(".md-footer");Dt&&(Dt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",qt),()=>{window.removeEventListener("resize",qt)}),[at,qt]),(0,r.useEffect)(()=>{Mt||(qt(),zt())},[it,Mt,qt,zt]);const Wn=(0,r.useCallback)((Dt,Nt)=>U(Dt,[Ce,Fn({techdocsStorageApi:dt,entityId:C,path:Nt}),xn(),fn(),ie(),k(),Mn(Et),Oe]),[C,Et,dt,Ce,Oe]),Cn=(0,r.useCallback)(async Dt=>U(Dt,[Be(),D(),jt(me),Pn({baseUrl:window.location.origin,onClick:(Nt,rn)=>{var On;const Qn=Nt.ctrlKey||Nt.metaKey,wn=new URL(rn),jn=`${wn.pathname}${wn.search}${wn.hash}`,Gn=((On=Nt.target)===null||On===void 0?void 0:On.innerText)||rn,gn=rn.replace(window.location.origin,"");if(Fe.captureEvent("click",Gn,{attributes:{to:gn}}),wn.hash)if(Qn)window.open(jn,"_blank");else{var Rn;H(jn),(Rn=Dt==null?void 0:Dt.querySelector(`[id="${wn.hash.slice(1)}"]`))===null||Rn===void 0||Rn.scrollIntoView()}else Qn?window.open(jn,"_blank"):H(jn)}}),ce({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=Dt.querySelector(".md-nav__title"))===null||Nt===void 0||Nt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Dt.querySelectorAll(".md-sidebar")).forEach(rn=>{rn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Fe]);return(0,r.useEffect)(()=>{if(!xt)return()=>{};let Dt=!0;return Wn(xt,ft).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!Dt)return;window.scroll({top:0});const rn=await Cn(Nt);Bt(rn)}),()=>{Dt=!1}},[xt,ft,Wn,Cn]),at};var be=t(8560);const $e=()=>{const C=(0,g.$L)(),{shadowRoot:H}=(0,g.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 Oe=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:C.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:C.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(be.Z,{container:Fe,children:C.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Ee=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ue=(0,S.m1)(C=>{var H;const{withSearch:me=!0,onReady:ue}=C,Ce=Ee(),{entityMetadata:{value:Oe,loading:Fe},entityRef:dt,setShadowRoot:Et}=(0,g.x1)(),it=pe(dt),ft=(0,r.useCallback)(xt=>{Et(xt),ue instanceof Function&&ue()},[Et,ue]);return Fe===!1&&!Oe?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):it?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(Z.Z,{container:!0,children:[(0,h.jsx)(Z.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})}),me&&(0,h.jsx)(Z.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:dt,entityTitle:Oe==null||(H=Oe.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(Z.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:it,onAppend:ft,children:(0,h.jsx)($e,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(Z.Z,{container:!0,children:(0,h.jsx)(Z.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})})})})}),nt=null},93225:function(Rt,ze,t){"use strict";t.d(ze,{S:function(){return fe}});var h=t(52322),r=t(2784),W=t(18671),Z=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(56941),te=t(25271),Q=t(93414),X=t(25248),z=t(76635),M=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),fe=le=>{const{children:T}=le,L=(0,c.$L)(),N=(0,X.h_)(X.Ds),{title:A,setTitle:S,subtitle:q,setSubtitle:Le,entityRef:Xe,metadata:{value:Qe,loading:qe},entityMetadata:{value:He,loading:mt}}=(0,c.x1)();(0,r.useEffect)(()=>{!Qe||(S(Qe.site_name),Le(()=>{let{site_description:oe}=Qe;return(!oe||oe==="None")&&(oe=""),oe}))},[Qe,S,Le]);const Te=N.getOptional("app.title")||"Backstage",Ye=[A,q,Te].filter(Boolean).join(" | "),{locationMetadata:st,spec:vt}=He||{},rt=vt==null?void 0:vt.lifecycle,ot=He?(0,P.hF)(He,te.S4):[],ct=(0,X.tg)(M._Z)(),St=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,z.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Xe,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)(Z.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(Z.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(Z.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!mt&&He===void 0||!qe&&Qe===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ct,title:A||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ye})}),St,T,L.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(Rt,ze,t){"use strict";t.d(ze,{b:function(){return z}});var h=t(52322),r=t(2784),W=t(79692),Z=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),Q=t(61886);const X=(0,W.Z)(M=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:M.spacing(3,3,0)}})),z=M=>{const _=X(),[fe,le]=(0,r.useState)(null),T=(0,r.useCallback)(Xe=>{le(Xe.currentTarget)},[]),L=(0,r.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:N,loading:A}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Le=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Le||A===!1&&!N?null:(0,h.jsx)(Z.Z,{classes:_,...M.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Le?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:T,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(fe),onClose:L,keepMounted:!0,children:Le})]}):null]})})}},95481:function(Rt,ze,t){"use strict";t.d(ze,{DK:function(){return z},m1:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),Z=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:fe,content:le,activeSyncState:T}){return fe||T==="BUILD_READY_RELOAD"||!le&&T==="CHECKING"?"CHECKING":!le&&T==="BUILDING"?"INITIAL_BUILD":le?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(fe,le){const T={...fe};switch(le.type){case"sync":le.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=le.state,T.syncError=le.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof le.path=="string"&&(T.path=le.path),T.contentLoading=!1,T.content=le.content,T.contentError=le.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function Q(fe,le,T,L){var N,A;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Le=(0,g.h_)(Z.Dl),{retry:Xe}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const He=await Le.getEntityDocs({kind:fe,namespace:le,name:T},L);return q({type:"content",content:He,path:L}),He}catch(He){q({type:"content",contentError:He,path:L})}},[Le,fe,le,T,L]),Qe=(0,r.useRef)({content:void 0,reload:()=>{}});return Qe.current={content:S.content,reload:Xe},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const He=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Le.syncEntityDocs({kind:fe,namespace:le,name:T},Te=>{q({type:"buildLog",log:Te})})){case"updated":Qe.current.content?q({type:"sync",state:"BUILD_READY"}):(Qe.current.reload(),q({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":q({type:"sync",state:"UP_TO_DATE"});break;default:q({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(mt){q({type:"sync",state:"ERROR",syncError:mt})}finally{clearTimeout(He)}},[fe,T,le,Le,q,Qe]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:Xe,path:S.path,content:S.content,contentErrorMessage:(N=S.contentError)===null||N===void 0?void 0:N.toString(),syncErrorMessage:(A=S.syncError)===null||A===void 0?void 0:A.toString(),buildLog:S.buildLog}}const X=(0,r.createContext)({}),z=()=>(0,r.useContext)(X),M=({children:fe})=>{const{"*":le=""}=(0,W.UO)(),{entityRef:T}=(0,Z.x1)(),{kind:L,namespace:N,name:A}=T,S=Q(L,N,A,le);return(0,h.jsx)(X.Provider,{value:S,children:fe instanceof Function?fe(S):fe})},_=fe=>le=>(0,h.jsx)(M,{children:(0,h.jsx)(fe,{...le})})},95573:function(Rt,ze,t){"use strict";t.d(ze,{Fw:function(){return W},_Z:function(){return r},pd:function(){return Z}});var h=t(25248);const r=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),Z=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(Rt,ze,t){"use strict";t.d(ze,{S:function(){return L}});var h=t(52322),r=t(2784),W=t(79692),Z=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(93414),te=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),z=N=>{const{result:A,highlight:S,rank:q,lineClamp:Le=5,asListItem:Xe=!0,asLink:Qe=!0,title:qe,icon:He}=N,mt=X(),Te=(0,te.z$)(),Ye=()=>{Te.captureEvent("discover",A.title,{attributes:{to:A.location},value:q})},st=({children:ot})=>Qe?(0,h.jsx)(P.rU,{noTrack:!0,to:A.location,onClick:Ye,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),vt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):A.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):A.entityTitle,St=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):A.name;return(0,h.jsx)(Z.Z,{className:mt.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:qe||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ct!=null?ct:St," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Le,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):A.text})})},rt=({children:ot})=>Xe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[He&&(0,h.jsx)(b.Z,{children:He}),(0,h.jsx)("div",{className:mt.flexContainer,children:ot})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ot});return(0,h.jsx)(rt,{children:(0,h.jsx)(vt,{})})};var M=t(27556),_=t(79635);const fe=(0,W.Z)(N=>({root:{width:"100%"},bar:{padding:N.spacing(1)}})),le=N=>N==null?void 0:N.document,T=N=>{const{entityId:A,entityTitle:S,debounceTime:q=150}=N,[Le,Xe]=(0,r.useState)(!1),Qe=(0,_.s0)(),{setFilters:qe,result:{loading:He,value:mt}}=(0,Q.Rx)(),Te=fe(),[Ye,st]=(0,r.useState)([]);(0,r.useEffect)(()=>{let St=!0;if(St&&mt){const Lt=mt.results.slice(0,10);st(Lt)}return()=>{St=!1}},[He,mt]);const{kind:vt,name:rt,namespace:ot}=A;(0,r.useEffect)(()=>{qe(St=>({...St,kind:vt,namespace:ot,name:rt}))},[vt,ot,rt,qe]);const ct=(St,Lt)=>{if(le(Lt)){const{location:Ve}=Lt.document;Qe(Ve)}};return(0,h.jsx)(M.Z,{className:Te.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:Te.root},"data-testid":"techdocs-search-bar",size:"small",open:Le,getOptionLabel:()=>"",filterOptions:St=>St,onClose:()=>{Xe(!1)},onFocus:()=>{Xe(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ye,renderOption:({document:St,highlight:Lt})=>(0,h.jsx)(z,{result:St,lineClamp:3,asListItem:!1,asLink:!1,title:St.title,highlight:Lt}),loading:He,inputDebounceTime:q,inputPlaceholder:`Search ${S||A.name} docs`,freeSolo:!1})})},L=N=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:N.entityId};return(0,h.jsx)(Q.Nd,{initialState:A,children:(0,h.jsx)(T,{...N})})}},53260:function(){}},function(Rt){var ze=function(h){return Rt(Rt.s=h)};Rt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return ze(51102)});var t=Rt.O()}]);})();
|
|
493
|
-
|
|
494
|
-
//# sourceMappingURL=main.c643eee1.js.map
|