@techdocs/cli 1.2.2-next.2 → 1.2.3-next.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 +32 -0
- package/dist/embedded-app/.config-schema.json +34 -5
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.98bf1656.chunk.js → 1032.eb3b9695.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.98bf1656.chunk.js.map → 1032.eb3b9695.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.c44a4e31.chunk.js → 1105.40283456.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.c44a4e31.chunk.js.map → 1105.40283456.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.9b13e518.chunk.js → 184.1cc84853.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.9b13e518.chunk.js.map → 184.1cc84853.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js → 2440.99fc794a.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js.map → 2440.99fc794a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.75ad4388.chunk.js → 5458.c2cfc48a.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.75ad4388.chunk.js.map → 5458.c2cfc48a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5837.ebb0f422.chunk.js +3 -0
- package/dist/embedded-app/static/5837.ebb0f422.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.dc28074b.chunk.js → 732.426f89e4.chunk.js} +2 -2
- package/dist/embedded-app/static/{732.dc28074b.chunk.js.map → 732.426f89e4.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.7f574fa6.chunk.js → 7560.b3ed3a97.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.7f574fa6.chunk.js.map → 7560.b3ed3a97.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.f1fbf797.chunk.js → 7750.0f3395fe.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.f1fbf797.chunk.js.map → 7750.0f3395fe.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.dbc0ba7e.chunk.js → 8951.b74cd97a.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.dbc0ba7e.chunk.js.map → 8951.b74cd97a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js → 9545.59bf7391.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js.map → 9545.59bf7391.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js → 9770.ae81d806.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js.map → 9770.ae81d806.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.ee853139.js +492 -0
- package/dist/embedded-app/static/main.ee853139.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.67523b24.js → module-octokit.9fb0d235.js} +2 -2
- package/dist/embedded-app/static/{module-octokit.67523b24.js.map → module-octokit.9fb0d235.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.8dc9310c.js → runtime.ee853139.js} +2 -2
- package/dist/embedded-app/static/{runtime.8dc9310c.js.map → runtime.ee853139.js.map} +1 -1
- package/dist/embedded-app/static/vendor.ee853139.js +236 -0
- package/dist/embedded-app/static/vendor.ee853139.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js +0 -3
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.8dc9310c.js +0 -492
- package/dist/embedded-app/static/main.8dc9310c.js.map +0 -1
- package/dist/embedded-app/static/vendor.8dc9310c.js +0 -236
- package/dist/embedded-app/static/vendor.8dc9310c.js.map +0 -1
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(wt,De,t){"use strict";t.d(De,{n3:function(){return W},MS:function(){return x}});var h=t(25271),n=t(23054),v=t(96279),P=t.n(v);const W=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class x{async getEntityAncestors(O,re){const{kind:q,namespace:_,name:M}=(0,h.of)(O.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(M)}/ancestry`,re)}async getLocationById(O,re){return await this.requestOptional("GET",`/locations/${encodeURIComponent(O)}`,re)}async getEntities(O,re){const{filter:q=[],fields:_=[],offset:M,limit:X,after:J}=O!=null?O:{},he=[];for(const Z of[q].flat()){const T=[];for(const[R,ne]of Object.entries(Z))for(const Se of[ne].flat())Se===W?T.push(encodeURIComponent(R)):typeof Se=="string"&&T.push(`${encodeURIComponent(R)}=${encodeURIComponent(Se)}`);T.length&&he.push(`filter=${T.join(",")}`)}_.length&&he.push(`fields=${_.map(encodeURIComponent).join(",")}`),M!==void 0&&he.push(`offset=${M}`),X!==void 0&&he.push(`limit=${X}`),J!==void 0&&he.push(`after=${encodeURIComponent(J)}`);const ue=he.length?`?${he.join("&")}`:"",k=await this.requestRequired("GET",`/entities${ue}`,re),L=(Z,T)=>{var R,ne;if(((R=Z.metadata)===null||R===void 0?void 0:R.name)===void 0||Z.kind===void 0||((ne=T.metadata)===null||ne===void 0?void 0:ne.name)===void 0||T.kind===void 0)return 0;const Se=(0,h.eE)(Z),Ve=(0,h.eE)(T);return Se<Ve?-1:Se>Ve?1:0};return{items:k.sort(L)}}async getEntityByRef(O,re){const{kind:q,namespace:_,name:M}=(0,h.of)(O);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(M)}`,re)}async getEntityByName(O,re){const{kind:q,namespace:_="default",name:M}=O;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(M)}`,re)}async refreshEntity(O,re){const q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(re==null?void 0:re.token)&&{Authorization:`Bearer ${re==null?void 0:re.token}`}},method:"POST",body:JSON.stringify({entityRef:O})});if(q.status!==200)throw new Error(await q.text())}async getEntityFacets(O,re){const{filter:q=[],facets:_}=O,M=[];for(const J of[q].flat()){const he=[];for(const[ue,k]of Object.entries(J))for(const L of[k].flat())L===W?he.push(encodeURIComponent(ue)):typeof L=="string"&&he.push(`${encodeURIComponent(ue)}=${encodeURIComponent(L)}`);he.length&&M.push(`filter=${he.join(",")}`)}for(const J of _)M.push(`facet=${encodeURIComponent(J)}`);const X=M.length?`?${M.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${X}`,re)}async addLocation(O,re){const{type:q="url",target:_,dryRun:M}=O,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${M?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(re==null?void 0:re.token)&&{Authorization:`Bearer ${re==null?void 0:re.token}`}},method:"POST",body:JSON.stringify({type:q,target:_})});if(X.status!==201)throw new Error(await X.text());const{location:J,entities:he,exists:ue}=await X.json();if(!J)throw new Error(`Location wasn't added: ${_}`);return{location:J,entities:he,exists:ue}}async getLocationByRef(O,re){return(await this.requestRequired("GET","/locations",re)).map(_=>_.data).find(_=>O===(0,h.NZ)(_))}async removeLocationById(O,re){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(O)}`,re)}async removeEntityByUid(O,re){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(O)}`,re)}async validateEntity(O,re,q){const _=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:O,location:re})});if(_.ok)return{valid:!0};if(_.status!==400)throw await n.VL.fromResponse(_);const{errors:M=[]}=await _.json();return{valid:!1,errors:M}}async requestIgnored(O,re,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${re}`,M=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:O,headers:M});if(!X.ok)throw await n.VL.fromResponse(X)}async requestRequired(O,re,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${re}`,M=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:O,headers:M});if(!X.ok)throw await n.VL.fromResponse(X);return await X.json()}async requestOptional(O,re,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${re}`,M=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},X=await this.fetchApi.fetch(_,{method:O,headers:M});if(!X.ok){if(X.status===404)return;throw await n.VL.fromResponse(X)}return await X.json()}constructor(O){this.discoveryApi=O.discoveryApi,this.fetchApi=O.fetchApi||{fetch:P()}}}},25271:function(wt,De,t){"use strict";t.d(De,{Tf:function(){return v},P1:function(){return ve},q1:function(){return te},M6:function(){return Te},l2:function(){return n},zG:function(){return h},w$:function(){return rn},nP:function(){return wn},aS:function(){return En},S4:function(){return qt},cz:function(){return jn},iB:function(){return _e},CV:function(){return Y},of:function(){return it},Ou:function(){return Be},eE:function(){return nt},NZ:function(){return Ke}});const h="default",n="backstage.io/view-url",v="backstage.io/edit-url",P="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",x="kubernetes.io/auth-provider";var l=t(76635),O=t.n(l);class re{async enforce(g){return g.metadata.namespace?g:lodash.merge({metadata:{namespace:this.namespace}},g)}constructor(g=DEFAULT_NAMESPACE){this.namespace=g}}class q{static isValidPrefixAndOrSuffix(g,$,ee,ge){if(typeof g!="string")return!1;const fe=g.split($);return fe.length===1?ge(fe[0]):fe.length===2?ee(fe[0])&&ge(fe[1]):!1}static isJsonSafe(g){try{return O().isEqual(g,JSON.parse(JSON.stringify(g)))}catch{return!1}}static isValidDnsSubdomain(g){return typeof g=="string"&&g.length>=1&&g.length<=253&&g.split(".").every(q.isValidDnsLabel)}static isValidDnsLabel(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(g)}static isValidTag(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(g)}static isValidUrl(g){if(typeof g!="string")return!1;try{return new URL(g),!0}catch{return!1}}static isValidString(g){var $;return typeof g=="string"&&(($=g==null?void 0:g.trim())===null||$===void 0?void 0:$.length)>=1}static isNonEmptyString(g){var $;return typeof g=="string"&&(($=g==null?void 0:g.trim())===null||$===void 0?void 0:$.length)>=1}}var _=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}}}}}'),M=t(27991),X=t.n(M),J=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),he=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),ue=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 k=new Map,L=[_,J,he,ue];function Z(C){if(!(C!=null&&C.length))throw new TypeError("Unknown error");const g=C[0];throw new TypeError(`${g.instancePath||"<root>"} ${g.message}${g.params?` - ${Object.entries(g.params).map(([$,ee])=>`${$}: ${ee}`).join(", ")}`:""}`)}function T(C,g={}){var $;const ee=($=g==null?void 0:g.disableCache)!==null&&$!==void 0?$:!1,ge=ee?"":JSON.stringify(C);if(!ee){const qe=k.get(ge);if(qe)return qe}const fe=R(C),Fe=new(X())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});fe.length&&Fe.addSchema(fe,void 0,void 0,!0);const Je=Fe.compile(C);return ee||k.set(ge,Je),Je}function R(C){if(typeof C!="object")return[];const g=new Set;C.$id&&g.add(C.$id);const $=new Array,ee=[C];for(;ee.length;){const ge=ee.pop();for(const fe of ne(ge))if(!g.has(fe)){g.add(fe);const Fe=L.find(Je=>Je.$id===fe);Fe&&($.push(Fe),ee.push(Fe))}}return $}function*ne(C){const g=[C];for(;g.length;){const $=g.pop();if(typeof $=="object"&&$)for(const[ee,ge]of Object.entries($))ee==="$ref"&&typeof ge=="string"?yield ge.split("#")[0]:g.push(ge)}}function Se(C){const g=compileAjvSchema(C||entityEnvelopeSchema);return $=>{if(g($)===!0)return $;throw throwAjvError(g.errors)}}function Ve(C){const g=T(C);return $=>{var ee;if(g($)===!0)return $;const fe=(ee=g.errors)===null||ee===void 0?void 0:ee.filter(Fe=>["/kind","/apiVersion"].includes(Fe.instancePath));if((fe==null?void 0:fe.length)&&fe.every(Fe=>Fe.keyword==="enum"))return!1;throw Z(g.errors)}}function ze(C){const g=compileAjvSchema(C||entitySchema);return $=>{if(g($)===!0)return $;throw throwAjvError(g.errors)}}class je{static isValidApiVersion(g){return q.isValidPrefixAndOrSuffix(g,"/",q.isValidDnsSubdomain,$=>$.length>=1&&$.length<=63&&/^[a-z0-9A-Z]+$/.test($))}static isValidKind(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(g)}static isValidObjectName(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(g)}static isValidNamespace(g){return q.isValidDnsLabel(g)}static isValidLabelKey(g){return q.isValidPrefixAndOrSuffix(g,"/",q.isValidDnsSubdomain,je.isValidObjectName)}static isValidLabelValue(g){return g===""||je.isValidObjectName(g)}static isValidAnnotationKey(g){return q.isValidPrefixAndOrSuffix(g,"/",q.isValidDnsSubdomain,je.isValidObjectName)}static isValidAnnotationValue(g){return typeof g=="string"}}const He={isValidApiVersion:je.isValidApiVersion,isValidKind:je.isValidKind,isValidEntityName:je.isValidObjectName,isValidNamespace:je.isValidNamespace,isValidLabelKey:je.isValidLabelKey,isValidLabelValue:je.isValidLabelValue,isValidAnnotationKey:je.isValidAnnotationKey,isValidAnnotationValue:je.isValidAnnotationValue,isValidTag:C=>typeof C=="string"&&C.length>=1&&C.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(C)};function ut(C={}){return{...He,...C}}class $e{async enforce(g){function $(j,F,oe){if(F==null)throw new Error(`${j} must have a value`);let ce;try{ce=oe(F)}catch(be){throw new Error(`${j} could not be validated, ${be}`)}if(!ce){let be;switch(oe.name){case"isValidLabelValue":case"isValidObjectName":be="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":be="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":be="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":be="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":be="a string";break;case"isValidKind":be="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":be="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":be="a non empty string";break;default:be=void 0;break}const Ie=be?` expected ${be} but found "${F}".`:"";throw new Error(`"${j}" is not valid;${Ie} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function ee(j,F,oe){return F===void 0||$(j,F,oe)}$("apiVersion",g.apiVersion,this.validators.isValidApiVersion),$("kind",g.kind,this.validators.isValidKind),$("metadata.name",g.metadata.name,this.validators.isValidEntityName),ee("metadata.namespace",g.metadata.namespace,this.validators.isValidNamespace);var ge;for(const[j,F]of Object.entries((ge=g.metadata.labels)!==null&&ge!==void 0?ge:[]))$(`labels.${j}`,j,this.validators.isValidLabelKey),$(`labels.${j}`,F,this.validators.isValidLabelValue);var fe;for(const[j,F]of Object.entries((fe=g.metadata.annotations)!==null&&fe!==void 0?fe:[]))$(`annotations.${j}`,j,this.validators.isValidAnnotationKey),$(`annotations.${j}`,F,this.validators.isValidAnnotationValue);var Fe;const Je=(Fe=g.metadata.tags)!==null&&Fe!==void 0?Fe:[];for(let j=0;j<Je.length;++j)$(`tags.${j}`,Je[j],this.validators.isValidTag);var qe;const ot=(qe=g.metadata.links)!==null&&qe!==void 0?qe:[];for(let j=0;j<ot.length;++j){var lt,ct,Rt;$(`links.${j}.url`,(lt=ot[j])===null||lt===void 0?void 0:lt.url,CommonValidatorFunctions.isValidUrl),ee(`links.${j}.title`,(ct=ot[j])===null||ct===void 0?void 0:ct.title,CommonValidatorFunctions.isNonEmptyString),ee(`links.${j}.icon`,(Rt=ot[j])===null||Rt===void 0?void 0:Rt.icon,KubernetesValidatorFunctions.isValidObjectName)}return g}constructor(g=makeValidator()){this.validators=g}}class Pe{async enforce(g){if(!this.validate){const ge=new Ajv({allowUnionTypes:!0});this.validate=ge.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(g)===!0)return g;const[ee]=this.validate.errors||[];throw ee?new Error(`Malformed envelope, ${ee.instancePath||"<root>"} ${ee.message}`):new Error("Malformed envelope, Unknown error")}}function Ye(C){let g=C.indexOf(":");const $=C.indexOf("/");$!==-1&&$<g&&(g=-1);const ee=g===-1?void 0:C.slice(0,g),ge=$===-1?void 0:C.slice(g+1,$),fe=C.slice(Math.max(g+1,$+1));if(ee===""||ge===""||fe==="")throw new TypeError(`Entity reference "${C}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:ee,namespace:ge,name:fe}}function _e(C){return{kind:C.kind,namespace:C.metadata.namespace||h,name:C.metadata.name}}function it(C,g){if(!C)throw new Error("Entity reference must not be empty");const $=g==null?void 0:g.defaultKind,ee=(g==null?void 0:g.defaultNamespace)||h;let ge,fe,Fe;if(typeof C=="string"){const ct=Ye(C);var Je;ge=(Je=ct.kind)!==null&&Je!==void 0?Je:$;var qe;fe=(qe=ct.namespace)!==null&&qe!==void 0?qe:ee,Fe=ct.name}else{var ot;ge=(ot=C.kind)!==null&&ot!==void 0?ot:$;var lt;fe=(lt=C.namespace)!==null&<!==void 0?lt:ee,Fe=C.name}if(ge)if(fe){if(!Fe){const ct=JSON.stringify(C);throw new Error(`Entity reference ${ct} had missing or empty name`)}}else{const ct=JSON.stringify(C);throw new Error(`Entity reference ${ct} had missing or empty namespace`)}else{const ct=JSON.stringify(C);throw new Error(`Entity reference ${ct} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:ge,namespace:fe,name:Fe}}function nt(C){let g,$,ee;if("metadata"in C){g=C.kind;var ge;$=(ge=C.metadata.namespace)!==null&&ge!==void 0?ge:h,ee=C.metadata.name}else{g=C.kind;var fe;$=(fe=C.namespace)!==null&&fe!==void 0?fe:h,ee=C.name}return`${g.toLocaleLowerCase("en-US")}:${$.toLocaleLowerCase("en-US")}/${ee.toLocaleLowerCase("en-US")}`}class Xe{async enforce(g){let $=g;for(const ee of this.policies){const ge=await ee.enforce($);if(!ge)throw new Error(`Policy ${ee.constructor.name} did not return a result`);$=ge}return $}constructor(g){this.policies=g}}class st{async enforce(g){for(const $ of this.policies){const ee=await $.enforce(g);if(ee)return ee}throw new Error("The entity did not match any known policy")}constructor(g){this.policies=g}}const ht={allOf(C){return new Xe(C)},oneOf(C){return new st(C)}};var Oe=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 le(C){let g;return{async check($){return g||(g=Ve(C)),g($)===$}}}const Ee=le(Oe);var Ze=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 pt=le(Ze);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 Et=le(yt);var at=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const bt=le(at);var Ct=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 Tt=le(Ct),qt="ownedBy",_t="ownerOf",Vt="consumesApi",Jt="apiConsumedBy",nn="providesApi",Qt="apiProvidedBy",wn="dependsOn",rn="dependencyOf",Cn="parentOf",on="childOf",Mn="memberOf",Wt="hasMember",jn="partOf",En="hasPart";var Ft=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 an=le(Ft);var sn=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 ln=le(sn);var An=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const cn=le(An),ve="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",Te="backstage.io/source-location";function Be(C){if(typeof C!="string")throw new TypeError(`Unable to parse location ref '${C}', unexpected argument ${typeof C}`);const g=C.indexOf(":");if(g<0)throw new TypeError(`Unable to parse location ref '${C}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const $=C.substring(0,g).trim(),ee=C.substring(g+1).trim();if(!$||!ee)throw new TypeError(`Unable to parse location ref '${C}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if($==="http"||$==="https")throw new TypeError(`Invalid location ref '${C}', please prefix it with 'url:', e.g. 'url:${C}'`);return{type:$,target:ee}}function Ke(C){const{type:g,target:$}=C;if(g){if(!$)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${g}:${$}`}function Y(C){var g,$,ee,ge,fe;const Fe=(fe=(g=C.metadata)===null||g===void 0||($=g.annotations)===null||$===void 0?void 0:$[Te])!==null&&fe!==void 0?fe:(ee=C.metadata)===null||ee===void 0||(ge=ee.annotations)===null||ge===void 0?void 0:ge[ve];if(!Fe)throw new Error(`Entity '${nt(C)}' is missing location`);return Be(Fe)}},71399:function(wt,De,t){"use strict";t.d(De,{zx:function(){return ze},Oi:function(){return Xe},VY:function(){return Ci},yW:function(){return Ua},XF:function(){return Oe},mn:function(){return Te},NX:function(){return h},ub:function(){return ot},mf:function(){return Ha},yu:function(){return w},h4:function(){return $i},M6:function(){return ts},i9:function(){return nl},aR:function(){return ji},rJ:function(){return Er},Oh:function(){return cl},hu:function(){return il},rU:function(){return Se},nU:function(){return os},sk:function(){return Rt},Or:function(){return Hr},T3:function(){return Zi},g9:function(){return hl},Ex:function(){return cs},Gk:function(){return A},tn:function(){return Ei},Ph:function(){return St},YE:function(){return bi},v7:function(){return _i},R6:function(){return Si},tR:function(){return Fo},uw:function(){return ha},qt:function(){return vi},iA:function(){return Oi},GB:function(){return Bn},po:function(){return or},mZ:function(){return so},Pf:function(){return Nr}});var h={};t.r(h),t.d(h,{Nm:function(){return le},ht:function(){return pt},LJ:function(){return Ze}});var n=t(52322),v=t(2784),P=t(25248),W=t(19928);function x(e){const[s,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const D=d.alert$().subscribe(V=>i(U=>U.concat(V)));return()=>{D.unsubscribe()}},[d]),s.length===0)return null;const[m]=s,E=()=>{i(D=>D.filter(V=>V!==m))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:E,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:m.severity,children:_jsxs("span",{children:[m.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),O=t(12420);const re=(0,l.Z)(e=>(0,O.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function q(e){const{displayName:s,picture:i,customStyles:d}=e,p=re();let m={...d};return i||(m={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:m,children:s&&extractInitials(s)})}var _=t(77277),M=t(72779),X=t.n(M),J=t(86689),he=t(62833),ue=t(76635);const k=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),L=e=>/^([a-z+.-]+):/.test(e),Z=()=>{try{return(0,P.h_)(P.Ds).getOptionalString("app.baseUrl")}catch{return}},T=()=>{const e="http://dummy.dev";var s;const i=(s=Z())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(i,e);return(0,ue.trimEnd)(d,"/")},R=e=>{let s=String(e);const i=T(),d=L(s),p=s.startsWith(i);return!d&&!p&&(s=i.concat(s)),s},ne=e=>{if(e instanceof Array)return e.map(ne).join(" ").trim();if(typeof e=="object"&&e){var s;return ne(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Se=v.forwardRef(({onClick:e,noTrack:s,...i},d)=>{const p=k(),m=(0,P.z$)(),E=R(i.to),D=ne(i.children)||E,V=L(E),U=V&&!!/^https?:/.exec(E),ye=ie=>{e==null||e(ie),s||m.captureEvent("click",D,{attributes:{to:E}})};return V?(0,n.jsxs)(J.Z,{...U?{target:"_blank",rel:"noopener"}:{},...i,ref:d,href:E,onClick:ye,className:X()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(J.Z,{...i,ref:d,component:he.rU,to:E,onClick:ye})}),Ve=v.forwardRef((e,s)=>(0,n.jsx)(Se,{ref:s,...e,color:"initial"})),ze=v.forwardRef((e,s)=>(0,n.jsx)(_.Z,{ref:s,component:Ve,...e}));var je=t(60364),He=t(61837),ut=t(80030),$e=t(19353),Pe=t(95074);function Ye(e){const{text:s,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,m=(0,P.h_)(P.VE),[E,D]=(0,v.useState)(!1),[{error:V},U]=(0,Pe.Z)();(0,v.useEffect)(()=>{V&&m.post(V)},[V,m]);const ye=ie=>{ie.stopPropagation(),D(!0),U(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(ut.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>D(!1),open:E,children:(0,n.jsx)(He.Z,{onClick:ye,"aria-label":p,children:(0,n.jsx)($e.Z,{})})})})}var _e=t(83229),it=t(26639),nt=t(39595);function Xe(e){const{text:s,language:i,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:m,showCopyCodeButton:E=!1}=e,D=(0,je.Z)(),V=D.palette.type==="dark"?it.Z:nt.Z,U=D.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(_e.Z,{customStyle:m,language:i,style:V,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:D.palette.textVerySubtle},lineProps:ye=>p!=null&&p.includes(ye)?{style:{backgroundColor:U}}:{},children:s}),E&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(Ye,{text:s})})]})}var st=t(41156),ht=t(88188);function Oe(e){const{title:s,to:i}=e,d=(0,st.Z)(p=>p.breakpoints.down("xs"));return i?d?(0,n.jsx)(He.Z,{component:he.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(ht.Z,{})}):(0,n.jsx)(_.Z,{component:he.rU,variant:"contained",color:"primary",to:i,children:s}):null}var le;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(le||(le={}));var Ee;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Ee||(Ee={}));var Ze;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Ze||(Ze={}));var pt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(pt||(pt={}));var yt=t(27397),Et=t(11105),at=t(97963),bt=t(46506),Ct=t.n(bt),Tt=t(54073),qt=t.n(Tt),_t=t(10368);const Vt=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Jt({node:{id:e}}){const s=Vt(),[i,d]=v.useState(0),[p,m]=v.useState(0),E=v.useRef(null);v.useLayoutEffect(()=>{if(E.current){let{height:ye,width:ie}=E.current.getBBox();ye=Math.round(ye),ie=Math.round(ie),(ye!==p||ie!==i)&&(d(ie),m(ye))}},[i,p]);const D=10,V=i+D*2,U=p+D*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:V,height:U,rx:10}),(0,n.jsx)("text",{ref:E,className:s.text,y:U/2,x:V/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const nn="arrow-marker",Qt="node",wn="edge",rn="label",Cn=(0,_t.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),on=e=>(0,n.jsx)(Jt,{...e});function Mn({render:e=on,setNode:s,node:i}){const{width:d,height:p,x:m=0,y:E=0}=i,D=i,V=Cn(),U=v.useRef(null);return v.useLayoutEffect(()=>{if(U.current){let{height:ye,width:ie}=U.current.getBBox();ye=Math.round(ye),ie=Math.round(ie),(ye!==p||ie!==d)&&s(i.id,{...i,height:ye,width:ie})}},[i,d,p,s]),(0,n.jsx)("g",{ref:U,"data-testid":Qt,className:V.node,transform:`translate(${m-d/2},${E-p/2})`,children:e({node:D})})}var Wt=t(55876),jn=t(66481),En=t(19574),Ft=t.n(En);const an=(0,_t.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function sn({edge:{label:e}}){const s=an();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ln=(0,_t.Z)(e=>({path:{strokeWidth:2,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),An=e=>(0,n.jsx)(sn,{...e}),cn=Wt.Z().x(e=>e.x).y(e=>e.y).curve(jn.Z);function ve({render:e=An,setEdge:s,id:i,edge:d}){const{x:p=0,y:m=0,width:E,height:D,points:V}=d,U=d,ye=ln(),ie=v.useRef(null);v.useLayoutEffect(()=>{if(ie.current){let{height:Ae,width:Me}=ie.current.getBBox();Ae=Math.round(Ae),Me=Math.round(Me),(Ae!==D||Me!==E)&&s(i,{...d,height:Ae,width:Me})}},[d,D,E,s,i]);let me="";if(V){const Ae=V.filter(Me=>Ft()(Me.x)&&Ft()(Me.y));me=cn(Ae)||""}return(0,n.jsxs)(n.Fragment,{children:[me&&(0,n.jsx)("path",{"data-testid":wn,className:ye.path,markerEnd:`url(#${nn})`,d:me}),U.label?(0,n.jsx)("g",{ref:ie,"data-testid":rn,className:ye.label,transform:`translate(${p},${m})`,children:e({edge:U})}):null]})}const te="workspace";function Te(e){var s,i;const{edges:d,nodes:p,renderNode:m,direction:E=le.TOP_BOTTOM,align:D,nodeMargin:V=50,edgeMargin:U=10,rankMargin:ye=50,paddingX:ie=0,paddingY:me=0,acyclicer:Ae,ranker:Me=Ze.NETWORK_SIMPLEX,labelPosition:dt=pt.RIGHT,labelOffset:$t=10,edgeRanks:Dt=1,edgeWeight:Kt=1,renderLabel:Yt,defs:jt,zoom:zt="enabled",...Nt}=e,pr=(0,at.Z)(),[Xn,fr]=v.useState(100),[gr,li]=v.useState(100),Zt=v.useRef(new(Ct()).graphlib.Graph),[_r,uo]=v.useState(((s=Zt.current.graph())===null||s===void 0?void 0:s.width)||0),[es,ho]=v.useState(((i=Zt.current.graph())===null||i===void 0?void 0:i.height)||0),[po,ci]=v.useState([]),[bn,ir]=v.useState([]),qn=Math.max(_r,Xn),Vn=Math.max(es,gr),mn=v.useMemo(()=>qt()(tn=>{if(!tn)return;const Sn=Et.Z(tn),en=Et.Z(tn.getElementById(te));function _n(){Sn.call(yt.sP().scaleExtent([1,10]).on("zoom",mr=>{mr.transform.x=Math.min(0,Math.max(mr.transform.x,qn-qn*mr.transform.k)),mr.transform.y=Math.min(0,Math.max(mr.transform.y,Vn-Vn*mr.transform.k)),en.attr("transform",mr.transform)}))}zt==="enabled"?_n():zt==="enable-on-click"&&Sn.on("click",()=>_n());const{width:er,height:fo}=tn.getBoundingClientRect();Xn!==er&&fr(er),gr!==fo&&li(fo)},100),[gr,Xn,qn,Vn,zt]),Rn=v.useCallback(()=>{const tn=Zt.current.nodes(),Sn=Zt.current.edges();tn.forEach(en=>{p.some(er=>er.id===en)||Zt.current.removeNode(en)}),Sn.forEach(en=>{d.some(er=>er.from===en.v&&er.to===en.w)||Zt.current.removeEdge(en.v,en.w)}),p.forEach(en=>{const _n=Zt.current.nodes().find(er=>en.id===er);if(_n&&Zt.current.node(_n)){const{width:er,height:fo,x:mr,y:Rl}=Zt.current.node(_n);Zt.current.setNode(_n,{...en,width:er,height:fo,x:mr,y:Rl})}else Zt.current.setNode(en.id,{...en,width:0,height:0})}),d.forEach(en=>{Zt.current.setEdge(en.from,en.to,{...en,label:en.label,width:0,height:0,labelpos:dt,labeloffset:$t,weight:Kt,minlen:Dt})})},[d,p,dt,$t,Kt,Dt]),ar=v.useMemo(()=>qt()(()=>{Ct().layout(Zt.current);const{height:tn,width:Sn}=Zt.current.graph(),en=Math.max(0,tn||0),_n=Math.max(0,Sn||0);uo(_n),ho(en),ci(Zt.current.nodes()),ir(Zt.current.edges())},250,{leading:!0}),[]);v.useEffect(()=>(Zt.current.setGraph({rankdir:E,align:D,nodesep:V,edgesep:U,ranksep:ye,marginx:ie,marginy:me,acyclicer:Ae,ranker:Me}),Rn(),ar(),ar.cancel),[Ae,D,E,U,ie,me,V,ye,Me,Rn,ar]);function Fr(tn,Sn){return Zt.current.setNode(tn,Sn),ar(),Zt.current}function ks(tn,Sn){return Zt.current.setEdge(tn,Sn),ar(),Zt.current}return(0,n.jsxs)("svg",{ref:mn,...Nt,width:"100%",height:Vn,viewBox:`0 0 ${qn} ${Vn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:nn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:pr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),jt]}),(0,n.jsx)("g",{id:te,children:(0,n.jsxs)("svg",{width:_r,height:es,y:Vn/2-es/2,x:qn/2-_r/2,viewBox:`0 0 ${_r} ${es}`,children:[bn.map(tn=>{const Sn=Zt.current.edge(tn);return Sn?(0,n.jsx)(ve,{id:tn,setEdge:ks,render:Yt,edge:Sn},`${tn.v}-${tn.w}`):null}),po.map(tn=>{const Sn=Zt.current.node(tn);return Sn?(0,n.jsx)(Mn,{setNode:Fr,render:m,node:Sn},tn):null})]})})]})}var Be;const Ke=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Be=e.palette.banner.warning)!==null&&Be!==void 0?Be:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Y=e=>{const{variant:s,message:i,id:d,fixed:p=!1}=e,m=Ke(),D=useApi(storageApiRef).forBucket("notifications");var V;const U=(V=D.snapshot("dismissedBanners").value)!==null&&V!==void 0?V:[],[ye,ie]=useState(new Set(U)),me=useObservable(D.observe$("dismissedBanners"));useEffect(()=>{if(me!=null&&me.value){var Me;const dt=(Me=me==null?void 0:me.value)!==null&&Me!==void 0?Me:[];ie(new Set(dt))}},[me==null?void 0:me.value]);const Ae=()=>{D.set("dismissedBanners",[...ye,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ye.has(d),classes:{root:classNames(m.root,!p&&m.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(m.content,m[s]),message:m.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ae,children:_jsx(Close,{className:m.icon})},"dismiss")]})})};var C=t(60905),g=t(90436),$=t.p+"static/missingAnnotation.67f79e98..svg",ee=t.p+"static/noInformation.4b426325..svg",ge=t.p+"static/createComponent.975d1e1e..svg",fe=t.p+"static/noBuild.1715fa71..svg";const Fe=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Je=({missing:e})=>{const s=Fe();switch(e){case"field":return(0,n.jsx)("img",{src:$,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:ee,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:ge,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:fe,alt:"no Build",className:s.generalImg});default:return null}},qe=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ot(e){const{title:s,description:i,missing:d,action:p}=e,m=qe();return(0,n.jsxs)(C.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:m.root,spacing:2,children:[(0,n.jsx)(C.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(C.Z,{container:!0,direction:"column",children:[(0,n.jsx)(C.Z,{item:!0,xs:!0,children:(0,n.jsx)(g.Z,{variant:"h5",children:s})}),(0,n.jsx)(C.Z,{item:!0,xs:!0,children:(0,n.jsx)(g.Z,{variant:"body1",children:i})}),(0,n.jsx)(C.Z,{item:!0,xs:!0,className:m.action,children:p})]})}),(0,n.jsx)(C.Z,{item:!0,xs:12,md:6,className:m.imageContainer,children:typeof d=="string"?(0,n.jsx)(Je,{missing:d}):d.customImage})]})}const lt=`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`,ct=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function Rt(e){const{annotation:s,readMoreUrl:i}=e,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=ct(),m=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)(ot,{missing:"field",title:"Missing Annotation",description:m,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(Xe,{text:lt.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(_.Z,{color:"primary",component:Se,to:d,children:"Read more"})]})})}var j=t(11776),F=t(38402),oe=t(49378),ce=t(41128),be=t(27616),Ie=t(8284),Qe=t(70660),ft=t(91750),et=t(38016);const mt=(e,s)=>(s.palette.type==="light"?ce._j:ce.$n)(s.palette[e].light,.6),gt=(e,s)=>(s.palette.type==="light"?ce.$n:ce._j)(s.palette[e].light,.9),At=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>mt(s,e)}})),Ut=({severity:e})=>{const s=At({severity:e});return(0,n.jsx)(ft.Z,{classes:s})},Wn=({severity:e})=>{const s=At({severity:e});return(0,n.jsx)(et.Z,{classes:s})},dn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>gt(s,e),color:({severity:s})=>mt(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>mt(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>mt(s,e),backgroundColor:({severity:s})=>gt(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),$n=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Bn(e){const{severity:s="warning",title:i,message:d,children:p,defaultExpanded:m}=e,E=dn({severity:s}),D=$n(s)+(i?`: ${i}`:"");return(0,n.jsxs)(be.Z,{defaultExpanded:m!=null?m:!1,className:E.panel,role:"alert",children:[(0,n.jsxs)(Ie.Z,{expandIcon:(0,n.jsx)(Wn,{severity:s}),className:E.summary,children:[(0,n.jsx)(Ut,{severity:s}),(0,n.jsx)(g.Z,{className:E.summaryText,variant:"subtitle1",children:D})]}),(d||p)&&(0,n.jsx)(Qe.Z,{children:(0,n.jsxs)(C.Z,{container:!0,children:[d&&(0,n.jsx)(C.Z,{item:!0,xs:12,children:(0,n.jsx)(g.Z,{className:E.message,variant:"body1",children:d})}),p&&(0,n.jsx)(C.Z,{item:!0,xs:12,className:E.details,children:p})]})})]})}const tr=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Bt=({error:e,message:s,stack:i,children:d})=>{const p=tr();return(0,n.jsxs)(j.Z,{dense:!0,children:[(0,n.jsxs)(F.Z,{alignItems:"flex-start",children:[(0,n.jsx)(oe.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(Ye,{text:e})]}),(0,n.jsxs)(F.Z,{alignItems:"flex-start",children:[(0,n.jsx)(oe.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(Ye,{text:s})]}),i&&(0,n.jsxs)(F.Z,{alignItems:"flex-start",children:[(0,n.jsx)(oe.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(Ye,{text:i})]}),d]})};function w(e){const{title:s,error:i,defaultExpanded:d,children:p}=e;return(0,n.jsx)(Bn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:d,children:(0,n.jsx)(Bt,{error:i.name,message:i.message,stack:i.stack,children:p})})}var u=t(85256);const b=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function A(e){var s;const{title:i,error:d,defaultExpanded:p}=e,m=b();if(d.name!=="ResponseError")return(0,n.jsx)(w,{title:i!=null?i:d.message,defaultExpanded:p,error:d});const{body:E,cause:D}=d,{request:V,response:U}=E,ye=`${U.statusCode}: ${D.name}`,ie=V&&`${V.method} ${V.url}`,me=D.message.replace(/\\n/g,`
|
|
12
|
-
`),Ae=(s=D.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
13
|
-
`),Me=JSON.stringify(E,void 0,2);return(0,n.jsxs)(w,{title:i!=null?i:d.message,defaultExpanded:p,error:{name:ye,message:me,stack:Ae},children:[ie&&(0,n.jsxs)(F.Z,{alignItems:"flex-start",children:[(0,n.jsx)(oe.Z,{classes:{secondary:m.text},primary:"Request",secondary:V?`${ie}`:void 0}),(0,n.jsx)(Ye,{text:ie})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{component:"li",className:m.divider}),(0,n.jsx)(F.Z,{alignItems:"flex-start",children:(0,n.jsx)(oe.Z,{classes:{secondary:m.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Xe,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var Q=t(28316);function xe(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function we(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function ke(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),m=p||xe(e);return p||we(m),m.appendChild(s.current),function(){s.current.remove(),m.childNodes.length===-1&&m.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var tt=null;const Pt="core.calloutSeen";function un(){const[e,s]=useState(()=>{const d=localStorage.getItem(Pt);return d?JSON.parse(d):{}}),i=useCallback((d,p)=>{const m=localStorage.getItem(Pt),D={...m?JSON.parse(m):{},[d]:p};s(D),localStorage.setItem(Pt,JSON.stringify(D))},[]);return{states:e,setState:i}}function Ln(e){const{states:s,setState:i}=un(),d=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:d}}function Ir(e){const{seen:s,markSeen:i}=Ln(e);return{show:s===!1,hide:i}}const Xt=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function vr(e){const{featureId:s,title:i,description:d,children:p}=e,{show:m,hide:E}=useShowCallout(s),D=usePortal("core.callout"),V=useRef(null),[U,ye]=useState(),ie=Xt(),me=useCallback(()=>{if(V.current){const Ae=V.current.getBoundingClientRect(),Me=Math.max(Ae.width,Ae.height),dt=800,$t=Ae.x-(Me-Ae.width)/2-dt,Dt=Ae.y-(Me-Ae.height)/2-dt,Kt=Me+2*dt,Yt=450,jt=Ae.x+Ae.width/2-Yt,zt=Ae.y-(Me-Ae.height)/2+Me+20;ye({dotLeft:$t,dotTop:Dt,dotSize:Kt,borderWidth:dt,textTop:zt,textLeft:jt,textWidth:Yt})}},[]);return useEffect(()=>(window.addEventListener("resize",me),window.addEventListener("scroll",me),()=>{window.removeEventListener("resize",me),window.removeEventListener("scroll",me)}),[me]),useLayoutEffect(me,[V.current,me]),m?_jsxs(_Fragment,{children:[_jsx("div",{className:ie.featureWrapper,ref:V,children:p}),createPortal(_jsx("div",{className:ie.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx("div",{className:ie.dot,"data-testid":"dot",style:{left:U==null?void 0:U.dotLeft,top:U==null?void 0:U.dotTop,width:U==null?void 0:U.dotSize,height:U==null?void 0:U.dotSize,borderWidth:U==null?void 0:U.borderWidth},onClick:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx("div",{className:ie.pulseCircle})}),_jsxs("div",{className:ie.text,"data-testid":"text",style:{left:U==null?void 0:U.textLeft,top:U==null?void 0:U.textTop,width:U==null?void 0:U.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:d})]})]})})}),D)]}):_jsx(_Fragment,{children:p})}var yr=t(35292);const Ur=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function Mr({color:e="primary",disabled:s=!1,href:i="#",icon:d=(0,n.jsx)(yr.Z,{}),label:p,onClick:m,title:E}){const D=Ur();return s?(0,n.jsxs)(J.Z,{title:E,className:X()(D.link,D.disabled),underline:"none",children:[d,(0,n.jsx)("span",{className:D.label,children:p})]}):(0,n.jsxs)(J.Z,{title:E,className:X()(D.link,D[e]),to:i,component:Se,onClick:m,children:[d,(0,n.jsx)("span",{className:D.label,children:p})]})}const xr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ts(e){const{links:s}=e,i=xr();return(0,n.jsx)("nav",{className:i.links,children:s.map((d,p)=>(0,n.jsx)(Mr,{...d},p+1))})}const br=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
14
|
-
hsl(0, 0%, ${s}) 0%,
|
|
15
|
-
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
16
|
-
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
17
|
-
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
18
|
-
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
19
|
-
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
20
|
-
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
21
|
-
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
22
|
-
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
23
|
-
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
24
|
-
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
25
|
-
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
26
|
-
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
27
|
-
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
28
|
-
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
29
|
-
hsla(0, 0%, ${s}, 0) 100%
|
|
30
|
-
`},ns=100,Rr=10,rs=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:ns,height:`calc(100% + ${Rr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Rr,background:`linear-gradient(90deg, ${br(e.palette.type)})`},fadeRight:{right:-Rr,background:`linear-gradient(270deg, ${br(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function ss(e){const[[s,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const m=()=>{const E=p.scrollLeft,D=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([E,D])};return m(),p.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{p.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[e]),[s,i]}function Hn(e,s,i){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const m=performance.now(),E=requestAnimationFrame(D=>{if(!e.current)return;const V=D-m,U=Math.abs(d)*V/s,ie=Math.max(i,U)*Math.sign(d);e.current.scrollBy({left:ie});const me=d-ie;Math.sign(d)!==Math.sign(me)?p(0):p(me)});return()=>cancelAnimationFrame(E)},[e,d,s,i]),p}function Zn(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:d=5,children:p,...m}=e,E=rs(e),D=React.useRef(),[V,U]=ss(D),ye=Hn(D,i,d),ie=me=>{!D.current||ye(me?s:-s)};return _jsxs("div",{...m,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:D,children:p}),_jsx("div",{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:V===0})}),_jsx("div",{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:U===0})}),V>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ie(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),U>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ie(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const lr=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Lr(e){const s=lr(e),{shorthand:i,alpha:d}=e;return i?_jsx("span",{className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const zr=(0,v.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function os(e){const{Progress:s}=(0,P.qD)().getComponents();return(0,n.jsx)(v.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(zr,{...e})})}const Sr=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),wr=(e,s)=>s?typeof s=="string"?e+s:v.Children.toArray(s.props.children).reduce(wr,e):e,nr=({level:e,children:s})=>{const p=v.Children.toArray(s).reduce(wr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return v.createElement(`h${e}`,{id:p},s)},Pr={code:({inline:e,className:s,children:i,...d})=>{const p=String(i).replace(/\n+$/,""),m=/language-(\w+)/.exec(s||"");return!e&&m?(0,n.jsx)(Xe,{language:m[1],text:p}):(0,n.jsx)("code",{className:s,...d,children:i})},h1:nr,h2:nr,h3:nr,h4:nr,h5:nr,h6:nr};function zn(e){const{content:s,dialect:i="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:m,className:E}=e,D=Sr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${D.markdown} ${E}`,children:s,components:Pr,linkTarget:d,transformLinkUri:p,transformImageUri:m})}var Cr=t(23054);const cr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),is=({request:e,busy:s,setBusy:i})=>{const d=cr(),[p,m]=useState(),E=async()=>{i(!0);try{await e.trigger()}catch(V){m(isError(V)?V.message:"An unspecified error occurred")}finally{i(!1)}},D=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(D,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var Vr=null;const Gn=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Os(e){const s=Gn(),[i,d]=useState(!1),p=useApi(oauthRequestApiRef),m=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{m.forEach(D=>D.reject())};return _jsxs(Dialog,{open:Boolean(m.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:m.map(D=>_jsx(LoginRequestListItem,{request:D,busy:i,setBusy:d},D.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var Wr=t(15277),jr=t.n(Wr),kr=t(29862);const as=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Hr(e){const[s,i]=(0,v.useState)(!1),d=(0,kr.t)(),p=as(),m=D=>{d()&&i(D)};var E;return(0,n.jsx)(ut.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(jr(),{text:e.text,line:e.line,onToggled:m,containerClassName:p.container})})}var ls=t(67358);function cs(e){const[s,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),s?(0,n.jsx)(ls.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Gr=t(94339),Kr=t(14503),Yr=t(24579),Jr=t(32552),pn=t(15459),Lt=t(95544),rr=t(27597);const dr=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function ds(e){const{link:s,title:i,onClick:d}=e,p=dr();return(0,n.jsxs)("div",{children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)(Se,{to:s,onClick:d,underline:"none",children:(0,n.jsxs)(Lt.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Lt.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(g.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(rr.Z,{className:p.arrow})]})})]})}const us=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(ze,{to:s.href,variant:"contained",children:s.name})},hs=class extends v.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:d}=this.state;return d?(0,n.jsx)(w,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(us,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},Qr=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),ps=(0,pn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Kr.Z),Xr={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 Er(e){const{title:s,subheader:i,divider:d=!0,deepLink:p,slackChannel:m,errorBoundaryProps:E,variant:D,children:V,headerStyle:U,headerProps:ye,icon:ie,action:me,actionsClassName:Ae,actions:Me,cardClassName:dt,actionsTopRight:$t,className:Dt,noPadding:Kt,titleTypographyProps:Yt}=e,jt=Qr();let zt={},Nt={};D&&D.split(/[\s]+/g).forEach(gr=>{zt={...zt,...Xr.card[gr]},Nt={...Nt,...Xr.cardContent[gr]}});const pr=()=>(0,n.jsxs)("div",{className:jt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:jt.subheader,children:i}),ie]}),Xn=E||(m?{slackChannel:m}:{});return(0,n.jsx)(Gr.Z,{style:zt,className:Dt,children:(0,n.jsxs)(hs,{...Xn,children:[s&&(0,n.jsx)(Jr.Z,{classes:{root:jt.header,title:jt.headerTitle,subheader:jt.headerSubheader,avatar:jt.headerAvatar,action:jt.headerAction,content:jt.headerContent},title:s,subheader:pr(),action:me,style:{...U},titleTypographyProps:Yt,...ye}),$t&&(0,n.jsx)(ps,{children:$t}),d&&(0,n.jsx)(u.Z,{}),(0,n.jsx)(Yr.Z,{className:X()(dt,{[jt.noPadding]:Kt}),style:Nt,children:V}),Me&&(0,n.jsx)(Kr.Z,{className:Ae,children:Me}),p&&(0,n.jsx)(ds,{...p})]})})}var $s=t(39307);const fs=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),qr={fractional:!0,inverse:!1,unit:"%",max:100},gs=({palette:e,value:s,inverse:i,max:d})=>{if(isNaN(s))return"#ddd";const p=d||qr.max,m=i?p-s:s;return m<p/3?e.status.error:m<p*(2/3)?e.status.warning:e.status.ok};function Bs(e){const[s,i]=useState(null),{getColor:d=gs}=e,p=fs(e),{palette:m}=useTheme(),{value:E,fractional:D,inverse:V,unit:U,max:ye,description:ie}={...qr,...e},me=D?Math.round(E*ye):E,Ae=ye!==100?Math.round(E):me,[Me,dt]=useState(!1);return useEffect(()=>{const $t=s,Dt=()=>dt(!0),Kt=()=>dt(!1);return $t&&ie?($t.addEventListener("mouseenter",Dt),$t.addEventListener("mouseleave",Kt),()=>{$t.removeEventListener("mouseenter",Dt),$t.removeEventListener("mouseleave",Kt)}):()=>{dt(!1)}},[ie,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:me,strokeWidth:12,trailWidth:12,strokeColor:d({palette:m,value:Ae,inverse:V,max:ye}),className:p.circle}),ie&&Me?_jsx("div",{className:p.description,children:ie}):_jsx("div",{className:p.overlay,children:isNaN(E)?"N/A":`${Ae}${U}`})]})}const ms=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Zs(e){const s=ms(e),{title:i,subheader:d,progress:p,inverse:m,deepLink:E,description:D,icon:V,variant:U,getColor:ye}=e,ie={inverse:m,description:D,getColor:ye,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:d,deepLink:E,variant:U,icon:V,children:_jsx(Gauge,{...ie})})})}function Ds(e){const{value:s,getColor:i=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const m=i({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:m})})})}var vs=t(21324),ys=t(7089),Ns=t(1292),y=t(42494),S=t(74603),I=t(56939),N=t(12231),K=t(73698),G=t(72379);const de=(0,l.Z)(()=>(0,O.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var pe=()=>{const e=de();return(0,n.jsx)(G.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Ce=(0,l.Z)(()=>(0,O.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Le=()=>{const e=Ce();return(0,n.jsx)(G.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Ge=(0,pn.Z)(e=>(0,O.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(S.Z),vt=(0,l.Z)(e=>(0,O.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function St(e){const{multiple:s,items:i,label:d,placeholder:p,selected:m,onChange:E,triggerReset:D,native:V=!1,disabled:U=!1,margin:ye}=e,ie=vt(),[me,Ae]=(0,v.useState)(m||(s?[]:"")),[Me,dt]=(0,v.useState)(!1);(0,v.useEffect)(()=>{Ae(s?[]:"")},[D,s]),(0,v.useEffect)(()=>{m!==void 0&&Ae(m)},[m]);const $t=jt=>{Ae(jt.target.value),E(jt.target.value)},Dt=jt=>{if(U){jt.preventDefault();return}dt(zt=>s&&!(jt.target instanceof HTMLElement)?!0:!zt)},Kt=()=>{dt(!1)},Yt=jt=>()=>{const zt=me.filter(Nt=>Nt!==jt);Ae(zt),E(zt)};return(0,n.jsx)("div",{className:ie.root,children:(0,n.jsx)(Ns.Z,{onClickAway:Kt,children:(0,n.jsxs)(y.Z,{className:ie.formControl,children:[(0,n.jsx)(I.Z,{className:ie.formLabel,children:d}),(0,n.jsxs)(K.Z,{"aria-label":d,value:me,native:V,disabled:U,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ye,onChange:$t,onClick:Dt,open:Me,input:(0,n.jsx)(Ge,{}),label:d,tabIndex:0,renderValue:jt=>{var zt;return s&&me.length!==0?(0,n.jsx)("div",{className:ie.chips,children:jt.map(Nt=>{var pr,Xn;return(0,n.jsx)(ys.Z,{label:(pr=i.find(fr=>fr.value===Nt))===null||pr===void 0?void 0:pr.label,clickable:!0,onDelete:Yt(Nt),className:ie.chip},(Xn=i.find(fr=>fr.value===Nt))===null||Xn===void 0?void 0:Xn.value)})}):(0,n.jsx)(g.Z,{children:me.length===0?p||"":(zt=i.find(Nt=>Nt.value===jt))===null||zt===void 0?void 0:zt.label})},IconComponent:()=>Me?(0,n.jsx)(Le,{}):(0,n.jsx)(pe,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(N.Z,{value:[],children:p}),V?i&&i.map(jt=>(0,n.jsx)("option",{value:jt.value,children:jt.label},jt.value)):i&&i.map(jt=>(0,n.jsxs)(N.Z,{value:jt.value,children:[s&&(0,n.jsx)(vs.Z,{color:"primary",checked:me.includes(jt.value)||!1,className:ie.checkbox}),jt.label]},jt.value))]})]})})})}const We=()=>{},It=v.createContext({stepperLength:0,stepIndex:0,setStepIndex:We,stepHistory:[],setStepHistory:We,onStepChange:We});function Ht(e){const{children:s,elevated:i,onStepChange:d,activeStep:p=0}=e,[m,E]=useState(p),[D,V]=useState([0]);useEffect(()=>{E(p)},[p]);const U=[];let ye;return Children.forEach(s,ie=>{isValidElement(ie)&&(ie.props.end?ye=ie:U.push(ie))}),_jsxs(_Fragment,{children:[_jsx(It.Provider,{value:{stepIndex:m,setStepIndex:E,stepHistory:D,setStepHistory:V,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:m,orientation:"vertical",elevation:i?2:0,children:U})}),m>=Children.count(s)-1&&ye]})}const Kn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Pn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),sr=({text:e,handleClick:s,disabled:i,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),hn=({text:e,handleClick:s,disabled:i,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:i,children:e||"Back"}),vn=({actions:e={},children:s})=>{const i=Kn(),{stepperLength:d,stepIndex:p,setStepIndex:m,stepHistory:E,setStepHistory:D,onStepChange:V}=useContext(VerticalStepperContext),U=(Ae,Me)=>{Me&&Me(),V&&V(p,Ae),m(Ae)},ye=()=>{const Ae=e.nextStep?e.nextStep(p,d-1):p+1;U(Ae,e.onNext),D([...E,Ae])},ie=()=>{E.pop(),U(E[E.length-1],e.onBack),D([...E])},me=()=>{U(0,e.onRestart),D([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(hn,{text:e.backText,handleClick:ie,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(sr,{text:e.nextText,handleClick:ye,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Pn,{text:e.restartText,handleClick:me,stepIndex:p}),s]})},yn=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Or(e){const{title:s,children:i,end:d,actions:p,...m}=e,E=yn();return d?_jsxs("div",{className:E.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...m,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Dn=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Ar(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function fn(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Tn(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Tr(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Vi(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Wi(e){const s=Dn(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var $r=t(74600),go=t(15584);const mo=e=>(0,O.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),di={root:{border:"0",verticalAlign:"top"}},ui=e=>(0,O.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),gn=e=>(0,O.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),xs=(0,pn.Z)(mo,{name:"BackstageMetadataTableTitleCell"})(go.Z),vo=(0,pn.Z)(di,{name:"BackstageMetadataTableCell"})(go.Z),bs=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Ss=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(xs,{children:e}),_jsx(vo,{colSpan:e?1:2,...i,children:s})]}),Br=(0,pn.Z)(ui,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),hi=(0,pn.Z)(gn,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),ws=(0,O.Z)({root:{margin:"0 0",listStyleType:"none"}}),yo=e=>(0,O.Z)({root:{...ws.root,paddingLeft:e.spacing(1)}}),Fs=(0,pn.Z)(ws,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Br,{classes:e,children:s})),Us=(0,pn.Z)(yo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Br,{classes:e,children:s}));function xo(e,s){const i=e.map((d,p)=>_jsx(MetadataListItem,{children:Yn(d)},p));return s?_jsx(Us,{children:i}):_jsx(Fs,{children:i})}function bo(e,s,i){const d=Object.keys(e).map(p=>{const m=Yn(e[p],!0),E=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${E}: `,m]},p)});return s?_jsx(Us,{children:d}):_jsx(Fs,{children:d})}function Yn(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?bo(e,s,i):Array.isArray(e)?xo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const Cs=({value:e,options:s})=>_jsx(Fragment,{children:Yn(e,s)}),So=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Cs,{value:s,options:i})});function wo(e,s){return Object.keys(e).map(i=>_jsx(So,{title:i,value:e[i],options:s},i))}function Co(e){const{metadata:s,dense:i=!0,options:d}=e,p=wo(s,d||{});return _jsx(MetadataTable,{dense:i,children:p})}var jo=t(49429),Eo=t(86136),Ms=t(79784),Ao=t(19126),To=t.n(Ao);function Io(e){return qs.stringify(e,{strictNullHandling:!0})}function zs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Vs(e,s){return zs(e)[s]}function Ro(e,s,i){const d={...zs(e),[s]:i};return Io(d)}function Lo(e,s=250){const[i,d]=useSearchParams(),p=i.toString(),[m,E]=useState(Vs(p,e));return useEffect(()=>{const D=Vs(p,e);E(V=>isEqual(D,V)?V:D)},[p,E,e]),useDebouncedEffect(()=>{const D=Ro(p,e,m);p!==D&&d(D,{replace:!0})},[d,m,p,e],s),[m,E]}const js={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 Ws(){const s=(0,P.I_)().get(P.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return js;var d;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(m=>({url:m.getString("url"),title:m.getString("title")}))}))}}var Po=t(80079);function Nn(e,s){const d=(0,P.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...s}):(0,n.jsx)(Po.Z,{...s})}function pi(e){return Nn("brokenImage",e)}function Hi(e){return Nn("catalog",e)}function Gi(e){return Nn("chat",e)}function Es(e){return Nn("dashboard",e)}function Ki(e){return Nn("docs",e)}function Yi(e){return Nn("email",e)}function fi(e){return Nn("github",e)}function gi(e){return Nn("group",e)}function Zr(e){return Nn("help",e)}function Ji(e){return Nn("user",e)}function Qi(e){return Nn("warning",e)}const Hs=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Gs=({icon:e})=>{const s=(0,P.qD)();var i;const d=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:Zr;return(0,n.jsx)(d,{})};var As;const ko=({link:e})=>(0,n.jsx)(Se,{to:e.url,children:(As=e.title)!==null&&As!==void 0?As:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(F.Z,{children:[(0,n.jsx)(Eo.Z,{children:(0,n.jsx)(Gs,{icon:e.icon})}),(0,n.jsx)(oe.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,d,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(ko,{link:d},d.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:d}=Ws(),[p,m]=(0,v.useState)(!1),[E,D]=(0,v.useState)(null),V=Hs(),U=(0,st.Z)(me=>me.breakpoints.down("sm")),ye=me=>{D(me.currentTarget),m(!0)},ie=()=>{m(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Lt.Z,{display:"flex",ml:1,children:U?(0,n.jsx)(He.Z,{color:"primary",size:"small",onClick:ye,"data-testid":"support-button",children:(0,n.jsx)(Zr,{})}):(0,n.jsx)(_.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ye,startIcon:(0,n.jsx)(Zr,{}),children:"Support"})}),(0,n.jsxs)(Ms.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ie,children:[(0,n.jsxs)(j.Z,{className:V.popoverList,children:[s&&(0,n.jsx)(F.Z,{alignItems:"flex-start",children:(0,n.jsx)(g.Z,{variant:"subtitle1",children:s})}),v.Children.map(i,(me,Ae)=>(0,n.jsx)(F.Z,{alignItems:"flex-start",children:me},`child-${Ae}`)),d&&d.map((me,Ae)=>(0,n.jsx)(mi,{item:me},`item-${Ae}`))]}),(0,n.jsx)(jo.Z,{children:(0,n.jsx)(_.Z,{color:"primary",onClick:ie,children:"Close"})})]})]})}var Ks=t(18671),Mt=t(10289);const Ts=72,Ys=24,Oo=18,or={drawerWidthClosed:Ts,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Ts,iconSize:Ts-Ys*2,iconPadding:Ys,selectedIndicatorWidth:3,userBadgePadding:Oo,userBadgeDiameter:Ts-Oo*2,mobileSidebarHeight:56},yi=e=>({...or,...e,iconContainerWidth:or.drawerWidthClosed,iconSize:or.drawerWidthClosed-or.iconPadding*2,userBadgeDiameter:or.drawerWidthClosed-or.userBadgePadding*2}),$o={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:or.defaultOpenDelayMs+200},xi=e=>({...$o,...e}),Xi="@backstage/core/sidebar-intro-dismissed",Jn=(0,v.createContext)({sidebarConfig:or,submenuConfig:$o}),Bo=(0,v.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Is;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Is||(Is={}));const Zo={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Is.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Is.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Dr=t(51837);const Js={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Qs=(0,v.createContext)(Js),Xs=(0,Dr.CT)("sidebar-pin-state-context");function Do(e){const{children:s,value:i}=e;return(0,n.jsx)(Qs.Provider,{value:i,children:(0,n.jsx)(Xs.Provider,{value:(0,Dr.EI)({1:i}),children:s})})}const Nr=()=>{const e=(0,v.useContext)(Xs),s=(0,v.useContext)(Qs);if(e===void 0)return s||Js;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},No=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),_s=(0,v.createContext)({content:{contentRef:void 0}});function Fo(e){const[s,i]=(0,v.useState)(()=>Zo.getSidebarPinState()),{sidebarConfig:d}=(0,v.useContext)(Jn),p=(0,v.useRef)(null),m=(0,v.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,v.useEffect)(()=>{Zo.setSidebarPinState(s)},[s]);const E=(0,st.Z)(U=>U.breakpoints.down("xs"),{noSsr:!0}),D=()=>i(!s),V=No({isPinned:s,sidebarConfig:d});return(0,n.jsx)(Do,{value:{isPinned:s,toggleSidebarPinState:D,isMobile:E},children:(0,n.jsx)(_s.Provider,{value:m,children:(0,n.jsx)("div",{className:V.root,children:e.children})})})}function eo(){const{content:e}=(0,v.useContext)(_s);return{focusContent:(0,v.useCallback)(()=>{var i,d;e==null||(i=e.contentRef)===null||i===void 0||(d=i.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const to={isOpen:!1,setOpen:()=>{}},Uo=(0,v.createContext)(to),no=(0,Dr.CT)("sidebar-open-state-context");function ro(e){const{children:s,value:i}=e;return(0,n.jsx)(Uo.Provider,{value:i,children:(0,n.jsx)(no.Provider,{value:(0,Dr.EI)({1:i}),children:s})})}const so=()=>{const e=(0,v.useContext)(no),s=(0,v.useContext)(Uo);if(e===void 0)return s||to;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Mo=t(50023),zo=t(4190),Vo=t(87685),Wo=t(44882),Ho=t(57998);const Go=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Ko=e=>{const{to:s,label:i,icon:d,value:p}=e,{sidebarConfig:m}=(0,v.useContext)(Jn),E=Go({sidebarConfig:m}),D=(0,Mt.TH)(),{selectedMenuItemIndex:V,setSelectedMenuItemIndex:U}=(0,v.useContext)(Rs),ye=(me,Ae)=>{U(Ae===V?-1:Ae)},ie=p===V&&V>=0||p!==V&&!(V>=0)&&s===D.pathname;return(0,n.jsx)(Ho.Z,{label:i,icon:d,component:Se,to:s||D.pathname,onChange:ye,value:p,selected:ie,classes:E})},oo=e=>{const{children:s,to:i,label:d,icon:p,value:m}=e,{isMobile:E}=Nr();return E?(0,n.jsx)(Ko,{to:i,label:d,icon:p,value:m}):(0,n.jsx)(n.Fragment,{children:s})},Fn=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Yo=e=>(0,ue.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Jo=v.createElement(oo).type,Qo=({children:e,label:s="Menu",open:i,onClose:d})=>{const{sidebarConfig:p}=(0,v.useContext)(Jn),m=Fn({sidebarConfig:p});return(0,n.jsxs)(zo.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:m.marginMobileSidebar}}},classes:{root:m.marginMobileSidebar,paperAnchorBottom:m.overlay},children:[(0,n.jsxs)(Lt.Z,{className:m.overlayHeader,children:[(0,n.jsx)(g.Z,{variant:"h3",children:s}),(0,n.jsx)(He.Z,{onClick:d,classes:{root:m.overlayHeaderClose},children:(0,n.jsx)(Vo.Z,{})})]}),(0,n.jsx)(Lt.Z,{component:"nav",children:e})]})},Rs=(0,v.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Xo=e=>{const{sidebarConfig:s}=(0,v.useContext)(Jn),{children:i}=e,d=Fn({sidebarConfig:s}),p=(0,Mt.TH)(),[m,E]=(0,v.useState)(-1);(0,v.useEffect)(()=>{E(-1)},[p.pathname]);let D=(0,P.vJ)(i,U=>U.getElements().filter(ye=>ye.type===Jo));if(i)D.length?D=Yo(D):D.push((0,n.jsx)(oo,{icon:(0,n.jsx)(Wo.Z,{}),children:i},"default_menu"));else return null;const V=m>=0&&!D[m].props.to;return(0,n.jsx)(ro,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(Rs.Provider,{value:{selectedMenuItemIndex:m,setSelectedMenuItemIndex:E},children:[(0,n.jsx)(Qo,{label:D[m]&&D[m].props.label,open:V,onClose:()=>E(-1),children:D[m]&&D[m].props.children}),(0,n.jsx)(Mo.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:D})]})})},io=(0,l.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var In;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(In||(In={}));const qo=e=>{const{sidebarConfig:s}=(0,v.useContext)(Jn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:m}=e,E=io({sidebarConfig:s}),D=(0,st.Z)(Dt=>Dt.breakpoints.down("md"),{noSsr:!0}),[V,U]=(0,v.useState)(In.Closed),ye=(0,v.useRef)(),{isPinned:ie,toggleSidebarPinState:me}=Nr(),Ae=()=>{ie||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),V!==In.Open&&!D&&(ye.current=window.setTimeout(()=>{ye.current=void 0,U(In.Open)},i),U(In.Idle)))},Me=()=>{ie||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),V===In.Idle?U(In.Closed):V===In.Open&&(ye.current=window.setTimeout(()=>{ye.current=void 0,U(In.Closed)},d)))},dt=V===In.Open&&!D||ie,$t=Dt=>{Dt?(U(In.Open),me()):(U(In.Closed),me())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(_o,{}),(0,n.jsx)(ro,{value:{isOpen:dt,setOpen:$t},children:(0,n.jsx)("div",{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ae,onFocus:p?()=>{}:Ae,onMouseLeave:p?()=>{}:Me,onBlur:p?()=>{}:Me,children:(0,n.jsx)("div",{className:X()(E.drawer,{[E.drawerOpen]:dt}),children:m})})})]})},bi=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=xi((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:m,disableExpandOnHover:E,openDelayMs:D,closeDelayMs:V}=e,{isMobile:U}=Nr();return U?(0,n.jsx)(Xo,{children:m}):(0,n.jsx)(Jn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(qo,{openDelayMs:D,closeDelayMs:V,disableExpandOnHover:E,children:m})})};function _o(){const{sidebarConfig:e}=(0,v.useContext)(Jn),{focusContent:s,contentRef:i}=eo(),d=io({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(_.Z,{onClick:s,variant:"contained",className:X()(d.visuallyHidden),children:"Skip to content"}):null}function a(e,s){const i=new URLSearchParams(s.search).toString(),d=To().parse(i),p=new URLSearchParams(e.search).toString(),m=To().parse(p);return(0,ue.isEqual)(s.pathname,e.pathname)&&(0,ue.isMatch)(m,d)}const r=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),o=e=>{const{title:s,subtitle:i,to:d,icon:p,dropdownItems:m}=e,E=r(),{setIsHoveredOn:D}=useContext(SidebarItemWithSubmenuContext),V=()=>{D(!1)},U=useResolvedPath(d!=null?d:""),ye=useLocation();let ie=isLocationMatch(ye,U);const[me,Ae]=useState(!1),Me=()=>{Ae(!me)};return m!==void 0?(m.some(dt=>{const $t=resolvePath(dt.to);return ie=isLocationMatch(ye,$t),ie}),_jsxs("div",{className:E.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Me,onTouchStart:dt=>dt.stopPropagation(),className:classnames(E.item,ie?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]}),me?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),m&&me&&_jsx("div",{className:E.dropdown,children:m.map((dt,$t)=>_jsx(Tooltip,{title:dt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:dt.to,underline:"none",className:E.dropdownItem,onClick:V,onTouchStart:Dt=>Dt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:dt.title})})},$t))})]})):_jsx("div",{className:E.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(E.item,ie?E.selected:void 0),onClick:V,onTouchStart:dt=>dt.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]})]})})})};var c;const f=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(c=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&c!==void 0?c:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),B=e=>{const{isOpen:s}=so(),{sidebarConfig:i,submenuConfig:d}=(0,v.useContext)(Jn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,m=f({left:p,submenuConfig:d}),{isHoveredOn:E}=(0,v.useContext)(Bo),[D,V]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{V(E)},[E]),(0,n.jsxs)("div",{className:X()(m.drawer,{[m.drawerOpen]:D}),children:[(0,n.jsx)(g.Z,{variant:"h5",className:m.title,children:e.title}),e.children]})};var z=t(76600),H=t(26739),se=t(98989),Ue=t(59797),Ne=t(83543);const xt=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),rt=()=>{const e=xt();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var kt=null;const Ot=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Gt=()=>{const e=Ot();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var xn=null,Un,kn;const Qn=e=>(0,l.Z)(s=>{var i,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Un=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Un!==void 0?Un:"#404040"}},highlighted:{background:(kn=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&kn!==void 0?kn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function ur(e){return(0,v.useMemo)(()=>Qn(e),[e])()}const ei=(e,s)=>(0,P.vJ)(e.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:m}})=>{if(!d){if(m!=null&&m.length){m.forEach(({to:E})=>d=d||a(s,(0,Mt.i3)(E)));return}p&&(d=a(s,(0,Mt.i3)(p)))}}),d},[s.pathname]);function ao(e){return e.to===void 0}const Ls=v.createElement(B).type,ti=v.forwardRef(function({to:s,end:i,style:d,className:p,activeStyle:m,caseSensitive:E,activeClassName:D="active","aria-current":V="page",...U},ye){let{pathname:ie}=(0,Mt.TH)(),{pathname:me}=(0,Mt.WU)(s);E||(ie=ie.toLocaleLowerCase("en-US"),me=me.toLocaleLowerCase("en-US"));let Ae=ie===me;!Ae&&!i&&(Ae=ie.startsWith(`${me}/`));const Me=Ae?V:void 0;return(0,n.jsx)(he.rU,{...U,to:s,ref:ye,"aria-current":Me,style:{...d,...Ae?m:void 0},className:X()([p,Ae?D:void 0])})}),hr=(0,v.forwardRef)((e,s)=>{const{icon:i,text:d,hasNotifications:p=!1,hasSubmenu:m=!1,disableHighlight:E=!1,onClick:D,children:V,className:U,...ye}=e,{sidebarConfig:ie}=(0,v.useContext)(Jn),me=ur(ie),{isOpen:Ae}=so(),Me=!Ae&&m?{display:"flex",marginLeft:"24px"}:{},dt=(0,n.jsxs)("div",{style:Me,children:[(0,n.jsx)(i,{fontSize:"small"}),!Ae&&m?(0,n.jsx)(se.Z,{}):(0,n.jsx)(n.Fragment,{})]}),$t=(0,n.jsx)(H.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:X()({[me.closedItemIcon]:!Ae}),children:dt}),Dt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:me.iconContainer,children:$t}),d&&(0,n.jsx)(g.Z,{variant:"subtitle2",className:me.label,children:d}),(0,n.jsx)("div",{className:me.secondaryAction,children:V})]}),Kt=Ae?Dt:$t,Yt={onClick:D,className:X()(U,me.root,Ae?me.open:me.closed,ao(e)&&me.buttonItem,{[me.highlightable]:!E})};return ao(e)?(0,n.jsx)("button",{"aria-label":d,...Yt,ref:s,children:Kt}):(0,n.jsx)(ti,{...Yt,activeClassName:me.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...ye,children:Kt})}),qi=({children:e,...s})=>{const{sidebarConfig:i}=(0,v.useContext)(Jn),d=ur(i),[p,m]=(0,v.useState)(!1),E=(0,Mt.TH)(),D=ei(e,E),V=(0,st.Z)(me=>me.breakpoints.down("sm")),U=()=>{m(!0)},ye=()=>{m(!1)},ie=()=>V?p?(0,n.jsx)(Ue.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(Ne.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(se.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Bo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:m},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ye,onTouchStart:p?ye:U,onMouseEnter:U,className:X()(p&&d.highlighted),children:[(0,n.jsx)(hr,{hasSubmenu:!0,className:D?d.selected:"",...s,children:ie()}),p&&e]})})},Si=(0,v.forwardRef)((e,s)=>{const[i]=(0,P.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Ls));return i?(0,n.jsx)(qi,{...e,children:i}):(0,n.jsx)(hr,{...e,ref:s})});function Ll(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,d]=useState(""),p=ur(s),m=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(i),d("")},D=ie=>{ie.key==="Enter"&&(ie.preventDefault(),E())},V=ie=>{d(ie.target.value)},U=ie=>{ie.preventDefault(),ie.stopPropagation()},ye=ie=>{E(),ie.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(Si,{icon:m,to:e.to,onClick:ye,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:U,onChange:V,onKeyDown:D,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Pl=(0,z.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),kl=(0,z.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),_i=(0,z.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),ea=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Ol=(0,z.Z)("div")(({theme:e})=>{const s=ea(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),$l=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=ur(e),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const m=()=>{d(!i)};return _jsx("button",{onClick:m,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ta=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:12}}),{name:"BackstageSidebarIntro"});function na(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ta({sidebarConfig:s}),{text:d,onClose:p}=e,m=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx("div",{className:i.introDismiss,children:_jsxs(Link,{component:"button",onClick:m,underline:"none",className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const wi=e=>{const{text:s,onDismiss:i}=e,[d,p]=useState(!1),m=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:i,children:_jsx(na,{text:s,onClose:m})})},ra=null,sa="And your recently viewed plugins will pop up here!";function Bl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:m,recentlyViewedItemsDismissed:E}=d!=null?d:{},D=()=>{p(U=>({...i,...U,starredItemsDismissed:!0}))},V=()=>{p(U=>({...i,...U,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!m&&_jsxs(_Fragment,{children:[_jsx(wi,{text:ra,onDismiss:D}),_jsx(SidebarDivider,{})]}),!E&&_jsx(wi,{text:sa,onDismiss:V})]}):null}const oa=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ci(e){const{className:s,stretch:i,noPadding:d,children:p,...m}=e,{contentRef:E}=eo(),D=oa();return(0,n.jsx)("article",{ref:E,tabIndex:-1,...m,className:X()(D.root,s,{[D.stretch]:i,[D.noPadding]:d}),children:p})}var ia=t(6487),aa=t(99152);const la=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function ji(e){const{tabs:s,onChange:i,selectedIndex:d}=e,[p,m]=(0,v.useState)(d!=null?d:0),E=la(),D=(0,v.useCallback)((V,U)=>{d===void 0&&m(U),i&&d!==U&&i(U)},[d,i]);return(0,v.useEffect)(()=>{d!==void 0&&m(d)},[d]),(0,n.jsx)("div",{className:E.tabsWrapper,children:(0,n.jsx)(aa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:D,value:p,children:s.map((V,U)=>(0,v.createElement)(ia.Z,{...V.tabProps,"data-testid":`header-tab-${U}`,label:V.label,key:V.id,value:U,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ca(e){const s=(0,Mt.UO)(),d=e.map(({path:me,children:Ae})=>({caseSensitive:!1,path:`${me}/*`,element:Ae})).sort((me,Ae)=>Ae.path.replace(/\/\*$/,"").localeCompare(me.path.replace(/\/\*$/,"")));var p;const m=(p=(0,Mt.V$)(d))!==null&&p!==void 0?p:e[0].children;var E;let D=(E=s["*"])!==null&&E!==void 0?E:"";D.startsWith("/")||(D=`/${D}`);var V;const[U]=(V=(0,Mt.fp)(d,D))!==null&&V!==void 0?V:[],ye=U?e.findIndex(me=>`${me.path}/*`===U.route.path):0;var ie;return{index:ye===-1?0:ye,element:m,route:(ie=e[ye])!==null&&ie!==void 0?ie:e[0]}}function Ei(e){const{routes:s}=e,i=(0,Mt.s0)(),{index:d,route:p,element:m}=ca(s),E=(0,v.useMemo)(()=>s.map(V=>({id:V.path,label:V.title,tabProps:V.tabProps})),[s]),D=V=>{let{path:U}=s[V];U=U.replace(/\/\*$/,""),U=U.replace(/^\//,""),i(U)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ji,{tabs:E,selectedIndex:d,onChange:D}),(0,n.jsxs)(Ci,{children:[(0,n.jsx)(Ks.q,{title:p.title}),m]})]})}const ni=()=>null;(0,P.R5)(ni,"core.gatherMountPoints",!0);function Ai(e){const s=(0,n.jsx)(ni,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return v.Children.toArray(e).flatMap(i=>{if(!(0,v.isValidElement)(i))return[];if(i.type===v.Fragment)return Ai(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:m,tabProps:E}=i.props;return[{path:d,title:p,children:m,tabProps:E}]})}function da(e){const s=Ai(e.children);return(0,n.jsx)(Ei,{routes:s})}da.Route=ni;const ua=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ha(e){const{value:s,subvalue:i}=e,d=ua();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d.value,children:s}),(0,n.jsx)("div",{className:d.subvalue,children:i})]})}var pa=t(21070),fa=t(90324),ga=t(98281),ma=t(48049),Ti=t(51209),Ii=t(33375),va=t(44233),ya=t(27604),ri=t(36444),xa=t(37971),ba=t(59709),Sa=t(17373),wa=t(3702),Ca=t(93111),lo=t(67222);const ja=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ea=e=>{var s;const i=ja(),{onChangeFilters:d}=e,[p,m]=(0,v.useState)({...e.selectedFilters}),[E,D]=(0,v.useState)(!1),V=()=>{m({}),D(U=>!U)};return(0,v.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(_.Z,{color:"primary",onClick:V,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(U=>(0,n.jsx)(St,{triggerReset:E,...U.element,selected:p[U.element.label],onChange:ye=>m({...p,[U.element.label]:ye})},U.element.label))})]})},Ri={Add:(0,v.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),Check:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),Clear:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Delete:(0,v.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),DetailPanel:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ti.Z,{...e,ref:s})),Edit:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),Export:(0,v.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),Filter:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ri.Z,{...e,ref:s})),FirstPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),LastPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),NextPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ti.Z,{...e,ref:s})),PreviousPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),ResetSearch:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Search:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ri.Z,{...e,ref:s})),SortArrow:(0,v.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),ThirdStateCheck:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),ViewColumn:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s}))};function Li(e,s){const i=s.split(".");let d=e[i[0]];for(let p=1;p<i.length;++p){if(d===void 0)return d;const m=i[p];d=d[m]}return d}const Aa=(0,pn.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"})(lo.W$),Pi=(0,pn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(lo.UW),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ia=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ra(e,s){return e.map(i=>{const d={};let p=i.cellStyle||{};if(i.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const m=p;p=(E,D,V)=>({...m(E,D,V),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:p}})}function La(e,s){return(0,ue.transform)(e,(i,d,p)=>{(0,ue.isEqual)(d,s[p])||(i[p]=d)})}const ki={search:"",filtersOpen:!1,filters:{}};function Pa(e){const{toolbarRef:s,setSearch:i,hasFilters:d,selectedFiltersLength:p,toggleFilters:m}=e,E=Ta(),D=(0,v.useCallback)(V=>{e.onSearchChanged(V),i(V)},[e,i]);return d?(0,n.jsxs)("div",{className:E.root,children:[(0,n.jsxs)("div",{className:E.root,children:[(0,n.jsx)(He.Z,{onClick:m,"aria-label":"filter list",children:(0,n.jsx)(ri.Z,{})}),(0,n.jsxs)(g.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:D})]}):(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:D})}function Oi(e){const{data:s,columns:i,options:d,title:p,subtitle:m,filters:E,initialState:D,emptyContent:V,onStateChange:U,components:ye,...ie}=e,me=Ia(),Ae=(0,je.Z)(),Me={...ki,...D},[dt,$t]=(0,v.useState)(Me.filtersOpen),Dt=(0,v.useCallback)(()=>$t(bn=>!bn),[$t]),[Kt,Yt]=(0,v.useState)(0),[jt,zt]=(0,v.useState)(s),[Nt,pr]=(0,v.useState)(Me.filters),Xn=Ra(i,Ae),[fr,gr]=(0,v.useState)(Me.search);(0,v.useEffect)(()=>{if(U){const bn=La({search:fr,filtersOpen:dt,filters:Nt},ki);U(bn)}},[fr,dt,Nt,U]);const li={headerStyle:{textTransform:"uppercase"}},Zt=(0,v.useCallback)(bn=>{var ir;return(ir=i.find(qn=>qn.title===bn))===null||ir===void 0?void 0:ir.field},[i]);(0,v.useEffect)(()=>{if(typeof s=="function")return;if(!Nt){zt(s);return}const bn=Object.values(Nt);if(s&&bn.flat().length){const ir=s.filter(qn=>!!Object.entries(Nt).filter(([,Vn])=>!!Vn.length).every(([Vn,mn])=>{const Rn=Li(qn,Zt(Vn));return Array.isArray(Rn)&&Array.isArray(mn)?Rn.some(ar=>mn.includes(ar)):Array.isArray(Rn)?Rn.includes(mn):Array.isArray(mn)?mn.includes(Rn):Rn===mn}));zt(ir)}else zt(s);Yt(bn.flat().length)},[s,Nt,Zt]);const _r=(bn,ir)=>{const qn=mn=>{const Rn=new Set,ar=Fr=>{Fr!=null&&Rn.add(Fr)};return ir&&ir.forEach(Fr=>{const ks=Li(Fr,Zt(mn));Array.isArray(ks)?ks.forEach(ar):ar(ks)}),Rn},Vn=mn=>({placeholder:"All results",label:mn.column,multiple:mn.type==="multiple-select",items:[...qn(mn.column)].sort().map(Rn=>({label:Rn,value:Rn}))});return bn.map(mn=>({type:mn.type,element:Vn(mn)}))},uo=!!(E!=null&&E.length),es=(0,v.useCallback)(bn=>(0,n.jsx)(Pa,{setSearch:gr,hasFilters:uo,selectedFiltersLength:Kt,toggleFilters:Dt,...bn}),[Dt,uo,Kt,gr]),ho=typeof s!="function"&&s.length===0,po=i.length,ci=(0,v.useCallback)(bn=>V&&ho?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:po,children:V})})}):(0,n.jsx)(lo.os,{...bn}),[ho,V,po]);return(0,n.jsxs)("div",{className:me.root,children:[dt&&s&&typeof s!="function"&&(E==null?void 0:E.length)&&(0,n.jsx)(Ea,{filters:_r(E,s),selectedFilters:Nt,onChangeFilters:pr}),(0,n.jsx)(lo.ZP,{components:{Header:Aa,Toolbar:es,Body:ci,...ye},options:{...li,...d},columns:Xn,icons:Ri,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.Z,{variant:"h5",component:"h2",children:p}),m&&(0,n.jsx)(g.Z,{color:"textSecondary",variant:"body1",children:m})]}),data:typeof s=="function"?s:jt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},...ie})]})}Oi.icons=Object.freeze(Ri);const Zl=e=>{const{children:s,value:i,index:d,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:i===d&&_jsx(Box,{p:3,children:s})})},ka=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Dl=e=>{const s=ka(e),{ariaLabel:i,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Oa=(e,s)=>s?e?"20px":"0":"40px",$a=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Oa(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Nl=e=>{const s=$a(e),{isFirstNav:i,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ba=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Fl=e=>{const s=Ba(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Za=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Ul(e){const{tabs:s}=e,i=Za(),[d,p]=useState([0,0]),[m,E]=useState(0),[D,V]=useState(0),[U,ye]=useState([[]]),ie=useRef(),{width:me}=useWindowSize(),Ae=(Kt,Yt)=>{p([m,Yt])},Me=()=>{E(m-1)},dt=()=>{E(m+1)},$t=()=>m+1<U.length;useEffect(()=>{const Yt=m===0?1:2,jt=ie.current.offsetWidth-20-Yt*30,zt=d[0]*D+d[1],Nt=Math.floor(jt/170);V(Nt),ye(chunkArray(s,Nt)),p([Math.floor(zt/Nt),zt%Nt])},[me,s]);const Dt=m===d[0]?d[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:ie,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Dt,onChange:Ae,selectionFollowsFocus:!0,children:[m!==0&&_jsx(StyledIcon,{onClick:Me,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),U[m].map((Kt,Yt)=>_jsx(StyledTab,{value:Yt,isFirstIndex:Yt===0,isFirstNav:m===0,icon:Kt.icon||void 0,label:Kt.label||void 0},Yt)),$t()&&_jsx(StyledIcon,{isNext:!0,onClick:dt,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Dt!==!1?U[m].map((Kt,Yt)=>_jsx(TabPanel,{value:Yt,index:Dt,children:Kt.content},Yt)):_jsx(TabPanel,{value:d[1],index:d[1],children:U[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Ml=t(44311);function Da(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function zl(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Da(e.data,s)})]})}const Na=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Fa=({title:e="Unknown page",className:s})=>(0,n.jsx)(g.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ua(e){const{description:s,title:i,titleComponent:d=void 0,children:p,textAlign:m="left"}=e,E=Na({textAlign:m})(),D=d||(0,n.jsx)(Fa,{title:i,className:E.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ks.q,{title:i}),(0,n.jsxs)("div",{className:E.container,children:[(0,n.jsxs)("div",{className:E.leftItemsBox,children:[D,s&&(0,n.jsx)(g.Z,{className:E.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:E.rightItemsBox,children:p})]})]})}var Ma=t.p+"static/mic-drop.fe3ef4d0..svg";const za=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Va=()=>{const e=za();return(0,n.jsx)("img",{src:Ma,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Wa=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ha(e){const{status:s,statusMessage:i,additionalInfo:d,supportUrl:p}=e,m=Wa(),E=(0,Mt.s0)(),D=Ws();return(0,n.jsxs)(C.Z,{container:!0,spacing:0,className:m.container,children:[(0,n.jsxs)(C.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(g.Z,{"data-testid":"error",variant:"body1",className:m.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(g.Z,{variant:"body1",className:m.subtitle,children:d}),(0,n.jsx)(g.Z,{variant:"h2",className:m.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(g.Z,{variant:"h6",children:[(0,n.jsx)(Se,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Se,{to:p||D.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(Va,{})]})}var Ga=t(16173);const Ka=(0,pn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(g.Z),si=(0,pn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Lt.Z);function Ya(e){const{children:s,...i}=e,[d,p]=v.useState(null),m=v.Children.toArray(s),[E,D,...V]=m,U=V.length?V.pop():m[m.length-1],ye=m.length>3,ie=Me=>{p(Me.currentTarget)},me=()=>{p(null)},Ae=Boolean(d);return(0,n.jsxs)(v.Fragment,{children:[(0,n.jsxs)(Ga.Z,{"aria-label":"breadcrumb",...i,children:[m.length>1&&(0,n.jsx)(si,{clone:!0,children:E}),m.length>2&&(0,n.jsx)(si,{clone:!0,children:D}),ye&&(0,n.jsx)(Ka,{onClick:ie,children:"..."}),(0,n.jsx)(Lt.Z,{style:{fontStyle:"italic"},children:U})]}),(0,n.jsx)(Ms.ZP,{open:Ae,anchorEl:d,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(j.Z,{children:V.map((Me,dt)=>(0,n.jsx)(F.Z,{button:!0,children:(0,n.jsx)(si,{clone:!0,children:Me})},dt))})})]})}const Ja=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),Qa=({type:e,typeLink:s,classes:i,pageTitle:d})=>e?s?(0,n.jsxs)(Ya,{className:i.breadcrumb,children:[(0,n.jsx)(Se,{to:s,children:e}),(0,n.jsx)(g.Z,{children:d})]}):(0,n.jsx)(g.Z,{className:i.type,children:e}):null,Xa=({pageTitle:e,classes:s,tooltip:i})=>{const d=(0,n.jsx)(g.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(ut.ZP,{title:i,placement:"top-start",children:d}):d},qa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(g.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function $i(e){const{children:s,pageTitleOverride:i,style:d,subtitle:p,title:m,tooltip:E,type:D,typeLink:V}=e,U=Ja(),ie=(0,P.h_)(P.Ds).getOptionalString("app.title")||"Backstage",me=i||m,Ae=m||i,Me=`${me} | %s | ${ie}`,dt=`${me} | ${ie}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ks.q,{titleTemplate:Me,defaultTitle:dt}),(0,n.jsxs)("header",{style:d,className:U.header,children:[(0,n.jsxs)(Lt.Z,{className:U.leftItemsBox,children:[(0,n.jsx)(Qa,{classes:U,type:D,typeLink:V,pageTitle:Ae}),(0,n.jsx)(Xa,{classes:U,pageTitle:Ae,tooltip:E}),(0,n.jsx)(qa,{classes:U,subtitle:p})]}),(0,n.jsx)(C.Z,{container:!0,className:U.rightItemsBox,spacing:4,children:s})]})]})}const _a=({label:e,secondaryLabel:s,icon:i,disabled:d=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:m=>{p&&p(m)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Vl(e){const{actionItems:s}=e,[i,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:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((m,E)=>_jsx(_a,{...m},`header-action-menu-${E}`))})})]})}const el=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),tl=({value:e,className:s})=>(0,n.jsx)(g.Z,{className:s,children:e});function nl(e){const{label:s,value:i,url:d}=e,p=el(),m=(0,n.jsx)(tl,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(C.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(g.Z,{className:p.label,children:s}),d?(0,n.jsx)(Se,{to:d,children:m}):m]})})}const rl={hour:"2-digit",minute:"2-digit"};function Bi(e){const s=new Date,i=window.navigator.language,d=[];if(!e.has("homepage.clocks"))return d;const p=e.getConfigArray("homepage.clocks");for(const m of p)if(m.has("label")&&m.has("timezone")){let E=m.getString("label");const D={timeZone:m.getString("timezone"),...rl};try{new Date().toLocaleString(i,D)}catch{console.warn(`The timezone ${D.timeZone} is invalid. Defaulting to GMT`),D.timeZone="GMT",E="GMT"}const V=s.toLocaleTimeString(i,D);d.push({time:V,label:E})}return d}function Wl(e){const s=useApi(configApiRef),i=[],[d,p]=React.useState(i);return React.useEffect(()=>{p(Bi(s));const m=setInterval(()=>{p(Bi(s))},1e3);return()=>{clearInterval(m)}},[s]),d.length!==0?_jsx(_Fragment,{children:d.map(m=>_jsx(HeaderLabel,{label:m.label,value:m.time},m.label))}):null}const sl=e=>(0,O.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ol=(0,l.Z)(sl,{name:"BackstageItemCardHeader"});function il(e){const{title:s,subtitle:i,children:d}=e,p=ol(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(g.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(g.Z,{variant:"h6",component:"h4",children:s}),d]})}function Hl(e){const{description:s,tags:i,title:d,type:p,subtitle:m,label:E,onClick:D,href:V}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:m||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((U,ye)=>_jsx(Chip,{size:"small",label:U},ye))}):null,s]}),_jsxs(CardActions,{children:[!V&&_jsx(Button,{to:"#",onClick:D,color:"primary",children:E}),V&&_jsx(Button,{to:V,color:"primary",children:E})]})]})}const al=e=>(0,O.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ll=(0,l.Z)(al,{name:"BackstageItemCardGrid"});function cl(e){const{children:s,...i}=e,d=ll(i);return(0,n.jsx)("div",{className:d.root,...i,children:s})}var dl=t(41547);const ul=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Zi(e){const{themeId:s,children:i}=e,{isMobile:d}=Nr(),p=ul({isMobile:d});return(0,n.jsx)(dl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function hl(e){const{themeId:s,children:i,...d}=e;return(0,n.jsxs)(Zi,{themeId:s,children:[(0,n.jsx)($i,{...d}),i]})}var On=t(30195);const Gl=On.z.object({providerInfo:On.z.object({}).catchall(On.z.unknown()).optional(),profile:On.z.object({email:On.z.string().optional(),displayName:On.z.string().optional(),picture:On.z.string().optional()}),backstageIdentity:On.z.object({token:On.z.string(),identity:On.z.object({type:On.z.literal("user"),userEntityRef:On.z.string(),ownershipEntityRefs:On.z.array(On.z.string())})})}),Di={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function pl(e){const s=new Date(Date.now()+Di.defaultTokenExpiryMillis);if(!e)return s;const[i,d,p]=e.split("."),m=JSON.parse(atob(d));return typeof m.exp!="number"?s:new Date(m.exp*1e3-Di.tokenExpiryMarginMillis)}class Kl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:pl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Yl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:d},{execute:p}]=useAsync(async()=>{const m=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await m.start(),e.onSignInSuccess(m)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},fl=(0,l.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=fl();return(0,n.jsx)(C.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 gl(e){const[s,i,d]=e.split(".");return JSON.parse(atob(i))}class ai{getUserId(){return this.result.userId}static fromResult(s){return new ai(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:d}=gl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Ps{static createGuest(){return new ii}static fromLegacy(s){return ai.fromResult(s)}static create(s){return new Ps(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,d){this.identity=s,this.authApi=i,this.profile=d}}const ml={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:d,message:p}=e,m=(0,P.h_)(i),E=(0,P.h_)(P.VE),D=async()=>{try{const V=await m.getBackstageIdentity({instantPopup:!0});if(!V)throw new Error(`The ${d} provider is not configured to support sign-in`);const U=await m.getProfile();s(Ps.create({identity:V.identity,profile:U,authApi:m}))}catch(V){E.post(new Cr.SP("Login failed",V))}};return(0,n.jsx)(oi,{children:(0,n.jsx)(Er,{variant:"fullHeight",title:d,actions:(0,n.jsx)(_.Z,{color:"primary",variant:"outlined",onClick:D,children:"Sign In"}),children:(0,n.jsx)(g.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const p=await i.getProfile();return Ps.create({identity:d.identity,profile:p,authApi:i})}},vl={Component:({onSignInSuccess:e})=>(0,n.jsx)(oi,{children:(0,n.jsx)(Er,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(_.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ii),children:"Enter"}),children:(0,n.jsxs)(g.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ii};var yl=t(63955),Ni=t(86619),Fi=t(74828),xl=t(45455),bl=t.n(xl);const Sl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,wl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ui=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Cl={Component:({onSignInSuccess:e})=>{const s=wl(),{register:i,handleSubmit:d,formState:p}=(0,yl.cI)({mode:"onChange"}),{errors:m}=p,E=({userId:D})=>{e(Ps.fromLegacy({userId:D,profile:{email:`${D}@example.com`}}))};return(0,n.jsx)(oi,{children:(0,n.jsxs)(Er,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(g.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:d(E),children:[(0,n.jsxs)(y.Z,{children:[(0,n.jsx)(Ni.Z,{...Ui(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(m.userId)}),m.userId&&(0,n.jsx)(Fi.Z,{error:!0,children:m.userId.message})]}),(0,n.jsxs)(y.Z,{children:[(0,n.jsx)(Ni.Z,{...Ui(i("idToken",{required:!1,validate:D=>!D||Sl.test(D)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(m.idToken)}),m.idToken&&(0,n.jsx)(Fi.Z,{error:!0,children:m.idToken.message})]}),(0,n.jsx)(_.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!bl()(m),children:"Continue"})]})]})})},loader:async()=>{}},co="@backstage/core:SignInPage:provider",Mi={guest:vl,custom:Cl,common:ml};function zi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function tc(e){return e.reduce((i,d)=>{if(typeof d=="string")return zi(d,i),i[d]={components:Mi[d],id:d},i;const{id:p}=d;return zi(p,i),i[p]={components:Mi.common,id:p,config:d},i},{})}const nc=(e,s)=>{const i=useApi(errorApiRef),d=useApiHolder(),[p,m]=useState(!0),E=useCallback(V=>{s(IdentityApiSignOutProxy.from({identityApi:V,signOut:async()=>{var U;localStorage.removeItem(co),await((U=V.signOut)===null||U===void 0?void 0:U.call(V))}}))},[s]);useLayoutEffect(()=>{var V;if(!p)return;const U=localStorage.getItem(co);if(U===null){m(!1);return}const ye=e[U];if(!ye){m(!1);return}let ie=!1;return ye.components.loader(d,(V=ye.config)===null||V===void 0?void 0:V.apiRef).then(me=>{ie||(me?E(me):m(!1))}).catch(me=>{ie||(localStorage.removeItem(co),i.post(me),m(!1))}),()=>{ie=!0}},[p,i,s,d,e,E]);const D=useMemo(()=>Object.keys(e).map(V=>{const U=e[V],{Component:ye}=U.components,ie=me=>{localStorage.setItem(co,U.id),E(me)};return _jsx(ye,{config:U.config,onSignInSuccess:ie},U.id)}),[e,E]);return[p,D]},jl=({onSignInSuccess:e,providers:s=[],title:i,align:d="left"})=>{const p=useApi(configApiRef),m=useStyles(),E=getSignInProviders(s),[D,V]=useSignInProviders(E,e);return D?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:m,children:V})]})]})},El=({provider:e,auto:s,onSignInSuccess:i})=>{const d=useStyles(),p=useApi(e.apiRef),m=useApi(configApiRef),[E,D]=useState(),[V,U]=useState(!1),ye=async({checkExisting:ie,showPopup:me})=>{try{let Ae;if(ie&&(Ae=await p.getBackstageIdentity({optional:!0})),!Ae&&(me||s)&&(U(!0),Ae=await p.getBackstageIdentity({instantPopup:!0}),!Ae))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ae){U(!0);return}const Me=await p.getProfile();i(UserIdentity.create({identity:Ae.identity,authApi:p,profile:Me}))}catch(Ae){D(Ae),U(!0)}};return useMountEffect(()=>ye({checkExisting:!0})),V?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.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:()=>{ye({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function rc(e){return"provider"in e?_jsx(El,{...e}):_jsx(jl,{...e})}const Al=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Tl=(0,pn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Jr.Z);function sc(e){const{slackChannel:s,errorBoundaryProps:i,children:d,title:p,deepLink:m,value:E,onChange:D}=e,V=Al(),[U,ye]=useState(0),ie=D||((Me,dt)=>ye(dt));let me;E?React.Children.map(d,Me=>{React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===E&&(me=Me==null?void 0:Me.props.children)}):React.Children.map(d,(Me,dt)=>{React.isValidElement(Me)&&dt===U&&(me=Me==null?void 0:Me.props.children)});const Ae=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ae,children:[p&&_jsx(Tl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:V,value:E||U,onChange:ie,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:me}),m&&_jsx(BottomLink,{...m})]})})}const Il=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function oc(e){const{children:s,...i}=e,d=Il();return _jsx(Tab,{disableRipple:!0,classes:d,...i})}},25248:function(wt,De,t){"use strict";t.d(De,{fC:function(){return x},CL:function(){return $e},sM:function(){return J},$v:function(){return Se},v_:function(){return Ve},hg:function(){return ze},uB:function(){return ne},R5:function(){return Et},bq:function(){return R},Ds:function(){return je},ni:function(){return X},T0:function(){return M},CO:function(){return En},x8:function(){return rn},rx:function(){return cn},YO:function(){return Ft},P4:function(){return jn},NT:function(){return qt},NW:function(){return He},VE:function(){return ut},W0:function(){return Pe},gP:function(){return Ye},IY:function(){return at},F4:function(){return ue},ux:function(){return L},Kp:function(){return he},$4:function(){return _e},p_:function(){return Z},ZM:function(){return it},D:function(){return k},gW:function(){return T},E6:function(){return nt},z$:function(){return ht},h_:function(){return re},I_:function(){return O},qD:function(){return Ze},vJ:function(){return ln},yx:function(){return Ee},tg:function(){return on},Oi:function(){return Mn}});var h=t(52322),n=t(51837),v=t(2784);const P=(0,n.CT)("analytics-context"),W=()=>{const ve=(0,v.useContext)(P);if(ve===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const te=ve.atVersion(1);if(te===void 0)throw new Error("No context found for version 1.");return te},x=ve=>{const{attributes:te,children:Te}=ve,Ke={...W(),...te},Y=(0,n.EI)({1:Ke});return(0,h.jsx)(P.Provider,{value:Y,children:Te})};function l(ve,te){const Te=Be=>_jsx(x,{attributes:te,children:_jsx(ve,{...Be})});return Te.displayName=`WithAnalyticsContext(${ve.displayName||ve.name||"Component"})`,Te}function O(){const ve=(0,n.Vt)("api-context");if(!ve)throw new Error("API context is not available");const te=ve.atVersion(1);if(!te)throw new Error("ApiContext v1 not available");return te}function re(ve){const Te=O().get(ve);if(!Te)throw new Error(`No implementation available for ${ve}`);return Te}function q(ve){return function(Te){const Be=Y=>{const C=O(),g={};for(const $ in ve)if(ve.hasOwnProperty($)){const ee=ve[$],ge=C.get(ee);if(!ge)throw new Error(`No implementation available for ${ee}`);g[$]=ge}return _jsx(Te,{...Y,...g})},Ke=Te.displayName||Te.name||"Component";return Be.displayName=`withApis(${Ke})`,Be}}class _{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(te){if(this.config=te,!te.id.split(".").flatMap(Be=>Be.split("-")).every(Be=>Be.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${te.id}'`)}}function M(ve){return new _(ve)}function X(ve,te){return"id"in ve?{api:ve,deps:{},factory:()=>te}:ve}var J;(function(ve){ve.SignedIn="SignedIn",ve.SignedOut="SignedOut"})(J||(J={}));const he=M({id:"core.auth.google"}),ue=M({id:"core.auth.github"}),k=M({id:"core.auth.okta"}),L=M({id:"core.auth.gitlab"}),Z=M({id:"core.auth.microsoft"}),T=M({id:"core.auth.onelogin"}),R=M({id:"core.auth.bitbucket"}),ne=M({id:"core.auth.atlassian"}),Se=M({id:"core.alert"}),Ve=M({id:"core.analytics"}),ze=M({id:"core.apptheme"}),je=M({id:"core.config"}),He=M({id:"core.discovery"}),ut=M({id:"core.error"});var $e;(function(ve){ve[ve.None=0]="None",ve[ve.Active=1]="Active"})($e||($e={}));const Pe=M({id:"core.featureflags"}),Ye=M({id:"core.fetch"}),_e=M({id:"core.identity"}),it=M({id:"core.oauthrequest"}),nt=M({id:"core.storage"});class Xe{setContext(te){this.context=te}captureEvent(te,Te,{value:Be,attributes:Ke}={}){try{this.analyticsApi.captureEvent({action:te,subject:Te,value:Be,attributes:Ke,context:this.context})}catch(Y){console.warn("Error during analytics event capture. %o",Y)}}constructor(te,Te={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=Te}}function st(){try{return re(Ve)}catch{return{captureEvent:()=>{}}}}function ht(){const ve=(0,v.useRef)(null),te=W(),Te=st();function Be(){return ve.current===null&&(ve.current=new Xe(Te)),ve.current}const Ke=Be();return Ke.setContext(te),Ke}const Oe="plugin-context",le=ve=>{const{children:te,plugin:Te}=ve,{Provider:Be}=(0,n.CT)(Oe);return(0,h.jsx)(Be,{value:(0,n.EI)({1:{plugin:Te}}),children:te})};function Ee(){const ve=(0,n.Vt)(Oe);if(!ve)throw new Error("Plugin Options context is not available");const te=ve.atVersion(1);if(!te)throw new Error("Plugin Options v1 is not available");return te.plugin.getPluginOptions()}const Ze=()=>{const ve=(0,n.Vt)("app-context");if(!ve)throw new Error("App context is not available");const te=ve.atVersion(1);if(!te)throw new Error("AppContext v1 not available");return te},pt=(0,n.uW)("component-data-store",()=>new WeakMap),yt="__backstage_data";function Et(ve,te,Te){const Be=ve;var Ke;let Y=(Ke=Be[yt])!==null&&Ke!==void 0?Ke:pt.get(ve);if(Y||(Y={map:new Map},Object.defineProperty(Be,yt,{enumerable:!1,configurable:!0,writable:!1,value:Y}),pt.set(ve,Y)),Y.map.has(te)){const C=ve.displayName||ve.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${C}"`)}Y.map.set(te,Te)}function at(ve,te){if(!ve)return;const Te=ve.type;if(!Te)return;var Be;const Ke=(Be=Te[yt])!==null&&Be!==void 0?Be:pt.get(Te);if(!!Ke)return Ke.map.get(te)}const bt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Ct=bt;class Tt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,Te){this.id=te,this.params=Te,this[Ct]="absolute"}}function qt(ve){var te;return new Tt(ve.id,(te=ve.params)!==null&&te!==void 0?te:[])}const _t=/^\w+$/;let Vt=null;class Jt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,Te,Be,Ke){this.id=te,this.path=Te,this.parent=Be,this.params=Ke,this[Vt]="sub"}}function nn(ve){const{id:te,path:Te,parent:Be}=ve,Ke=Te.split("/").filter(g=>g.startsWith(":")).map(g=>g.substring(1)),Y=[...Be.params,...Ke];if(Be.params.some(g=>Ke.includes(g)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Te.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Te}'`);if(Te.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Te}'`);for(const g of Ke)if(!_t.test(g))throw new Error(`SubRouteRef path has invalid param, got '${g}'`);return new Jt(te,Te,Be,Y)}let Qt=bt;class wn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,Te,Be){this.id=te,this.params=Te,this.optional=Be,this[Qt]="external"}}function rn(ve){var te;return new wn(ve.id,(te=ve.params)!==null&&te!==void 0?te:[],Boolean(ve.optional))}var Cn=t(10289);function on(ve){const te=(0,Cn.TH)(),Te=(0,n.Vt)("routing-context");if(!Te)throw new Error("Routing context is not available");const Be=Te.atVersion(1),Ke=(0,v.useMemo)(()=>Be&&Be.resolve(ve,te),[Be,ve,te]);if(!Te)throw new Error("useRouteRef used outside of routing context");if(!Be)throw new Error("RoutingContext v1 not available");const Y="optional"in ve&&ve.optional;if(!Ke&&!Y)throw new Error(`No path for ${ve}`);return Ke}function Mn(ve){return(0,Cn.UO)()}class Wt extends v.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:Te,plugin:Be}=this.props,{ErrorBoundaryFallback:Ke}=Te.getComponents();return te?(0,h.jsx)(Ke,{error:te,resetError:this.handleErrorReset,plugin:Be}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function jn(ve){const{component:te,mountPoint:Te,name:Be}=ve;return Ft({component:{lazy:()=>te().then(Ke=>{const Y=g=>{try{on(Te)}catch($){if(typeof $=="object"&&$!==null){const{message:ee}=$;if(typeof ee=="string"&&ee.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Te} 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 $}return(0,h.jsx)(Ke,{...g})},C=Be||Ke.displayName||Ke.name||"LazyComponent";return Y.displayName=`RoutableExtension(${C})`,Y},Ke=>C=>{const g=Ze(),{BootErrorPage:$}=g.getComponents();return(0,h.jsx)($,{step:"load-chunk",error:Ke})})},data:{"core.mountPoint":Te},name:Be})}function En(ve){const{component:te,name:Te}=ve;return Ft({component:te,name:Te})}function Ft(ve){const{data:te={},name:Te}=ve;Te||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Be;if("lazy"in ve.component){const Y=ve.component.lazy;Be=(0,v.lazy)(()=>Y().then(C=>({default:C})))}else Be=ve.component.sync;const Ke=Te||Be.displayName||Be.name||"Component";return{expose(Y){const C=g=>{const $=Ze(),{Progress:ee}=$.getComponents(),ge=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(v.Suspense,{fallback:(0,h.jsx)(ee,{}),children:(0,h.jsx)(Wt,{app:$,plugin:Y,children:(0,h.jsx)(x,{attributes:{pluginId:Y.getId(),...Te&&{extension:Te},...ge&&{routeRef:ge.id}},children:(0,h.jsx)(le,{plugin:Y,children:(0,h.jsx)(Be,{...g})})})})})};Et(C,"core.plugin",Y);for(const[g,$]of Object.entries(te))Et(C,g,$);return C.displayName=`Extension(${Ke})`,C}}}function an(ve,te,Te,Be){return v.Children.toArray(ve).flatMap(Ke=>{if(!(0,v.isValidElement)(Ke))return[];if(Ke.type===v.Fragment)return an(Ke.props.children,te,Te,Be);if(at(Ke,"core.featureFlagged")){const Y=Ke.props;return("with"in Y?te.isActive(Y.with):!te.isActive(Y.without))?an(Ke.props.children,te,Te,Be):[]}if(Te===void 0||Te(Ke))return[Ke];if(Be)throw new Error(Be);return an(Ke.props.children,te,Te,Be)})}class sn{selectByComponentData(te){const Te=an(this.node,this.featureFlagsApi,Be=>at(Be,te.key)!==void 0,te.withStrictError);return new sn(Te,this.featureFlagsApi)}findComponentData(te){return an(this.node,this.featureFlagsApi,Be=>at(Be,te.key)!==void 0).map(Be=>at(Be,te.key)).filter(Be=>Be!==void 0)}getElements(){return an(this.node,this.featureFlagsApi)}constructor(te,Te){this.node=te,this.featureFlagsApi=Te}}function ln(ve,te,Te=[]){const Be=re(Pe),Ke=new sn(ve,Be);return(0,v.useMemo)(()=>te(Ke),[ve,...Te])}class An{getId(){return this.config.id}getApis(){var te;return(te=this.config.apis)!==null&&te!==void 0?te:[]}getFeatureFlags(){var te,Te;return(Te=(te=this.config.featureFlags)===null||te===void 0?void 0:te.slice())!==null&&Te!==void 0?Te:[]}get routes(){var te;return(te=this.config.routes)!==null&&te!==void 0?te:{}}get externalRoutes(){var te;return(te=this.config.externalRoutes)!==null&&te!==void 0?te:{}}provide(te){return te.expose(this)}__experimentalReconfigure(te){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(te))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var te;return(te=this.options)!==null&&te!==void 0?te:{}}toString(){return`plugin{${this.config.id}}`}constructor(te){this.config=te,this.options=void 0}}function cn(ve){return new An(ve)}},23054:function(wt,De,t){"use strict";t.d(De,{SP:function(){return J},dR:function(){return _},VL:function(){return ue},BD:function(){return n}});function h(k){if(typeof k!="object"||k===null||Array.isArray(k))return!1;const L=k;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function n(k){if(typeof k!="object"||k===null||Array.isArray(k))throw new Error(`Encountered invalid error, not an object, got '${k}'`);const L=k;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${k}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${k}'`)}var v=t(24852);function P(k,L){const Z=serializeErrorInternal(k),T={name:"Unknown",message:"<no reason given>",...Z};return L!=null&&L.includeStack||delete T.stack,T}function W(k){const L=(0,v.deserializeError)(k);return k.stack||(L.stack=void 0),L}function x(k){if(h(k)){const L=String(k);return L!=="[object Object]"?L:`${k.name}: ${k.message}`}return`unknown error '${k}'`}class l extends Error{constructor(L,Z){var T;let R=L;if(Z!==void 0){const ne=x(Z);R?R+=`; caused by ${ne}`:R=`caused by ${ne}`}super(R),(T=Error.captureStackTrace)===null||T===void 0||T.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(Z)?Z:void 0}}class O extends null{}class re extends null{}class q extends null{}class _ extends l{}class M extends null{}class X extends null{}class J extends l{constructor(L,Z){super(L,Z),this.name=h(Z)?Z.name:"Error"}}async function he(k){try{const Z=await k.text();if(Z){var L;if(!((L=k.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const T=JSON.parse(Z);if(T.error&&T.response)return T}catch{}return{error:{name:"Error",message:`Request failed with status ${k.status} ${k.statusText}, ${Z}`},response:{statusCode:k.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${k.status} ${k.statusText}`},response:{statusCode:k.status}}}class ue extends Error{static async fromResponse(L){const Z=await he(L),T=Z.response.statusCode||L.status,R=Z.error.name||L.statusText,ne=`Request failed with ${T} ${R}`,Se=W(Z.error);return new ue({message:ne,response:L,data:Z,cause:Se})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(wt,De,t){"use strict";t.d(De,{nW:function(){return ue},ae:function(){return _},q3:function(){return M}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var v=new WeakMap;class P{async getCredentials(L){const Z=new URL(L.url),T=_class_private_field_get(this,v).find(R=>R.isUrlSupported(Z));if(!T)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(L)}constructor(L){_class_private_field_init(this,v,{writable:!0,value:void 0}),_class_private_field_set(this,v,L)}}var W=new WeakMap,x=new WeakMap,l=new WeakMap,O=new WeakMap;class re{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:L,gitlab:Z,azure:T,bitbucket:R})=>re.merge(re.forGithub(L),re.forGitlab(Z),re.forAzure(T),re.forBitbucket(R))})}static forAuthApi(L,Z){return new re("generic",L,Z.host,Z.scopeMapping)}static forGithub(L,Z){var T;const R=(T=Z==null?void 0:Z.host)!==null&&T!==void 0?T:"github.com";return new re("github",L,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,Z){var T;const R=(T=Z==null?void 0:Z.host)!==null&&T!==void 0?T:"gitlab.com";return new re("gitlab",L,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,Z){var T;const R=(T=Z==null?void 0:Z.host)!==null&&T!==void 0?T:"dev.azure.com";return new re("azure",L,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,Z){var T;const R=(T=Z==null?void 0:Z.host)!==null&&T!==void 0?T:"bitbucket.org";return new re("bitbucket",L,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new P(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,x)}getAdditionalScopesForProvider(L){var Z;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,O)==="generic")return[];var T;return(T=(Z=L.customScopes)===null||Z===void 0?void 0:Z[_class_private_field_get(this,O)])!==null&&T!==void 0?T:[]}async getCredentials(L){const{url:Z,additionalScope:T,...R}=L,ne=_class_private_field_get(this,l).default.slice();T!=null&&T.repoWrite&&ne.push(..._class_private_field_get(this,l).repoWrite);const Se=this.getAdditionalScopesForProvider(T);Se.length&&ne.push(...Se);const Ve=[...new Set(ne)],ze=await _class_private_field_get(this,W).getAccessToken(Ve,R);return{token:ze,headers:{Authorization:`Bearer ${ze}`}}}constructor(L,Z,T,R){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,x,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,O,{writable:!0,value:void 0}),_class_private_field_set(this,W,Z),_class_private_field_set(this,x,T),_class_private_field_set(this,l,R),_class_private_field_set(this,O,L)}}var q=t(39619);class _{static fromConfig(L){return q.Lx.fromConfig(L)}}const M=(0,h.T0)({id:"integration.scmintegrations"});var X=t(52322),J=t(73250),he=t(2784);const ue=k=>{const{type:L}=k,Z=(0,h.qD)(),T=J.Z;var R;const ne=L&&(R=Z.getSystemIcon(L))!==null&&R!==void 0?R:T;return(0,X.jsx)(ne,{})}},39619:function(wt,De,t){"use strict";t.d(De,{Lx:function(){return Bt},Pb:function(){return Qe}});var h=t(82717),n=t.n(h),v=t(76635);function P(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function W(w){try{return new URL(w),!0}catch{return!1}}function x(w,u){return{list(){return w},byUrl(b){try{const A=typeof b=="string"?new URL(b):b;return w.find(Q=>u(Q)===A.host)}catch{return}},byHost(b){return w.find(A=>u(A)===b)}}}function l(w){const{url:u,base:b,lineNumber:A}=w;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:xe}=n()(b);Q=new URL(b);const we=(0,v.trimEnd)(Q.pathname.substring(0,Q.pathname.length-xe.length),"/");Q.pathname=`${we}${u}`}else Q=new URL(u,b);return Q.search=new URL(b).search,A&&(Q.hash=`L${A}`),Q.toString()}const O="amazonaws.com";function re(w){const u=w.getOptionalString("endpoint");var b;const A=(b=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Q,xe;if(u){try{const un=new URL(u);Q=un.host,xe=un.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(xe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=O;const we=w.getOptionalString("accessKeyId"),ke=w.getOptionalString("secretAccessKey"),tt=w.getOptionalString("roleArn"),Pt=w.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:A,accessKeyId:we,secretAccessKey:ke,roleArn:tt,externalId:Pt}}function q(w){const u=w.map(re);return u.some(b=>b.host===O)||u.push({host:O}),u}class _{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}_.factory=({config:w})=>{var u;const b=q((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new _(A)),A=>A.config.host)};var M=t(90383),X=t(22504),J=t(69866);const he="GB";var ue=new WeakMap,k=new WeakMap,L=new WeakMap,Z=new WeakMap,T=new WeakMap,R=new WeakMap,ne=new WeakMap;class Se{static fromRepoUrl(u){const b=new URL(u);let A,Q,xe;const we=b.pathname.split("/").map(Ln=>decodeURIComponent(Ln));if(we[2]==="_git"?(A=we[1],Q=xe=we[3]):we[3]==="_git"?(A=we[1],Q=we[2],xe=we[4]):we[4]==="_git"&&(A=`${we[1]}/${we[2]}`,Q=we[3],xe=we[5]),!A||!Q||!xe)throw new Error("Azure URL must point to a git repository");var ke;const tt=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let Pt;const un=b.searchParams.get("version");if(un){if(un.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Pt=un.slice(2)}return new Se(b.origin,A,Q,xe,tt,Pt)}toRepoUrl(){let u;return(0,M.Z)(this,L)===(0,M.Z)(this,Z)?u=(0,M.Z)(this,ne).call(this,(0,M.Z)(this,k),"_git",(0,M.Z)(this,Z)):u=(0,M.Z)(this,ne).call(this,(0,M.Z)(this,k),(0,M.Z)(this,L),"_git",(0,M.Z)(this,Z)),(0,M.Z)(this,T)&&u.searchParams.set("path",(0,M.Z)(this,T)),(0,M.Z)(this,R)&&u.searchParams.set("version",he+(0,M.Z)(this,R)),u.toString()}toFileUrl(){if(!(0,M.Z)(this,T))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,M.Z)(this,ne).call(this,(0,M.Z)(this,k),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,M.Z)(this,T)),(0,M.Z)(this,R)&&u.searchParams.set("version",(0,M.Z)(this,R)),u.toString()}toArchiveUrl(){const u=(0,M.Z)(this,ne).call(this,(0,M.Z)(this,k),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,M.Z)(this,T)&&u.searchParams.set("scopePath",(0,M.Z)(this,T)),(0,M.Z)(this,R)&&u.searchParams.set("version",(0,M.Z)(this,R)),u.toString()}toCommitsUrl(){const u=(0,M.Z)(this,ne).call(this,(0,M.Z)(this,k),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"commits");return u.searchParams.set("api-version","6.0"),(0,M.Z)(this,R)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,M.Z)(this,R)),u.toString()}getOwner(){return(0,M.Z)(this,k)}getProject(){return(0,M.Z)(this,L)}getRepo(){return(0,M.Z)(this,Z)}getPath(){return(0,M.Z)(this,T)}getRef(){return(0,M.Z)(this,R)}constructor(u,b,A,Q,xe,we){(0,X.Z)(this,ue,{writable:!0,value:void 0}),(0,X.Z)(this,k,{writable:!0,value:void 0}),(0,X.Z)(this,L,{writable:!0,value:void 0}),(0,X.Z)(this,Z,{writable:!0,value:void 0}),(0,X.Z)(this,T,{writable:!0,value:void 0}),(0,X.Z)(this,R,{writable:!0,value:void 0}),(0,X.Z)(this,ne,{writable:!0,value:(...ke)=>{const tt=new URL((0,M.Z)(this,ue));return tt.pathname=ke.map(Pt=>encodeURIComponent(Pt)).join("/"),tt}}),(0,J.Z)(this,ue,u),(0,J.Z)(this,k,b),(0,J.Z)(this,L,A),(0,J.Z)(this,Z,Q),(0,J.Z)(this,T,xe),(0,J.Z)(this,R,we)}}const Ve="dev.azure.com";function ze(w){var u;const b=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Ve,A=w.getOptionalString("token");if(!P(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:A}}function je(w){const u=w.map(ze);return u.some(b=>b.host===Ve)||u.push({host:Ve}),u}class He{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A}=u;if(W(b))return b;try{const xe=Se.fromRepoUrl(A),we=new URL(A);var Q;const ke=new URL(`https://a.com${(Q=xe.getPath())!==null&&Q!==void 0?Q:""}`),tt=new URL(b,ke).pathname;return we.searchParams.set("path",tt),u.lineNumber&&(we.searchParams.set("line",String(u.lineNumber)),we.searchParams.set("lineEnd",String(u.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}He.factory=({config:w})=>{var u;const b=je((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new He(A)),A=>A.config.host)};var ut=t(48834).lW;function $e(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Pe(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function Ye(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function _e(w,u){const b=u?{...u}:{};if(w.token){const A=ut.from(`:${w.token}`,"utf8");b.Authorization=`Basic ${A.toString("base64")}`}return{headers:b}}const it="bitbucket.org",nt="https://api.bitbucket.org/2.0";function Xe(w){var u;const b=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:it;let A=w.getOptionalString("apiBaseUrl");const Q=w.getOptionalString("token"),xe=w.getOptionalString("username"),we=w.getOptionalString("appPassword");if(!P(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,v.trimEnd)(A,"/"):b===it?A=nt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:Q,username:xe,appPassword:we}}function st(w){const u=w.map(Xe);return u.some(b=>b.host===it)||u.push({host:it,apiBaseUrl:nt}),u}class ht{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(!u.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${u.lineNumber}`:A.hash=`${u.lineNumber}`,A.toString()}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}ht.factory=({config:w})=>{var u,b,A;const Q=st((A=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(b=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return x(Q.map(xe=>new ht(xe)),xe=>xe.config.host)};var Oe=t(96279),le=t(48834).lW;async function Ee(w,u){const{name:b,owner:A,resource:Q}=parseGitUrl(w),xe=Q==="bitbucket.org";let we=xe?`${u.apiBaseUrl}/repositories/${A}/${b}`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ke=await fetch(we,yt(u));if(ke.status===404&&!xe&&(we=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ke=await fetch(we,yt(u))),!ke.ok){const Pt=`Failed to retrieve default branch from ${we}, ${ke.status} ${ke.statusText}`;throw new Error(Pt)}let tt;if(xe)tt=(await ke.json()).mainbranch.name;else{const{displayId:Pt}=await ke.json();tt=Pt}if(!tt)throw new Error(`Failed to read default branch from ${we}. Response ${ke.status} ${ke.json()}`);return tt}async function Ze(w,u){const{name:b,owner:A,ref:Q,protocol:xe,resource:we,filepath:ke}=parseGitUrl(w),tt=we==="bitbucket.org";let Pt=Q;Pt||(Pt=await Ee(w,u));const un=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return tt?`${xe}://${we}/${A}/${b}/get/${Pt}.tar.gz`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${Pt}&prefix=${A}-${b}${un}`}function pt(w,u){try{const{owner:b,name:A,ref:Q,filepathtype:xe,filepath:we}=parseGitUrl(w);if(!b||!A||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=we.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${Q}/${ke}`}return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function yt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const b=le.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}const Et="bitbucket.org",at="https://api.bitbucket.org/2.0";function bt(w){const u=Et,b=at,A=w.getString("username"),Q=w.getString("appPassword");return{host:u,apiBaseUrl:b,username:A,appPassword:Q}}function Ct(w){const u=w.map(bt);return u.length===0&&u.push({host:Et,apiBaseUrl:at}),u}class Tt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=`lines-${u.lineNumber}`,A.toString()}return b}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}Tt.factory=({config:w})=>{var u;const b=Ct((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new Tt(A)),A=>A.config.host)};var qt=t(48834).lW;async function _t(w,u){const{name:b,owner:A}=parseGitUrl(w),Q=`${u.apiBaseUrl}/repositories/${A}/${b}`,xe=await fetch(Q,nn(u));if(!xe.ok){const tt=`Failed to retrieve default branch from ${Q}, ${xe.status} ${xe.statusText}`;throw new Error(tt)}const ke=(await xe.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${xe.status} ${xe.json()}`);return ke}async function Vt(w,u){const{name:b,owner:A,ref:Q,protocol:xe,resource:we}=parseGitUrl(w);let ke=Q;return ke||(ke=await _t(w,u)),`${xe}://${we}/${A}/${b}/get/${ke}.tar.gz`}function Jt(w,u){try{const{owner:b,name:A,ref:Q,filepathtype:xe,filepath:we}=parseGitUrl(w);if(!b||!A||xe!=="src"&&xe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=we.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${Q}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function nn(w){const u={};if(w.username&&w.appPassword){const b=qt.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function Qt(w){const u=w.getString("host");let b=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token"),Q=w.getOptionalString("username"),xe=w.getOptionalString("password");if(!P(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return b?b=(0,v.trimEnd)(b,"/"):b=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:b,token:A,username:Q,password:xe}}function wn(w){return w.map(Qt)}class rn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=u.lineNumber.toString(),A.toString()}return b}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}rn.factory=({config:w})=>{var u;const b=wn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new rn(A)),A=>A.config.host)};var Cn=t(48834).lW;async function on(w,u){const{name:b,owner:A}=parseGitUrl(w);let Q=`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,xe=await fetch(Q,jn(u));if(xe.status===404&&(Q=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,xe=await fetch(Q,jn(u))),!xe.ok){const tt=`Failed to retrieve default branch from ${Q}, ${xe.status} ${xe.statusText}`;throw new Error(tt)}const{displayId:we}=await xe.json(),ke=we;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${xe.status} ${xe.json()}`);return ke}async function Mn(w,u){const{name:b,owner:A,ref:Q,filepath:xe}=parseGitUrl(w);let we=Q;we||(we=await on(w,u));const ke=xe?`&path=${encodeURIComponent(decodeURIComponent(xe))}`:"";return`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${we}&prefix=${A}-${b}${ke}`}function Wt(w,u){try{const{owner:b,name:A,ref:Q,filepathtype:xe,filepath:we}=parseGitUrl(w);if(!b||!A||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=we.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function jn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const b=Cn.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function En(w){const u=w.getString("host");let b=w.getOptionalString("baseUrl"),A=w.getOptionalString("cloneUrl"),Q=w.getOptionalString("gitilesBaseUrl");const xe=w.getOptionalString("username"),we=w.getOptionalString("password");if(P(u)){if(b&&!W(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!W(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(Q&&!W(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return b?b=(0,v.trimEnd)(b,"/"):b=`https://${u}`,Q?Q=(0,v.trimEnd)(Q,"/"):Q=`https://${u}`,A?A=(0,v.trimEnd)(A,"/"):A=b,{host:u,baseUrl:b,cloneUrl:A,gitilesBaseUrl:Q,username:xe,password:we}}function Ft(w){return w.map(En)}var an=t(48834).lW;const sn=")]}'";function ln(w,u){const A=u.replace(w.gitilesBaseUrl,"").split("/").filter(Pt=>!!Pt),Q=A.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const xe=(0,v.trimStart)(A.slice(0,Q).join("/"),"/"),we=A.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${u}`);const ke=A[we+1],tt=A.slice(we+2).join("/");return{branch:ke,filePath:tt===""?"/":tt,project:xe}}function An(w,u,b,A){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${b}/${(0,v.trimStart)(A,"/")}`}function cn(w){return w.password?"/a/":"/"}function ve(w,u){const{branch:b,project:A}=ln(w,u);return`${w.baseUrl}${cn(w)}projects/${encodeURIComponent(A)}/branches/${b}`}function te(w,u){const{project:b}=ln(w,u);return`${w.cloneUrl}${cn(w)}${b}`}function Te(w,u){const{branch:b,filePath:A,project:Q}=ln(w,u);return`${w.baseUrl}${cn(w)}projects/${encodeURIComponent(Q)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function Be(w){return`${w.baseUrl}${cn(w)}projects/`}function Ke(w){const u={};if(!w.password)return u;const b=an.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${b.toString("base64")}`,{headers:u}}async function Y(w){const u=await w.text();if(u.startsWith(sn))try{return JSON.parse(u.slice(sn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class C{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A,lineNumber:Q}=u;let xe;if(b.startsWith("/")){const{branch:we,project:ke}=ln(this.config,A);return An(this.config,ke,we,b)}return b?xe=new URL(b,A):xe=new URL(A),Q&&(xe.hash=Q.toString()),xe.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}C.factory=({config:w})=>{var u;const b=Ft((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new C(A)),A=>A.config.host)};const g="github.com",$="https://api.github.com",ee="https://raw.githubusercontent.com";function ge(w){var u,b;const A=(b=w.getOptionalString("host"))!==null&&b!==void 0?b:g;let Q=w.getOptionalString("apiBaseUrl"),xe=w.getOptionalString("rawBaseUrl");const we=w.getOptionalString("token"),ke=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(tt=>({appId:tt.getNumber("appId"),clientId:tt.getString("clientId"),clientSecret:tt.getString("clientSecret"),webhookSecret:tt.getString("webhookSecret"),privateKey:tt.getString("privateKey"),allowedInstallationOwners:tt.getOptionalStringArray("allowedInstallationOwners")}));if(!P(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return Q?Q=(0,v.trimEnd)(Q,"/"):A===g&&(Q=$),xe?xe=(0,v.trimEnd)(xe,"/"):A===g&&(xe=ee),{host:A,apiBaseUrl:Q,rawBaseUrl:xe,token:we,apps:ke}}function fe(w){const u=w.map(ge);return u.some(b=>b.host===g)||u.push({host:g,apiBaseUrl:$,rawBaseUrl:ee}),u}function Fe(w,u,b){try{const{owner:A,name:Q,ref:xe,filepathtype:we,filepath:ke}=parseGitUrl(w);if(!A||!Q||!xe||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const tt=ke.replace(/^\//,"");return qe(u,b)==="api"?`${u.apiBaseUrl}/repos/${A}/${Q}/contents/${tt}?ref=${xe}`:`${u.rawBaseUrl}/${A}/${Q}/${xe}/${tt}`}catch(A){throw new Error(`Incorrect URL: ${w}, ${A}`)}}function Je(w,u){const b={};return qe(w,u)==="api"&&(b.Accept="application/vnd.github.v3.raw"),u.token&&(b.Authorization=`token ${u.token}`),{headers:b}}function qe(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var ot=t(42822),lt=t(89393),ct=t(26228);class Rt{async getOrCreateToken(u,b,A){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await A(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,b))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${b}`);return{accessToken:Q.token}}appliesToRepo(u,b){return b===void 0?!0:u.repositories!==void 0?u.repositories.includes(b):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>ct.ou.local()>u}}const j={Accept:"application/vnd.github.machine-man-preview+json"};class F{async getInstallationCredentials(u,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,b,async()=>{const{installationId:Q,suspended:xe}=await this.getInstallationData(u);if(xe)throw new Error(`The GitHub application for ${u} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:j});let ke;if(we.data.repository_selection==="selected"){const Pt=new lt.v({baseUrl:this.baseUrl,auth:we.data.token}),un=await Pt.paginate(Pt.apps.listReposAccessibleToInstallation);var tt;ke=((tt=un.repositories)!==null&&tt!==void 0?tt:un).map(Ir=>Ir.name)}return{token:we.data.token,expiresAt:ct.ou.fromISO(we.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const A=(await this.getInstallations()).find(xe=>{var we,ke;return((we=xe.account)===null||we===void 0||(ke=we.login)===null||ke===void 0?void 0:ke.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,b){this.cache=new Rt,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
31
|
-
`)},this.appClient=new lt.v({baseUrl:b,headers:j,authStrategy:ot.i,auth:this.baseAuthConfig})}}class oe{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(u,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(u,b).then(tt=>({credentials:tt,error:void 0}),tt=>({credentials:void 0,error:tt})))),Q=A.find(ke=>ke.credentials);if(Q)return Q.credentials.accessToken;const we=A.map(ke=>ke.error).find(ke=>ke.name!=="NotFoundError");if(we)throw we}constructor(u){var b,A;this.apps=(A=(b=u.apps)===null||b===void 0?void 0:b.map(Q=>new F(Q,u.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class ce{async getCredentials(u){const b=n()(u.url),A=b.owner||b.name,Q=b.owner?b.name:void 0;let xe="app",we=await this.githubAppCredentialsMux.getAppToken(A,Q);return we||(xe="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:xe}}constructor(u,b){this.githubAppCredentialsMux=u,this.token=b}}ce.create=w=>new ce(new oe(w),w.token);class be{static fromIntegrations(u){const b=new Map;return u.github.list().forEach(A=>{const Q=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,Q)}),new be(b)}async getCredentials(u){const b=new URL(u.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return A.getCredentials(u)}constructor(u){this.providers=u}}class Ie{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return Qe(l(u),"tree")}resolveEditUrl(u){return Qe(u,"edit")}constructor(u){this.integrationConfig=u}}Ie.factory=({config:w})=>{var u;const b=fe((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new Ie(A)),A=>A.config.host)};function Qe(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,Q,xe)=>`//${A}/${Q}/${xe}/${u}/`)}const ft="gitlab.com",et="https://gitlab.com/api/v4";function mt(w){const u=w.getString("host");let b=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token");let Q=w.getOptionalString("baseUrl");if(b?b=(0,v.trimEnd)(b,"/"):u===ft&&(b=et),Q?Q=(0,v.trimEnd)(Q,"/"):Q=`https://${u}`,P(u)){if(!b||!W(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!W(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:A,apiBaseUrl:b,baseUrl:Q}}function gt(w){const u=w.map(mt);return u.some(b=>b.host===ft)||u.push({host:ft,apiBaseUrl:et,baseUrl:`https://${ft}`}),u}function At(w){let u="";return w.host!==ft&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function Ut(w,u){const b=await $n(w,u);return dn(w,b,u).toString()}function Wn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function dn(w,u,b){try{const A=new URL(w),Q=A.pathname.split("/blob/").slice(1).join("/blob/"),[xe,...we]=Q.split("/"),ke=getGitLabIntegrationRelativePath(b);return A.pathname=[...ke?[ke]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),A.search=`?ref=${xe}`,A}catch(A){throw new Error(`Incorrect url: ${w}, ${A}`)}}async function $n(w,u){const b=new URL(w);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(u);Q&&(A=A.replace(Q,""));const xe=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),we=await fetch(xe.toString(),Wn(u)),ke=await we.json();if(!we.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${w}, ${A}`)}}class Bn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return tr(u,"edit")}constructor(u){this.integrationConfig=u}}Bn.factory=({config:w})=>{var u;const b=gt((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return x(b.map(A=>new Bn(A)),A=>A.config.host)};function tr(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class Bt{static fromConfig(u){return new Bt({awsS3:_.factory({config:u}),azure:He.factory({config:u}),bitbucket:ht.factory({config:u}),bitbucketCloud:Tt.factory({config:u}),bitbucketServer:rn.factory({config:u}),gerrit:C.factory({config:u}),github:Ie.factory({config:u}),gitlab:Bn.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let b=Object.values(this.byType).map(A=>A.byUrl(u)).filter(Boolean);if(b.length>1){const A=b.filter(Q=>!(Q instanceof ht));A.length!==0&&(b=A)}return b[0]}byHost(u){return Object.values(this.byType).map(b=>b.byHost(u)).find(Boolean)}resolveUrl(u){const b=this.byUrl(u.base);return b?b.resolveUrl(u):l(u)}resolveEditUrl(u){const b=this.byUrl(u);return b?b.resolveEditUrl(u):u}constructor(u){this.byType=u}}},96215:function(wt,De,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return R.s4}});var n=t(52322),v=t(2784),P=t(28316),W=t(10289),x=t(25248);const l=(0,x.T0)({id:"plugin.techdocs.storageservice"}),O=(0,x.T0)({id:"plugin.techdocs.service"});var re=t(92077),q=t(95481),_=t(7476),M=t(93225),X=t(67896),J=t(65124),he=t(17339),ue=t(85478),k=t(68435),L=t(3482),Z=t(42081),T=t(48431),R=t(89258),ne=t(52943),Se=t(61886),Ve=t(13980),ze=t.n(Ve);class je{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var He=t(51837);const ut=(0,He.CT)("api-context"),$e=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,v.useContext)(ut))===null||r===void 0?void 0:r.atVersion(1),B=f?new je(o,f):o;return(0,n.jsx)(ut.Provider,{value:(0,He.EI)({1:B}),children:c})};$e.propTypes={apis:ze().shape({get:ze().func.isRequired}).isRequired,children:ze().node};class Pe{static validateFactories(r,o){for(const c of o){const f=[c],B=new Set;for(;f.length;){const z=f.shift(),H=r.get(z);if(!!H)for(const se of Object.values(H.deps)){if(se.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);B.has(se)||(B.add(se),f.push(se))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const B=this.loadDeps(r,f.deps,[...o,f.api]),z=f.factory(B);return this.apis.set(r.id,z),z}loadDeps(r,o,c){const f={};for(const B in o)if(o.hasOwnProperty(B)){const z=o[B],H=this.load(z,c);if(!H)throw new Error(`No API factory available for dependency ${z} of dependent ${r}`);f[B]=H}return f}constructor(r){this.factories=r,this.apis=new Map}}var Ye;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(Ye||(Ye={}));class _e{register(r,o){const c=Ye[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function it(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,B=window.screen.width/2-c/2,z=window.screen.height/2-f/2,H=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${z},left=${B}`);let se="";if(!H||typeof H.closed=="undefined"||H.closed){const rt=new Error("Failed to open auth popup.");rt.name="PopupRejectedError",o(rt);return}const Ue=rt=>{if(rt.source!==H||rt.origin!==a.origin)return;const{data:kt}=rt;if(kt.type==="config_info"){se=kt.targetOrigin;return}if(kt.type!=="authorization_response")return;const Ot=kt;if("error"in Ot){const Gt=new Error(Ot.error.message);Gt.name=Ot.error.name,o(Gt)}else r(Ot.response);xt()},Ne=setInterval(()=>{if(H.closed){const rt=`Login failed, ${se&&se!==window.location.origin?`Incorrect app origin, expected ${se}`:"popup was closed"}`,kt=new Error(rt);kt.name="PopupClosedError",o(kt),xt()}},100);function xt(){window.removeEventListener("message",Ue),clearInterval(Ne)}window.addEventListener("message",Ue)})}function nt(a){return[...a].join(" ")}class Xe{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await it({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:B=nt,oauthRequestApi:z,sessionTransform:H=se=>se}=r;this.authRequester=z.createAuthRequester({provider:f,onAuthRequest:se=>this.showPopup(se)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=B,this.sessionTransform=H}}function st(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class ht{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return st(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const B of f)c.add(B)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Oe=t(82394),le=t.n(Oe);let Ee=Symbol.observable;class Ze{[Ee](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(le())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let pt=Symbol.observable;class yt{[pt](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(le())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Et{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?x.sM.SignedIn:x.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new yt(x.sM.SignedOut),this.signedIn=!1}}class at{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),B=this.sessionScopesFunc(c);return st(B,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Et;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:B}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=B,this.helper=new ht({sessionScopes:f,defaultScopes:c})}}class bt{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const Ct={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Tt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ct,oauthRequestApi:B,defaultScopes:z=[],scopeTransform:H=Ne=>Ne}=r,se=new Xe({discoveryApi:o,environment:c,provider:f,oauthRequestApi:B,sessionTransform(Ne){return{...Ne,providerInfo:{idToken:Ne.providerInfo.idToken,accessToken:Ne.providerInfo.accessToken,scopes:Tt.normalizeScopes(H,Ne.providerInfo.scope),expiresAt:new Date(Date.now()+Ne.providerInfo.expiresInSeconds*1e3)}}}}),Ue=new at({connector:se,defaultScopes:new Set(z),sessionScopes:Ne=>Ne.providerInfo.scopes,sessionShouldRefresh:Ne=>(Ne.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Tt({sessionManager:Ue,scopeTransform:H})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=Tt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var B;return(B=f==null?void 0:f.providerInfo.accessToken)!==null&&B!==void 0?B:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const qt={id:"github",title:"GitHub",icon:()=>null};class _t{static create(r){const{discoveryApi:o,environment:c="development",provider:f=qt,oauthRequestApi:B,defaultScopes:z=["read:user"]}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c,defaultScopes:z})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Jt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Vt,oauthRequestApi:B,defaultScopes:z=["read_user"]}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c,defaultScopes:z})}}const nn={id:"google",title:"Google",icon:()=>null},Qt="https://www.googleapis.com/auth/";class wn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:B=nn,defaultScopes:z=["openid",`${Qt}userinfo.email`,`${Qt}userinfo.profile`]}=r;return Tt.create({discoveryApi:o,oauthRequestApi:c,provider:B,environment:f,defaultScopes:z,scopeTransform(H){return H.map(se=>se==="openid"?se:se==="profile"||se==="email"?`${Qt}userinfo.${se}`:se.startsWith(Qt)?se:`${Qt}${se}`)}})}}const rn={id:"okta",title:"Okta",icon:()=>null},Cn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),on="okta.";class Mn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=rn,oauthRequestApi:B,defaultScopes:z=["openid","email","profile","offline_access"]}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c,defaultScopes:z,scopeTransform(H){return H.map(se=>Cn.has(se)||se.startsWith(on)?se:`${on}${se}`)}})}}var Wt=t(30195);const jn=Wt.z.object({profile:Wt.z.object({email:Wt.z.string().optional(),displayName:Wt.z.string().optional(),picture:Wt.z.string().optional()}),backstageIdentity:Wt.z.object({token:Wt.z.string(),identity:Wt.z.object({type:Wt.z.literal("user"),userEntityRef:Wt.z.string(),ownershipEntityRefs:Wt.z.array(Wt.z.string())})})}),En={id:"saml",title:"SAML",icon:()=>null};class Ft{static create(r){const{discoveryApi:o,environment:c="development",provider:f=En}=r,B=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),z=new StaticAuthSessionManager({connector:B}),H=new AuthSessionStore({manager:z,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Ft(H)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const an={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(r){const{environment:o="development",provider:c=an,oauthRequestApi:f,discoveryApi:B,defaultScopes:z=["openid","offline_access","profile","email","User.Read"]}=r;return Tt.create({discoveryApi:B,oauthRequestApi:f,provider:c,environment:o,defaultScopes:z})}}const ln={id:"onelogin",title:"onelogin",icon:()=>null},An=new Set(["openid","profile","email","phone","address","groups","offline_access"]),cn="onelogin.";class ve{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:B}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(z){return z.map(H=>An.has(H)||H.startsWith(cn)?H:`${cn}${H}`)}})}}const te={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Te{static create(r){const{discoveryApi:o,environment:c="development",provider:f=te,oauthRequestApi:B,defaultScopes:z=["team"]}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c,defaultScopes:z})}}const Be={id:"atlassian",title:"Atlassian",icon:()=>null};class Ke{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Be,oauthRequestApi:B}=r;return Tt.create({discoveryApi:o,oauthRequestApi:B,provider:f,environment:c})}}class Y{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Ze}}class C{captureEvent(r){}}const g="theme";class ${static createWithStorage(r){const o=new $(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(g))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(B=>{B?window.localStorage.setItem(g,B):window.localStorage.removeItem(g)}),window.addEventListener("storage",B=>{if(B.key===g){var z;const H=(z=localStorage.getItem(g))!==null&&z!==void 0?z:void 0;o.setActiveThemeId(H)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new yt(void 0)}}var ee=t(9850),ge=t.n(ee),fe=t(12782),Fe=t.n(fe);const Je=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function qe(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function ot(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const lt={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class ct{static fromConfigs(r){return r.length===0?new ct(void 0):r.reduce((o,{data:c,context:f,filteredKeys:B,deprecatedKeys:z})=>{const H=new ct(c,f,o);if(H.filteredKeys=B,z)for(const{key:se,description:Ue}of z)console.warn(`The configuration key '${se}' of ${f} is deprecated and may be removed soon. ${Ue||""}`);return H},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=ge()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var B;return f}else if(f===void 0)return c;return Fe()({},{value:f},{value:c},(z,H)=>!qe(H)||!qe(z)?H:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(qe(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(lt.type(this.fullKey(r),this.context,ot(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[B,z]of f.entries())if(!qe(z))return{expected:"object-array",value:z,key:`${r}[${B}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,B)=>this.copy(f,`${r}[${B}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(lt.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(lt.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new ct(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var B;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const z=o(c);if(z!==!0){const{key:H=r,value:se=c,expected:Ue}=z;throw new TypeError(lt.type(this.fullKey(H),this.context,ot(se),Ue))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!Je.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,B]of o.entries())if(qe(c))c=c[B];else if(c!==void 0){const z=this.fullKey(o.slice(0,f).join("."));throw new TypeError(lt.type(z,this.context,ot(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const Rt="Invalid discovery URL pattern,";class j{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${Rt} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${Rt} URL must not have a hash`);if(f.search)throw new Error(`${Rt} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${Rt} URL must not end with a slash`);return new j(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class F{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class oe{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Ze}}class ce{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function be(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ie{registerFlag(r){be(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===x.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===x.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,B])=>(be(f),B===x.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Qe(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class ft{static create(r){var o,c;const f=et(r),B=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",z=((c=r.header)===null||c===void 0?void 0:c.value)||(H=>`Bearer ${H}`);return new ft(r.identityApi,f,B,z)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:B}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof B!="string"||!B||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(B)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function et(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?mt(a.urlPrefixAllowlist):a.config?mt([a.config.getString("backend.baseUrl")]):()=>!1}function mt(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function gt(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class At{apply(r){return async(o,c)=>{const f=new Request(o,c),B="plugin://";if(!f.url.startsWith(B))return r(o,c);const{hostname:z,pathname:H,search:se,hash:Ue,username:Ne,password:xt}=new URL(`http://${f.url.substring(B.length)}`);let rt=await this.discoveryApi.getBaseUrl(z);if(Ne||xt){const Ot=new URL(rt),Gt=`${Ne}${xt?`:${xt}`:""}@`;rt=`${Ot.protocol}//${Gt}${Ot.host}${Ot.pathname}`}const kt=`${gt(rt,H)}${se}${Ue}`;return r(kt,typeof o=="string"||Ut(o)?c:o)}}constructor(r){this.discoveryApi=r}}function Ut(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Wn{static resolvePluginProtocol(r){return new At(r.discoveryApi)}static injectIdentityAuth(r){return ft.create(r)}constructor(){}}function dn(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function $n(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class Bn{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>dn(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>$n(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new yt(this.getCurrentPending())}}class tr{createAuthRequester(r){const o=new Bn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const B=this.currentRequests.slice(),z=this.makeAuthRequest(f,r);z?B[c]=z:delete B[c],this.currentRequests=B,this.subject.next(B.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new yt([]),this.currentRequests=[],this.handlerCount=0}}const Bt=new Map;class w{static create(r){var o;return new w((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(B,z)=>(typeof z=="object"&&z!==null&&Object.freeze(z),z)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Bt.has(o)||Bt.set(o,new w(o,this.errorApi)),Bt.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(le())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var u=t(64279);function b(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:v.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:B}=o.shift();v.Children.forEach(c,z=>{if(!(0,v.isValidElement)(z))return;const H={};for(const se in r)if(r.hasOwnProperty(se)){const Ue=r[se];H[se]=Ue.visit(Ue.accumulator,z,f,B[se])}for(const se of a.discoverers){const Ue=se(z);Ue&&o.push({node:Ue,parent:z,contexts:H})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function A(a,r){return()=>({accumulator:a(),visit:r})}function Q(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function xe(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const we=A(()=>new Set,(a,r)=>{const o=(0,x.IY)(r,"core.plugin");o&&a.add(o)}),ke=a=>{const{children:r}=a,o=(0,x.h_)(x.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,x.R5)(ke,"core.featureFlagged",!0);const tt={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Pt(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function un(a,r=new Array){return v.Children.forEach(a,o=>{if(!(0,v.isValidElement)(o))return;const c=(0,x.IY)(o,"core.mountPoint");if(c){const f=(0,x.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}un(o.props.children,r)}),r}const Ln=A(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,B;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const z=(f=r.props)===null||f===void 0?void 0:f.path,H=(0,x.IY)(r,"core.mountPoint");if(H&&z)throw new Error(`Path property may not be set directly on a routable extension "${Pt(r)}"`);var se;const Ue=(se=c==null||(B=c.obj)===null||B===void 0?void 0:B.children)!==null&&se!==void 0?se:a.objects;if(z!==void 0){if(typeof z!="string")throw new Error(`Element path must be a string at "${Pt(r)}"`);const kt=z.startsWith("/")?z.slice(1):z,Ot=r.props.element;if((0,x.IY)(r,"core.gatherMountPoints")){var Ne;if(Ot)throw new Error(`Mount point gatherers may not have an element prop "${Pt(r)}"`);const Gt={path:kt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ne=r.props)===null||Ne===void 0?void 0:Ne.caseSensitive),children:[tt],plugin:void 0};return Ue.push(Gt),{obj:Gt,gatherPath:kt,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Ot){var xt;const[Gt,...xn]=un(Ot);if(xn.length>0)throw new Error(`Route element with path "${z}" may not contain multiple routable extensions`);if(!Gt)return c;const{routeRef:Un,plugin:kn}=Gt,Qn={path:kt,element:"mounted",routeRefs:new Set([Un]),caseSensitive:Boolean((xt=r.props)===null||xt===void 0?void 0:xt.caseSensitive),children:[tt],plugin:kn};return Ue.push(Qn),a.paths.set(Un,kt),a.parents.set(Un,c==null?void 0:c.routeRef),{obj:Qn,routeRef:Un!=null?Un:c==null?void 0:c.routeRef,gatherPath:kt,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(H){var rt;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${Pt(r)}" with mount point "${H}" must be assigned a path`);return c==null||(rt=c.obj)===null||rt===void 0||rt.routeRefs.add(H),a.paths.set(H,c.gatherPath),a.parents.set(H,c==null?void 0:c.gatherRouteRef),{...c,routeRef:H}}return c}),Ir=A(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,B,z;if((o==null?void 0:o.props.element)===r)return c;let H=c==null?void 0:c.obj,se=c==null?void 0:c.routeRef,Ue=c==null?void 0:c.sticky;const Ne=(f=r.props)===null||f===void 0?void 0:f.path;var xt;const rt=(xt=H==null?void 0:H.children)!==null&&xt!==void 0?xt:a.objects,kt=Boolean((B=r.props)===null||B===void 0?void 0:B.caseSensitive);let Ot=c==null?void 0:c.path;if((0,x.IY)(r,"core.gatherMountPoints")){if(!Ne)throw new Error("Mount point gatherer must have a path");Ot=Ne}const Gt=(z=r.props)===null||z===void 0?void 0:z.element;let xn=(0,x.IY)(r,"core.mountPoint");if(!xn&&(0,v.isValidElement)(Gt)&&(xn=(0,x.IY)(Gt,"core.mountPoint")),xn){let Qn=Ne;if(Ot&&(Qn?Ot=void 0:Qn=Ot),!Qn)throw new Error("Mounted routable extension must have a path");a.paths.set(xn,Qn),se&&Ue?(a.parents.set(xn,se),Ne&&(se=xn,Ue=!1)):(a.parents.set(xn,se),se=xn),Ne?(H={caseSensitive:kt,path:Ne,element:"mounted",routeRefs:new Set([xn]),children:[tt],plugin:(0,x.IY)(r.props.element,"core.plugin")},rt.push(H)):H==null||H.routeRefs.add(xn)}if((0,x.IY)(r,"core.gatherMountPoints")&&(Ue=!0),(0,x.IY)(r,"core.gatherMountPoints")){if(!Ne)throw new Error("Mount point gatherer must have a path");if(!xn){var kn;H={caseSensitive:kt,path:Ne,element:"gathered",routeRefs:new Set,children:[tt],plugin:c==null||(kn=c.obj)===null||kn===void 0?void 0:kn.plugin},rt.push(H)}}return{obj:H,path:Ot,routeRef:se,sticky:Ue}}),Xt=A(()=>new Set,(a,r)=>{if(r.type===ke){const o=r.props;a.add("with"in o?o.with:o.without)}}),vr=(0,He.uW)("route-ref-type",()=>Symbol("route-ref-type"));function yr(a){return a[vr]==="absolute"}function Ur(a){return a[vr]==="sub"}function Mr(a){return a[vr]==="external"}function xr(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function ts(a,r,o){let c,f="";if(yr(a))c=a;else if(Ur(a))c=a.parent,f=a.path;else if(Mr(a)){const H=o.get(a);if(!H)return[void 0,""];if(yr(H))c=H;else if(Ur(H))c=H.parent,f=H.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${H}`)}else throw a[vr]?new Error(`Unknown or invalid route ref type, ${a[vr]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const B=r.get(c);if(B===void 0)return[void 0,""];const z=xr(B,f);return[c,z]}function br(a,r,o,c,f){var B;const z=(B=(0,W.fp)(f,r))!==null&&B!==void 0?B:[],H=Array();let se=-1;for(let xt=a;xt&&(se=z.findIndex(rt=>rt.route.routeRefs.has(xt)),se===-1);xt=c.get(xt))H.unshift(xt);H.length===0&&(se-=1);const Ue=se===-1?"":z[se].pathname,Ne=H.slice(0,-1).map(xt=>{const rt=o.get(xt);if(rt===void 0)throw new Error(`No path for ${xt}`);if(rt.includes(":"))throw new Error(`Cannot route to ${a} with parent ${xt} as it has parameters`);return rt});return`${xr(Ue,...Ne)}/`}class ns{resolve(r,o){const[c,f]=ts(r,this.routePaths,this.routeBindings);if(!c)return;let B;typeof o=="string"?B=this.trimPath(o):o.pathname?B={...o,pathname:this.trimPath(o.pathname)}:B=o;const z=this.appBasePath+br(c,B,this.routePaths,this.routeParents,this.routeObjects);return(...[se])=>xr(z,(0,W.Gn)(f,se))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,B){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=B}}const Rr=(0,He.CT)("routing-context"),rs=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:B})=>{const z=new ns(a,r,o,c,f),H=(0,He.EI)({1:z});return(0,n.jsx)(Rr.Provider,{value:H,children:B})},ss=(a,r)=>{try{var o,c;const f=(0,W.fp)(r,{pathname:a}),B=(o=f==null?void 0:f.filter(H=>{var se;return((se=H==null?void 0:H.route.routeRefs)===null||se===void 0?void 0:se.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!B)return{};let z;return B.routeRefs.size===1&&(z=B.routeRefs.values().next().value),{extension:"App",pluginId:((c=B.plugin)===null||c===void 0?void 0:c.getId())||"root",...z?{routeRef:z.id}:{}}}catch{return{}}},Hn=({pathname:a,search:r,hash:o})=>{const c=(0,x.z$)();return(0,v.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Zn=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,W.TH)();return(0,n.jsx)(x.fC,{attributes:ss(r,a),children:(0,n.jsx)(Hn,{pathname:r,search:o,hash:c})})};function lr(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,B="";for(;f;){const H=a.get(f);if(H===void 0)throw new Error(`No path for ${f}`);B=xr(H,B),f=r.get(f)}const z=B.match(/:(\w+)/g);if(z){for(let H=0;H<z.length;H++)for(let se=H+1;se<z.length;se++)if(z[se]===z[H])throw new Error(`Parameter ${z[se]} is duplicated in path ${B}`)}}}function Lr(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const zr=(0,He.CT)("app-context"),os=({appContext:a,children:r})=>{const o=(0,He.EI)({1:a});return(0,n.jsx)(zr.Provider,{value:o,children:r})};function Sr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function wr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class nr{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw Sr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return wr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Sr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return wr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return wr("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var Pr=t(72164);function zn(a,r,o){if(a!==void 0){const f=o.find(B=>B.id===a);if(f)return f}if(r){const f=o.find(B=>B.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Cr=()=>{const a=(0,v.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,v.useState)(a.matches);return(0,v.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function cr({children:a}){const r=(0,x.h_)(x.hg),o=(0,Pr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Cr():!1,f=zn(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const is=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Vr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Gn(new Map(this.apis))}constructor(){this.apis=[]}}class Gn{static builder(){return new Vr}static from(r){return new Gn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Gn(new Map([[r.id,o]]))}with(r,o){return new Gn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Os(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[B,z]of Object.entries(f)){const H=c[B];if(!H)throw new Error(`Key ${B} is not an existing external route`);if(!z&&!H.optional)throw new Error(`External route ${B} is required but was undefined`);z&&r.set(H,z)}}}),r}function Wr(){const[a]=(0,W.is)((0,n.jsx)(W.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const jr=(0,v.createContext)({routeObjects:[]});function kr(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function as(a,r,o){const c=Boolean(a),f=(0,u.default)(a||(()=>Promise.resolve([])));let B;if(c&&f.loading){const{Progress:Ue}=r;B=(0,n.jsx)(Ue,{})}else if(f.error){const{BootErrorPage:Ue}=r;B=(0,n.jsx)(Ue,{step:"load-config",error:f.error})}const{ThemeProvider:z=cr}=r;if(B)return{node:(0,n.jsx)($e,{apis:Gn.with(x.hg,o),children:(0,n.jsx)(z,{children:B})})};var H;return{api:ct.fromConfigs((H=f.value)!==null&&H!==void 0?H:[])}}class Hr{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class ls{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new Hr(this);let o=!1;return({children:f})=>{const B=(0,v.useMemo)(()=>$.createWithStorage(this.themes),[]),{routing:z,featureFlags:H,routeBindings:se}=(0,v.useMemo)(()=>{const rt=b({root:f,discoverers:[Q,xe],collectors:{routing:Wr()?Ir:Ln,collectedPlugins:we,featureFlags:Xt}});return rt.collectedPlugins.forEach(kt=>this.plugins.add(kt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...rt,routeBindings:Os(this.bindRoutes)}},[f]);o||(o=!0,lr(z.paths,z.parents),Lr(se,this.plugins));const Ue=as(this.configLoader,this.components,B),Ne="api"in Ue;if(Ne){const{api:rt}=Ue;this.configApi=rt}if((0,v.useEffect)(()=>{if(Ne){const rt=this.getApiHolder().get(x.W0);for(const kt of this.plugins.values())if("getFeatureFlags"in kt)for(const Ot of kt.getFeatureFlags())rt.registerFlag({name:Ot.name,pluginId:kt.getId()});else for(const Ot of kt.output())Ot.type==="feature-flag"&&rt.registerFlag({name:Ot.name,pluginId:kt.getId()});for(const kt of H)rt.registerFlag({name:kt,pluginId:""})}},[Ne,Ue,H]),"node"in Ue)return Ue.node;const{ThemeProvider:xt=cr}=this.components;return(0,n.jsx)($e,{apis:this.getApiHolder(),children:(0,n.jsx)(os,{appContext:r,children:(0,n.jsx)(xt,{children:(0,n.jsx)(rs,{routePaths:z.paths,routeParents:z.parents,routeObjects:z.objects,routeBindings:se,basePath:kr(Ue.api),children:(0,n.jsx)(jr.Provider,{value:{routeObjects:z.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:B,children:z})=>{const[H,se]=(0,v.useState)(),Ue=(0,x.h_)(x.Ds),Ne=kr(Ue);return H?(this.appIdentityProxy.setTarget(H,{signOutTargetUrl:Ne||"/"}),z):(0,n.jsx)(B,{onSignInSuccess:se})};return({children:B})=>{const z=(0,x.h_)(x.Ds),H=kr(z),se=`${H}/*`,{routeObjects:Ue}=(0,v.useContext)(jr);return o?(0,n.jsxs)(r,{children:[(0,n.jsx)(Zn,{routeObjects:Ue}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:se,element:(0,n.jsx)(n.Fragment,{children:B})})})})]}):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:H||"/"}),(0,n.jsxs)(r,{children:[(0,n.jsx)(Zn,{routeObjects:Ue}),(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:se,element:(0,n.jsx)(n.Fragment,{children:B})})})]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Pe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:x.hg,deps:{},factory:()=>$.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:x.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:x.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:x.W0,deps:{},factory:()=>new Ie});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Pe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Pe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new nr;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:is;var B;this.defaultApis=(B=r.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new _e}}function cs(a){return new ls(a)}let Gr=!1;const Kr=a=>{const r=(0,x.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,v.useMemo)(()=>Wr(),[]),B=[...(0,x.vJ)(a.children,z=>z.getElements().flatMap(H=>{let se=H.props.path;if(se==="")return[];var Ue;se=(Ue=se==null?void 0:se.replace(/\/\*$/,""))!==null&&Ue!==void 0?Ue:"/";let Ne=c?H:H.props.element;return!c&&!Ne&&(Ne=H,Gr||(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] />} />."),Gr=!0)),[{path:se,element:Ne,children:H.props.children?[{path:se==="/"?"/":"*",element:H.props.children}]:void 0}]}).sort((H,se)=>se.path.localeCompare(H.path)).map(H=>({...H,path:H.path==="/"?"/":`${H.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,W.V$)(B)};var Yr=t(25488);const Jr=[(0,x.ni)({api:x.NW,deps:{configApi:x.Ds},factory:({configApi:a})=>j.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,x.ni)({api:x.$v,deps:{},factory:()=>new Y}),(0,x.ni)({api:x.v_,deps:{},factory:()=>new C}),(0,x.ni)({api:x.VE,deps:{alertApi:x.$v},factory:({alertApi:a})=>{const r=new F(a,new oe);return ce.forward(r,{hidden:!1}),r}}),(0,x.ni)({api:x.E6,deps:{errorApi:x.VE},factory:({errorApi:a})=>w.create({errorApi:a})}),(0,x.ni)({api:x.gP,deps:{configApi:x.Ds,identityApi:x.$4,discoveryApi:x.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Qe({middleware:[Wn.resolvePluginProtocol({discoveryApi:o}),Wn.injectIdentityAuth({identityApi:r,config:a})]})}),(0,x.ni)({api:x.ZM,deps:{},factory:()=>new tr}),(0,x.ni)({api:x.Kp,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>wn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.p_,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>sn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.F4,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>_t.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.D,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Mn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.ux,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Jt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.gW,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ve.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.bq,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Te.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.uB,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ke.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:Yr.RV,deps:{discovery:x.NW,identity:x.$4,config:x.Ds},factory:({config:a,discovery:r,identity:o})=>Yr.iM.create({config:a,discovery:r,identity:o})})];var pn=t(77277),Lt=t(71399),rr=t(62833);function dr({children:a}){return(0,W.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(W.VA,{children:a})}const ds=()=>(0,n.jsx)(Lt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),us=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(dr,{children:(0,n.jsx)(Lt.mf,{status:"501",statusMessage:o})})},hs=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Lt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(pn.Z,{variant:"outlined",onClick:r,children:"Retry"})}),Qr={Progress:Lt.Ex,Router:rr.VK,NotFoundErrorPage:ds,BootErrorPage:us,ErrorBoundaryFallback:hs};var ps=t(43642),Xr=t(80079),Er=t(90941),$s=t(32915),fs=t(40562),qr=t(21853),gs=t(60744),Bs=t(66569),ms=t(30254),Zs=t(13384),Ds=t(15933),vs=t(58838),ys=t(86737),Ns=t(4989),y=t(44407),S=t(18628),I=t(84219),N=t(98685),K=t(39781);const G={brokenImage:Xr.Z,catalog:S.Z,scaffolder:$s.Z,techdocs:fs.Z,search:qr.Z,chat:gs.Z,dashboard:Bs.Z,docs:ms.Z,email:Zs.Z,github:vs.Z,group:I.Z,help:ys.Z,"kind:api":Ds.Z,"kind:component":y.Z,"kind:domain":ps.Z,"kind:group":I.Z,"kind:location":Ns.Z,"kind:system":Er.Z,"kind:user":N.Z,user:N.Z,warning:K.Z};var de=t(73689),ae=t(48032);const pe={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")`},Ce={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 Re(a){const{colors:r,shape:o,options:c}=a,B=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,z=`${o}, ${B}`;var H;const se=(H=c==null?void 0:c.fontColor)!==null&&H!==void 0?H:"#FFFFFF";return{colors:r,shape:o,backgroundImage:z,fontColor:se}}const Le={home:Re({colors:Ce.teal,shape:pe.wave}),documentation:Re({colors:Ce.pinkSea,shape:pe.wave2}),tool:Re({colors:Ce.purpleSky,shape:pe.round}),service:Re({colors:Ce.marineBlue,shape:pe.wave}),website:Re({colors:Ce.veryBlue,shape:pe.wave}),library:Re({colors:Ce.rubyRed,shape:pe.wave}),other:Re({colors:Ce.darkGrey,shape:pe.wave}),app:Re({colors:Ce.toastyOrange,shape:pe.wave}),apis:Re({colors:Ce.teal,shape:pe.wave2}),card:Re({colors:Ce.greens,shape:pe.wave})},Ge=16,vt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function St(a){const{palette:r,htmlFontSize:o=Ge,fontFamily:c=vt,defaultPageTheme:f,pageTheme:B=Le}=a;if(!B[f])throw new Error(`${f} is not defined in pageTheme.`);var z;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:B[f],getPageTheme:({themeId:H})=>(z=B[H])!==null&&z!==void 0?z:B[f]}}function We(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,ae.darken)(a.palette.link,.3),background:(0,ae.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function It(a){const r=St(a),o=(0,de.Z)(r),c=We(o);return{...o,overrides:c}}var Ht=t(34505);const Kn=It({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:Ht.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:Le}),Pn=It({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:Ht.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:Le});var sr=t(98192),hn=t(15222),vn=t(41547),yn=t(87561);const Or=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(hn.Z,{}),Provider:({children:a})=>(0,n.jsx)(vn.Z,{theme:Kn,children:(0,n.jsx)(yn.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(sr.Z,{}),Provider:({children:a})=>(0,n.jsx)(vn.Z,{theme:Pn,children:(0,n.jsx)(yn.ZP,{children:a})})}];function Dn(a){var r,o,c;return cs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Qr,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:Jr,icons:{...G,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:Or})}var Ar=t(25271),fn=t(76635);async function Tn({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,fn.isArray)(c))return;var f;const B=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(fn.isString).map(z=>z.split(":")).filter(z=>z.length===4&&z[0]==="entity").map(([z,H,se,Ue])=>(0,Ar.eE)({kind:H,namespace:se,name:Ue})).forEach(z=>B.add(z)),await o.set("entityRefs",Array.from(B)),await r.remove("starredEntities")}class Tr{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(le())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Tn(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Vi=t(33414),Wi=t(79324),$r=t(79692),go=t(60712);const mo=(0,$r.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function di(a){var r,o;const c=a.result,f=mo(),B=useAnalytics(),z=()=>{B.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:z,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var ui=t(86359),gn=t(43297),xs=t(95544),vo=t(99688),bs=t(12231),Ss=t(86136),Br=t(49378),hi=t(85256),ws=t(61837),yo=t(79784),Fs=t(50758),Us=t(31654),xo=t(43054),bo=t(65759),Yn=t(51666);const Cs="catalog-entity",So=(0,Yn.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Cs}),wo=(0,Yn.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Co=(0,Yn.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Cs}),jo=(0,Yn.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Cs}),Eo=(0,Yn.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Ms=(0,Yn.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Ao=(0,Yn.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),To=[So,wo,Co,jo,Eo,Ms,Ao];var Io=t(49166);function zs(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,B=typeof(r==null?void 0:r.disableUnregister)=="boolean";var z;const H=(z=!o||(B?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&z!==void 0?z:!1;let se=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(se=(0,n.jsxs)(bs.Z,{onClick:()=>{f(),c()},disabled:H,children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(Io.Z,{fontSize:"small"})}),(0,n.jsx)(Br.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:se})}const Vs=(0,$r.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ro(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[B,z]=(0,v.useState)(),H=Vs(),Ue=(0,gn.N$)(Co).allowed,Ne=Gt=>{z(Gt.currentTarget)},xt=()=>{z(void 0)},rt=(0,x.h_)(x.$v),kt=(0,v.useCallback)(()=>{navigator.clipboard.writeText(window.location.toString()).then(()=>rt.post({message:"Copied!",severity:"info"}))},[rt]),Ot=r&&[...r.map(Gt=>(0,n.jsxs)(bs.Z,{onClick:()=>{xt(),Gt.onClick()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(Gt.Icon,{fontSize:"small"})}),(0,n.jsx)(Br.Z,{primary:Gt.title})]},Gt.title)),(0,n.jsx)(hi.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ws.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!B,role:"button",onClick:Ne,"data-testid":"menu-button",className:H.button,id:"long-menu",children:(0,n.jsx)(xo.Z,{})}),(0,n.jsx)(yo.ZP,{open:Boolean(B),onClose:xt,anchorEl:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Fs.Z,{children:[Ot,(0,n.jsx)(zs,{unregisterEntityOptions:o,isUnregisterAllowed:Ue,onUnregisterEntity:c,onClose:xt}),(0,n.jsxs)(bs.Z,{onClick:()=>{xt(),f()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(Us.Z,{fontSize:"small"})}),(0,n.jsx)(Br.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(bs.Z,{onClick:()=>{xt(),kt()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(bo.Z,{fontSize:"small"})}),(0,n.jsx)(Br.Z,{primary:"Copy entity URL"})]})]})})]})}const Lo="plugin.catalog.entityLayoutRoute",js=()=>null;(0,x.R5)(js,Lo,!0),(0,x.R5)(js,"core.gatherMountPoints",!0);function Ws(a){const{entity:r,title:o}=a;return(0,n.jsxs)(xs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(xs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(gn.LH,{entity:r})]})}function Po(a,r,o,c){var f;const B=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var z;const H=(z=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&z!==void 0?z:"";var se,Ue,Ne;return{headerTitle:`${(Ne=(Ue=(se=c==null?void 0:c.metadata.title)!==null&&se!==void 0?se:o)!==null&&Ue!==void 0?Ue:c==null?void 0:c.metadata.name)!==null&&Ne!==void 0?Ne:""}${H&&H!==Ar.zG?` in ${H}`:""}`,headerType:(()=>{let rt=B.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(rt+=" \u2014 ",rt+=c.spec.type.toLocaleLowerCase("en-US")),rt})()}}function Nn(a){var r;const{entity:o}=a,c=(0,gn.hF)(o,Ar.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Lt.i9,{label:"Owner",value:(0,n.jsx)(gn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Lt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const pi=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:B,NotFoundComponent:z}=a,{kind:H,namespace:se,name:Ue}=(0,x.Oi)(gn.wi),{entity:Ne,loading:xt,error:rt}=(0,gn.ce)(),kt=(0,W.TH)(),Ot=(0,x.vJ)(B,ti=>ti.selectByComponentData({key:Lo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:hr})=>{if(Ne){if(hr.if&&!hr.if(Ne))return[]}else return[];return[{path:hr.path,title:hr.title,children:hr.children,tabProps:hr.tabProps}]}),[Ne]),{headerTitle:Gt,headerType:xn}=Po(H,se,Ue,Ne),[Un,kn]=(0,v.useState)(!1),[Qn,ur]=(0,v.useState)(!1),ei=(0,W.s0)(),ao=async()=>{kn(!1),ur(!1),ei("/")};(0,v.useEffect)(()=>{kn(!1),ur(!1)},[kt.pathname]);var Ls;return(0,n.jsxs)(Lt.T3,{themeId:(Ls=Ne==null||(r=Ne.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Ls!==void 0?Ls:"home",children:[(0,n.jsx)(Lt.h4,{title:(0,n.jsx)(Ws,{title:Gt,entity:Ne}),pageTitleOverride:Gt,type:xn,children:Ne&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Nn,{entity:Ne}),(0,n.jsx)(Ro,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>kn(!0),onInspectEntity:()=>ur(!0)})]})}),xt&&(0,n.jsx)(Lt.Ex,{}),Ne&&(0,n.jsx)(Lt.tn,{routes:Ot}),rt&&(0,n.jsx)(Lt.VY,{children:(0,n.jsx)(vo.Z,{severity:"error",children:rt.toString()})}),!xt&&!rt&&!Ne&&(0,n.jsx)(Lt.VY,{children:z||(0,n.jsxs)(Lt.GB,{title:"Entity not found",children:["There is no ",H," with the requested"," ",(0,n.jsx)(Lt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(gn.pp,{open:Un,entity:Ne,onConfirm:ao,onClose:()=>kn(!1)}),(0,n.jsx)(gn.U_,{open:Qn,entity:Ne,onClose:()=>ur(!1)})]})};pi.Route=js;var Hi=t(23054);function Gi(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[B,z]=useState(!1),H=useApi(catalogApiRef),se=useApi(alertApiRef),Ue=async()=>{z(!0);try{const Ne=f.metadata.uid;await H.removeEntityByUid(Ne),c()}catch(Ne){assertError(Ne),se.post({message:Ne.message})}finally{z(!1)}};return _jsxs(Dialog,{open:r,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:B,onClick:Ue,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Es=t(19625);function Ki(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Yi(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),B=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:B,onClose:()=>c(!1)})]})}var fi=t(29644);const gi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Zr(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var B,z;return{errors:((z=(B=f.entity.status)===null||B===void 0?void 0:B.items)!==null&&z!==void 0?z:[]).filter(gi).map(Ue=>Ue.error).filter(Ue=>Boolean(Ue)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ji(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Zr(stringifyEntityRef(a),o)).items.length>0}function Qi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:B}=useAsync(async()=>Zr(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!B?null:_jsx(_Fragment,{children:B.items.map((z,H)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(z.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:z.entity})]}),z.errors.map((se,Ue)=>_jsx(ResponseErrorPanel,{error:se},Ue))]},H))})}const Hs="core.backstage.entitySwitch",Gs=a=>null;(0,x.R5)(Gs,Hs,!0);const As=a=>{var r;const{entity:o,loading:c}=(0,gn.ce)(),f=(0,x.I_)(),B=(0,x.vJ)(a.children,se=>se.selectByComponentData({key:Hs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ue=>{if(c)return[];const{if:Ne,children:xt}=Ue.props;if(!o)return[{if:Ne===void 0,children:xt}];var rt;return[{if:(rt=Ne==null?void 0:Ne(o,{apis:f}))!==null&&rt!==void 0?rt:!0,children:xt}]}),[f,o,c]);if(B.some(se=>typeof se.if=="object"&&"then"in se.if))return(0,n.jsx)(ko,{results:B});var H;return(H=(r=B.find(se=>se.if))===null||r===void 0?void 0:r.children)!==null&&H!==void 0?H:null};function ko({results:a}){const{loading:r,value:o}=(0,u.default)(async()=>{const c=a.map(async({if:B,children:z})=>{try{if(await B)return z}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}As.Case=Gs;const mi=null,vi=gn._i.Filters,Ks=gn._i.Content,Mt=(0,x.rx)({id:"catalog",apis:[(0,x.ni)({api:gn.Ah,deps:{discoveryApi:x.NW,fetchApi:x.gP},factory:({discoveryApi:a,fetchApi:r})=>new fi.MS({discoveryApi:a,fetchApi:r})}),(0,x.ni)({api:gn.p3,deps:{storageApi:x.E6},factory:({storageApi:a})=>new Tr({storageApi:a})})],routes:{catalogIndex:Es._Z,catalogEntity:gn.wi},externalRoutes:{createComponent:Es.yw,viewTechDoc:Es.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Ts=Mt.provide((0,x.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Es._Z})),Ys=Mt.provide((0,x.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:gn.wi})),Oo=Mt.provide((0,x.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),or=Mt.provide((0,x.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),yi=Mt.provide((0,x.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),$o=Mt.provide((0,x.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),xi=Mt.provide((0,x.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Xi=Mt.provide((0,x.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Jn=Mt.provide((0,x.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Bo=Mt.provide((0,x.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Is=Mt.provide((0,x.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Zo=Mt.provide((0,x.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Dr=t(32838);class Js{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,o){const f=`${await this.getApiOrigin()}/${o}`,B=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(B.status===404)throw new Error("Page not found");return B.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class Qs{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Xs=[(0,x.ni)({api:Se.Dl,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Js({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Se.gT,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Qs({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Dr.q3,deps:{configApi:x.Ds},factory:({configApi:a})=>Dr.ae.fromConfig(a)})],Do={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Nr={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function No(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function _s(){const a=await is(),r=await No();return[...a,{context:"detected",data:r?Do:Nr}]}var Fo=t(86689),eo=t(58845);const to=(0,$r.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var no=()=>{const a=to();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const ro=(0,$r.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Mo=()=>{const a=ro();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const zo=(0,$r.Z)({root:{width:Lt.po.drawerWidthClosed,height:3*Lt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Lt.po.drawerWidthClosed,marginLeft:24}}),Vo=()=>{const a=zo(),{isOpen:r}=(0,Lt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Fo.Z,{component:rr.OL,to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(no,{}):(0,n.jsx)(Mo,{})})})},Wo=({children:a})=>(0,n.jsxs)(Lt.tR,{children:[(0,n.jsxs)(Lt.YE,{children:[(0,n.jsx)(Vo,{}),(0,n.jsx)(Lt.v7,{}),(0,n.jsx)(Lt.R6,{icon:eo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var Ho=t(80030),Go=t(32388),Ko=t(4142);const oo=(0,$r.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Fn;(function(a){a.LIGHT="light",a.DARK="dark"})(Fn||(Fn={}));const Yo=()=>{const a=(0,x.h_)(x.hg),r=oo(),[o,c]=(0,v.useState)(a.getActiveThemeId()===Fn.DARK?Fn.DARK:Fn.LIGHT),f={[Fn.LIGHT]:{icon:Ko.Z,title:"Dark theme"},[Fn.DARK]:{icon:Go.Z,title:"Light theme"}},{title:B,icon:z}=f[o],H=()=>{c(se=>{const Ue=se===Fn.LIGHT?Fn.DARK:Fn.LIGHT;return a.setActiveThemeId(Ue),Ue})};return(0,n.jsx)(xs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(Ho.ZP,{title:B,arrow:!0,children:(0,n.jsx)(ws.Z,{size:"small",onClick:H,children:(0,n.jsx)(z,{className:r.headerIcon})})})})},Jo=()=>(0,n.jsxs)(R.I6,{children:[(0,n.jsx)(M.S,{}),(0,n.jsx)(X.F,{withSearch:!1})]}),Qo=(0,n.jsx)(Jo,{}),Rs=Dn({apis:Xs,configLoader:_s,plugins:Object.values(h)}),Xo=Rs.getProvider(),io=Rs.getRouter(),In=R.s4.provide((0,Se.KY)({name:"ThemeToggleAddon",component:Yo,location:Se.oZ.Header})),qo=(0,n.jsxs)(Kr,{children:[(0,n.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Ys,{})}),(0,n.jsx)(W.AW,{path:"/docs",element:(0,n.jsx)(R.Jl,{}),children:(0,n.jsx)(L.u,{})}),(0,n.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(R.I6,{}),children:[Qo,(0,n.jsx)(Se.DR,{children:(0,n.jsx)(In,{})})]})]});var _o=()=>(0,n.jsx)(Xo,{children:(0,n.jsx)(io,{children:(0,n.jsx)(Wo,{children:qo})})});P.render((0,n.jsx)(_o,{}),document.getElementById("root"))},51837:function(wt,De,t){"use strict";t.d(De,{CT:function(){return x},EI:function(){return re},uW:function(){return P},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),v=q=>`__@backstage/${q}__`;function P(q,_){const M=v(q);let X=n[M];return X||(X=_(),n[M]=X,X)}var W=t(2784);function x(q){return P(q,()=>(0,W.createContext)(void 0))}function l(q){return(0,W.useContext)(x(q))}function O(q){return{set(_){globalThis[`__@backstage/${q}__`]=createContext(createVersionedValueMap(_))},reset(){delete globalThis[`__@backstage/${q}__`]}}}function re(q){return Object.freeze(q),{atVersion(_){return q[_]}}}},43297:function(wt,De,t){"use strict";t.d(De,{h$:function(){return _t},n3:function(){return h.n3},_i:function(){return Z},zo:function(){return Ee},tW:function(){return ge},df:function(){return ce},UO:function(){return En},dq:function(){return ft},nl:function(){return ys},dx:function(){return _e},rI:function(){return nt},u3:function(){return dn},xE:function(){return Bt},sL:function(){return w},LH:function(){return we},U_:function(){return ds},pp:function(){return Er},EW:function(){return ms},Ah:function(){return v},wi:function(){return ut},hF:function(){return ht},CV:function(){return Oe},$3:function(){return Pe},p3:function(){return P},ce:function(){return nn},X2:function(){return Jt},wp:function(){return Ft},ZW:function(){return Y},N$:function(){return g},eK:function(){return cn},CR:function(){return Te}});var h=t(29644),n=t(25248);const v=(0,n.T0)({id:"plugin.catalog.service"}),P=(0,n.T0)({id:"catalog-react.starred-entities"});var W=t(82394);class x{async toggleStarred(S){this.starredEntities.delete(S)||this.starredEntities.add(S);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(S=>(S.next(new Set(this.starredEntities)),this.subscribers.add(S),()=>{this.subscribers.delete(S)}))}}var l=t(52322),O=t(2784),re=t(41156),q=t(60364),_=t(77277),M=t(4190),X=t(95544),J=t(90436),he=t(60905),ue=t(36444);const k=y=>{const S=(0,re.Z)(G=>G.breakpoints.down("md")),I=(0,q.Z)(),[N,K]=(0,O.useState)(!1);return S?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(_.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>K(!0),startIcon:(0,l.jsx)(ue.Z,{}),children:"Filters"}),(0,l.jsx)(M.ZP,{open:N,onClose:()=>K(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(X.Z,{m:2,children:[(0,l.jsx)(J.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),y.children]})})]}):(0,l.jsx)(he.Z,{item:!0,lg:2,children:y.children})},L=y=>(0,l.jsx)(he.Z,{item:!0,xs:12,lg:10,children:y.children}),Z=y=>(0,l.jsx)(he.Z,{container:!0,style:{position:"relative"},children:y.children});Z.Filters=k,Z.Content=L;var T=t(71399),R=t(82108),ne=t.n(R),Se=t(829),Ve=t.n(Se),ze=t(64279),je=t(25271),He=t(51837);const ut=(0,He.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function $e(y){var S,I;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(I=(S=y.metadata.namespace)===null||S===void 0?void 0:S.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:y.metadata.name}}function Pe(y,S){const I=S==null?void 0:S.defaultKind;let N,K,G;return"metadata"in y?(N=y.kind,K=y.metadata.namespace,G=y.metadata.name):(N=y.kind,K=y.namespace,G=y.name),(K===void 0||K==="")&&(K=je.zG),(S==null?void 0:S.defaultNamespace)!==void 0?(S==null?void 0:S.defaultNamespace)===K&&(K=void 0):K===je.zG&&(K=void 0),N=N.toLocaleLowerCase("en-US"),N=I&&I.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${K?`${K}/`:""}${G}`}var Ye=t(80030);const _e=(0,O.forwardRef)((y,S)=>{const{entityRef:I,defaultKind:N,title:K,children:G,...de}=y,ae=(0,n.tg)(ut);let pe,Ce,Re;if(typeof I=="string"){const We=(0,je.of)(I);pe=We.kind,Ce=We.namespace,Re=We.name}else"metadata"in I?(pe=I.kind,Ce=I.metadata.namespace,Re=I.metadata.name):(pe=I.kind,Ce=I.namespace,Re=I.name);pe=pe.toLocaleLowerCase("en-US");var Le;Ce=(Le=Ce==null?void 0:Ce.toLocaleLowerCase("en-US"))!==null&&Le!==void 0?Le:je.zG;const Ge={kind:pe,namespace:Ce,name:Re},vt=Pe({kind:pe,namespace:Ce,name:Re},{defaultKind:N}),St=(0,l.jsxs)(T.rU,{...de,ref:S,to:ae(Ge),children:[G,!G&&(K!=null?K:vt)]});return K?(0,l.jsx)(Ye.ZP,{title:vt,children:St}):St});function it(y){const{entityRefs:S,defaultKind:I,getTitle:N,...K}=y,G=(0,n.h_)(v),{value:de=new Array,loading:ae,error:pe}=(0,ze.default)(async()=>{const Ce=S.reduce((Le,Ge)=>"metadata"in Ge?Le:[...Le,(0,je.of)(Ge)],new Array),Re=S.filter(Le=>"metadata"in Le);return Ce.length>0?[...(await G.getEntities({filter:Ce.map(Le=>({kind:Le.kind,"metadata.namespace":Le.namespace,"metadata.name":Le.name}))})).items,...Re]:Re},[S]);return ae?(0,l.jsx)(T.Ex,{}):pe?(0,l.jsx)(T.yu,{error:pe}):(0,l.jsx)(l.Fragment,{children:de.map((Ce,Re)=>(0,l.jsxs)(O.Fragment,{children:[Re>0&&", ",(0,l.jsx)(_e,{...K,defaultKind:I,entityRef:Ce,title:N(Ce)})]},Re))})}function nt(y){const{entityRefs:S,defaultKind:I,fetchEntities:N,getTitle:K,...G}=y;return N?(0,l.jsx)(it,{...G,defaultKind:I,entityRefs:S,getTitle:K}):(0,l.jsx)(l.Fragment,{children:S.map((de,ae)=>(0,l.jsxs)(O.Fragment,{children:[ae>0&&", ",(0,l.jsx)(_e,{...G,defaultKind:I,entityRef:de,title:K?K(de):void 0})]},ae))})}function Xe(y){return y.reduce((S,I)=>({...S,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function st(y){return S=>y.every(I=>!I.filterEntity||I.filterEntity(S))}function ht(y,S,I){var N;let K=(y==null||(N=y.relations)===null||N===void 0?void 0:N.filter(G=>G.type===S).map(G=>(0,je.of)(G.targetRef)))||[];return I!=null&&I.kind&&(K=K.filter(G=>G.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),K}function Oe(y,S){var I;const N=(I=y.metadata.annotations)===null||I===void 0?void 0:I[je.M6];if(!!N)try{const K=(0,je.Ou)(N),G=S.byUrl(K.target);return{locationTargetUrl:K.target,integrationType:G==null?void 0:G.type}}catch{return}}function le(y,S){const I=new Set([...getEntityRelations(y,RELATION_MEMBER_OF,{kind:"group"}),...y?[getCompoundEntityRef(y)]:[]].map(stringifyEntityRef)),N=getEntityRelations(S,RELATION_OWNED_BY).map(stringifyEntityRef);for(const K of N)if(I.has(K))return!0;return!1}class Ee{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(S){this.value=S}}class Ze{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(S){this.value=S}}class pt{filterEntity(S){var I;return this.values.every(N=>((I=S.metadata.tags)!==null&&I!==void 0?I:[]).includes(N))}toQueryValue(){return this.values}constructor(S){this.values=S}}class yt{filterEntity(S){const I=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([S.metadata.tags]),K=this.toUpperArray([S.metadata.name,S.metadata.title]);for(const G of I)if(N.every(de=>de!==G)&&K.every(de=>!de.includes(G)))return!1;return!0}toUpperArray(S){return S.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(S){this.value=S}}class Et{filterEntity(S){return this.values.some(I=>ht(S,je.S4).some(N=>Pe(N,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(S){this.values=S}}class at{filterEntity(S){return this.values.some(I=>{var N;return((N=S.spec)===null||N===void 0?void 0:N.lifecycle)===I})}toQueryValue(){return this.values}constructor(S){this.values=S}}class bt{filterEntity(S){switch(this.value){case"owned":return this.isOwnedEntity(S);case"starred":return this.isStarredEntity(S);default:return!0}}toQueryValue(){return this.value}constructor(S,I,N){this.value=S,this.isOwnedEntity=I,this.isStarredEntity=N}}class Ct{filterEntity(S){var I;const N=(I=S.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(S){this.value=S}}class Tt{filterEntity(S){var I,N;const K=(S==null||(I=S.status)===null||I===void 0||(N=I.items)===null||N===void 0?void 0:N.length)>0;return K!==void 0&&this.value===K}constructor(S){this.value=S}}const qt=(0,He.CT)("entity-context"),_t=({children:y,entity:S,loading:I,error:N,refresh:K})=>{const G={entity:S,loading:I,error:N,refresh:K};return(0,l.jsx)(qt.Provider,{value:(0,He.EI)({1:G}),children:y})},Vt=y=>_jsx(_t,{entity:y.entity,loading:!Boolean(y.entity),error:void 0,refresh:void 0,children:y.children});function Jt(){const y=(0,He.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const S=y.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");if(!S.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:S.entity}}function nn(){const y=(0,He.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const S=y.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");const{entity:I,loading:N,error:K,refresh:G}=S;return{entity:I,loading:N,error:K,refresh:G}}var Qt=t(76635),wn=t(19126),rn=t.n(wn),Cn=t(10289),on=t(69294),Mn=t(48760),Wt=t(90736);const jn=(0,O.createContext)(void 0),En=({children:y})=>{const S=(0,Wt.default)(),I=(0,n.h_)(v),[N,K]=(0,O.useState)({}),G=(0,Cn.TH)();var de;const ae=(0,O.useMemo)(()=>(de=rn().parse(G.search,{ignoreQueryPrefix:!0}).filters)!==null&&de!==void 0?de:{},[G]),[pe,Ce]=(0,O.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Re,error:Le},Ge]=(0,on.default)(async()=>{const We=(0,Qt.compact)(Object.values(N)),It=st(We),Ht=Xe(We),Kn=Xe((0,Qt.compact)(Object.values(pe.appliedFilters))),Pn=Object.keys(N).reduce((hn,vn)=>{const yn=N[vn];return yn!=null&&yn.toQueryValue&&(hn[vn]=yn.toQueryValue()),hn},{});if((0,Qt.isEqual)(Kn,Ht))Ce({appliedFilters:N,backendEntities:pe.backendEntities,entities:pe.backendEntities.filter(It)});else{const hn=await I.getEntities({filter:Ht});Ce({appliedFilters:N,backendEntities:hn.items,entities:hn.items.filter(It)})}if(S()){var sr;const hn=rn().parse(G.search,{ignoreQueryPrefix:!0}),vn=rn().stringify({...hn,filters:Pn},{addQueryPrefix:!0,arrayFormat:"repeat"}),yn=`${window.location.pathname}${vn}`;(sr=window.history)===null||sr===void 0||sr.replaceState(null,document.title,yn)}},[I,ae,N,pe],{loading:!0});(0,Mn.Z)(Ge,10,[N]);const vt=(0,O.useCallback)(We=>{K(It=>{const Ht=typeof We=="function"?We(It):We;return{...It,...Ht}})},[]),St=(0,O.useMemo)(()=>({filters:pe.appliedFilters,entities:pe.entities,backendEntities:pe.backendEntities,updateFilters:vt,queryParameters:ae,loading:Re,error:Le}),[pe,vt,ae,Re,Le]);return(0,l.jsx)(jn.Provider,{value:St,children:y})};function Ft(){const y=(0,O.useContext)(jn);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var an=t(18149),sn=t.n(an);function ln(){const y=(0,n.h_)(v),{filters:{kind:S,type:I},queryParameters:{type:N},updateFilters:K}=Ft(),G=(0,O.useMemo)(()=>[N].flat().filter(Boolean),[N]);var de;const[ae,pe]=(0,O.useState)(G.length?G:(de=I==null?void 0:I.getTypes())!==null&&de!==void 0?de:[]);(0,O.useEffect)(()=>{G.length&&pe(G)},[G]);const[Ce,Re]=(0,O.useState)([]),Le=(0,O.useMemo)(()=>S==null?void 0:S.value,[S]),{error:Ge,loading:vt,value:St}=(0,ze.default)(async()=>Le?await y.getEntityFacets({filter:{kind:Le},facets:["spec.type"]}).then(Ht=>Ht.facets["spec.type"]||[]):[],[Le,y]),We=(0,O.useRef)(St);return(0,O.useEffect)(()=>{const It=We.current;if(We.current=St,vt||!Le||It===St||!St)return;const Ht=[...new Set(Ve()(St,Pn=>-Pn.count).map(Pn=>Pn.value.toLocaleLowerCase("en-US")))];Re(Ht);const Kn=ae.filter(Pn=>Ht.includes(Pn));sn()(ae,Kn)||pe(Kn)},[vt,Le,ae,pe,St]),(0,O.useEffect)(()=>{K({type:ae.length?new Ze(ae):void 0})},[ae,K]),{loading:vt,error:Ge,availableTypes:Ce,selectedTypes:ae,setSelectedTypes:pe}}const An=20;function cn(y,S){var I,N;const K=S==null||(I=S.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),G=S==null||(N=S.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),de=(0,n.h_)(v),{loading:ae,value:pe,error:Ce}=(0,ze.default)(async()=>{var Re;const Le=(Re=y.relations)===null||Re===void 0?void 0:Re.map(We=>({type:We.type,target:(0,je.of)(We.targetRef)})).filter(We=>(!K||We.type.toLocaleLowerCase("en-US")===K)&&(!G||We.target.kind===G));if(!Le)return[];const Ge=Object.values((0,Qt.groupBy)(Le,({target:We})=>`${We.kind}:${We.namespace}`.toLocaleLowerCase("en-US"))),vt=[];for(const We of Ge)vt.push({kind:We[0].target.kind,namespace:We[0].target.namespace,nameBatches:(0,Qt.chunk)(We.map(It=>It.target.name),An)});return(await Promise.all(vt.flatMap(We=>We.nameBatches.map(It=>de.getEntities({filter:{kind:We.kind,"metadata.namespace":We.namespace,"metadata.name":It}}))))).flatMap(We=>We.items)},[y,K,G]);return{entities:pe,loading:ae,error:Ce}}var ve=t(72164);function te(y){return typeof y=="string"?y:(0,je.eE)(y)}function Te(){const y=(0,n.h_)(P),S=(0,ve.Z)(y.starredEntitie$(),new Set),I=(0,O.useCallback)(K=>S.has(te(K)),[S]),N=(0,O.useCallback)(K=>y.toggleStarred(te(K)).then(),[y]);return{starredEntities:S,toggleStarredEntity:N,isStarredEntity:I}}function Be(y){return typeof y=="string"?y:(0,je.eE)(y)}function Ke(y){const S=(0,n.h_)(P),[I,N]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{const G=S.starredEntitie$().subscribe({next(de){N(de.has(Be(y)))}});return()=>{G.unsubscribe()}},[y,S]),{toggleStarredEntity:(0,O.useCallback)(()=>S.toggleStarred(Be(y)).then(),[y,S]),isStarredEntity:I}}function Y(){const y=(0,n.h_)(n.$4),{loading:S,value:I}=(0,ze.default)(async()=>{const{ownershipEntityRefs:K}=await y.getBackstageIdentity();return K},[]),N=(0,O.useMemo)(()=>{const K=new Set(I!=null?I:[]);return G=>{const de=ht(G,je.S4).map(je.eE);for(const ae of de)if(K.has(ae))return!0;return!1}},[I]);return(0,O.useMemo)(()=>({loading:S,isOwnedEntity:N}),[S,N])}var C=t(25488);function g(y){const{entity:S,loading:I,error:N}=nn(),{allowed:K,loading:G,error:de}=(0,C.gI)({permission:y,resourceRef:S?(0,je.eE)(S):void 0});return I||G?{loading:!0,allowed:!1}:N?{loading:!1,allowed:!1,error:N}:{loading:!1,allowed:K,error:de}}function $(){const y=(0,n.h_)(v),[S,I]=(0,O.useState)([]),{error:N,loading:K,value:G}=(0,ze.default)(async()=>{const ae="kind";return await y.getEntityFacets({facets:[ae]}).then(Ce=>Ce.facets[ae]||[])},[y]),de=(0,O.useRef)(G);return(0,O.useEffect)(()=>{const ae=de.current;if(de.current=G,K||ae===G||!G)return;const pe=[...new Set(Ve()(G,Ce=>Ce.value).map(Ce=>Ce.value.toLocaleLowerCase("en-US")))];I(pe)},[K,G,I]),{loading:K,error:N,availableKinds:S}}function ee(y){var S;const{filters:I,queryParameters:{kind:N},updateFilters:K}=Ft(),G=(0,O.useMemo)(()=>[N].flat()[0],[N]);var de;const[ae,pe]=(0,O.useState)((de=G!=null?G:(S=I.kind)===null||S===void 0?void 0:S.value)!==null&&de!==void 0?de:y.initialFilter);(0,O.useEffect)(()=>{G&&pe(G)},[G]),(0,O.useEffect)(()=>{var Ge;if(!((Ge=I.kind)===null||Ge===void 0)&&Ge.value){var vt;pe((vt=I.kind)===null||vt===void 0?void 0:vt.value)}},[I.kind]);const{availableKinds:Ce,loading:Re,error:Le}=$();return(0,O.useEffect)(()=>{K({kind:ae?new Ee(ae):void 0})},[ae,K]),{loading:Re,error:Le,availableKinds:Ce,selectedKind:ae,setSelectedKind:pe}}const ge=y=>{const{hidden:S,initialFilter:I="component"}=y,N=(0,n.h_)(n.$v),{error:K,availableKinds:G,selectedKind:de,setSelectedKind:ae}=ee({initialFilter:I});if((0,O.useEffect)(()=>{K&&N.post({message:"Failed to load entity kinds",severity:"error"}),I&&ae(I)},[K,N,I,ae]),(G==null?void 0:G.length)===0||K)return null;const pe=[...G.map(Ce=>({value:Ce,label:ne()(Ce)}))];return S?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(T.Ph,{label:"Kind",items:pe,selected:de,onChange:Ce=>ae(String(Ce))})})};var fe=t(79692),Fe=t(5806),Je=t(21324),qe=t(86619),ot=t(19996),lt=t(25505),ct=t(38016),Rt=t(88013);const j=(0,fe.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),F=(0,l.jsx)(lt.Z,{fontSize:"small"}),oe=(0,l.jsx)(ot.Z,{fontSize:"small"}),ce=()=>{var y;const S=j(),{updateFilters:I,backendEntities:N,filters:K,queryParameters:{lifecycles:G}}=Ft(),de=(0,O.useMemo)(()=>[G].flat().filter(Boolean),[G]);var ae;const[pe,Ce]=(0,O.useState)(de.length?de:(ae=(y=K.lifecycles)===null||y===void 0?void 0:y.values)!==null&&ae!==void 0?ae:[]);(0,O.useEffect)(()=>{de.length&&Ce(de)},[de]),(0,O.useEffect)(()=>{I({lifecycles:pe.length?new at(pe):void 0})},[pe,I]);const Re=(0,O.useMemo)(()=>[...new Set(N.map(Le=>{var Ge;return(Ge=Le.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[N]);return Re.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(J.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(Rt.ZP,{multiple:!0,options:Re,value:pe,onChange:(Le,Ge)=>Ce(Ge),renderOption:(Le,{selected:Ge})=>(0,l.jsx)(Fe.Z,{control:(0,l.jsx)(Je.Z,{icon:F,checkedIcon:oe,checked:Ge}),label:Le}),size:"small",popupIcon:(0,l.jsx)(ct.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Le=>(0,l.jsx)(qe.Z,{...Le,className:S.input,variant:"outlined"})})]})}):null},be=(0,fe.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ie=(0,l.jsx)(lt.Z,{fontSize:"small"}),Qe=(0,l.jsx)(ot.Z,{fontSize:"small"}),ft=()=>{var y;const S=be(),{updateFilters:I,backendEntities:N,filters:K,queryParameters:{owners:G}}=Ft(),de=(0,O.useMemo)(()=>[G].flat().filter(Boolean),[G]);var ae;const[pe,Ce]=(0,O.useState)(de.length?de:(ae=(y=K.owners)===null||y===void 0?void 0:y.values)!==null&&ae!==void 0?ae:[]);(0,O.useEffect)(()=>{de.length&&Ce(de)},[de]),(0,O.useEffect)(()=>{I({owners:pe.length?new Et(pe):void 0})},[pe,I]);const Re=(0,O.useMemo)(()=>[...new Set(N.flatMap(Le=>ht(Le,je.S4).map(Ge=>Pe(Ge,{defaultKind:"group"}))).filter(Boolean))].sort(),[N]);return Re.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(J.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(Rt.ZP,{multiple:!0,options:Re,value:pe,onChange:(Le,Ge)=>Ce(Ge),renderOption:(Le,{selected:Ge})=>(0,l.jsx)(Fe.Z,{control:(0,l.jsx)(Je.Z,{icon:Ie,checkedIcon:Qe,checked:Ge}),label:Le}),size:"small",popupIcon:(0,l.jsx)(ct.Z,{"data-testid":"owner-picker-expand"}),renderInput:Le=>(0,l.jsx)(qe.Z,{...Le,className:S.input,variant:"outlined"})})]})}):null},et=(0,fe.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),mt=()=>{var y;const S=et(),{filters:I,updateFilters:N}=useEntityList();var K;const[G,de]=useState((K=(y=I.text)===null||y===void 0?void 0:y.value)!==null&&K!==void 0?K:"");return useDebounce(()=>{N({text:G.length?new EntityTextFilter(G):void 0})},250,[G,N]),_jsx(Toolbar,{className:S.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:S.input,placeholder:"Search",autoComplete:"off",onChange:ae=>de(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:()=>de(""),edge:"end",disabled:G.length===0,children:_jsx(Clear,{})})})})})})},gt=Object.freeze({createEntityRefColumn(y){const{defaultKind:S}=y;function I(N){var K;return((K=N.metadata)===null||K===void 0?void 0:K.title)||Pe(N,{defaultKind:S})}return{title:"Name",highlight:!0,customFilterAndSearch(N,K){return I(K).includes(N)},customSort(N,K){return I(N).localeCompare(I(K))},render:N=>{var K;return(0,l.jsx)(_e,{entityRef:N,defaultKind:S,title:(K=N.metadata)===null||K===void 0?void 0:K.title})}}},createEntityRelationColumn(y){const{title:S,relation:I,defaultKind:N,filter:K}=y;function G(ae){return ht(ae,I,K)}function de(ae){return G(ae).map(pe=>Pe(pe,{defaultKind:N})).join(", ")}return{title:S,customFilterAndSearch(ae,pe){return de(pe).includes(ae)},customSort(ae,pe){return de(ae).localeCompare(de(pe))},render:ae=>(0,l.jsx)(nt,{entityRefs:G(ae),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:je.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:je.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:je.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,l.jsx)(T.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),At=[gt.createEntityRefColumn({defaultKind:"system"}),gt.createDomainColumn(),gt.createOwnerColumn(),gt.createMetadataDescriptionColumn()],Ut=[gt.createEntityRefColumn({defaultKind:"component"}),gt.createSystemColumn(),gt.createOwnerColumn(),gt.createSpecTypeColumn(),gt.createSpecLifecycleColumn(),gt.createMetadataDescriptionColumn()],Wn=(0,fe.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),dn=y=>{const{entities:S,title:I,emptyContent:N,variant:K="gridItem",columns:G}=y,de=Wn(),ae={minWidth:"0",width:"100%"};return K==="gridItem"&&(ae.height="calc(100% - 10px)"),(0,l.jsx)(T.iA,{columns:G,title:I,style:ae,emptyContent:N&&(0,l.jsx)("div",{className:de.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:S})};dn.columns=gt,dn.systemEntityColumns=At,dn.componentEntityColumns=Ut;const $n=(0,fe.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Bn=(0,l.jsx)(lt.Z,{fontSize:"small"}),tr=(0,l.jsx)(ot.Z,{fontSize:"small"}),Bt=y=>{var S;const I=$n(),{updateFilters:N,filters:K,queryParameters:{tags:G}}=Ft(),de=(0,n.h_)(v),{value:ae}=(0,ze.default)(async()=>{var Ge;const vt="metadata.tags",{facets:St}=await de.getEntityFacets({facets:[vt],filter:(Ge=K.kind)===null||Ge===void 0?void 0:Ge.getCatalogFilters()});return Object.fromEntries(St[vt].map(({value:We,count:It})=>[We,It]))},[K.kind]),pe=(0,O.useMemo)(()=>[G].flat().filter(Boolean),[G]);var Ce;const[Re,Le]=(0,O.useState)(pe.length?pe:(Ce=(S=K.tags)===null||S===void 0?void 0:S.values)!==null&&Ce!==void 0?Ce:[]);return(0,O.useEffect)(()=>{pe.length&&Le(pe)},[pe]),(0,O.useEffect)(()=>{N({tags:Re.length?new pt(Re):void 0})},[Re,N]),Object.keys(ae!=null?ae:{}).length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(J.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(Rt.ZP,{multiple:!0,options:Object.keys(ae!=null?ae:{}),value:Re,onChange:(Ge,vt)=>Le(vt),renderOption:(Ge,{selected:vt})=>(0,l.jsx)(Fe.Z,{control:(0,l.jsx)(Je.Z,{icon:Bn,checkedIcon:tr,checked:vt}),label:y.showCounts?`${Ge} (${ae==null?void 0:ae[Ge]})`:Ge}),size:"small",popupIcon:(0,l.jsx)(ct.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ge=>(0,l.jsx)(qe.Z,{...Ge,className:I.input,variant:"outlined"})})]})}):null},w=y=>{const{hidden:S,initialFilter:I}=y,N=(0,n.h_)(n.$v),{error:K,availableTypes:G,selectedTypes:de,setSelectedTypes:ae}=ln();if((0,O.useEffect)(()=>{K&&N.post({message:"Failed to load entity types",severity:"error"}),I&&ae([I])},[K,N,I,ae]),G.length===0||K)return null;const pe=[{value:"all",label:"All"},...G.map(Re=>({value:Re,label:ne()(Re)}))];var Ce;return S?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(T.Ph,{label:"Type",items:pe,selected:(Ce=pe.length>1?de[0]:void 0)!==null&&Ce!==void 0?Ce:"all",onChange:Re=>ae(Re==="all"?[]:[String(Re)])})})};var u=t(15459),b=t(61837),A=t(11640),Q=t(28347);const xe=(0,u.Z)({root:{color:"#f3ba37"}})(A.Z),we=y=>{const{toggleStarredEntity:S,isStarredEntity:I}=Ke(y.entity);return(0,l.jsx)(b.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>S(),children:(0,l.jsx)(Ye.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,l.jsx)(xe,{}):(0,l.jsx)(Q.Z,{})})})};var ke=t(8629),tt=t(79249),Pt=t(38724),un=t(99152),Ln=t(6487),Ir=t(49429),Xt=t(55999),vr=t(72779),yr=t.n(vr),Ur=t(39412);const Mr=Ur.Z;function xr(y,S){if(y)return y.toLocaleLowerCase("en-US");if(S)try{return(0,je.of)(S).kind.toLocaleLowerCase("en-US")}catch{return}}function ts(y,S){const I=(0,n.qD)(),N=xr(y,S);return N&&I.getSystemIcon(`kind:${N}`)||Mr}function br(y){const{kind:S,entityRef:I,...N}=y,K=ts(S,I);return(0,l.jsx)(K,{...N})}const ns=(0,fe.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Rr(y){const S=(0,n.h_)(v),I=(0,je.eE)(y),{loading:N,error:K,value:G}=(0,ze.default)(async()=>{const de=await S.getEntityAncestors({entityRef:I}),ae=new Array,pe=new Array;for(const Ce of de.items){const Re=(0,je.eE)(Ce.entity),Le=Re===de.rootEntityRef;ae.push({id:Re,root:Le,...Ce.entity});for(const Ge of Ce.parentEntityRefs)pe.push({from:Re,to:Ge})}return{nodes:ae,edges:pe}},[I]);return{loading:N,error:K,nodes:(G==null?void 0:G.nodes)||[],edges:(G==null?void 0:G.edges)||[]}}function rs({node:y}){const S=ns(),I=(0,Cn.s0)(),N=(0,n.tg)(ut),[K,G]=(0,O.useState)(0),[de,ae]=(0,O.useState)(0),pe=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{if(pe.current){let{height:It,width:Ht}=pe.current.getBBox();It=Math.round(It),Ht=Math.round(Ht),(It!==de||Ht!==K)&&(G(Ht),ae(It))}},[K,de]);const Ce=10,Re=de,Le=Re+Ce,Ge=Le+K+Ce*2,vt=de+Ce*2,St=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?Pe({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),We=()=>{I(N({kind:y.kind,namespace:y.metadata.namespace||je.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:We,className:S.clickable,children:[(0,l.jsx)("rect",{className:yr()(S.node,y.root?"secondary":"primary"),width:Ge,height:vt,rx:10}),(0,l.jsx)(br,{kind:y.kind,y:Ce,x:Ce,width:Re,height:Re,className:yr()(S.text,y.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:pe,className:yr()(S.text,y.root?"secondary":"primary"),y:vt/2,x:Le+(K+Ce*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:St})]})}function ss(y){const{loading:S,error:I,nodes:N,edges:K}=Rr(y.entity);return S?(0,l.jsx)(T.Ex,{}):I?(0,l.jsx)(T.Gk,{error:I}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Xt.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(T.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(X.Z,{mt:4,children:(0,l.jsx)(T.mn,{nodes:N,edges:K,renderNode:rs,direction:T.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Hn=t(11776),Zn=t(38402),lr=t(86136),Lr=t(99688),zr=t(49378),os=t(54506),Sr=t(94339),wr=t(24579),nr=t(27685);const Pr=(0,fe.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function zn(y){const S=Pr();return(0,l.jsx)(zr.Z,{...y,primaryTypographyProps:{className:S.monospace},secondaryTypographyProps:{className:S.monospace}})}function Cr(y){const S=Pr();return(0,l.jsx)(os.Z,{className:S.monospace,children:y.children})}function cr(y){return(0,l.jsx)(X.Z,{mt:2,children:(0,l.jsx)(Sr.Z,{variant:"outlined",children:(0,l.jsxs)(wr.Z,{children:[(0,l.jsxs)(J.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(Gn,{to:y.helpLink})]}),y.children]})})})}function is(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function Vr(y){const[S,I]=y.entry,N=is(I);return(0,l.jsxs)(Zn.Z,{children:[y.indent&&(0,l.jsx)(lr.Z,{}),(0,l.jsx)(zn,{primary:S,secondary:N?(0,l.jsx)(T.rU,{to:N,children:I}):I})]})}function Gn(y){const S=Pr();return(0,l.jsx)(T.rU,{to:y.to,className:S.helpIcon,children:(0,l.jsx)(nr.Z,{fontSize:"inherit"})})}const Os=(0,fe.Z)({root:{display:"flex",flexDirection:"column"}});function Wr(y){var S,I;const N=(0,n.h_)(v),K=(0,je.eE)(y),G=(S=y.metadata.annotations)===null||S===void 0?void 0:S[je.P1],de=(I=y.metadata.annotations)===null||I===void 0?void 0:I[je.q1],{loading:ae,error:pe,value:Ce}=(0,ze.default)(async()=>!G&&!de?[]:(await N.getEntities({filter:[...G?[{[`metadata.annotations.${je.P1}`]:G}]:[],...de?[{[`metadata.annotations.${je.q1}`]:de}]:[]]})).items,[G,de]);return{loading:ae,error:pe,location:G,originLocation:de,colocatedEntities:Ce==null?void 0:Ce.filter(Re=>(0,je.eE)(Re)!==K)}}function jr(y){return(0,l.jsxs)(Hn.Z,{dense:!0,children:[y.header&&(0,l.jsx)(Vr,{entry:y.header},"header"),y.entities.map(S=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(br,{kind:S.kind})}),(0,l.jsx)(zn,{primary:(0,l.jsx)(_e,{entityRef:S})})]},(0,je.eE)(S)))]})}function kr(y){const{entity:S}=y,{loading:I,error:N,location:K,originLocation:G,colocatedEntities:de}=Wr(S);if(I)return(0,l.jsx)(T.Ex,{});if(N)return(0,l.jsx)(T.Gk,{error:N});if(!K&&!G)return(0,l.jsx)(Lr.Z,{severity:"warning",children:"Entity had no location information."});if(!(de!=null&&de.length))return(0,l.jsx)(Lr.Z,{severity:"info",children:"There were no other entities on this location."});if(K===G)return(0,l.jsx)(jr,{entities:de});const ae=de.filter(Ce=>{var Re;return((Re=Ce.metadata.annotations)===null||Re===void 0?void 0:Re[je.P1])===K}),pe=de.filter(Ce=>{var Re;return((Re=Ce.metadata.annotations)===null||Re===void 0?void 0:Re[je.q1])===G});return(0,l.jsxs)(l.Fragment,{children:[ae.length>0&&(0,l.jsx)(jr,{entities:ae,header:["At the same location",K]}),pe.length>0&&(0,l.jsx)(jr,{entities:pe,header:["At the same origin",G]})]})}function as(y){const S=Os();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Xt.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:S.root,children:(0,l.jsx)(kr,{entity:y.entity})})]})}function Hr(y){return Object.fromEntries([...Object.entries(y)].sort((S,I)=>S[0]<I[0]?-1:1))}function ls(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Xt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Xt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(T.Oi,{text:JSON.stringify(Hr(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var cs=t(3440),Gr=t.n(cs);const Kr=(0,fe.Z)({root:{display:"flex",flexDirection:"column"}});function Yr(y){var S,I;const N=Kr(),{apiVersion:K,kind:G,metadata:de,spec:ae,relations:pe=[],status:Ce={}}=y.entity,Re=Gr()(Ve()(pe,Le=>Le.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:N.root,children:[(0,l.jsx)(cr,{title:"Identity",children:(0,l.jsxs)(Hn.Z,{dense:!0,children:[(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(zn,{primary:"apiVersion",secondary:K})}),(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(zn,{primary:"kind",secondary:G})}),(ae==null?void 0:ae.type)&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(zn,{primary:"spec.type",secondary:ae.type})}),de.uid&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(zn,{primary:"uid",secondary:de.uid})}),de.etag&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(zn,{primary:"etag",secondary:de.etag})})]})}),(0,l.jsxs)(cr,{title:"Metadata",children:[!!Object.keys(de.annotations||{}).length&&(0,l.jsx)(Hn.Z,{dense:!0,subheader:(0,l.jsxs)(Cr,{children:["Annotations",(0,l.jsx)(Gn,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(de.annotations).map(Le=>(0,l.jsx)(Vr,{indent:!0,entry:Le},Le[0]))}),!!Object.keys(de.labels||{}).length&&(0,l.jsx)(Hn.Z,{dense:!0,subheader:(0,l.jsx)(Cr,{children:"Labels"}),children:Object.entries(de.labels).map(Le=>(0,l.jsx)(Vr,{indent:!0,entry:Le},Le[0]))}),!!(!((S=de.tags)===null||S===void 0)&&S.length)&&(0,l.jsx)(Hn.Z,{dense:!0,subheader:(0,l.jsx)(Cr,{children:"Tags"}),children:de.tags.map((Le,Ge)=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{}),(0,l.jsx)(zn,{primary:Le})]},`${Le}-${Ge}`))})]}),!!pe.length&&(0,l.jsx)(cr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Re).map(([Le,Ge],vt)=>(0,l.jsx)("div",{children:(0,l.jsx)(Hn.Z,{dense:!0,subheader:(0,l.jsx)(Cr,{children:Le}),children:Ge.map(St=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(br,{entityRef:St.targetRef})}),(0,l.jsx)(zn,{primary:(0,l.jsx)(_e,{entityRef:St.targetRef})})]},St.targetRef))})},vt))}),!!(!((I=Ce.items)===null||I===void 0)&&I.length)&&(0,l.jsx)(cr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ce.items.map((Le,Ge)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(J.Z,{children:[Le.level,": ",Le.type]}),(0,l.jsx)(X.Z,{ml:2,children:Le.message})]},Ge))})]})]})}var Jr=t(72847);function pn(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Xt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Xt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(T.Oi,{text:Jr.ZP.stringify(Hr(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Lt=(0,fe.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function rr(y){const{children:S,value:I,index:N,...K}=y,G=Lt();return(0,l.jsx)("div",{role:"tabpanel",hidden:I!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:G.tabContents,...K,children:I===N&&(0,l.jsx)(X.Z,{pl:3,pr:3,children:S})})}function dr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function ds(y){const S=Lt(),[I,N]=O.useState(0);return(0,O.useEffect)(()=>{N(0)},[y.open]),y.entity?(0,l.jsxs)(ke.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:S.fullHeightDialog},children:[(0,l.jsx)(tt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(Pt.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:S.root,children:[(0,l.jsxs)(un.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(K,G)=>N(G),"aria-label":"Inspector options",className:S.tabs,children:[(0,l.jsx)(Ln.Z,{label:"Overview",...dr(0)}),(0,l.jsx)(Ln.Z,{label:"Ancestry",...dr(1)}),(0,l.jsx)(Ln.Z,{label:"Colocated",...dr(2)}),(0,l.jsx)(Ln.Z,{label:"Raw JSON",...dr(3)}),(0,l.jsx)(Ln.Z,{label:"Raw YAML",...dr(4)})]}),(0,l.jsx)(rr,{value:I,index:0,children:(0,l.jsx)(Yr,{entity:y.entity})}),(0,l.jsx)(rr,{value:I,index:1,children:(0,l.jsx)(ss,{entity:y.entity})}),(0,l.jsx)(rr,{value:I,index:2,children:(0,l.jsx)(as,{entity:y.entity})}),(0,l.jsx)(rr,{value:I,index:3,children:(0,l.jsx)(ls,{entity:y.entity})}),(0,l.jsx)(rr,{value:I,index:4,children:(0,l.jsx)(pn,{entity:y.entity})})]})}),(0,l.jsx)(Ir.Z,{children:(0,l.jsx)(_.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var us=t(85256);function hs(y){var S;const I=(0,n.h_)(v),N=(S=y.metadata.annotations)===null||S===void 0?void 0:S[je.q1],K=y.metadata.uid,G=N==="bootstrap:bootstrap",de=(0,ze.default)(async()=>{const St=I.getLocationByRef(N);let We;if(!N)We=Promise.resolve([]);else{const It=`metadata.annotations.${je.q1}`;We=I.getEntities({filter:{[It]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Ht=>Ht.items)}return Promise.all([St,We]).then(([It,Ht])=>({location:It,colocatedEntities:Ht}))},[I,y]),ae=(0,O.useCallback)(async function(){const{location:We}=de.value;await I.removeLocationById(We.id)},[I,de]),pe=(0,O.useCallback)(async function(){await I.removeEntityByUid(K)},[I,K]);if(G)return{type:"bootstrap",location:N,deleteEntity:pe};const{loading:Ce,error:Re,value:Le}=de;if(Ce)return{type:"loading"};if(Re)return{type:"error",error:Re};const{location:Ge,colocatedEntities:vt}=Le;return Ge?{type:"unregister",location:N,colocatedEntities:vt.map(je.iB),unregisterLocation:ae,deleteEntity:pe}:{type:"only-delete",deleteEntity:pe}}var Qr=t(23054);const ps=(0,fe.Z)({advancedButton:{fontSize:"0.7em"}}),Xr=({entity:y,onConfirm:S})=>{const I=(0,n.h_)(n.$v),N=(0,n.h_)(n.Ds),K=ps(),G=hs(y),[de,ae]=(0,O.useState)(!1),[pe,Ce]=(0,O.useState)(!1);var Re;const Le=(Re=N.getOptionalString("app.title"))!==null&&Re!==void 0?Re:"Backstage",Ge=(0,O.useCallback)(async function(){if("unregisterLocation"in G){Ce(!0);try{await G.unregisterLocation(),S()}catch(We){(0,Qr.BD)(We),I.post({message:We.message})}finally{Ce(!1)}}},[I,S,G]),vt=(0,O.useCallback)(async function(){if("deleteEntity"in G){Ce(!0);try{await G.deleteEntity(),S()}catch(We){(0,Qr.BD)(We),I.post({message:We.message})}finally{Ce(!1)}}},[I,S,G]);return G.type==="loading"?(0,l.jsx)(T.Ex,{}):G.type==="error"?(0,l.jsx)(T.Gk,{error:G.error}):G.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Lr.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 ',Le," ","integrator."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[!de&&(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:K.advancedButton,onClick:()=>ae(!0),children:"Advanced Options"}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:vt,children:"Delete Entity"})]})]})]}):G.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:vt,children:"Delete Entity"})]}):G.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xt.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Xt.Z,{component:"ul",children:G.colocatedEntities.map(St=>(0,l.jsx)("li",{children:(0,l.jsx)(_e,{entityRef:St})},`${St.kind}:${St.namespace}/${St.name}`))}),(0,l.jsx)(Xt.Z,{children:"Located at the following location:"}),(0,l.jsx)(Xt.Z,{component:"ul",children:(0,l.jsx)("li",{children:G.location})}),(0,l.jsxs)(Xt.Z,{children:["To undo, just re-register the entity in ",Le,"."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:Ge,children:"Unregister Location"}),!de&&(0,l.jsx)(X.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:K.advancedButton,onClick:()=>ae(!0),children:"Advanced Options"})})]}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(us.Z,{})}),(0,l.jsx)(Xt.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(_.Z,{variant:"contained",color:"secondary",disabled:pe,onClick:vt,children:"Delete Entity"})]})]}):(0,l.jsx)(Lr.Z,{severity:"error",children:"Internal error: Unknown state"})},Er=y=>{const{open:S,onConfirm:I,onClose:N,entity:K}=y;return(0,l.jsxs)(ke.Z,{open:S,onClose:N,children:[(0,l.jsx)(tt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(Pt.Z,{children:(0,l.jsx)(Xr,{entity:K,onConfirm:I})}),(0,l.jsx)(Ir.Z,{children:(0,l.jsx)(_.Z,{onClick:N,color:"primary",children:"Cancel"})})]})};var $s=t(12231),fs=t(9520),qr=t(47603);const gs=(0,fe.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Bs(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:qr.Z},{id:"starred",label:"Starred",icon:A.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const ms=y=>{const{initialFilter:S,availableFilters:I}=y,N=gs(),K=(0,n.h_)(n.Ds);var G;const de=(G=K.getOptionalString("organization.name"))!==null&&G!==void 0?G:"Company",{filters:ae,updateFilters:pe,backendEntities:Ce,queryParameters:{kind:Re,user:Le},loading:Ge}=Ft(),vt=["starred","all"],St=Bs(de).map(fn=>({...fn,items:fn.items.filter(({id:Tn})=>["group","user"].some(Tr=>Tr===Re)?vt.includes(Tn):!I||I.includes(Tn))})).filter(({items:fn})=>!!fn.length),{isStarredEntity:We}=Te(),{isOwnedEntity:It,loading:Ht}=Y(),Kn=Ge||Ht,Pn=(0,O.useMemo)(()=>new bt("owned",It,We),[It,We]),sr=(0,O.useMemo)(()=>new bt("starred",It,We),[It,We]),hn=(0,O.useMemo)(()=>[Le].flat()[0],[Le]),[vn,yn]=(0,O.useState)(hn!=null?hn:S),Or=(0,O.useMemo)(()=>Ce.filter(st((0,Qt.compact)(Object.values({...ae,user:void 0})))),[ae,Ce]),Dn=(0,O.useMemo)(()=>({all:Or.length,starred:Or.filter(fn=>sr.filterEntity(fn)).length,owned:Or.filter(fn=>Pn.filterEntity(fn)).length}),[Or,sr,Pn]);(0,O.useEffect)(()=>{hn&&yn(hn)},[hn]),(0,O.useEffect)(()=>{!Kn&&!!vn&&vn!=="all"&&Dn[vn]===0&&yn("all")},[Kn,Dn,vn,yn]),(0,O.useEffect)(()=>{pe({user:vn?new bt(vn,It,We):void 0})},[vn,It,We,pe]);var Ar;return(0,l.jsx)(Sr.Z,{className:N.root,children:St.map(fn=>(0,l.jsxs)(O.Fragment,{children:[(0,l.jsx)(J.Z,{variant:"subtitle2",component:"span",className:N.title,children:fn.name}),(0,l.jsx)(Sr.Z,{className:N.groupWrapper,children:(0,l.jsx)(Hn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":fn.name,children:fn.items.map(Tn=>{var Tr;return(0,l.jsxs)($s.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>yn(Tn.id),selected:Tn.id===((Tr=ae.user)===null||Tr===void 0?void 0:Tr.value),className:N.menuItem,disabled:Dn[Tn.id]===0,"data-testid":`user-picker-${Tn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Tn.icon&&(0,l.jsx)(lr.Z,{className:N.listIcon,children:(0,l.jsx)(Tn.icon,{fontSize:"small"})}),(0,l.jsx)(zr.Z,{children:(0,l.jsxs)(J.Z,{variant:"body1",children:[Tn.label," "]})}),(0,l.jsx)(fs.Z,{children:(Ar=Dn[Tn.id])!==null&&Ar!==void 0?Ar:"-"})]},Tn.id)})})})]},fn.name))})},Zs=(0,fe.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ds=(0,l.jsx)(lt.Z,{fontSize:"small"}),vs=(0,l.jsx)(ot.Z,{fontSize:"small"}),ys=()=>{const y=Zs(),{updateFilters:S}=Ft(),[I,N]=(0,O.useState)([]);function K(ae){S({orphan:ae?new Ct(ae):void 0})}function G(ae){S({error:ae?new Tt(ae):void 0})}const de=["Is Orphan","Has Error"];return(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(J.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(Rt.ZP,{multiple:!0,options:de,value:I,onChange:(ae,pe)=>{N(pe),K(pe.includes("Is Orphan")),G(pe.includes("Has Error"))},renderOption:(ae,{selected:pe})=>(0,l.jsx)(Fe.Z,{control:(0,l.jsx)(Je.Z,{icon:Ds,checkedIcon:vs,checked:pe}),label:ae}),size:"small",popupIcon:(0,l.jsx)(ct.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ae=>(0,l.jsx)(qe.Z,{...ae,className:y.input,variant:"outlined"})})]})})},Ns=({children:y,value:S})=>{var I;const[N,K]=useState((I=S==null?void 0:S.filters)!==null&&I!==void 0?I:{}),G=useCallback(vt=>{K(St=>{const We=typeof vt=="function"?vt(St):vt;return{...St,...We}})},[]),de=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var ae,pe,Ce,Re,Le;const Ge=useMemo(()=>({entities:(ae=S==null?void 0:S.entities)!==null&&ae!==void 0?ae:de.entities,backendEntities:(pe=S==null?void 0:S.backendEntities)!==null&&pe!==void 0?pe:de.backendEntities,updateFilters:(Ce=S==null?void 0:S.updateFilters)!==null&&Ce!==void 0?Ce:G,filters:N,loading:(Re=S==null?void 0:S.loading)!==null&&Re!==void 0?Re:!1,queryParameters:(Le=S==null?void 0:S.queryParameters)!==null&&Le!==void 0?Le:de.queryParameters,error:S==null?void 0:S.error}),[S,de,N,G]);return _jsx(EntityListContext.Provider,{value:Ge,children:y})}},33414:function(wt,De,t){"use strict";t.r(De),t.d(De,{AboutCard:function(){return ut},AboutContent:function(){return je},AboutField:function(){return ne}});var h=t(52322),n=t(25271),v=t(71399),P=t(25248),W=t(32838),x=t(43297),l=t(79692),O=t(94339),re=t(32552),q=t(61837),_=t(85256),M=t(24579),X=t(52866),J=t(30254),he=t(27604),ue=t(2784),k=t(19625),L=t(60905),Z=t(90436),T=t(7089);const R=(0,l.Z)($e=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:$e.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ne($e){const{label:Pe,value:Ye,gridSizes:_e,children:it}=$e,nt=R(),Xe=(0,P.vJ)(it,ht=>ht.getElements()),st=Xe.length>0?Xe:(0,h.jsx)(Z.Z,{variant:"body2",className:nt.value,children:Ye||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,..._e,children:[(0,h.jsx)(Z.Z,{variant:"h2",className:nt.label,children:Pe}),st]})}var Se=t(24851);const Ve=(0,l.Z)({description:{wordBreak:"break-word"}});function ze($e,Pe,Ye){if(Pe==="url"||$e.includes("://"))return $e;const _e=Ye.type==="file"?`file://${Ye.target}`:Ye.target;return Pe==="file"||Ye.type==="file"?new URL($e,_e).href:_e}function je($e){var Pe,Ye,_e,it,nt,Xe,st,ht;const{entity:Oe}=$e,le=Ve(),Ee=Oe.kind.toLocaleLowerCase("en-US")==="system",Ze=Oe.kind.toLocaleLowerCase("en-US")==="resource",pt=Oe.kind.toLocaleLowerCase("en-US")==="component",yt=Oe.kind.toLocaleLowerCase("en-US")==="api",Et=Oe.kind.toLocaleLowerCase("en-US")==="template",at=Oe.kind.toLocaleLowerCase("en-US")==="location",bt=Oe.kind.toLocaleLowerCase("en-US")==="group",Ct=(0,x.hF)(Oe,n.cz,{kind:"system"}),Tt=(0,x.hF)(Oe,n.cz,{kind:"component"}),qt=(0,x.hF)(Oe,n.cz,{kind:"domain"}),_t=(0,x.hF)(Oe,n.S4);let Vt;try{Vt=(0,n.CV)(Oe)}catch{Vt=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(ne,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(Z.Z,{variant:"body2",paragraph:!0,className:le.description,children:(Oe==null||(Pe=Oe.metadata)===null||Pe===void 0?void 0:Pe.description)||"No description"})}),(0,h.jsx)(ne,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,h.jsx)(x.rI,{entityRefs:_t,defaultKind:"group"})}),(Ee||qt.length>0)&&(0,h.jsx)(ne,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:qt.length>0&&(0,h.jsx)(x.rI,{entityRefs:qt,defaultKind:"domain"})}),(yt||pt||Ze||Ct.length>0)&&(0,h.jsx)(ne,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Ct.length>0&&(0,h.jsx)(x.rI,{entityRefs:Ct,defaultKind:"system"})}),pt&&Tt.length>0&&(0,h.jsx)(ne,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(x.rI,{entityRefs:Tt,defaultKind:"component"})}),(yt||pt||Ze||Et||bt||at||typeof(Oe==null||(Ye=Oe.spec)===null||Ye===void 0?void 0:Ye.type)=="string")&&(0,h.jsx)(ne,{label:"Type",value:Oe==null||(_e=Oe.spec)===null||_e===void 0?void 0:_e.type,gridSizes:{xs:12,sm:6,lg:4}}),(yt||pt||typeof(Oe==null||(it=Oe.spec)===null||it===void 0?void 0:it.lifecycle)=="string")&&(0,h.jsx)(ne,{label:"Lifecycle",value:Oe==null||(nt=Oe.spec)===null||nt===void 0?void 0:nt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(ne,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Oe==null||(Xe=Oe.metadata)===null||Xe===void 0?void 0:Xe.tags)||[]).map(Jt=>(0,h.jsx)(T.Z,{size:"small",label:Jt},Jt))}),at&&((Oe==null||(st=Oe.spec)===null||st===void 0?void 0:st.targets)||(Oe==null||(ht=Oe.spec)===null||ht===void 0?void 0:ht.target))&&(0,h.jsx)(ne,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Se.s,{cols:1,items:(Oe.spec.targets||[Oe.spec.target]).map(Jt=>Jt).map(Jt=>{var nn;return{text:Jt,href:ze(Jt,(Oe==null||(nn=Oe.spec)===null||nn===void 0?void 0:nn.type)||"unknown",Vt)}})})})]})}const He=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ut($e){var Pe,Ye,_e;const{variant:it}=$e,nt=He(),{entity:Xe}=(0,x.X2)(),st=(0,P.h_)(W.q3),ht=(0,P.h_)(x.Ah),Oe=(0,P.h_)(P.$v),le=(0,P.tg)(k.jU),Ee=(0,x.CV)(Xe,st),Ze=(Pe=Xe.metadata.annotations)===null||Pe===void 0?void 0:Pe[n.Tf],pt={label:"View Source",disabled:!Ee,icon:(0,h.jsx)(W.nW,{type:Ee==null?void 0:Ee.integrationType}),href:Ee==null?void 0:Ee.locationTargetUrl},yt={label:"View TechDocs",disabled:!(!((Ye=Xe.metadata.annotations)===null||Ye===void 0)&&Ye["backstage.io/techdocs-ref"])||!le,icon:(0,h.jsx)(J.Z,{}),href:le&&le({namespace:Xe.metadata.namespace||n.zG,kind:Xe.kind,name:Xe.metadata.name})};let Et="";it==="gridItem"?Et=nt.gridItemCard:it==="fullHeight"&&(Et=nt.fullHeightCard);let at="";it==="gridItem"?at=nt.gridItemCardContent:it==="fullHeight"&&(at=nt.fullHeightCardContent);const bt=(_e=Xe.metadata.annotations)===null||_e===void 0?void 0:_e[n.P1],Ct=(bt==null?void 0:bt.startsWith("url:"))||(bt==null?void 0:bt.startsWith("file:")),Tt=(0,ue.useCallback)(async()=>{await ht.refreshEntity((0,n.eE)(Xe)),Oe.post({message:"Refresh scheduled",severity:"info"})},[ht,Oe,Xe]);return(0,h.jsxs)(O.Z,{className:Et,children:[(0,h.jsx)(re.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ct&&(0,h.jsx)(q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Tt,children:(0,h.jsx)(X.Z,{})}),(0,h.jsx)(q.Z,{component:v.rU,"aria-label":"Edit",disabled:!Ze,title:"Edit Metadata",to:Ze!=null?Ze:"#",children:(0,h.jsx)(he.Z,{})})]}),subheader:(0,h.jsx)(v.M6,{links:[pt,yt]})}),(0,h.jsx)(_.Z,{}),(0,h.jsx)(M.Z,{className:at,children:(0,h.jsx)(je,{entity:Xe})})]})}},79324:function(wt,De,t){"use strict";t.d(De,{K:function(){return X}});var h=t(52322),n=t(2784),v=t(79692),P=t(12420),W=t(97580),x=t(73698),l=t(74603),O=t(12231),re=t(43297),q=t(64279),_=t(25248);const M=(0,v.Z)(J=>(0,P.Z)({root:{...J.typography.h4}}));function X(J){const{initialFilter:he="component",allowedKinds:ue}=J,k=M(),L=(0,_.h_)(re.Ah),{value:Z}=(0,q.default)(async()=>await L.getEntityFacets({facets:["kind"]}).then($e=>{var Pe;return((Pe=$e.facets.kind)===null||Pe===void 0?void 0:Pe.map(Ye=>Ye.value).sort())||[]})),{filters:T,updateFilters:R,queryParameters:{kind:ne}}=(0,re.wp)(),Se=(0,n.useMemo)(()=>{var $e;return($e=[ne].flat()[0])===null||$e===void 0?void 0:$e.toLocaleLowerCase("en-US")},[ne]),[Ve,ze]=(0,n.useState)(Se!=null?Se:he);(0,n.useEffect)(()=>{var $e;if(!(($e=T.kind)===null||$e===void 0)&&$e.value){var Pe;ze((Pe=T.kind)===null||Pe===void 0?void 0:Pe.value)}},[T.kind]),(0,n.useEffect)(()=>{R({kind:Ve?new re.zo(Ve):void 0})},[Ve,R]),(0,n.useEffect)(()=>{Se&&ze(Se)},[Se]);var je;const ut=[(0,W.Z)(Ve)].concat((je=Z==null?void 0:Z.filter($e=>ue?ue.some(Pe=>Pe.toLocaleLowerCase("en-US")===$e.toLocaleLowerCase("en-US")):!0))!==null&&je!==void 0?je:[]).sort().reduce(($e,Pe)=>($e[Pe.toLocaleLowerCase("en-US")]=Pe,$e),{});return(0,h.jsx)(x.Z,{input:(0,h.jsx)(l.Z,{value:Ve}),value:Ve,onChange:$e=>ze($e.target.value),classes:k,children:Object.keys(ut).map($e=>(0,h.jsx)(O.Z,{value:$e,children:`${ut[$e]}s`},$e))})}},86359:function(wt,De,t){"use strict";t.d(De,{E:function(){return ue}});var h=t(52322),n=t(25271),v=t(71399),P=t(43297),W=t(90436),x=t(15459),l=t(27604),O=t(2997),re=t(11640),q=t(28347),_=t(76635),M=t(2784),X=t(7089);const J=Object.freeze({createNameColumn(k){function L(Z){var T;return((T=Z.metadata)===null||T===void 0?void 0:T.title)||(0,P.$3)(Z,{defaultKind:k==null?void 0:k.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:Z},{entity:T}){return L(Z).localeCompare(L(T))},render:({entity:Z})=>{var T;return(0,h.jsx)(P.dx,{entityRef:Z,defaultKind:(k==null?void 0:k.defaultKind)||"Component",title:(T=Z.metadata)===null||T===void 0?void 0:T.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:k})=>(0,h.jsx)(P.rI,{entityRefs:k.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:k})=>(0,h.jsx)(P.rI,{entityRefs:k.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:k})=>{var L,Z;return(0,h.jsx)(h.Fragment,{children:((k==null||(L=k.spec)===null||L===void 0?void 0:L.targets)||(k==null||(Z=k.spec)===null||Z===void 0?void 0:Z.target))&&(0,h.jsx)(v.Or,{text:(k.spec.targets||[k.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:k})=>(0,h.jsx)(v.Or,{text:k.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:k})=>(0,h.jsx)(h.Fragment,{children:k.metadata.tags&&k.metadata.tags.map(L=>(0,h.jsx)(X.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(k){return{title:"Title",field:"entity.metadata.title",hidden:k==null?void 0:k.hidden,searchable:!0}},createLabelColumn(k,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>{var T;const R=(T=Z.metadata)===null||T===void 0?void 0:T.labels,ne=R&&R[k]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:ne&&(0,h.jsx)(X.Z,{label:ne,size:"small",variant:"outlined"},ne)})},width:"auto"}}}),he=(0,x.Z)({root:{color:"#f3ba37"}})(re.Z),ue=k=>{var L,Z;const{columns:T,actions:R,tableOptions:ne,subtitle:Se}=k,{isStarredEntity:Ve,toggleStarredEntity:ze}=(0,P.CR)(),{loading:je,error:He,entities:ut,filters:$e}=(0,P.wp)(),Pe=(0,M.useMemo)(()=>{var Oe;return[J.createTitleColumn({hidden:!0}),J.createNameColumn({defaultKind:(Oe=$e.kind)===null||Oe===void 0?void 0:Oe.value}),...le(),J.createMetadataDescriptionColumn(),J.createTagsColumn()];function le(){var Ee;switch((Ee=$e.kind)===null||Ee===void 0?void 0:Ee.value){case"user":return[];case"domain":case"system":return[J.createOwnerColumn()];case"group":case"template":return[J.createSpecTypeColumn()];case"location":return[J.createSpecTypeColumn(),J.createSpecTargetsColumn()];default:return[J.createSystemColumn(),J.createOwnerColumn(),J.createSpecTypeColumn(),J.createSpecLifecycleColumn()]}}},[(L=$e.kind)===null||L===void 0?void 0:L.value]),Ye=$e.type===void 0;var _e;const it=(0,_.capitalize)((_e=(Z=$e.user)===null||Z===void 0?void 0:Z.value)!==null&&_e!==void 0?_e:"all");if(He)return(0,h.jsx)("div",{children:(0,h.jsx)(v.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(v.Oi,{language:"text",text:He.toString()})})});const nt=[({entity:Oe})=>{var le;const Ee=(le=Oe.metadata.annotations)===null||le===void 0?void 0:le[n.l2],Ze="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ze}),(0,h.jsx)(O.Z,{fontSize:"small"})]}),tooltip:Ze,disabled:!Ee,onClick:()=>{!Ee||window.open(Ee,"_blank")}}},({entity:Oe})=>{var le;const Ee=(le=Oe.metadata.annotations)===null||le===void 0?void 0:le[n.Tf],Ze="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ze}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Ze,disabled:!Ee,onClick:()=>{!Ee||window.open(Ee,"_blank")}}},({entity:Oe})=>{const le=Ve(Oe),Ee=le?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ee}),le?(0,h.jsx)(he,{}):(0,h.jsx)(q.Z,{})]}),tooltip:Ee,onClick:()=>ze(Oe)}}],Xe=ut.map(Oe=>{const le=(0,P.hF)(Oe,n.cz,{kind:"system"}),Ee=(0,P.hF)(Oe,n.S4);return{entity:Oe,resolved:{name:(0,P.$3)(Oe,{defaultKind:"Component"}),ownedByRelationsTitle:Ee.map(Ze=>(0,P.$3)(Ze,{defaultKind:"group"})).join(", "),ownedByRelations:Ee,partOfSystemRelationTitle:le.map(Ze=>(0,P.$3)(Ze,{defaultKind:"system"})).join(", "),partOfSystemRelations:le}}}),st=(T||Pe).find(Oe=>Oe.title==="Type");st&&(st.hidden=!Ye);const ht=Xe.length>20;return(0,h.jsx)(v.iA,{isLoading:je,columns:T||Pe,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!je,padding:"dense",pageSizeOptions:[20,50,100],...ne},title:`${it} (${ut.length})`,data:Xe,actions:R||nt,subtitle:Se})};ue.columns=J},24851:function(wt,De,t){"use strict";t.d(De,{s:function(){return he}});var h=t(52322),n=t(90348),v=t(11861),P=t(2784),W=t(79692),x=t(95544),l=t(90436),O=t(52160),re=t(71399);const q=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function _(ue){const{href:k,text:L,Icon:Z}=ue,T=q();return(0,h.jsxs)(x.Z,{display:"flex",children:[(0,h.jsx)(x.Z,{mr:1,className:T.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:Z?(0,h.jsx)(Z,{}):(0,h.jsx)(O.Z,{})})}),(0,h.jsx)(x.Z,{flexGrow:"1",children:(0,h.jsx)(re.rU,{to:k,target:"_blank",rel:"noopener",children:L||k})})]})}var M=t(41156);const X={xs:1,sm:1,md:1,lg:2,xl:3};function J(ue){const k=[(0,M.Z)(R=>R.breakpoints.up("xl"))?"xl":null,(0,M.Z)(R=>R.breakpoints.up("lg"))?"lg":null,(0,M.Z)(R=>R.breakpoints.up("md"))?"md":null,(0,M.Z)(R=>R.breakpoints.up("sm"))?"sm":null,(0,M.Z)(R=>R.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof ue=="number")L=ue;else{var Z;const R=(Z=k.find(ne=>ne!==null))!==null&&Z!==void 0?Z:"xs";var T;L=(T=ue==null?void 0:ue[R])!==null&&T!==void 0?T:X[R]}return L}function he(ue){const{items:k,cols:L=void 0}=ue,Z=J(L);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:Z,children:k.map(({text:T,href:R,Icon:ne},Se)=>(0,h.jsx)(v.Z,{children:(0,h.jsx)(_,{href:R,text:T!=null?T:R,Icon:ne})},Se))})}},19625:function(wt,De,t){"use strict";t.d(De,{_Z:function(){return P},jU:function(){return v},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),v=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),P=(0,h.NT)({id:"catalog"})},51666:function(wt,De,t){"use strict";t.d(De,{rG:function(){return h},Y2:function(){return Z},J$:function(){return re},g2:function(){return v}});var h;(function(T){T.DENY="DENY",T.ALLOW="ALLOW",T.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(T,R){return T.name===R.name}function v(T,R){return"resourceType"in T?!R||T.resourceType===R:!1}function P(T){return T.attributes.action==="create"}function W(T){return T.attributes.action==="read"}function x(T){return T.attributes.action==="update"}function l(T){return T.attributes.action==="delete"}function O(T){return{authorize:async(R,ne)=>await T.authorize(R,ne),authorizeConditional(R,ne){const Se=R;return T.authorize(Se,ne)}}}function re({name:T,attributes:R,resourceType:ne}){return ne?{type:"resource",name:T,attributes:R,resourceType:ne}:{type:"basic",name:T,attributes:R}}var q=t(23054),_=t(96279),M=t.n(_),X=t(9571),J=t(30195);const he=J.z.lazy(()=>J.z.object({rule:J.z.string(),resourceType:J.z.string(),params:J.z.record(J.z.any())}).or(J.z.object({anyOf:J.z.array(he).nonempty()})).or(J.z.object({allOf:J.z.array(he).nonempty()})).or(J.z.object({not:he}))),ue=J.z.object({result:J.z.literal(h.ALLOW).or(J.z.literal(h.DENY))}),k=J.z.union([J.z.object({result:J.z.literal(h.ALLOW).or(J.z.literal(h.DENY))}),J.z.object({result:J.z.literal(h.CONDITIONAL),pluginId:J.z.string(),resourceType:J.z.string(),conditions:he})]),L=(T,R)=>J.z.object({items:J.z.array(J.z.intersection(J.z.object({id:J.z.string()}),T)).refine(ne=>ne.length===R.size&&ne.every(({id:Se})=>R.has(Se)),{message:"Items in response do not match request"})});class Z{async authorize(R,ne){return this.makeRequest(R,ue,ne)}async authorizeConditional(R,ne){return this.makeRequest(R,k,ne)}async makeRequest(R,ne,Se){if(!this.enabled)return R.map(Pe=>({result:h.ALLOW}));const Ve={items:R.map(Pe=>({id:X.Z(),...Pe}))},ze=await this.discovery.getBaseUrl("permission"),je=await M()(`${ze}/authorize`,{method:"POST",body:JSON.stringify(Ve),headers:{...this.getAuthorizationHeader(Se==null?void 0:Se.token),"content-type":"application/json"}});if(!je.ok)throw await q.VL.fromResponse(je);const He=await je.json(),$e=L(ne,new Set(Ve.items.map(({id:Pe})=>Pe))).parse(He).items.reduce((Pe,Ye)=>(Pe[Ye.id]=Ye,Pe),{});return Ve.items.map(Pe=>$e[Pe.id])}getAuthorizationHeader(R){return R?{Authorization:`Bearer ${R}`}:{}}constructor(R){this.discovery=R.discovery;var ne;this.enabled=(ne=R.config.getOptionalBoolean("permission.enabled"))!==null&&ne!==void 0?ne:!1}}},25488:function(wt,De,t){"use strict";t.d(De,{iM:function(){return x},RV:function(){return P},gI:function(){return O}});var h=t(52322),n=t(2784),v=t(25248);const P=(0,v.T0)({id:"plugin.permission.api"});var W=t(51666);class x{static create(M){const{config:X,discovery:J,identity:he}=M,ue=new W.Y2({discovery:J,config:X});return new x(ue,he)}async authorize(M){return(await this.permissionClient.authorize([M],await this.identityApi.getCredentials()))[0]}constructor(M,X){this.permissionClient=M,this.identityApi=X}}var l=t(49857);function O(_){const M=(0,v.h_)(P),{data:X,error:J}=(0,l.ZP)(_,async he=>{if((0,W.g2)(he.permission)&&!he.resourceRef)return W.rG.DENY;const{result:ue}=await M.authorize(he);return ue});return J?{error:J,loading:!1,allowed:!1}:X===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:X===W.rG.ALLOW}}const re=_=>{const{permission:M,resourceRef:X,errorComponent:J,...he}=_,ue=usePermission(isResourcePermission(M)?{permission:M,resourceRef:X}:{permission:M}),k=useApp(),{NotFoundErrorPage:L}=k.getComponents();let Z=J===void 0?_jsx(L,{}):J;return ue.loading?Z=null:ue.allowed&&(Z=_.element),_jsx(Route,{...he,element:Z})};function q(_){const{permission:M,resourceRef:X}=_,J=usePermission(isResourcePermission(M)?{permission:M,resourceRef:X}:{permission:M}),he=useApp();if(J.loading)return null;if(J.allowed)return _jsx(_Fragment,{children:_.children});if(_.errorPage)return _jsx(_Fragment,{children:_.errorPage});const{NotFoundErrorPage:ue}=he.getComponents();return _jsx(ue,{})}},60712:function(wt,De,t){"use strict";t.d(De,{FA:function(){return O},qO:function(){return it},Nd:function(){return ze},Rx:function(){return T}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class v{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(C){this.mockedResults=C}}var P=t(52322),W=t(2784),x=t(79692);const l=(0,x.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),O=({text:Y,preTag:C,postTag:g})=>{const $=l(),ee=(0,W.useMemo)(()=>Y.split(new RegExp(`(${C}.+?${g})`)),[g,C,Y]);return(0,P.jsx)(P.Fragment,{children:ee.map((ge,fe)=>ge.includes(C)?(0,P.jsx)("mark",{className:$.highlight,children:ge.replace(new RegExp(`${C}|${g}`,"g"),"")},fe):ge)})};var re=t(48760),q=t(50581),_=t(61837),M=t(74603),X=t(21853),J=t(33375),he=t(76635),ue=t(64279),k=t(1849),L=t(51837);const Z=(0,L.CT)("search-context"),T=()=>{const Y=(0,W.useContext)(Z);if(!Y)throw new Error("useSearch must be used within a SearchContextProvider");const C=Y.atVersion(1);if(!C)throw new Error("No SearchContext v1 found");return C},R=()=>(0,W.useContext)(Z)!==void 0,ne={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Se=(Y=ne)=>{var C,g,$,ee;const ge=(0,h.h_)(n),[fe,Fe]=(0,W.useState)(Y.term),[Je,qe]=(0,W.useState)(Y.types),[ot,lt]=(0,W.useState)(Y.filters),[ct,Rt]=(0,W.useState)(Y.pageLimit),[j,F]=(0,W.useState)(Y.pageCursor),oe=(0,k.Z)(fe),ce=(0,k.Z)(ot),be=(0,ue.default)(()=>ge.query({term:fe,types:Je,filters:ot,pageLimit:ct,pageCursor:j}),[fe,Je,ot,ct,j]),Ie=!be.loading&&!be.error&&((C=be.value)===null||C===void 0?void 0:C.nextPageCursor),Qe=!be.loading&&!be.error&&((g=be.value)===null||g===void 0?void 0:g.previousPageCursor),ft=(0,W.useCallback)(()=>{var gt;F((gt=be.value)===null||gt===void 0?void 0:gt.nextPageCursor)},[($=be.value)===null||$===void 0?void 0:$.nextPageCursor]),et=(0,W.useCallback)(()=>{var gt;F((gt=be.value)===null||gt===void 0?void 0:gt.previousPageCursor)},[(ee=be.value)===null||ee===void 0?void 0:ee.previousPageCursor]);return(0,W.useEffect)(()=>{oe!==void 0&&fe!==oe&&F(void 0)},[fe,oe,F]),(0,W.useEffect)(()=>{ce!==void 0&&!(0,he.isEqual)(ot,ce)&&F(void 0)},[ot,ce,F]),{result:be,term:fe,setTerm:Fe,types:Je,setTypes:qe,filters:ot,setFilters:lt,pageLimit:ct,setPageLimit:Rt,pageCursor:j,setPageCursor:F,fetchNextPage:Ie?ft:void 0,fetchPreviousPage:Qe?et:void 0}},Ve=Y=>{const{initialState:C,children:g}=Y,$=Se(C);return(0,P.jsx)(h.fC,{attributes:{searchTypes:$.types.sort().join(",")},children:(0,P.jsx)(Z.Provider,{value:(0,L.EI)({1:$}),children:g})})},ze=Y=>{const{initialState:C,inheritParentContextIfAvailable:g,children:$}=Y;return R()&&g?(0,P.jsx)(P.Fragment,{children:$}):(0,P.jsx)(Ve,{initialState:C,children:$})},je=({children:Y})=>{const C=(0,h.z$)(),{term:g}=T();return(0,W.useEffect)(()=>{g&&C.captureEvent("search",g)},[C,g]),(0,P.jsx)(P.Fragment,{children:Y})};function He(Y){return(0,W.forwardRef)((C,g)=>(0,P.jsx)(ze,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(Y,{...C,ref:g})}))}const ut=He((0,W.forwardRef)((Y,C)=>{const{onChange:g,onKeyDown:$=()=>{},onClear:ee=()=>{},onSubmit:ge=()=>{},debounceTime:fe=200,clearButton:Fe=!0,fullWidth:Je=!0,value:qe,placeholder:ot,inputProps:lt={},endAdornment:ct,...Rt}=Y,j=(0,h.h_)(h.Ds),[F,oe]=(0,W.useState)("");(0,W.useEffect)(()=>{oe(mt=>mt!==qe?String(qe):mt)},[qe]),(0,re.Z)(()=>g(F),fe,[F]);const ce=(0,W.useCallback)(mt=>{oe(mt.target.value)},[oe]),be=(0,W.useCallback)(mt=>{$&&$(mt),ge&&mt.key==="Enter"&&ge()},[$,ge]),Ie=(0,W.useCallback)(()=>{g(""),ee&&ee()},[g,ee]),Qe=ot!=null?ot:`Search in ${j.getOptionalString("app.title")||"Backstage"}`,ft=(0,P.jsx)(q.Z,{position:"start",children:(0,P.jsx)(_.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,P.jsx)(X.Z,{})})}),et=(0,P.jsx)(q.Z,{position:"end",children:(0,P.jsx)(_.Z,{"aria-label":"Clear",size:"small",onClick:Ie,children:(0,P.jsx)(J.Z,{})})});return(0,P.jsx)(je,{children:(0,P.jsx)(M.Z,{"data-testid":"search-bar-next",ref:C,value:F,placeholder:Qe,startAdornment:ft,endAdornment:Fe?et:ct,inputProps:{"aria-label":"Search",...lt},fullWidth:Je,onChange:ce,onKeyDown:be,...Rt})})})),$e=He((0,W.forwardRef)((Y,C)=>{const{value:g="",onChange:$,...ee}=Y,{term:ge,setTerm:fe}=T();(0,W.useEffect)(()=>{g&&fe(String(g))},[g,fe]);const Fe=(0,W.useCallback)(Je=>{$?$(Je):fe(Je)},[$,fe]);return(0,P.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,P.jsx)(ut,{...ee,ref:C,value:ge,onChange:Fe})})}));var Pe=t(4614),Ye=t(88013);const it=(Y=>C=>(0,P.jsx)(ze,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(Y,{...C})}))(function(C){const{loading:g,value:$,onChange:ee=()=>{},options:ge=[],getOptionLabel:fe=Ie=>String(Ie),inputPlaceholder:Fe,inputDebounceTime:Je,freeSolo:qe=!0,fullWidth:ot=!0,clearOnBlur:lt=!1,"data-testid":ct="search-autocomplete",...Rt}=C,{setTerm:j}=T(),F=(0,W.useCallback)(Ie=>Ie?typeof Ie=="string"?Ie:fe(Ie):"",[fe]),oe=(0,W.useMemo)(()=>F($),[$,F]),ce=(0,W.useCallback)((Ie,Qe,ft,et)=>{j(F(Qe)),ee(Ie,Qe,ft,et)},[F,j,ee]),be=(0,W.useCallback)(({InputProps:{ref:Ie,endAdornment:Qe},InputLabelProps:ft,...et})=>(0,P.jsx)($e,{...et,ref:Ie,clearButton:!1,value:oe,placeholder:Fe,debounceTime:Je,endAdornment:g?(0,P.jsx)(Pe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Qe}),[g,oe,Fe,Je]);return(0,P.jsx)(Ye.ZP,{...Rt,"data-testid":ct,value:$,onChange:ce,options:ge,getOptionLabel:fe,renderInput:be,freeSolo:qe,fullWidth:ot,clearOnBlur:lt})}),nt=({icon:Y,primaryText:C,primaryTextTypographyProps:g,secondaryText:$,secondaryTextTypographyProps:ee,disableTextTypography:ge})=>_jsxs(_Fragment,{children:[Y?_jsx(ListItemIcon,{children:Y}):null,_jsx(ListItemText,{primary:C,primaryTypographyProps:g,secondary:$,secondaryTypographyProps:ee,disableTypography:ge})]});var Xe=t(42494),st=t(84899),ht=t(5806),Oe=t(21324),le=t(56939),Ee=t(73698),Ze=t(12231),pt=t(86619),yt=t(7089),Et=t(69294);const at=(Y,C,g=[],$=250)=>{const ee=(0,W.useRef)({}),ge=Y||(()=>Promise.resolve([])),[fe,Fe]=(0,Et.default)(ge,[C],{loading:!0});if((0,re.Z)(()=>{ee.current[C]===void 0&&(ee.current[C]=Fe(C).then(qe=>(ee.current[C]=qe,qe)))},$,[Fe,C]),g.length)return{loading:!1,value:g};const Je=ee.current[C];return Array.isArray(Je)?{loading:!1,value:Je}:fe},bt=(Y,C)=>{const{setFilters:g}=T();(0,W.useEffect)(()=>{C&&[C].flat().length>0&&g($=>({...$,[Y]:C}))},[])},Ct=Y=>{const{className:C,defaultValue:g,name:$,values:ee,valuesDebounceMs:ge,label:fe,filterSelectedOptions:Fe,limitTags:Je,multiple:qe}=Y,[ot,lt]=(0,W.useState)("");bt($,g);const ct=typeof ee=="function"?ee:void 0,Rt=typeof ee=="function"?void 0:ee,{value:j,loading:F}=at(ct,ot,Rt,ge),{filters:oe,setFilters:ce}=T(),be=oe[$]||(qe?[]:null),Ie=(et,mt)=>{ce(gt=>{const{[$]:At,...Ut}=gt;return mt?{...Ut,[$]:mt}:{...Ut}})},Qe=et=>(0,P.jsx)(pt.Z,{...et,name:"search",variant:"outlined",label:fe,fullWidth:!0}),ft=(et,mt)=>et.map((gt,At)=>(0,P.jsx)(yt.Z,{label:gt,color:"primary",...mt({index:At})}));return(0,P.jsx)(Ye.ZP,{filterSelectedOptions:Fe,limitTags:Je,multiple:qe,className:C,id:`${qe?"multi-":""}select-filter-${$}--select`,options:j||[],loading:F,value:be,onChange:Ie,onInputChange:(et,mt)=>lt(mt),renderInput:Qe,renderTags:ft})},Tt=(0,x.Z)({label:{textTransform:"capitalize"}}),qt=Y=>{const{className:C,defaultValue:g,label:$,name:ee,values:ge=[],valuesDebounceMs:fe}=Y,Fe=Tt(),{filters:Je,setFilters:qe}=T();bt(ee,g);const ot=typeof ge=="function"?ge:void 0,lt=typeof ge=="function"?void 0:ge,{value:ct=[],loading:Rt}=at(ot,"",lt,fe),j=oe=>{const{target:{value:ce,checked:be}}=oe;qe(Ie=>{const{[ee]:Qe,...ft}=Ie,et=(Qe||[]).filter(gt=>gt!==ce),mt=be?[...et,ce]:et;return mt.length?{...ft,[ee]:mt}:ft})};var F;return(0,P.jsxs)(Xe.Z,{className:C,disabled:Rt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[$?(0,P.jsx)(st.Z,{className:Fe.label,children:$}):null,ct.map(oe=>(0,P.jsx)(ht.Z,{control:(0,P.jsx)(Oe.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":oe},value:oe,name:oe,onChange:j,checked:((F=Je[ee])!==null&&F!==void 0?F:[]).includes(oe)}),label:oe},oe))]})},_t=Y=>{const{className:C,defaultValue:g,label:$,name:ee,values:ge,valuesDebounceMs:fe}=Y,Fe=Tt();bt(ee,g);const Je=typeof ge=="function"?ge:void 0,qe=typeof ge=="function"?void 0:ge,{value:ot=[],loading:lt}=at(Je,"",qe,fe),{filters:ct,setFilters:Rt}=T(),j=F=>{const{target:{value:oe}}=F;Rt(ce=>{const{[ee]:be,...Ie}=ce;return oe?{...Ie,[ee]:oe}:Ie})};return(0,P.jsxs)(Xe.Z,{disabled:lt,className:C,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[$?(0,P.jsx)(le.Z,{className:Fe.label,margin:"dense",children:$}):null,(0,P.jsxs)(Ee.Z,{variant:"outlined",value:ct[ee]||"",onChange:j,children:[(0,P.jsx)(Ze.Z,{value:"",children:(0,P.jsx)("em",{children:"All"})}),ot.map(F=>(0,P.jsx)(Ze.Z,{value:F,children:F},F))]})]})},Vt=({component:Y,...C})=>(0,P.jsx)(Y,{...C});Vt.Checkbox=Y=>(0,P.jsx)(Vt,{...Y,component:qt}),Vt.Select=Y=>(0,P.jsx)(Vt,{...Y,component:_t}),Vt.Autocomplete=Y=>(0,P.jsx)(Vt,{...Y,component:Ct});var Jt=t(71399);const nn=Y=>{const{children:C}=Y,$=useSearch().result;return C($)},Qt=Y=>{const{query:C,children:g}=Y,$=useApi(searchApiRef),ee=useAsync(()=>{const{term:ge="",types:fe=[],filters:Fe={},...Je}=C;return $.query({...Je,term:ge,types:fe,filters:Fe})},[C]);return g(ee)},wn=Y=>{const{query:C,children:g}=Y;return C?_jsx(Qt,{query:C,children:g}):_jsx(nn,{children:g})},rn=Y=>{const{query:C,children:g}=Y;return _jsx(wn,{query:C,children:({loading:$,error:ee,value:ge})=>$?_jsx(Progress,{}):ee?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ee}):ge!=null&&ge.results.length?g(ge):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Cn=Y=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(rn,{...Y})}),on=(0,x.Z)(Y=>({root:{display:"flex",justifyContent:"space-between",gap:Y.spacing(2),margin:Y.spacing(2,0)}})),Mn=()=>{const{fetchNextPage:Y,fetchPreviousPage:C}=useSearch(),g=on();return!Y&&!C?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:g.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!C,onClick:C,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!Y,onClick:Y,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Wt=({result:Y,highlight:C,rank:g,icon:$,secondaryAction:ee,lineClamp:ge=5})=>{const fe=useAnalytics(),Fe=()=>{fe.captureEvent("discover",Y.title,{attributes:{to:Y.location},value:g})};return _jsxs(Link,{noTrack:!0,to:Y.location,onClick:Fe,children:[_jsxs(ListItem,{alignItems:"center",children:[$&&_jsx(ListItemIcon,{children:$}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:C!=null&&C.fields.title?_jsx(HighlightedSearchResultText,{text:C.fields.title,preTag:C.preTag,postTag:C.postTag}):Y.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ge,overflow:"hidden"},children:C!=null&&C.fields.text?_jsx(HighlightedSearchResultText,{text:C.fields.text,preTag:C.preTag,postTag:C.postTag}):Y.text})}),ee&&_jsx(Box,{alignItems:"flex-end",children:ee})]}),_jsx(Divider,{})]})},jn=Y=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Wt,{...Y})}),En=Y=>{const{loading:C,error:g,resultItems:$,renderResultItem:ee=Fe=>_jsx(DefaultResultListItem,{result:Fe.document},Fe.document.location),noResultsComponent:ge=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...fe}=Y;return _jsxs(List,{...fe,children:[C?_jsx(Progress,{}):null,!C&&g?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:g}):null,!C&&!g&&($==null?void 0:$.length)?$.map(ee):null,!C&&!g&&!($!=null&&$.length)?_jsx(ListItem,{children:ge}):null]})},Ft=Y=>{const{query:C,disableRenderingWithNoResults:g,...$}=Y;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:C,children:({loading:ee,error:ge,value:fe})=>{var Fe;return!(!(fe==null||(Fe=fe.results)===null||Fe===void 0)&&Fe.length)&&g?null:_jsx(En,{...$,loading:ee,error:ge,resultItems:fe==null?void 0:fe.results})}})})};var an=t(19126);const sn=(0,x.Z)(Y=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:Y.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:Y.palette.text.secondary,margin:Y.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:Y.palette.text.secondary,margin:Y.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:Y.spacing(.5)}})),ln=Y=>{const C=sn(),{label:g,children:$,...ee}=Y;return _jsx(Chip,{...ee,className:C.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[g,": ",$]})})},An=()=>null,cn=(0,x.Z)(Y=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:Y.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:Y.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),ve=Y=>{const C=cn(),{label:g,value:$="None",onChange:ee,onDelete:ge}=Y,fe=useCallback(Fe=>{ee(Fe.target.value)},[ee]);return _jsx(ln,{label:g,onDelete:ge,children:_jsx(Typography,{role:"textbox",component:"span",className:C.root,onChange:fe,contentEditable:!0,suppressContentEditableWarning:!0,children:$})})},te=(0,x.Z)(Y=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:Y.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Te=Y=>{const C=te(),{label:g,value:$="none",onChange:ee,onDelete:ge,children:fe}=Y,Fe=useCallback(Je=>{ee(Je.target.value)},[ee]);return _jsx(ln,{label:g,onDelete:ge,children:_jsxs(Select,{className:C.root,value:$,onChange:Fe,input:_jsx(InputBase,{}),IconComponent:An,children:[_jsx(MenuItem,{value:"none",children:"None"}),fe]})})};function Be(Y){const C=sn(),[g,$]=useState(null),{loading:ee,error:ge,icon:fe,title:Fe,titleProps:Je={},link:qe=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:C.listSubheaderLinkIcon})]}),linkProps:ot={},filterOptions:lt,renderFilterOption:ct=et=>_jsx(MenuItem,{value:String(et),children:et},String(et)),filterFields:Rt,renderFilterField:j,resultItems:F,renderResultItem:oe=et=>_jsx(DefaultResultListItem,{result:et.document},et.document.location),noResultsComponent:ce=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...be}=Y,Ie=useCallback(et=>{$(et.currentTarget)},[]),Qe=useCallback(()=>{$(null)},[]);var ft;return _jsxs(List,{...be,children:[_jsxs(ListSubheader,{className:C.listSubheader,children:[fe,_jsx(Typography,{className:C.listSubheaderName,component:"strong",...Je,children:Fe}),lt?_jsx(Chip,{className:C.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Ie}):null,lt?_jsx(Menu,{id:"filters-menu",anchorEl:g,open:Boolean(g),onClose:Qe,onClick:Qe,keepMounted:!0,children:lt.map(ct)}):null,Rt==null?void 0:Rt.map(et=>(ft=j==null?void 0:j(et))!==null&&ft!==void 0?ft:null),_jsx(Link,{className:C.listSubheaderLink,to:"/search",...ot,children:qe})]}),ee?_jsx(Progress,{}):null,!ee&&ge?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ge}):null,!ee&&!ge&&(F==null?void 0:F.length)?F.map(oe):null,!ee&&!ge&&!(F!=null&&F.length)?_jsx(ListItem,{children:ce}):null]})}function Ke(Y){const{query:C,linkProps:g={},disableRenderingWithNoResults:$,...ee}=Y,ge=`/search?${qs.stringify({query:C.term,types:C.types,filters:C.filters,pageCursor:C.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:C,children:({loading:fe,error:Fe,value:Je})=>{var qe;if(!(!(Je==null||(qe=Je.results)===null||qe===void 0)&&qe.length)&&$)return null;var ot;return _jsx(Be,{...ee,loading:fe,error:Fe,linkProps:{to:ge,...g},resultItems:Je==null?void 0:Je.results,filterFields:Object.keys((ot=C.filters)!==null&&ot!==void 0?ot:{})})}})})}},61886:function(wt,De,t){"use strict";t.d(De,{Ox:function(){return Pe},Zz:function(){return x},oZ:function(){return ze},DR:function(){return l},ZS:function(){return Se},VA:function(){return it},KY:function(){return re},gT:function(){return J},Dl:function(){return he},ux:function(){return _e},$L:function(){return X},x1:function(){return Ve}});var h=t(52322),n=t(2784),v=t(10289),P=t(25248);const W="techdocs.addons.addon.v1",x="techdocs.addons.wrapper.v1",l=()=>null;(0,P.R5)(l,x,!0);const O=le=>`${W}.${le.toLocaleLowerCase("en-US")}`;function re(le){const{name:Ee,component:Ze}=le;return(0,P.YO)({name:Ee,component:{sync:pt=>(0,h.jsx)(Ze,{...pt})},data:{[W]:le,[O(Ee)]:!0}})}const q=(le,Ee)=>le.selectByComponentData({key:Ee}).getElements()[0],_=le=>le.selectByComponentData({key:x}).selectByComponentData({key:W}),M=le=>le.selectByComponentData({key:x}).findComponentData({key:W}),X=()=>{const le=(0,v.pC)(),Ee=(0,P.vJ)(le,_),Ze=(0,P.vJ)(le,M),pt=(0,n.useCallback)(at=>{if(!Ee||!at)return null;const bt=O(at.name);var Ct;return(Ct=q(Ee,bt))!==null&&Ct!==void 0?Ct:null},[Ee]),yt=(0,n.useCallback)(at=>{const bt=Ze.find(Ct=>Ct.name===at);return bt?pt(bt):null},[Ze,pt]),Et=(0,n.useCallback)(at=>{const bt=Ze.filter(Ct=>Ct.location===at);return bt.length?bt.map(pt):null},[Ze,pt]);return{renderComponentByName:yt,renderComponentsByLocation:Et}},J=(0,P.T0)({id:"plugin.techdocs.service"}),he=(0,P.T0)({id:"plugin.techdocs.storageservice"});var ue=t(64279),k=t(25271),L=t(51837);function Z(le,Ee){return Ee.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(le.kind=le.kind.toLocaleLowerCase(),le.name=le.name.toLocaleLowerCase(),le.namespace=le.namespace.toLocaleLowerCase()),le}const T=(le,Ee)=>(0,k.eE)(le)===(0,k.eE)(Ee),R={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ne=(0,L.CT)("techdocs-reader-page-context"),Se=(0,n.memo)(({entityRef:le,children:Ee})=>{const Ze=(0,P.h_)(J),pt=(0,P.h_)(P.Ds),yt=(0,ue.default)(async()=>Ze.getTechDocsMetadata(le),[le]),Et=(0,ue.default)(async()=>Ze.getEntityMetadata(le),[le]),[at,bt]=(0,n.useState)(R.title),[Ct,Tt]=(0,n.useState)(R.subtitle),[qt,_t]=(0,n.useState)(R.shadowRoot),Vt={metadata:yt,entityRef:Z(le,pt),entityMetadata:Et,shadowRoot:qt,setShadowRoot:_t,title:at,setTitle:bt,subtitle:Ct,setSubtitle:Tt},Jt=(0,L.EI)({1:Vt});return(0,h.jsx)(ne.Provider,{value:Jt,children:Ee instanceof Function?Ee(Vt):Ee})},(le,Ee)=>T(le.entityRef,Ee.entityRef)),Ve=()=>{const le=(0,n.useContext)(ne);if(le===void 0)return R;const Ee=le.atVersion(1);if(Ee===void 0)throw new Error("No context found for version 1.");return Ee},ze=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var je=t(70882),He=t(50236),ut=t(19219),$e=t(71399);const Pe="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Ye=le=>{(0,n.useEffect)(()=>{if(!le)return()=>{};const Ee=le.querySelectorAll('head > link[rel="stylesheet"]');var Ze;let pt=(Ze=Ee==null?void 0:Ee.length)!==null&&Ze!==void 0?Ze:0;const yt=new CustomEvent(Pe);if(!pt)return le.dispatchEvent(yt),()=>{};const Et=()=>{--pt===0&&le.dispatchEvent(yt)};return Ee==null||Ee.forEach(at=>{at.addEventListener("load",Et)}),()=>{Ee==null||Ee.forEach(at=>{at.removeEventListener("load",Et)})}},[le])},_e=le=>{const[Ee,Ze]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!le)return()=>{};Ze(!0);const pt=le.style;pt.setProperty("opacity","0");const yt=()=>{Ze(!1),pt.setProperty("opacity","1")};return le.addEventListener(Pe,yt),()=>{le.removeEventListener(Pe,yt)}},[le]),Ee},it=({element:le,onAppend:Ee,children:Ze})=>{const[pt,yt]=(0,n.useState)((0,je.Ue)({...(0,He.Z)(),insertionPoint:void 0}));Ye(le);const Et=_e(le),at=(0,n.useCallback)(bt=>{if(!le||!bt)return;yt((0,je.Ue)({...(0,He.Z)(),insertionPoint:le.querySelector("head")||void 0}));let Ct=bt.shadowRoot;Ct||(Ct=bt.attachShadow({mode:"open"})),Ct.replaceChildren(le),typeof Ee=="function"&&Ee(Ct)},[le,Ee]);return(0,h.jsxs)(h.Fragment,{children:[Et&&(0,h.jsx)($e.Ex,{}),(0,h.jsxs)(ut.ZP,{jss:pt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:at,"data-testid":"techdocs-native-shadowroot"}),Ze]})]})};var nt=t(54073);const Xe=()=>{const{shadowRoot:le}=useTechDocsReaderPage();return le},st=le=>{const Ee=Xe();return Ee?le.map(Ze=>Ee==null?void 0:Ee.querySelectorAll(Ze)).filter(Ze=>Ze.length).map(Ze=>Array.from(Ze)).flat():[]},ht=le=>le.toString()&&le.rangeCount&&le.getRangeAt(0).getBoundingClientRect().top,Oe=(le=0)=>{const Ee=Xe(),[Ze,pt]=useState(null),yt=useMemo(()=>debounce(()=>{const Et=Ee,at=Et.getSelection?Et.getSelection():document.getSelection();at&&ht(at)?pt(at):pt(null)},le),[Ee,pt,le]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>window.document.removeEventListener("selectionchange",yt)),[yt]),Ze}},52943:function(wt,De,t){"use strict";t.r(De),t.d(De,{EmbeddedDocsRouter:function(){return ue},Router:function(){return he},isTechDocsAvailable:function(){return J}});var h=t(52322),n=t(2784),v=t(10289),P=t(43297),W=t(71399),x=t(25271),l=t(89258),O=t(65124),re=t(67896);const q=({entity:k})=>{const L=(0,x.iB)(k);return(0,h.jsxs)(l.I6,{entityRef:L,children:[(0,h.jsx)(O.b,{}),(0,h.jsx)(re.F,{withSearch:!1})]})};var _=t(18662),M=t(7476);const X="backstage.io/techdocs-ref",J=k=>{var L,Z;return Boolean(k==null||(L=k.metadata)===null||L===void 0||(Z=L.annotations)===null||Z===void 0?void 0:Z[X])},he=()=>(0,h.jsxs)(v.Z5,{children:[(0,h.jsx)(v.AW,{path:"/",element:(0,h.jsx)(_.TechDocsIndexPage,{})}),(0,h.jsx)(v.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(M.TechDocsReaderPage,{})})]}),ue=k=>{var L;const{children:Z}=k,{entity:T}=(0,P.X2)(),R=(0,v.V$)([{path:"/*",element:(0,h.jsx)(q,{entity:T}),children:[{path:"*",element:Z}]}]);return((L=T.metadata.annotations)===null||L===void 0?void 0:L[X])?R:(0,h.jsx)(W.sk,{annotation:X})}},92077:function(wt,De,t){"use strict";t.d(De,{k:function(){return W},p:function(){return P}});var h=t(23054),n=t(76372),v=t.n(n);class P{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:O,namespace:re,name:q}=l,M=`${await this.getApiOrigin()}/metadata/techdocs/${re}/${O}/${q}`,X=await this.fetchApi.fetch(`${M}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}async getEntityMetadata(l){const{kind:O,namespace:re,name:q}=l,M=`${await this.getApiOrigin()}/metadata/entity/${re}/${O}/${q}`,X=await this.fetchApi.fetch(`${M}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,O){const{kind:re,namespace:q,name:_}=l,X=`${await this.getStorageUrl()}/${q}/${re}/${_}/${O}`,J=await this.fetchApi.fetch(`${X.endsWith("/")?X:`${X}/`}index.html`);let he="";switch(J.status){case 404:throw he="Page not found. ",O||(he+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(he);case 500:throw he="Could not generate documentation or an error in the TechDocs backend. ",new Error(he);default:break}return J.text()}async syncEntityDocs(l,O=()=>{}){const{kind:re,namespace:q,name:_}=l,X=`${await this.getApiOrigin()}/sync/${q}/${re}/${_}`,{token:J}=await this.identityApi.getCredentials();return new Promise((he,ue)=>{const k=new n.EventSourcePolyfill(X,{withCredentials:!0,headers:J?{Authorization:`Bearer ${J}`}:{}});k.addEventListener("log",L=>{L.data&&O(JSON.parse(L.data))}),k.addEventListener("finish",L=>{let Z=!1;L.data&&({updated:Z}=JSON.parse(L.data)),he(Z?"updated":"cached")}),k.onerror=L=>{switch(k.close(),L.status){case 404:ue(new h.dR(L.message));return;default:ue(new Error(L.data));return}}})}async getBaseUrl(l,O,re){const{kind:q,namespace:_,name:M}=O,J=`${await this.getApiOrigin()}/static/docs/${_}/${q}/${M}/${re}`;return new URL(l,J.endsWith("/")?J:`${J}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(wt,De,t){"use strict";t.d(De,{D:function(){return h}});function h(n,v){return v.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(wt,De,t){"use strict";t.d(De,{u:function(){return O}});var h=t(52322),n=t(2784),v=t(71399),P=t(43297),W=t(42081),x=t(48431),l=t(68435);const O=re=>{const{initialFilter:q="owned",columns:_,actions:M}=re;return(0,h.jsx)(W.j,{children:(0,h.jsxs)(v.VY,{children:[(0,h.jsx)(v.yW,{title:"",children:(0,h.jsx)(v.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(P.UO,{children:(0,h.jsxs)(P._i,{children:[(0,h.jsxs)(P._i.Filters,{children:[(0,h.jsx)(x.f,{}),(0,h.jsx)(P.EW,{initialFilter:q}),(0,h.jsx)(P.dq,{}),(0,h.jsx)(P.xE,{})]}),(0,h.jsx)(P._i.Content,{children:(0,h.jsx)(l.n,{actions:M,columns:_})})]})})]})})}},85478:function(wt,De,t){"use strict";t.d(De,{f:function(){return _}});var h=t(52322),n=t(95573),v=t(51953),P=t(25248),W=t(71399),x=t(94339),l=t(16111),O=t(24579),re=t(14503),q=t(2784);const _=J=>{const{entities:he}=J,ue=(0,P.tg)(n.Fw),k=(0,P.h_)(P.Ds);if(!he)return null;var L,Z;return(0,h.jsx)(W.Oh,{"data-testid":"docs-explore",children:he!=null&&he.length?he.map((T,R)=>(0,h.jsxs)(x.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(W.hu,{title:(L=T.metadata.title)!==null&&L!==void 0?L:T.metadata.name})}),(0,h.jsx)(O.Z,{children:T.metadata.description}),(0,h.jsx)(re.Z,{children:(0,h.jsx)(W.zx,{to:ue({namespace:(0,v.D)((Z=T.metadata.namespace)!==null&&Z!==void 0?Z:"default",k),kind:(0,v.D)(T.kind,k),name:(0,v.D)(T.metadata.name,k)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},R)):null})};var M=t(43297);const X=()=>{const{loading:J,error:he,entities:ue}=useEntityList();if(he)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:he.toString()})});if(J||!ue)return _jsx(Progress,{});var k,L;return ue.sort((Z,T)=>((k=Z.metadata.title)!==null&&k!==void 0?k:Z.metadata.name).localeCompare((L=T.metadata.title)!==null&&L!==void 0?L:T.metadata.name)),_jsx(DocsCardGrid,{entities:ue})}},68435:function(wt,De,t){"use strict";t.d(De,{H:function(){return Z},n:function(){return T}});var h=t(52322),n=t(2784),v=t(95074),P=t(76635),W=t(71399),x=t(43297),l=t(25248),O=t(25271),re=t(95573),q=t(39981),_=t(2337),M=t(11640),X=t(28347);const J=(0,_.Z)({root:{color:"#f3ba37"}})(M.Z),he={createCopyDocsUrlAction(R){return ne=>({icon:()=>(0,h.jsx)(q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>R(`${window.location.origin}${ne.resolved.docsUrl}`)})},createStarEntityAction(R,ne){return({entity:Se})=>{const Ve=R(Se);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ve?(0,h.jsx)(J,{}):(0,h.jsx)(X.Z,{}),tooltip:Ve?"Remove from favorites":"Add to favorites",onClick:()=>ne(Se)}}}};function ue(R){return R.metadata.title||R.metadata.name}const k={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:R=>(0,h.jsx)(W.uw,{value:(0,h.jsx)(W.rU,{to:R.resolved.docsUrl,children:ue(R.entity)}),subvalue:R.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,h.jsx)(x.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const Z=R=>{const{entities:ne,title:Se,loading:Ve,columns:ze,actions:je}=R,[,He]=(0,v.Z)(),ut=(0,l.tg)(re.Fw),$e=(0,l.h_)(l.Ds);if(!ne)return null;const Pe=ne.map(it=>{const nt=(0,x.hF)(it,O.S4);var Xe;return{entity:it,resolved:{docsUrl:ut({namespace:(0,L.D)((Xe=it.metadata.namespace)!==null&&Xe!==void 0?Xe:"default",$e),kind:(0,L.D)(it.kind,$e),name:(0,L.D)(it.metadata.name,$e)}),ownedByRelations:nt,ownedByRelationsTitle:nt.map(st=>(0,x.$3)(st,{defaultKind:"group"})).join(", ")}}}),Ye=[k.createNameColumn(),k.createOwnerColumn(),k.createTypeColumn()],_e=[he.createCopyDocsUrlAction(He)];return(0,h.jsx)(h.Fragment,{children:Ve||Pe&&Pe.length>0?(0,h.jsx)(W.iA,{isLoading:Ve,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Pe,columns:ze||Ye,actions:je||_e,title:Se?`${Se} (${Pe.length})`:`All (${Pe.length})`}):(0,h.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(W.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};Z.columns=k,Z.actions=he;const T=R=>{var ne;const{columns:Se,actions:Ve}=R,{loading:ze,error:je,entities:He,filters:ut}=(0,x.wp)(),{isStarredEntity:$e,toggleStarredEntity:Pe}=(0,x.CR)(),[,Ye]=(0,v.Z)();var _e;const it=(0,P.capitalize)((_e=(ne=ut.user)===null||ne===void 0?void 0:ne.value)!==null&&_e!==void 0?_e:"all"),nt=[he.createCopyDocsUrlAction(Ye),he.createStarEntityAction($e,Pe)];return je?(0,h.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(W.Oi,{language:"text",text:je.toString()})}):(0,h.jsx)(Z,{title:it,entities:He,loading:ze,actions:Ve||nt,columns:Se})};T.columns=k,T.actions=he},18662:function(wt,De,t){"use strict";t.r(De),t.d(De,{TechDocsIndexPage:function(){return W}});var h=t(52322),n=t(2784),v=t(10289),P=t(3482);const W=x=>(0,v.pC)()||(0,h.jsx)(P.u,{...x})},42081:function(wt,De,t){"use strict";t.d(De,{j:function(){return W}});var h=t(52322),n=t(2784),v=t(71399),P=t(25248);const W=x=>{const{children:l}=x,O=(0,P.h_)(P.Ds);var re;const q=`Documentation available in ${(re=O.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Backstage"}`;return(0,h.jsx)(v.g9,{title:"Documentation",subtitle:q,themeId:"documentation",children:l})}},48431:function(wt,De,t){"use strict";t.d(De,{f:function(){return P}});var h=t(2784),n=t(43297);class v{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const P=()=>{const{updateFilters:W}=(0,n.wp)();return(0,h.useEffect)(()=>{W({techdocs:new v})},[W]),null}},89258:function(wt,De,t){"use strict";t.d(De,{I6:function(){return q},Jl:function(){return re},s4:function(){return W}});var h=t(61886),n=t(92077),v=t(95573),P=t(25248);const W=(0,P.rx)({id:"techdocs",apis:[(0,P.ni)({api:h.Dl,deps:{configApi:P.Ds,discoveryApi:P.NW,identityApi:P.$4,fetchApi:P.gP},factory:({configApi:_,discoveryApi:M,identityApi:X,fetchApi:J})=>new n.k({configApi:_,discoveryApi:M,identityApi:X,fetchApi:J})}),(0,P.ni)({api:h.gT,deps:{configApi:P.Ds,discoveryApi:P.NW,fetchApi:P.gP},factory:({configApi:_,discoveryApi:M,fetchApi:X})=>new n.p({configApi:_,discoveryApi:M,fetchApi:X})})],routes:{root:v._Z,docRoot:v.Fw,entityContent:v.pd}}),x=W.provide((0,P.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.Router),mountPoint:v._Z})),l=W.provide((0,P.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.EmbeddedDocsRouter),mountPoint:v.pd})),O=W.provide((0,P.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(_=>_.TechDocsCustomHome),mountPoint:v._Z})),re=W.provide((0,P.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(_=>_.TechDocsIndexPage),mountPoint:v._Z})),q=W.provide((0,P.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(_=>_.TechDocsReaderPage),mountPoint:v.Fw}))},7476:function(wt,De,t){"use strict";t.r(De),t.d(De,{TechDocsReaderLayout:function(){return _},TechDocsReaderPage:function(){return M}});var h=t(52322),n=t(2784),v=t(10289),P=t(71399),W=t(61886),x=t(67896),l=t(93225),O=t(65124),re=t(95573),q=t(25248);const _=({withSearch:X,withHeader:J=!0})=>(0,h.jsxs)(P.T3,{themeId:"documentation",children:[J&&(0,h.jsx)(l.S,{}),(0,h.jsx)(O.b,{}),(0,h.jsx)(x.F,{withSearch:X})]}),M=X=>{const{kind:J,name:he,namespace:ue}=(0,q.Oi)(re.Fw),{children:k,entityRef:L={kind:J,name:he,namespace:ue}}=X,Z=(0,v.pC)();if(!k){const R=(Z?n.Children.toArray(Z.props.children):[]).find(ne=>{var Se;if((0,q.IY)(ne,W.Zz))return!1;const Ve=ne==null||(Se=ne.props)===null||Se===void 0?void 0:Se.children;return Ve?!n.Children.toArray(Ve).some(ze=>(0,q.IY)(ze,W.Zz)):!0});return(0,h.jsx)(W.ZS,{entityRef:L,children:R||(0,h.jsx)(_,{})})}return(0,h.jsx)(W.ZS,{entityRef:L,children:({metadata:T,entityMetadata:R,onReady:ne})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(P.T3,{themeId:"documentation",children:k instanceof Function?k({entityRef:L,techdocsMetadataValue:T.value,entityMetadataValue:R.value,onReady:ne}):k})})})}},67896:function(wt,De,t){"use strict";t.d(De,{F:function(){return ct}});var h=t(52322),n=t(2784),v=t(79692),P=t(60905),W=t(61886),x=t(71399),l=t(17339),O=t(4614),re=t(77277),q=t(99688),_=t(12420),M=t(90436),X=t(61837),J=t(4190),he=t(87685);const ue=(0,v.Z)(j=>(0,_.Z)({paper:{width:"100%",[j.breakpoints.up("sm")]:{width:"75%"},[j.breakpoints.up("md")]:{width:"50%"},padding:j.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:j.palette.background.default}})),k=({buildLog:j,onClose:F})=>{const oe=ue(),ce=j.length===0?"Waiting for logs...":j.join(`
|
|
32
|
-
`);return(0,h.jsxs)(P.Z,{container:!0,direction:"column",className:oe.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(P.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(M.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(X.Z,{title:"Close the drawer",onClick:F,color:"inherit",children:(0,h.jsx)(he.Z,{})},"dismiss")]}),(0,h.jsx)(x.nU,{text:ce,classes:{root:oe.logs}})]})},L=({buildLog:j})=>{const F=ue(),[oe,ce]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(re.Z,{color:"inherit",onClick:()=>ce(!0),children:"Show Build Logs"}),(0,h.jsx)(J.ZP,{classes:{paper:F.paper},anchor:"right",open:oe,onClose:()=>ce(!1),children:(0,h.jsx)(k,{buildLog:j,onClose:()=>ce(!1)})})]})};var Z=t(25248);const T=({errorMessage:j})=>{const F=(0,Z.h_)(Z.Ds).getOptionalString("techdocs.builder");let oe="";return F!=="local"&&(oe="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(x.mf,{status:"404",statusMessage:j||"Documentation not found",additionalInfo:oe})};var R=t(95481);const ne=(0,v.Z)(j=>({root:{marginBottom:j.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Se=()=>{let j=null;const F=ne(),{state:oe,contentReload:ce,contentErrorMessage:be,syncErrorMessage:Ie,buildLog:Qe}=(0,R.DK)();return oe==="INITIAL_BUILD"&&(j=(0,h.jsx)(q.Z,{classes:{root:F.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(O.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Qe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),oe==="CONTENT_STALE_REFRESHING"&&(j=(0,h.jsx)(q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(O.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Qe}),classes:{root:F.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),oe==="CONTENT_STALE_READY"&&(j=(0,h.jsx)(q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(re.Z,{color:"inherit",onClick:()=>ce(),children:"Refresh"}),classes:{root:F.root},children:"A newer version of this documentation is now available, please refresh to view."})),oe==="CONTENT_STALE_ERROR"&&(j=(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Qe}),classes:{root:F.root,message:F.message},children:["Building a newer version of this documentation failed."," ",Ie]})),oe==="CONTENT_NOT_FOUND"&&(j=(0,h.jsxs)(h.Fragment,{children:[Ie&&(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Qe}),classes:{root:F.root,message:F.message},children:["Building a newer version of this documentation failed."," ",Ie]}),(0,h.jsx)(T,{errorMessage:be})]})),j};var Ve=t(10289),ze=t(60364),je=t(41156),He=t(32838),ut=t(35368),$e=t.n(ut);const Pe=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Ye=/^https:\/\/fonts\.googleapis\.com/,_e=/^https:\/\/fonts\.gstatic\.com/,it=j=>j.nodeName==="LINK",nt=j=>{const F=(j==null?void 0:j.getAttribute("href"))||"",oe=F.match(Pe),ce=F.match(Ye),be=F.match(_e);return oe||ce||be},Xe=j=>(it(j)&&!nt(j)&&j.remove(),j),st=j=>j.nodeName==="IFRAME",ht=(j,F)=>{const oe=j.getAttribute("src")||"";try{const{host:ce}=new URL(oe);return F.includes(ce)}catch{return!1}},Oe=j=>F=>(st(F)&&!ht(F,j)&&F.remove(),F),le=()=>{const j=(0,Z.h_)(Z.Ds);return(0,n.useMemo)(()=>j.getOptionalConfig("techdocs.sanitizer"),[j])},Ee=()=>{const j=le();return(0,n.useCallback)(async F=>{const oe=j==null?void 0:j.getOptionalStringArray("allowedIframeHosts");$e().addHook("beforeSanitizeElements",Xe);const ce=["link"];return oe&&(ce.push("iframe"),$e().addHook("beforeSanitizeElements",Oe(oe))),$e().sanitize(F.innerHTML,{ADD_TAGS:ce,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[j])};var Ze=t(41128),pt=({theme:j})=>`
|
|
33
|
-
/*================== Variables ==================*/
|
|
34
|
-
/*
|
|
35
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
36
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
:host {
|
|
40
|
-
/* FONT */
|
|
41
|
-
--md-default-fg-color: ${j.palette.text.primary};
|
|
42
|
-
--md-default-fg-color--light: ${j.palette.text.secondary};
|
|
43
|
-
--md-default-fg-color--lighter: ${(0,Ze.$n)(j.palette.text.secondary,.7)};
|
|
44
|
-
--md-default-fg-color--lightest: ${(0,Ze.$n)(j.palette.text.secondary,.3)};
|
|
45
|
-
|
|
46
|
-
/* BACKGROUND */
|
|
47
|
-
--md-default-bg-color:${j.palette.background.default};
|
|
48
|
-
--md-default-bg-color--light: ${j.palette.background.paper};
|
|
49
|
-
--md-default-bg-color--lighter: ${(0,Ze.$n)(j.palette.background.paper,.7)};
|
|
50
|
-
--md-default-bg-color--lightest: ${(0,Ze.$n)(j.palette.background.paper,.3)};
|
|
51
|
-
|
|
52
|
-
/* PRIMARY */
|
|
53
|
-
--md-primary-fg-color: ${j.palette.primary.main};
|
|
54
|
-
--md-primary-fg-color--light: ${j.palette.primary.light};
|
|
55
|
-
--md-primary-fg-color--dark: ${j.palette.primary.dark};
|
|
56
|
-
--md-primary-bg-color: ${j.palette.primary.contrastText};
|
|
57
|
-
--md-primary-bg-color--light: ${(0,Ze.$n)(j.palette.primary.contrastText,.7)};
|
|
58
|
-
|
|
59
|
-
/* ACCENT */
|
|
60
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
61
|
-
|
|
62
|
-
/* SHADOW */
|
|
63
|
-
--md-shadow-z1: ${j.shadows[1]};
|
|
64
|
-
--md-shadow-z2: ${j.shadows[2]};
|
|
65
|
-
--md-shadow-z3: ${j.shadows[3]};
|
|
66
|
-
|
|
67
|
-
/* EXTENSIONS */
|
|
68
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
69
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
70
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
71
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
72
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
73
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
74
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
75
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
76
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
77
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
78
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
79
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
80
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
81
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
82
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
83
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
84
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
85
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
86
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
87
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
88
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
89
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
90
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
91
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
92
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
93
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
94
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
95
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
96
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host > * {
|
|
100
|
-
/* CODE */
|
|
101
|
-
--md-code-fg-color: ${j.palette.text.primary};
|
|
102
|
-
--md-code-bg-color: ${j.palette.background.paper};
|
|
103
|
-
--md-code-hl-color: ${(0,Ze.Fq)(j.palette.warning.main,.5)};
|
|
104
|
-
--md-code-hl-keyword-color: ${j.palette.type==="dark"?j.palette.primary.light:j.palette.primary.dark};
|
|
105
|
-
--md-code-hl-function-color: ${j.palette.type==="dark"?j.palette.secondary.light:j.palette.secondary.dark};
|
|
106
|
-
--md-code-hl-string-color: ${j.palette.type==="dark"?j.palette.success.light:j.palette.success.dark};
|
|
107
|
-
--md-code-hl-number-color: ${j.palette.type==="dark"?j.palette.error.light:j.palette.error.dark};
|
|
108
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
109
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
110
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
111
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
112
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
113
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
114
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
115
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
116
|
-
|
|
117
|
-
/* TYPESET */
|
|
118
|
-
--md-typeset-font-size: 1rem;
|
|
119
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
120
|
-
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
121
|
-
--md-typeset-table-color: ${j.palette.text.primary};
|
|
122
|
-
--md-typeset-del-color: ${j.palette.type==="dark"?(0,Ze.Fq)(j.palette.error.dark,.5):(0,Ze.Fq)(j.palette.error.light,.5)};
|
|
123
|
-
--md-typeset-ins-color: ${j.palette.type==="dark"?(0,Ze.Fq)(j.palette.success.dark,.5):(0,Ze.Fq)(j.palette.success.light,.5)};
|
|
124
|
-
--md-typeset-mark-color: ${j.palette.type==="dark"?(0,Ze.Fq)(j.palette.warning.dark,.5):(0,Ze.Fq)(j.palette.warning.light,.5)};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@media screen and (max-width: 76.1875em) {
|
|
128
|
-
:host > * {
|
|
129
|
-
/* TYPESET */
|
|
130
|
-
--md-typeset-font-size: .9rem;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@media screen and (max-width: 600px) {
|
|
135
|
-
:host > * {
|
|
136
|
-
/* TYPESET */
|
|
137
|
-
--md-typeset-font-size: .7rem;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
`,yt=({theme:j})=>`
|
|
141
|
-
/*================== Reset ==================*/
|
|
142
|
-
|
|
143
|
-
body {
|
|
144
|
-
--md-text-color: var(--md-default-fg-color);
|
|
145
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
146
|
-
--md-text-font-family: ${j.typography.fontFamily};
|
|
147
|
-
font-family: var(--md-text-font-family);
|
|
148
|
-
background-color: unset;
|
|
149
|
-
}
|
|
150
|
-
`;const Et="224px";var at=({theme:j,sidebar:F})=>`
|
|
151
|
-
/*================== Layout ==================*/
|
|
152
|
-
|
|
153
|
-
.md-grid {
|
|
154
|
-
max-width: 100%;
|
|
155
|
-
margin: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.md-nav {
|
|
159
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
160
|
-
}
|
|
161
|
-
.md-nav__link {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
justify-content: space-between;
|
|
165
|
-
}
|
|
166
|
-
.md-nav__icon {
|
|
167
|
-
height: 20px !important;
|
|
168
|
-
width: 20px !important;
|
|
169
|
-
margin-left:${j.spacing(1)}px;
|
|
170
|
-
}
|
|
171
|
-
.md-nav__icon svg {
|
|
172
|
-
margin: 0;
|
|
173
|
-
width: 20px !important;
|
|
174
|
-
height: 20px !important;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon:after {
|
|
177
|
-
width: 20px !important;
|
|
178
|
-
height: 20px !important;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
182
|
-
text-decoration: underline;
|
|
183
|
-
color: var(--md-typeset-a-color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.md-main__inner {
|
|
187
|
-
margin-top: 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.md-sidebar {
|
|
191
|
-
bottom: 75px;
|
|
192
|
-
position: fixed;
|
|
193
|
-
width: 16rem;
|
|
194
|
-
overflow-y: auto;
|
|
195
|
-
overflow-x: hidden;
|
|
196
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
197
|
-
scrollbar-width: thin;
|
|
198
|
-
}
|
|
199
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
200
|
-
width: calc(12.1rem);
|
|
201
|
-
}
|
|
202
|
-
.md-sidebar--secondary {
|
|
203
|
-
right: ${j.spacing(3)}px;
|
|
204
|
-
}
|
|
205
|
-
.md-sidebar::-webkit-scrollbar {
|
|
206
|
-
width: 5px;
|
|
207
|
-
}
|
|
208
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
209
|
-
width: 5px;
|
|
210
|
-
height: 5px;
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
213
|
-
background: #eee;
|
|
214
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
215
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
216
|
-
border-radius: 3px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
219
|
-
width: 5px;
|
|
220
|
-
background: rgb(193, 193, 193);
|
|
221
|
-
border: transparent;
|
|
222
|
-
border-radius: 3px;
|
|
223
|
-
}
|
|
224
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
225
|
-
background: rgb(125, 125, 125);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.md-content {
|
|
229
|
-
max-width: calc(100% - 16rem * 2);
|
|
230
|
-
margin-left: 16rem;
|
|
231
|
-
margin-bottom: 50px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.md-footer {
|
|
235
|
-
position: fixed;
|
|
236
|
-
bottom: 0px;
|
|
237
|
-
}
|
|
238
|
-
.md-footer__title {
|
|
239
|
-
background-color: unset;
|
|
240
|
-
}
|
|
241
|
-
.md-footer-nav__link {
|
|
242
|
-
width: 16rem;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.md-dialog {
|
|
246
|
-
background-color: unset;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
@media screen and (min-width: 76.25em) {
|
|
250
|
-
.md-sidebar {
|
|
251
|
-
height: auto;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
@media screen and (max-width: 76.1875em) {
|
|
256
|
-
.md-nav {
|
|
257
|
-
transition: none !important;
|
|
258
|
-
background-color: var(--md-default-bg-color)
|
|
259
|
-
}
|
|
260
|
-
.md-nav--primary .md-nav__title {
|
|
261
|
-
cursor: auto;
|
|
262
|
-
color: var(--md-default-fg-color);
|
|
263
|
-
font-weight: 700;
|
|
264
|
-
white-space: normal;
|
|
265
|
-
line-height: 1rem;
|
|
266
|
-
height: auto;
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-flow: column;
|
|
269
|
-
row-gap: 1.6rem;
|
|
270
|
-
padding: 1.2rem .8rem .8rem;
|
|
271
|
-
background-color: var(--md-default-bg-color);
|
|
272
|
-
}
|
|
273
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
277
|
-
border-top: none;
|
|
278
|
-
}
|
|
279
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
280
|
-
display: none;
|
|
281
|
-
}
|
|
282
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
283
|
-
color: var(--md-default-fg-color);
|
|
284
|
-
position: static;
|
|
285
|
-
height: auto;
|
|
286
|
-
margin: 0 0 0 -0.2rem;
|
|
287
|
-
}
|
|
288
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
289
|
-
padding-top: 0;
|
|
290
|
-
}
|
|
291
|
-
.md-nav--primary .md-nav__item {
|
|
292
|
-
border-top: none;
|
|
293
|
-
}
|
|
294
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
295
|
-
font-size : var(--md-typeset-font-size);
|
|
296
|
-
}
|
|
297
|
-
.md-nav .md-source {
|
|
298
|
-
display: none;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.md-sidebar {
|
|
302
|
-
height: 100%;
|
|
303
|
-
}
|
|
304
|
-
.md-sidebar--primary {
|
|
305
|
-
width: 12.1rem !important;
|
|
306
|
-
z-index: 200;
|
|
307
|
-
left: ${F.isPinned?`calc(-12.1rem + ${Et})`:"calc(-12.1rem + 72px)"} !important;
|
|
308
|
-
}
|
|
309
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
310
|
-
display: none;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.md-content {
|
|
314
|
-
max-width: 100%;
|
|
315
|
-
margin-left: 0;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.md-header__button {
|
|
319
|
-
margin: 0.4rem 0;
|
|
320
|
-
margin-left: 0.4rem;
|
|
321
|
-
padding: 0;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.md-overlay {
|
|
325
|
-
left: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.md-footer {
|
|
329
|
-
position: static;
|
|
330
|
-
padding-left: 0;
|
|
331
|
-
}
|
|
332
|
-
.md-footer-nav__link {
|
|
333
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
334
|
-
width: 50%;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
@media screen and (max-width: 600px) {
|
|
339
|
-
.md-sidebar--primary {
|
|
340
|
-
left: -12.1rem !important;
|
|
341
|
-
width: 12.1rem;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`;const bt=["h1","h2","h3","h4","h5","h6"];var Ct=({theme:j})=>`
|
|
345
|
-
/*================== Typeset ==================*/
|
|
346
|
-
|
|
347
|
-
.md-typeset {
|
|
348
|
-
font-size: var(--md-typeset-font-size);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
${bt.reduce((F,oe)=>{var ce;const be=(ce=j.typography.htmlFontSize)!==null&&ce!==void 0?ce:16,Ie=j.typography[oe],{lineHeight:Qe,fontFamily:ft,fontWeight:et,fontSize:mt}=Ie,gt=At=>{let Ut=1;return typeof At=="number"&&(Ut=At/be*.6),typeof At=="string"&&(Ut=At.replace("rem","")),`calc(${Ut} * var(--md-typeset-font-size))`};return F.concat(`
|
|
352
|
-
.md-typeset ${oe} {
|
|
353
|
-
color: var(--md-default-fg-color);
|
|
354
|
-
line-height: ${Qe};
|
|
355
|
-
font-family: ${ft};
|
|
356
|
-
font-weight: ${et};
|
|
357
|
-
font-size: ${gt(mt)};
|
|
358
|
-
}
|
|
359
|
-
`)},"")}
|
|
360
|
-
|
|
361
|
-
.md-typeset .md-content__button {
|
|
362
|
-
color: var(--md-default-fg-color);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.md-typeset hr {
|
|
366
|
-
border-bottom: 0.05rem dotted ${j.palette.divider};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.md-typeset details {
|
|
370
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
371
|
-
}
|
|
372
|
-
.md-typeset details summary {
|
|
373
|
-
padding-left: 2.5rem !important;
|
|
374
|
-
}
|
|
375
|
-
.md-typeset details summary:before,
|
|
376
|
-
.md-typeset details summary:after {
|
|
377
|
-
top: 50% !important;
|
|
378
|
-
width: 20px !important;
|
|
379
|
-
height: 20px !important;
|
|
380
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
381
|
-
}
|
|
382
|
-
.md-typeset details[open] > summary:after {
|
|
383
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.md-typeset blockquote {
|
|
387
|
-
color: var(--md-default-fg-color--light);
|
|
388
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.md-typeset table:not([class]) {
|
|
392
|
-
font-size: var(--md-typeset-font-size);
|
|
393
|
-
border: 1px solid var(--md-default-fg-color);
|
|
394
|
-
border-bottom: none;
|
|
395
|
-
border-collapse: collapse;
|
|
396
|
-
}
|
|
397
|
-
.md-typeset table:not([class]) th {
|
|
398
|
-
font-weight: bold;
|
|
399
|
-
}
|
|
400
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
401
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
405
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
406
|
-
}
|
|
407
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
408
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
409
|
-
}
|
|
410
|
-
`,Tt=()=>`
|
|
411
|
-
/*================== Animations ==================*/
|
|
412
|
-
/*
|
|
413
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
414
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
415
|
-
*/
|
|
416
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
417
|
-
transition: none;
|
|
418
|
-
}
|
|
419
|
-
`,qt=({theme:j})=>`
|
|
420
|
-
/*================== Extensions ==================*/
|
|
421
|
-
|
|
422
|
-
/* HIGHLIGHT */
|
|
423
|
-
.highlight .md-clipboard:after {
|
|
424
|
-
content: unset;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.highlight .nx {
|
|
428
|
-
color: ${j.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/* CODE HILITE */
|
|
432
|
-
.codehilite .gd {
|
|
433
|
-
background-color: ${j.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.codehilite .gi {
|
|
437
|
-
background-color: ${j.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* TABBED */
|
|
441
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
442
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
443
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
444
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
445
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
446
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
447
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
448
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
449
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
450
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
451
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
452
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
453
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
454
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
455
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
456
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
457
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
458
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
459
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
460
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
461
|
-
color: var(--md-accent-fg-color);
|
|
462
|
-
border-color: var(--md-accent-fg-color);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/* TASK-LIST */
|
|
466
|
-
.task-list-control .task-list-indicator::before {
|
|
467
|
-
background-color: ${j.palette.action.disabledBackground};
|
|
468
|
-
}
|
|
469
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
470
|
-
background-color: ${j.palette.success.main};
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* ADMONITION */
|
|
474
|
-
.admonition {
|
|
475
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
476
|
-
}
|
|
477
|
-
.admonition .admonition-title {
|
|
478
|
-
padding-left: 2.5rem !important;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.admonition .admonition-title:before {
|
|
482
|
-
top: 50% !important;
|
|
483
|
-
width: 20px !important;
|
|
484
|
-
height: 20px !important;
|
|
485
|
-
transform: translateY(-50%) !important;
|
|
486
|
-
}
|
|
487
|
-
`;const _t=[pt,yt,at,Ct,Tt,qt],Vt=()=>(0,x.Pf)(),Jt=()=>{const j=Vt(),F=(0,ze.Z)();return(0,n.useMemo)(()=>{const oe={theme:F,sidebar:j};return _t.reduce((ce,be)=>ce+be(oe),"")},[F,j])},nn=()=>{const j=Jt();return(0,n.useCallback)(F=>(F.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${j}</style>`),F),[j])},Qt=(j,F,oe)=>{const ce=j==="src"&&F.endsWith(".svg"),be=!F.match(/^([a-z]*:)?\/\//i),Ie=F.startsWith(oe);return ce&&(be||Ie)},wn=({techdocsStorageApi:j,entityId:F,path:oe})=>async ce=>{const be=await j.getApiOrigin(),Ie=async(Qe,ft)=>{for(const et of Qe)if(et.hasAttribute(ft)){const mt=et.getAttribute(ft);if(!mt)return;const gt=await j.getBaseUrl(mt,F,oe);if(Qt(ft,mt,be))try{const Ut=await(await fetch(gt,{credentials:"include"})).text();et.setAttribute(ft,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Ut)))}`)}catch{et.setAttribute("alt",`Error: ${mt}`)}else et.setAttribute(ft,gt)}};return await Promise.all([Ie(ce.querySelectorAll("img"),"src"),Ie(ce.querySelectorAll("script"),"src"),Ie(ce.querySelectorAll("source"),"src"),Ie(ce.querySelectorAll("link"),"href"),Ie(ce.querySelectorAll("a[download]"),"href")]),ce};var rn=t(39619),Cn=t(67097),on=t(28316),Mn=t(82717),Wt=t.n(Mn);const jn=j=>F=>{var oe;const ce=F.querySelector('[title="Edit this page"]');if(!ce||!ce.href)return F;const be=new URL(ce.href),Ie=j.byUrl(be);if((Ie==null?void 0:Ie.type)!=="github"&&(Ie==null?void 0:Ie.type)!=="gitlab")return F;const Qe=((oe=F.querySelector("article>h1"))===null||oe===void 0?void 0:oe.childNodes[0].textContent)||"",ft=encodeURIComponent(`Documentation Feedback: ${Qe}`),et=encodeURIComponent(`Page source:
|
|
488
|
-
${ce.href}
|
|
489
|
-
|
|
490
|
-
Feedback:`),mt=(Ie==null?void 0:Ie.type)==="github"?(0,rn.Pb)(be.href,"blob"):be.href,gt=Wt()(mt),At=`/${gt.organization}/${gt.name}`,Ut=ce.cloneNode();switch(Ie==null?void 0:Ie.type){case"gitlab":Ut.href=`${be.origin}${At}/issues/new?issue[title]=${ft}&issue[description]=${et}`;break;case"github":Ut.href=`${be.origin}${At}/issues/new?title=${ft}&body=${et}`;break;default:return F}return on.render(n.createElement(Cn.Z),Ut),Ut.style.paddingLeft="5px",Ut.title="Leave feedback for this page",Ut.id="git-feedback-link",ce==null||ce.insertAdjacentElement("beforebegin",Ut),F};var En=t(44882);const Ft=()=>j=>{const F=j.querySelector('.md-header label[for="__drawer"]'),oe=j.querySelector("article");if(!F||!oe)return j;const ce=F.cloneNode();return on.render(n.createElement(En.Z),ce),ce.id="toggle-sidebar",ce.title="Toggle Sidebar",ce.classList.add("md-content__button"),ce.style.setProperty("padding","0 0 0 5px"),ce.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),oe==null||oe.prepend(ce),j},an=()=>j=>(((oe,ce)=>{Array.from(oe).filter(be=>be.hasAttribute(ce)).forEach(be=>{const Ie=be.getAttribute(ce);if(Ie){Ie.match(/^https?:\/\//i)&&be.setAttribute("target","_blank");try{const Qe=sn(window.location.href);be.setAttribute(ce,new URL(Ie,Qe).toString())}catch{be.replaceWith(be.textContent||Ie)}}})})(Array.from(j.getElementsByTagName("a")),"href"),j);function sn(j){const F=new URL(j);return!F.pathname.endsWith("/")&&!F.pathname.endsWith(".html")&&(F.pathname+="/"),F.toString()}const ln=({baseUrl:j,onClick:F})=>oe=>(Array.from(oe.getElementsByTagName("a")).forEach(ce=>{ce.addEventListener("click",be=>{const Qe=ce.getAttribute("href");!Qe||Qe.startsWith(j)&&!ce.hasAttribute("download")&&(be.preventDefault(),F(be,Qe))})}),oe);var An=t(15459),cn=t(80030),ve=t(72379),te=t(41547);const Te=(0,An.Z)(j=>({tooltip:{fontSize:"inherit",color:j.palette.text.primary,margin:0,padding:j.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(cn.ZP),Be=()=>(0,h.jsx)(ve.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"})}),Ke=({text:j})=>{const[F,oe]=(0,n.useState)(!1),ce=(0,n.useCallback)(()=>{navigator.clipboard.writeText(j),oe(!0)},[j]),be=(0,n.useCallback)(()=>{oe(!1)},[oe]);return(0,h.jsx)(Te,{title:"Copied to clipboard",placement:"left",open:F,onClose:be,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ce,children:(0,h.jsx)(Be,{})})})},Y=j=>F=>{const oe=F.querySelectorAll("pre > code");for(const be of oe){var ce;const Ie=be.textContent||"",Qe=document.createElement("div");be==null||(ce=be.parentElement)===null||ce===void 0||ce.prepend(Qe),on.render((0,h.jsx)(te.Z,{theme:j,children:(0,h.jsx)(Ke,{text:Ie})}),Qe)}return F},C=()=>j=>{var F;return(F=j.querySelector(".md-header"))===null||F===void 0||F.remove(),j},g=()=>j=>{var F,oe;return(F=j.querySelector(".md-footer .md-copyright"))===null||F===void 0||F.remove(),(oe=j.querySelector(".md-footer-copyright"))===null||oe===void 0||oe.remove(),j},$=({onLoading:j,onLoaded:F})=>oe=>(j(),oe.addEventListener(W.Ox,function ce(){F(),oe.removeEventListener(W.Ox,ce)}),oe),ee=()=>j=>(setTimeout(()=>{if(window.location.hash){var F;const oe=window.location.hash.slice(1);(F=j==null?void 0:j.querySelector(`[id="${oe}"]`))===null||F===void 0||F.scrollIntoView()}},200),j),ge=()=>j=>(setTimeout(()=>{const F=j==null?void 0:j.querySelectorAll("li.md-nav__item--active");F.length!==0&&(F.forEach(ce=>{const be=ce==null?void 0:ce.querySelector("input");be!=null&&be.checked||be==null||be.click()}),F[F.length-1].scrollIntoView())},200),j),fe=async(j,F)=>{let oe;if(typeof j=="string")oe=new DOMParser().parseFromString(j,"text/html").documentElement;else if(j instanceof Element)oe=j;else throw new Error("dom is not a recognized type");for(const ce of F)oe=await ce(oe);return oe},Fe="screen and (max-width: 76.1875em)",Je=j=>{const F=(0,Ve.s0)(),oe=(0,ze.Z)(),ce=(0,je.Z)(Fe),be=Ee(),Ie=nn(),Qe=(0,Z.h_)(W.Dl),ft=(0,Z.h_)(He.q3),{state:et,path:mt,content:gt}=(0,R.DK)(),[At,Ut]=(0,n.useState)(null),Wn=(0,W.ux)(At),dn=(0,n.useCallback)(()=>{if(!At)return;At.querySelectorAll(".md-sidebar").forEach(w=>{if(ce)w.style.top="0px";else{const Q=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const xe=(u=Q==null?void 0:Q.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var b;let we=(b=At.getBoundingClientRect().top)!==null&&b!==void 0?b:0;const ke=At.querySelector(".md-container > .md-tabs");var A;const tt=(A=ke==null?void 0:ke.getBoundingClientRect().height)!==null&&A!==void 0?A:0;we<xe&&(we=xe),w.style.top=`${Math.max(we,0)+tt}px`}w.style.setProperty("opacity","1")})},[At,ce]);(0,n.useEffect)(()=>(window.addEventListener("resize",dn),window.addEventListener("scroll",dn,!0),()=>{window.removeEventListener("resize",dn),window.removeEventListener("scroll",dn,!0)}),[At,dn]);const $n=(0,n.useCallback)(()=>{if(!At)return;const Bt=At.querySelector(".md-footer");Bt&&(Bt.style.width=`${At.getBoundingClientRect().width}px`)},[At]);(0,n.useEffect)(()=>(window.addEventListener("resize",$n),()=>{window.removeEventListener("resize",$n)}),[At,$n]),(0,n.useEffect)(()=>{Wn||($n(),dn())},[et,Wn,$n,dn]);const Bn=(0,n.useCallback)((Bt,w)=>fe(Bt,[be,wn({techdocsStorageApi:Qe,entityId:j,path:w}),an(),Ft(),C(),g(),jn(ft),Ie]),[j,ft,Qe,be,Ie]),tr=(0,n.useCallback)(async Bt=>fe(Bt,[ee(),ge(),Y(oe),ln({baseUrl:window.location.origin,onClick:(w,u)=>{const b=w.ctrlKey||w.metaKey,A=new URL(u);if(A.hash)if(b)window.open(`${A.pathname}${A.hash}`,"_blank");else{var Q;F(`${A.pathname}${A.hash}`),(Q=Bt==null?void 0:Bt.querySelector(`[id="${A.hash.slice(1)}"]`))===null||Q===void 0||Q.scrollIntoView()}else b?window.open(A.pathname,"_blank"):F(A.pathname)}}),$({onLoading:()=>{},onLoaded:()=>{var w;(w=Bt.querySelector(".md-nav__title"))===null||w===void 0||w.removeAttribute("for")}}),$({onLoading:()=>{Array.from(Bt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[oe,F]);return(0,n.useEffect)(()=>{if(!gt)return()=>{};let Bt=!0;return Bn(gt,mt).then(async w=>{if(!(w!=null&&w.innerHTML)||!Bt)return;window.scroll({top:0});const u=await tr(w);Ut(u)}),()=>{Bt=!1}},[gt,mt,Bn,tr]),At};var qe=t(8560);const ot=()=>{const j=(0,W.$L)(),{shadowRoot:F}=(0,W.x1)(),oe=F==null?void 0:F.querySelector('[data-md-component="content"]'),ce=F==null?void 0:F.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let be=ce==null?void 0:ce.querySelector('[data-techdocs-addons-location="primary sidebar"]');be||(be=document.createElement("div"),be.setAttribute("data-techdocs-addons-location","primary sidebar"),ce==null||ce.prepend(be));const Ie=F==null?void 0:F.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Qe=Ie==null?void 0:Ie.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Qe||(Qe=document.createElement("div"),Qe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ie==null||Ie.prepend(Qe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(qe.Z,{container:be,children:j.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,h.jsx)(qe.Z,{container:oe,children:j.renderComponentsByLocation(W.oZ.Content)}),(0,h.jsx)(qe.Z,{container:Qe,children:j.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},lt=(0,v.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),ct=(0,R.m1)(j=>{var F;const{withSearch:oe=!0,onReady:ce}=j,be=lt(),{entityMetadata:{value:Ie,loading:Qe},entityRef:ft,setShadowRoot:et}=(0,W.x1)(),mt=Je(ft),gt=(0,n.useCallback)(At=>{et(At),ce instanceof Function&&ce()},[et,ce]);return Qe===!1&&!Ie?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):mt?(0,h.jsx)(x.VY,{children:(0,h.jsxs)(P.Z,{container:!0,children:[(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})}),oe&&(0,h.jsx)(P.Z,{className:be.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:ft,entityTitle:Ie==null||(F=Ie.metadata)===null||F===void 0?void 0:F.title})}),(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(W.VA,{element:mt,onAppend:gt,children:(0,h.jsx)(ot,{})})})]})}):(0,h.jsx)(x.VY,{children:(0,h.jsx)(P.Z,{container:!0,children:(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})})})})}),Rt=null},93225:function(wt,De,t){"use strict";t.d(De,{S:function(){return X}});var h=t(52322),n=t(2784),v=t(18671),P=t(98069),W=t(73250),x=t(61886),l=t(43297),O=t(25271),re=t(71399),q=t(25248),_=t(95573);const M=(0,h.jsx)(P.Z,{animation:"wave",variant:"text",height:40}),X=J=>{const{children:he}=J,ue=(0,x.$L)(),k=(0,q.h_)(q.Ds),{title:L,setTitle:Z,subtitle:T,setSubtitle:R,entityRef:ne,metadata:{value:Se,loading:Ve},entityMetadata:{value:ze,loading:je}}=(0,x.x1)();(0,n.useEffect)(()=>{!Se||(Z(Se.site_name),R(()=>{let{site_description:ht}=Se;return(!ht||ht==="None")&&(ht="Home"),ht}))},[Se,Z,R]);const He=k.getOptional("app.title")||"Backstage",ut=[L,T,He].filter(Boolean).join(" | "),{locationMetadata:$e,spec:Pe}=ze||{},Ye=Pe==null?void 0:Pe.lifecycle,_e=ze?(0,l.hF)(ze,O.S4):[],it=(0,q.tg)(_._Z)(),nt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(re.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:ne,title:ze==null?void 0:ze.metadata.title,defaultKind:"Component"})}),_e.length>0&&(0,h.jsx)(re.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:_e,defaultKind:"group"})}),Ye?(0,h.jsx)(re.i9,{label:"Lifecycle",value:Ye}):null,$e&&$e.type!=="dir"&&$e.type!=="file"?(0,h.jsx)(re.i9,{label:"",value:(0,h.jsx)("a",{href:$e.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(W.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!je&&ze===void 0||!Ve&&Se===void 0?null:(0,h.jsxs)(re.h4,{type:"Documentation",typeLink:it,title:L||M,subtitle:T||M,children:[(0,h.jsx)(v.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:ut})}),nt,he,ue.renderComponentsByLocation(x.oZ.Header)]})}},65124:function(wt,De,t){"use strict";t.d(De,{b:function(){return M}});var h=t(52322),n=t(2784),v=t(79692),P=t(15223),W=t(95544),x=t(80030),l=t(61837),O=t(48348),re=t(47603),q=t(61886);const _=(0,v.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),M=X=>{const J=_(),[he,ue]=(0,n.useState)(null),k=(0,n.useCallback)(Ve=>{ue(Ve.currentTarget)},[]),L=(0,n.useCallback)(()=>{ue(null)},[]),{entityMetadata:{value:Z,loading:T}}=(0,q.x1)(),R=(0,q.$L)(),ne=R.renderComponentsByLocation(q.oZ.Subheader),Se=R.renderComponentsByLocation(q.oZ.Settings);return!ne&&!Se||T===!1&&!Z?null:(0,h.jsx)(P.Z,{classes:J,...X.toolbarProps,children:(0,h.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ne,Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:k,children:(0,h.jsx)(re.Z,{})})}),(0,h.jsx)(O.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(he),onClose:L,keepMounted:!0,children:Se})]}):null]})})}},95481:function(wt,De,t){"use strict";t.d(De,{DK:function(){return M},m1:function(){return J}});var h=t(52322),n=t(2784),v=t(10289),P=t(61886),W=t(25248),x=t(64279),l=t(77446);function O({contentLoading:he,content:ue,activeSyncState:k}){return he||k==="BUILD_READY_RELOAD"||!ue&&k==="CHECKING"?"CHECKING":!ue&&k==="BUILDING"?"INITIAL_BUILD":ue?k==="BUILDING"?"CONTENT_STALE_REFRESHING":k==="BUILD_READY"?"CONTENT_STALE_READY":k==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function re(he,ue){const k={...he};switch(ue.type){case"sync":ue.state==="CHECKING"&&(k.buildLog=[]),k.activeSyncState=ue.state,k.syncError=ue.syncError;break;case"contentLoading":k.contentLoading=!0,k.contentError=void 0;break;case"content":typeof ue.path=="string"&&(k.path=ue.path),k.contentLoading=!1,k.content=ue.content,k.contentError=ue.contentError;break;case"buildLog":k.buildLog=k.buildLog.concat(ue.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(k.activeSyncState)&&["contentLoading","content"].includes(ue.type)&&(k.activeSyncState="UP_TO_DATE",k.buildLog=[]),k}function q(he,ue,k,L){var Z,T;const[R,ne]=(0,n.useReducer)(re,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Se=(0,W.h_)(P.Dl),{retry:Ve}=(0,l.Z)(async()=>{ne({type:"contentLoading"});try{const He=await Se.getEntityDocs({kind:he,namespace:ue,name:k},L);return ne({type:"content",content:He,path:L}),He}catch(He){ne({type:"content",contentError:He,path:L})}},[Se,he,ue,k,L]),ze=(0,n.useRef)({content:void 0,reload:()=>{}});return ze.current={content:R.content,reload:Ve},(0,x.default)(async()=>{ne({type:"sync",state:"CHECKING"});const He=setTimeout(()=>{ne({type:"sync",state:"BUILDING"})},1e3);try{switch(await Se.syncEntityDocs({kind:he,namespace:ue,name:k},$e=>{ne({type:"buildLog",log:$e})})){case"updated":ze.current.content?ne({type:"sync",state:"BUILD_READY"}):(ze.current.reload(),ne({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ne({type:"sync",state:"UP_TO_DATE"});break;default:ne({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ut){ne({type:"sync",state:"ERROR",syncError:ut})}finally{clearTimeout(He)}},[he,k,ue,Se,ne,ze]),{state:(0,n.useMemo)(()=>O({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:Ve,path:R.path,content:R.content,contentErrorMessage:(Z=R.contentError)===null||Z===void 0?void 0:Z.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const _=(0,n.createContext)({}),M=()=>(0,n.useContext)(_),X=({children:he})=>{const{"*":ue=""}=(0,v.UO)(),{entityRef:k}=(0,P.x1)(),{kind:L,namespace:Z,name:T}=k,R=q(L,Z,T,ue);return(0,h.jsx)(_.Provider,{value:R,children:he instanceof Function?he(R):he})},J=he=>ue=>(0,h.jsx)(X,{children:(0,h.jsx)(he,{...ue})})},95573:function(wt,De,t){"use strict";t.d(De,{Fw:function(){return v},_Z:function(){return n},pd:function(){return P}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),v=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),P=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(wt,De,t){"use strict";t.d(De,{S:function(){return L}});var h=t(52322),n=t(2784),v=t(79692),P=t(49378),W=t(38402),x=t(86136),l=t(85256),O=t(71399),re=t(25248),q=t(60712);const _=(0,v.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=Z=>{const{result:T,highlight:R,rank:ne,lineClamp:Se=5,asListItem:Ve=!0,asLink:ze=!0,title:je,icon:He}=Z,ut=_(),$e=(0,re.z$)(),Pe=()=>{$e.captureEvent("discover",T.title,{attributes:{to:T.location},value:ne})},Ye=()=>{const nt=R!=null&&R.fields.title?(0,h.jsx)(q.FA,{text:R.fields.title,preTag:R.preTag,postTag:R.postTag}):T.title,Xe=R!=null&&R.fields.entityTitle?(0,h.jsx)(q.FA,{text:R.fields.entityTitle,preTag:R.preTag,postTag:R.postTag}):T.entityTitle,st=R!=null&&R.fields.name?(0,h.jsx)(q.FA,{text:R.fields.name,preTag:R.preTag,postTag:R.postTag}):T.name;return(0,h.jsx)(P.Z,{className:ut.itemText,primaryTypographyProps:{variant:"h6"},primary:je||(0,h.jsxs)(h.Fragment,{children:[nt," | ",Xe!=null?Xe:st," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Se,overflow:"hidden"},children:R!=null&&R.fields.text?(0,h.jsx)(q.FA,{text:R.fields.text,preTag:R.preTag,postTag:R.postTag}):T.text})})},_e=({children:nt})=>ze?(0,h.jsx)(O.rU,{noTrack:!0,to:T.location,onClick:Pe,children:nt}):(0,h.jsx)(h.Fragment,{children:nt}),it=({children:nt})=>Ve?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(W.Z,{alignItems:"flex-start",children:[He&&(0,h.jsx)(x.Z,{children:He}),(0,h.jsx)("div",{className:ut.flexContainer,children:nt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:nt});return(0,h.jsx)(_e,{children:(0,h.jsx)(it,{children:(0,h.jsx)(Ye,{})})})};var X=t(27556),J=t(10289);const he=(0,v.Z)(Z=>({root:{width:"100%"},bar:{padding:Z.spacing(1)}})),ue=Z=>Z==null?void 0:Z.document,k=Z=>{const{entityId:T,entityTitle:R,debounceTime:ne=150}=Z,[Se,Ve]=(0,n.useState)(!1),ze=(0,J.s0)(),{setFilters:je,result:{loading:He,value:ut}}=(0,q.Rx)(),$e=he(),[Pe,Ye]=(0,n.useState)([]);(0,n.useEffect)(()=>{let st=!0;if(st&&ut){const ht=ut.results.slice(0,10);Ye(ht)}return()=>{st=!1}},[He,ut]);const{kind:_e,name:it,namespace:nt}=T;(0,n.useEffect)(()=>{je(st=>({...st,kind:_e,namespace:nt,name:it}))},[_e,nt,it,je]);const Xe=(st,ht)=>{if(ue(ht)){const{location:Oe}=ht.document;ze(Oe)}};return(0,h.jsx)(X.Z,{className:$e.bar,variant:"outlined",children:(0,h.jsx)(q.qO,{classes:{root:$e.root},"data-testid":"techdocs-search-bar",size:"small",open:Se,getOptionLabel:()=>"",filterOptions:st=>st,onClose:()=>{Ve(!1)},onFocus:()=>{Ve(!0)},onChange:Xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Pe,renderOption:({document:st,highlight:ht})=>(0,h.jsx)(M,{result:st,lineClamp:3,asListItem:!1,asLink:!1,title:st.title,highlight:ht}),loading:He,inputDebounceTime:ne,inputPlaceholder:`Search ${R||T.name} docs`,freeSolo:!1})})},L=Z=>{const T={term:"",types:["techdocs"],pageCursor:"",filters:Z.entityId};return(0,h.jsx)(q.Nd,{initialState:T,children:(0,h.jsx)(k,{...Z})})}},53260:function(){}},function(wt){var De=function(h){return wt(wt.s=h)};wt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return De(96215)});var t=wt.O()}]);})();
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=main.8dc9310c.js.map
|