@techdocs/cli 0.0.0-nightly-20230203023049 → 0.0.0-nightly-20230205023116
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 +4 -4
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.21295780.js → main.2f5136d8.js} +2 -2
- package/dist/embedded-app/static/{main.21295780.js.map → main.2f5136d8.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.21295780.js → runtime.2f5136d8.js} +1 -1
- package/dist/embedded-app/static/{runtime.21295780.js.map → runtime.2f5136d8.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.21295780.js → vendor.2f5136d8.js} +1 -1
- package/dist/embedded-app/static/{vendor.21295780.js.map → vendor.2f5136d8.js.map} +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20230205023116
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 6e0b6a0d50: Fixed publish command missing awsBucketRootPath option.
|
|
8
8
|
Fixed publish command having the gcsBucketRootPath option misconfigured, previously returning a boolean vs a string.
|
|
9
9
|
- Updated dependencies
|
|
10
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
11
|
-
- @backstage/
|
|
12
|
-
- @backstage/
|
|
10
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20230205023116
|
|
11
|
+
- @backstage/catalog-model@0.0.0-nightly-20230205023116
|
|
12
|
+
- @backstage/backend-common@0.0.0-nightly-20230205023116
|
|
13
13
|
- @backstage/cli-common@0.1.11
|
|
14
14
|
- @backstage/config@1.0.6
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.2f5136d8.js"></script><script defer="defer" src="/static/module-material-ui.e7d0407d.js"></script><script defer="defer" src="/static/module-lodash.f07e54c1.js"></script><script defer="defer" src="/static/module-date-fns.7dd2cc1f.js"></script><script defer="defer" src="/static/module-yaml.cb32d5ca.js"></script><script defer="defer" src="/static/module-ajv.07e5c2aa.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.9cc2c5ac.js"></script><script defer="defer" src="/static/module-octokit.991a0781.js"></script><script defer="defer" src="/static/module-react-dom.5abdac04.js"></script><script defer="defer" src="/static/module-zod.49ffd80f.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.97cccd01.js"></script><script defer="defer" src="/static/module-remix-run.b9acb514.js"></script><script defer="defer" src="/static/vendor.2f5136d8.js"></script><script defer="defer" src="/static/main.2f5136d8.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Oe,t){"use strict";t.d(Oe,{n3:function(){return m},MS:function(){return S}});var h=t(25271),n=t(23054),z=t(96279),B=t.n(z);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class S{async getEntityAncestors(k,se){const{kind:_,namespace:te,name:$}=(0,h.of)(k.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}/ancestry`,se)}async getLocationById(k,se){return await this.requestOptional("GET",`/locations/${encodeURIComponent(k)}`,se)}async getEntities(k,se){const{filter:_=[],fields:te=[],order:$,offset:T,limit:H,after:ue}=k!=null?k:{},ie=[];for(const P of[_].flat()){const C=[];for(const[X,we]of Object.entries(P))for(const Ve of[we].flat())Ve===m?C.push(encodeURIComponent(X)):typeof Ve=="string"&&C.push(`${encodeURIComponent(X)}=${encodeURIComponent(Ve)}`);C.length&&ie.push(`filter=${C.join(",")}`)}if(te.length&&ie.push(`fields=${te.map(encodeURIComponent).join(",")}`),$)for(const P of[$].flat())P&&ie.push(`order=${encodeURIComponent(P.order)}:${encodeURIComponent(P.field)}`);T!==void 0&&ie.push(`offset=${T}`),H!==void 0&&ie.push(`limit=${H}`),ue!==void 0&&ie.push(`after=${encodeURIComponent(ue)}`);const I=ie.length?`?${ie.join("&")}`:"",L=await this.requestRequired("GET",`/entities${I}`,se),W=(P,C)=>{var X,we;if(((X=P.metadata)===null||X===void 0?void 0:X.name)===void 0||P.kind===void 0||((we=C.metadata)===null||we===void 0?void 0:we.name)===void 0||C.kind===void 0)return 0;const Ve=(0,h.eE)(P),Ge=(0,h.eE)(C);return Ve<Ge?-1:Ve>Ge?1:0};return{items:L.sort(W)}}async getEntitiesByRefs(k,se){var _;const te={entityRefs:k.entityRefs};!((_=k.fields)===null||_===void 0)&&_.length&&(te.fields=k.fields);const T=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,H=await this.fetchApi.fetch(T,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify(te)});if(!H.ok)throw await n.VL.fromResponse(H);const{items:ue}=await H.json();return{items:ue}}async getEntityByRef(k,se){const{kind:_,namespace:te,name:$}=(0,h.of)(k);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}`,se)}async getEntityByName(k,se){const{kind:_,namespace:te="default",name:$}=k;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}`,se)}async refreshEntity(k,se){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({entityRef:k})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(k,se){const{filter:_=[],facets:te}=k,$=[];for(const H of[_].flat()){const ue=[];for(const[ie,I]of Object.entries(H))for(const L of[I].flat())L===m?ue.push(encodeURIComponent(ie)):typeof L=="string"&&ue.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);ue.length&&$.push(`filter=${ue.join(",")}`)}for(const H of te)$.push(`facet=${encodeURIComponent(H)}`);const T=$.length?`?${$.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,se)}async addLocation(k,se){const{type:_="url",target:te,dryRun:$}=k,T=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${$?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({type:_,target:te})});if(T.status!==201)throw new Error(await T.text());const{location:H,entities:ue,exists:ie}=await T.json();if(!H)throw new Error(`Location wasn't added: ${te}`);return{location:H,entities:ue,exists:ie}}async getLocationByRef(k,se){return(await this.requestRequired("GET","/locations",se)).map(te=>te.data).find(te=>k===(0,h.NZ)(te))}async removeLocationById(k,se){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(k)}`,se)}async removeEntityByUid(k,se){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(k)}`,se)}async validateEntity(k,se,_){const te=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:k,location:se})});if(te.ok)return{valid:!0};if(te.status!==400)throw await n.VL.fromResponse(te);const{errors:$=[]}=await te.json();return{valid:!1,errors:$}}async requestIgnored(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok)throw await n.VL.fromResponse(T)}async requestRequired(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok)throw await n.VL.fromResponse(T);return await T.json()}async requestOptional(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok){if(T.status===404)return;throw await n.VL.fromResponse(T)}return await T.json()}constructor(k){this.discoveryApi=k.discoveryApi,this.fetchApi=k.fetchApi||{fetch:B()}}}},25271:function(At,Oe,t){"use strict";t.d(Oe,{Tf:function(){return z},P1:function(){return ge},q1:function(){return ne},M6:function(){return Te},l2:function(){return n},zG:function(){return h},w$:function(){return En},nP:function(){return jn},aS:function(){return Hn},S4:function(){return Jt},cz:function(){return Vn},iB:function(){return jt},CV:function(){return mt},of:function(){return dt},Ou:function(){return Ze},eE:function(){return bt},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",z="backstage.io/edit-url",B="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",S="kubernetes.io/auth-provider";var l=t(76635),k=t.n(l);class se{async enforce(Z){return Z.metadata.namespace?Z:lodash.merge({metadata:{namespace:this.namespace}},Z)}constructor(Z=DEFAULT_NAMESPACE){this.namespace=Z}}class _{static isValidPrefixAndOrSuffix(Z,pe,Fe,Be){if(typeof Z!="string")return!1;const nt=Z.split(pe);return nt.length===1?Be(nt[0]):nt.length===2?Fe(nt[0])&&Be(nt[1]):!1}static isJsonSafe(Z){try{return k().isEqual(Z,JSON.parse(JSON.stringify(Z)))}catch{return!1}}static isValidDnsSubdomain(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=253&&Z.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(Z)}static isValidTag(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(Z)}static isValidUrl(Z){if(typeof Z!="string")return!1;try{return new URL(Z),!0}catch{return!1}}static isValidString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}}var te=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}}}}}'),$=t(27991),T=t.n($),H=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"}}}`),ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),ie=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const I=new Map,L=[te,H,ue,ie];function W(he){if(!(he!=null&&he.length))throw new TypeError("Unknown error");const Z=he[0];throw new TypeError(`${Z.instancePath||"<root>"} ${Z.message}${Z.params?` - ${Object.entries(Z.params).map(([pe,Fe])=>`${pe}: ${Fe}`).join(", ")}`:""}`)}function P(he,Z={}){var pe;const Fe=(pe=Z==null?void 0:Z.disableCache)!==null&&pe!==void 0?pe:!1,Be=Fe?"":JSON.stringify(he);if(!Fe){const Mt=I.get(Be);if(Mt)return Mt}const nt=C(he),It=new(T())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});nt.length&&It.addSchema(nt,void 0,void 0,!0);const Ht=It.compile(he);return Fe||I.set(Be,Ht),Ht}function C(he){if(typeof he!="object")return[];const Z=new Set;he.$id&&Z.add(he.$id);const pe=new Array,Fe=[he];for(;Fe.length;){const Be=Fe.pop();for(const nt of X(Be))if(!Z.has(nt)){Z.add(nt);const It=L.find(Ht=>Ht.$id===nt);It&&(pe.push(It),Fe.push(It))}}return pe}function*X(he){const Z=[he];for(;Z.length;){const pe=Z.pop();if(typeof pe=="object"&&pe)for(const[Fe,Be]of Object.entries(pe))Fe==="$ref"&&typeof Be=="string"?yield Be.split("#")[0]:Z.push(Be)}}function we(he){const Z=compileAjvSchema(he||entityEnvelopeSchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}function Ve(he){const Z=P(he);return pe=>{var Fe;if(Z(pe)===!0)return pe;const nt=(Fe=Z.errors)===null||Fe===void 0?void 0:Fe.filter(It=>["/kind","/apiVersion"].includes(It.instancePath));if((nt==null?void 0:nt.length)&&nt.every(It=>It.keyword==="enum"))return!1;throw W(Z.errors)}}function Ge(he){const Z=compileAjvSchema(he||entitySchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}class Je{static isValidApiVersion(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(Z)}static isValidObjectName(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(Z)}static isValidNamespace(Z){return _.isValidDnsLabel(Z)}static isValidLabelKey(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,Je.isValidObjectName)}static isValidLabelValue(Z){return Z===""||Je.isValidObjectName(Z)}static isValidAnnotationKey(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,Je.isValidObjectName)}static isValidAnnotationValue(Z){return typeof Z=="string"}}const We={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:he=>typeof he=="string"&&he.length>=1&&he.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(he)};function wt(he={}){return{...We,...he}}class Qe{async enforce(Z){function pe(f,A,M){if(A==null)throw new Error(`${f} must have a value`);let K;try{K=M(A)}catch(oe){throw new Error(`${f} could not be validated, ${oe}`)}if(!K){let oe;switch(M.name){case"isValidLabelValue":case"isValidObjectName":oe="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":oe="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":oe="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":oe="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":oe="a string";break;case"isValidKind":oe="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":oe="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":oe="a non empty string";break;default:oe=void 0;break}const me=oe?` expected ${oe} but found "${A}".`:"";throw new Error(`"${f}" is not valid;${me} 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 Fe(f,A,M){return A===void 0||pe(f,A,M)}pe("apiVersion",Z.apiVersion,this.validators.isValidApiVersion),pe("kind",Z.kind,this.validators.isValidKind),pe("metadata.name",Z.metadata.name,this.validators.isValidEntityName),Fe("metadata.namespace",Z.metadata.namespace,this.validators.isValidNamespace);var Be;for(const[f,A]of Object.entries((Be=Z.metadata.labels)!==null&&Be!==void 0?Be:[]))pe(`labels.${f}`,f,this.validators.isValidLabelKey),pe(`labels.${f}`,A,this.validators.isValidLabelValue);var nt;for(const[f,A]of Object.entries((nt=Z.metadata.annotations)!==null&&nt!==void 0?nt:[]))pe(`annotations.${f}`,f,this.validators.isValidAnnotationKey),pe(`annotations.${f}`,A,this.validators.isValidAnnotationValue);var It;const Ht=(It=Z.metadata.tags)!==null&&It!==void 0?It:[];for(let f=0;f<Ht.length;++f)pe(`tags.${f}`,Ht[f],this.validators.isValidTag);var Mt;const Qt=(Mt=Z.metadata.links)!==null&&Mt!==void 0?Mt:[];for(let f=0;f<Qt.length;++f){var zt,Y,q;pe(`links.${f}.url`,(zt=Qt[f])===null||zt===void 0?void 0:zt.url,CommonValidatorFunctions.isValidUrl),Fe(`links.${f}.title`,(Y=Qt[f])===null||Y===void 0?void 0:Y.title,CommonValidatorFunctions.isNonEmptyString),Fe(`links.${f}.icon`,(q=Qt[f])===null||q===void 0?void 0:q.icon,KubernetesValidatorFunctions.isValidObjectName)}return Z}constructor(Z=makeValidator()){this.validators=Z}}class xe{async enforce(Z){if(!this.validate){const Be=new Ajv({allowUnionTypes:!0});this.validate=Be.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(Z)===!0)return Z;const[Fe]=this.validate.errors||[];throw Fe?new Error(`Malformed envelope, ${Fe.instancePath||"<root>"} ${Fe.message}`):new Error("Malformed envelope, Unknown error")}}function _e(he){let Z=he.indexOf(":");const pe=he.indexOf("/");pe!==-1&&pe<Z&&(Z=-1);const Fe=Z===-1?void 0:he.slice(0,Z),Be=pe===-1?void 0:he.slice(Z+1,pe),nt=he.slice(Math.max(Z+1,pe+1));if(Fe===""||Be===""||nt==="")throw new TypeError(`Entity reference "${he}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Fe,namespace:Be,name:nt}}function jt(he){return{kind:he.kind,namespace:he.metadata.namespace||h,name:he.metadata.name}}function dt(he,Z){if(!he)throw new Error("Entity reference must not be empty");const pe=Z==null?void 0:Z.defaultKind,Fe=(Z==null?void 0:Z.defaultNamespace)||h;let Be,nt,It;if(typeof he=="string"){const Y=_e(he);var Ht;Be=(Ht=Y.kind)!==null&&Ht!==void 0?Ht:pe;var Mt;nt=(Mt=Y.namespace)!==null&&Mt!==void 0?Mt:Fe,It=Y.name}else{var Qt;Be=(Qt=he.kind)!==null&&Qt!==void 0?Qt:pe;var zt;nt=(zt=he.namespace)!==null&&zt!==void 0?zt:Fe,It=he.name}if(Be)if(nt){if(!It){const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Be,namespace:nt,name:It}}function bt(he){let Z,pe,Fe;if("metadata"in he){Z=he.kind;var Be;pe=(Be=he.metadata.namespace)!==null&&Be!==void 0?Be:h,Fe=he.metadata.name}else{Z=he.kind;var nt;pe=(nt=he.namespace)!==null&&nt!==void 0?nt:h,Fe=he.name}return`${Z.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Fe.toLocaleLowerCase("en-US")}`}class ut{async enforce(Z){let pe=Z;for(const Fe of this.policies){const Be=await Fe.enforce(pe);if(!Be)throw new Error(`Policy ${Fe.constructor.name} did not return a result`);pe=Be}return pe}constructor(Z){this.policies=Z}}class Rt{async enforce(Z){for(const pe of this.policies){const Fe=await pe.enforce(Z);if(Fe)return Fe}throw new Error("The entity did not match any known policy")}constructor(Z){this.policies=Z}}const Zt={allOf(he){return new ut(he)},oneOf(he){return new Rt(he)}};var He=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(he){let Z;return{async check(pe){return Z||(Z=Ve(he)),Z(pe)===pe}}}const Re=le(He);var Ae=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 Xe=le(Ae);var St=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 Ot=le(St);var ht=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Tt=le(ht);var gt=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 Dt=le(gt),Jt="ownedBy",Xt="ownerOf",cn="consumesApi",Ut="apiConsumedBy",fn="providesApi",gn="apiProvidedBy",jn="dependsOn",En="dependencyOf",Wn="parentOf",An="childOf",dn="memberOf",rn="hasMember",Vn="partOf",Hn="hasPart";var Sn=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 mn=le(Sn);var Tn=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 In=le(Tn);var Kn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const vn=le(Kn),ge="backstage.io/managed-by-location",ne="backstage.io/managed-by-origin-location",Te="backstage.io/source-location";function Ze(he){if(typeof he!="string")throw new TypeError(`Unable to parse location ref '${he}', unexpected argument ${typeof he}`);const Z=he.indexOf(":");if(Z<0)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=he.substring(0,Z).trim(),Fe=he.substring(Z+1).trim();if(!pe||!Fe)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${he}', please prefix it with 'url:', e.g. 'url:${he}'`);return{type:pe,target:Fe}}function qe(he){const{type:Z,target:pe}=he;if(Z){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${Z}:${pe}`}function mt(he){var Z,pe,Fe,Be,nt;const It=(nt=(Z=he.metadata)===null||Z===void 0||(pe=Z.annotations)===null||pe===void 0?void 0:pe[Te])!==null&&nt!==void 0?nt:(Fe=he.metadata)===null||Fe===void 0||(Be=Fe.annotations)===null||Be===void 0?void 0:Be[ge];if(!It)throw new Error(`Entity '${bt(he)}' is missing location`);return Ze(It)}},23196:function(At,Oe,t){"use strict";t.d(Oe,{zx:function(){return Qe},Oi:function(){return Re},VY:function(){return Ni},yW:function(){return _a},XF:function(){return St},mn:function(){return he},NX:function(){return h},ub:function(){return q},mf:function(){return ol},yu:function(){return Cn},h4:function(){return Ji},M6:function(){return Gr},i9:function(){return gl},aR:function(){return Fi},rJ:function(){return Ir},Oh:function(){return Sl},hu:function(){return yl},rU:function(){return Je},nU:function(){return vo},SA:function(){return Yr},sk:function(){return it},Or:function(){return Co},T3:function(){return Xi},g9:function(){return jl},Ex:function(){return wo},Gk:function(){return u},tn:function(){return Ui},Ph:function(){return wn},YE:function(){return ti},v7:function(){return ha},R6:function(){return Ss},tR:function(){return _s},uw:function(){return Ea},qt:function(){return Ti},iA:function(){return Yi},GB:function(){return yn},po:function(){return ur},mZ:function(){return Wo},Pf:function(){return Mr}});var h={};t.r(h),t.d(h,{Nm:function(){return Ot},ht:function(){return gt},LJ:function(){return Tt}});var n=t(52322),z=t(25248),B=t(19928),m=t(2784);function S(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const U=d.alert$().subscribe(fe=>a(ce=>ce.concat(fe)));return()=>{U.unsubscribe()}},[d]);const[N]=o;if(useEffect(()=>{if(N&&N.display==="transient"){const U=setTimeout(()=>{a(fe=>{const ce=fe.filter(ye=>ye!==N);return ce.length===fe.length?fe:ce})},j);return()=>clearTimeout(U)}},[N,j]),o.length===0)return null;const G=()=>{a(U=>U.filter(fe=>fe!==N))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:N.severity,children:_jsxs(Typography,{component:"span",children:[String(N.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=t(79692),k=t(12420);const se=(0,l.Z)(e=>(0,k.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:o,picture:a,customStyles:d}=e,p=se();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(o)})})}var te=t(77277),$=t(86689),T=t(90436),H=t(72779),ue=t.n(H),ie=t(76635),I=t(79635),L=t(39857);function W(){const[e]=(0,I.is)((0,n.jsx)(I.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const P=(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"}),C=e=>/^([a-z+.-]+):/.test(e),X=()=>{try{return(0,z.h_)(z.Ds).getOptionalString("app.baseUrl")}catch{return}},we=()=>{const e="http://sample.dev";var o;const a=(o=X())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,ie.trimEnd)(d,"/")},Ve=e=>{let o=String(e);const a=we(),d=C(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},Ge=e=>{if(e instanceof Array)return e.map(Ge).join(" ").trim();if(typeof e=="object"&&e){var o;return Ge(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},Je=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=P(),v=(0,z.z$)(),j=W()?Ve(a.to):a.to,N=Ge(a.children)||j,G=C(j),U=G&&!!/^https?:/.exec(j),fe=ce=>{e==null||e(ce),o||v.captureEvent("click",N,{attributes:{to:j}})};return G?(0,n.jsxs)($.Z,{...U?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:fe,className:ue()(p.externalLink,a.className),children:[a.children,(0,n.jsx)(T.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)($.Z,{...a,ref:d,component:L.rU,to:j,onClick:fe})}),We=m.forwardRef((e,o)=>(0,n.jsx)(Je,{ref:o,...e,color:"initial"})),Qe=m.forwardRef((e,o)=>(0,n.jsx)(te.Z,{ref:o,component:We,...e}));var xe=t(95544),_e=t(60364),jt=t(83229),dt=t(26639),bt=t(39595),ut=t(61837),Rt=t(80030),Zt=t(19353),He=t(95074);function le(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,z.h_)(z.VE),[j,N]=(0,m.useState)(!1),[{error:G},U]=(0,He.Z)();(0,m.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=ce=>{ce.stopPropagation(),N(!0),U(o)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Rt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>N(!1),open:j,children:(0,n.jsx)(ut.Z,{onClick:fe,"aria-label":p,children:(0,n.jsx)(Zt.Z,{})})})})}function Re(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,N=(0,_e.Z)(),G=N.palette.type==="dark"?dt.Z:bt.Z,U=N.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(xe.Z,{position:"relative",children:[(0,n.jsx)(jt.Z,{customStyle:v,language:a,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:fe=>p!=null&&p.includes(fe)?{style:{backgroundColor:U}}:{},children:o}),j&&(0,n.jsx)(xe.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(le,{text:o})})]})}var Ae=t(41156),Xe=t(88188);function St(e){const{title:o,to:a}=e,d=(0,Ae.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,n.jsx)(ut.Z,{component:L.rU,color:"primary",title:o,size:"small",to:a,children:(0,n.jsx)(Xe.Z,{})}):(0,n.jsx)(te.Z,{component:L.rU,variant:"contained",color:"primary",to:a,children:o}):null}var Ot;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Ot||(Ot={}));var ht;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ht||(ht={}));var Tt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Tt||(Tt={}));var gt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(gt||(gt={}));var Dt=t(27397),Jt=t(11105),Xt=t(97963),cn=t(46506),Ut=t.n(cn),fn=t(54073),gn=t.n(fn),jn=t(10368);const En=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Wn({node:{id:e}}){const o=En(),[a,d]=m.useState(0),[p,v]=m.useState(0),j=m.useRef(null);m.useLayoutEffect(()=>{if(j.current){let{height:fe,width:ce}=j.current.getBBox();fe=Math.round(fe),ce=Math.round(ce),(fe!==p||ce!==a)&&(d(ce),v(fe))}},[a,p]);const N=10,G=a+N*2,U=p+N*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:o.node,width:G,height:U,rx:10}),(0,n.jsx)("text",{ref:j,className:o.text,y:U/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const An="arrow-marker",dn="node",rn="edge",Vn="label",Hn=(0,jn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Sn=e=>(0,n.jsx)(Wn,{...e});function mn({render:e=Sn,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,N=a,G=Hn(),U=m.useRef(null);return m.useLayoutEffect(()=>{if(U.current){let{height:fe,width:ce}=U.current.getBBox();fe=Math.round(fe),ce=Math.round(ce),(fe!==p||ce!==d)&&o(a.id,{...a,height:fe,width:ce})}},[a,d,p,o]),(0,n.jsx)("g",{ref:U,"data-testid":dn,className:G.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:N})})}var Tn=t(76985),In=t(39829),Kn=t(19574),vn=t.n(Kn);const ge=(0,jn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ne({edge:{label:e}}){const o=ge();return(0,n.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Te=(0,jn.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Ze=e=>(0,n.jsx)(ne,{...e});function qe({render:e=Ze,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:N,height:G,points:U}=d,fe=d,ce=Te(),ye=m.useRef(null);m.useLayoutEffect(()=>{if(ye.current){let{height:Ye,width:Pt}=ye.current.getBBox();Ye=Math.round(Ye),Pt=Math.round(Pt),(Ye!==G||Pt!==N)&&o(a,{...d,height:Ye,width:Pt})}},[d,G,N,o,a]);let Ee="";const Me=m.useMemo(()=>Tn.Z().x(Ye=>Ye.x).y(Ye=>Ye.y).curve(In[p]),[p]);if(U){const Ye=U.filter(Pt=>vn()(Pt.x)&&vn()(Pt.y));Ee=Me(Ye)||""}return(0,n.jsxs)(n.Fragment,{children:[Ee&&(0,n.jsx)("path",{"data-testid":rn,className:ce.path,d:Ee}),fe.label?(0,n.jsx)("g",{ref:ye,"data-testid":Vn,className:ce.label,transform:`translate(${v},${j})`,children:e({edge:fe})}):null]})}const mt="workspace";function he(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:j=Ot.TOP_BOTTOM,align:N,nodeMargin:G=50,edgeMargin:U=10,rankMargin:fe=50,paddingX:ce=0,paddingY:ye=0,acyclicer:Ee,ranker:Me=Tt.NETWORK_SIMPLEX,labelPosition:Ye=gt.RIGHT,labelOffset:Pt=10,edgeRanks:qt=1,edgeWeight:on=1,renderLabel:sn,defs:kt,zoom:nn="enabled",curve:_t="curveMonotoneX",fit:Sr="grow",...Cr}=e,wr=(0,Xt.Z)(),[jr,di]=m.useState(100),[Pr,ui]=m.useState(100),en=m.useRef(new(Ut()).graphlib.Graph),[lo,js]=m.useState(((o=en.current.graph())===null||o===void 0?void 0:o.width)||0),[kr,hi]=m.useState(((a=en.current.graph())===null||a===void 0?void 0:a.height)||0),[Mn,hr]=m.useState([]),[Wr,Vr]=m.useState([]),an=Math.max(lo,jr),bn=Math.max(kr,Pr),co=Math.min(kr,Pr),Hr=Sr==="grow"?bn:co,Go=m.useMemo(()=>gn()(pn=>{if(!pn)return;const zn=Jt.Z(pn),ln=Jt.Z(pn.getElementById(mt));function sr(){zn.call(Dt.sP().scaleExtent([1,10]).on("zoom",Er=>{Er.transform.x=Math.min(0,Math.max(Er.transform.x,an-an*Er.transform.k)),Er.transform.y=Math.min(0,Math.max(Er.transform.y,bn-bn*Er.transform.k)),ln.attr("transform",Er.transform)}))}nn==="enabled"?sr():nn==="enable-on-click"&&zn.on("click",()=>sr());const{width:ir,height:Es}=pn.getBoundingClientRect();jr!==ir&&di(ir),Pr!==Es&&ui(Es)},100),[Pr,jr,an,bn,nn]),ra=m.useCallback(()=>{const pn=en.current.nodes(),zn=en.current.edges();pn.forEach(ln=>{p.some(ir=>ir.id===ln)||en.current.removeNode(ln)}),zn.forEach(ln=>{d.some(ir=>ir.from===ln.v&&ir.to===ln.w)||en.current.removeEdge(ln.v,ln.w)}),p.forEach(ln=>{const sr=en.current.nodes().find(ir=>ln.id===ir);if(sr&&en.current.node(sr)){const{width:ir,height:Es,x:Er,y:Wl}=en.current.node(sr);en.current.setNode(sr,{...ln,width:ir,height:Es,x:Er,y:Wl})}else en.current.setNode(ln.id,{...ln,width:0,height:0})}),d.forEach(ln=>{en.current.setEdge(ln.from,ln.to,{...ln,label:ln.label,width:0,height:0,labelpos:Ye,labeloffset:Pt,weight:on,minlen:qt})})},[d,p,Ye,Pt,on,qt]),Ko=m.useMemo(()=>gn()(()=>{Ut().layout(en.current);const{height:pn,width:zn}=en.current.graph(),ln=Math.max(0,pn||0),sr=Math.max(0,zn||0);js(sr),hi(ln),hr(en.current.nodes()),Vr(en.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(en.current.setGraph({rankdir:j,align:N,nodesep:G,edgesep:U,ranksep:fe,marginx:ce,marginy:ye,acyclicer:Ee,ranker:Me}),ra(),Ko(),Ko.cancel),[Ee,N,j,U,ce,ye,G,fe,Me,ra,Ko]);function Ml(pn,zn){return en.current.setNode(pn,zn),Ko(),en.current}function zl(pn,zn){return en.current.setEdge(pn,zn),Ko(),en.current}return(0,n.jsxs)("svg",{ref:Go,...Cr,width:"100%",height:Hr,viewBox:`0 0 ${an} ${bn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:An,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:wr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,n.jsx)("g",{id:mt,children:(0,n.jsxs)("svg",{width:lo,height:kr,y:bn/2-kr/2,x:an/2-lo/2,viewBox:`0 0 ${lo} ${kr}`,children:[Wr.map(pn=>{const zn=en.current.edge(pn);return zn?(0,n.jsx)(qe,{id:pn,setEdge:zl,render:sn,edge:zn,curve:_t},`${pn.v}-${pn.w}`):null}),Mn.map(pn=>{const zn=en.current.node(pn);return zn?(0,n.jsx)(mn,{setNode:Ml,render:v,node:zn},pn):null})]})})]})}var Z;const pe=(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:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Z=e.palette.banner.warning)!==null&&Z!==void 0?Z:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Fe=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=pe(),N=useApi(storageApiRef).forBucket("notifications");var G;const U=(G=N.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,ce]=useState(new Set(U)),ye=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{if(ye!=null&&ye.value){var Me;const Ye=(Me=ye==null?void 0:ye.value)!==null&&Me!==void 0?Me:[];ce(new Set(Ye))}},[ye==null?void 0:ye.value]);const Ee=()=>{N.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ee,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),nt=t.p+"static/missingAnnotation.67f79e98..svg",It=t.p+"static/noInformation.4b426325..svg",Ht=t.p+"static/createComponent.975d1e1e..svg",Mt=t.p+"static/noBuild.1715fa71..svg";const Qt=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),zt=({missing:e})=>{const o=Qt();switch(e){case"field":return(0,n.jsx)("img",{src:nt,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:It,alt:"no Information",className:o.generalImg});case"content":return(0,n.jsx)("img",{src:Ht,alt:"create Component",className:o.generalImg});case"data":return(0,n.jsx)("img",{src:Mt,alt:"no Build",className:o.generalImg});default:return null}},Y=(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 q(e){const{title:o,description:a,missing:d,action:p}=e,v=Y();return(0,n.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(T.Z,{variant:"h5",children:o})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(T.Z,{variant:"body1",children:a})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,n.jsx)(zt,{missing:d}):d.customImage})]})}const f=`apiVersion: backstage.io/v1alpha1
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Oe,t){"use strict";t.d(Oe,{n3:function(){return m},MS:function(){return S}});var h=t(25271),n=t(23054),z=t(96279),B=t.n(z);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class S{async getEntityAncestors(k,se){const{kind:_,namespace:te,name:$}=(0,h.of)(k.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}/ancestry`,se)}async getLocationById(k,se){return await this.requestOptional("GET",`/locations/${encodeURIComponent(k)}`,se)}async getEntities(k,se){const{filter:_=[],fields:te=[],order:$,offset:T,limit:H,after:ue}=k!=null?k:{},ie=[];for(const P of[_].flat()){const C=[];for(const[X,we]of Object.entries(P))for(const Ve of[we].flat())Ve===m?C.push(encodeURIComponent(X)):typeof Ve=="string"&&C.push(`${encodeURIComponent(X)}=${encodeURIComponent(Ve)}`);C.length&&ie.push(`filter=${C.join(",")}`)}if(te.length&&ie.push(`fields=${te.map(encodeURIComponent).join(",")}`),$)for(const P of[$].flat())P&&ie.push(`order=${encodeURIComponent(P.order)}:${encodeURIComponent(P.field)}`);T!==void 0&&ie.push(`offset=${T}`),H!==void 0&&ie.push(`limit=${H}`),ue!==void 0&&ie.push(`after=${encodeURIComponent(ue)}`);const I=ie.length?`?${ie.join("&")}`:"",L=await this.requestRequired("GET",`/entities${I}`,se),W=(P,C)=>{var X,we;if(((X=P.metadata)===null||X===void 0?void 0:X.name)===void 0||P.kind===void 0||((we=C.metadata)===null||we===void 0?void 0:we.name)===void 0||C.kind===void 0)return 0;const Ve=(0,h.eE)(P),Ge=(0,h.eE)(C);return Ve<Ge?-1:Ve>Ge?1:0};return{items:L.sort(W)}}async getEntitiesByRefs(k,se){var _;const te={entityRefs:k.entityRefs};!((_=k.fields)===null||_===void 0)&&_.length&&(te.fields=k.fields);const T=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,H=await this.fetchApi.fetch(T,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify(te)});if(!H.ok)throw await n.VL.fromResponse(H);const{items:ue}=await H.json();return{items:ue}}async getEntityByRef(k,se){const{kind:_,namespace:te,name:$}=(0,h.of)(k);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}`,se)}async getEntityByName(k,se){const{kind:_,namespace:te="default",name:$}=k;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(te)}/${encodeURIComponent($)}`,se)}async refreshEntity(k,se){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({entityRef:k})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(k,se){const{filter:_=[],facets:te}=k,$=[];for(const H of[_].flat()){const ue=[];for(const[ie,I]of Object.entries(H))for(const L of[I].flat())L===m?ue.push(encodeURIComponent(ie)):typeof L=="string"&&ue.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);ue.length&&$.push(`filter=${ue.join(",")}`)}for(const H of te)$.push(`facet=${encodeURIComponent(H)}`);const T=$.length?`?${$.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,se)}async addLocation(k,se){const{type:_="url",target:te,dryRun:$}=k,T=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${$?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({type:_,target:te})});if(T.status!==201)throw new Error(await T.text());const{location:H,entities:ue,exists:ie}=await T.json();if(!H)throw new Error(`Location wasn't added: ${te}`);return{location:H,entities:ue,exists:ie}}async getLocationByRef(k,se){return(await this.requestRequired("GET","/locations",se)).map(te=>te.data).find(te=>k===(0,h.NZ)(te))}async removeLocationById(k,se){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(k)}`,se)}async removeEntityByUid(k,se){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(k)}`,se)}async validateEntity(k,se,_){const te=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:k,location:se})});if(te.ok)return{valid:!0};if(te.status!==400)throw await n.VL.fromResponse(te);const{errors:$=[]}=await te.json();return{valid:!1,errors:$}}async requestIgnored(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok)throw await n.VL.fromResponse(T)}async requestRequired(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok)throw await n.VL.fromResponse(T);return await T.json()}async requestOptional(k,se,_){const te=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,$=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},T=await this.fetchApi.fetch(te,{method:k,headers:$});if(!T.ok){if(T.status===404)return;throw await n.VL.fromResponse(T)}return await T.json()}constructor(k){this.discoveryApi=k.discoveryApi,this.fetchApi=k.fetchApi||{fetch:B()}}}},25271:function(At,Oe,t){"use strict";t.d(Oe,{Tf:function(){return z},P1:function(){return ge},q1:function(){return ne},M6:function(){return Te},l2:function(){return n},zG:function(){return h},w$:function(){return En},nP:function(){return jn},aS:function(){return Hn},S4:function(){return Jt},cz:function(){return Vn},iB:function(){return jt},CV:function(){return mt},of:function(){return dt},Ou:function(){return Ze},eE:function(){return bt},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",z="backstage.io/edit-url",B="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",S="kubernetes.io/auth-provider";var l=t(76635),k=t.n(l);class se{async enforce(Z){return Z.metadata.namespace?Z:lodash.merge({metadata:{namespace:this.namespace}},Z)}constructor(Z=DEFAULT_NAMESPACE){this.namespace=Z}}class _{static isValidPrefixAndOrSuffix(Z,pe,Fe,Be){if(typeof Z!="string")return!1;const nt=Z.split(pe);return nt.length===1?Be(nt[0]):nt.length===2?Fe(nt[0])&&Be(nt[1]):!1}static isJsonSafe(Z){try{return k().isEqual(Z,JSON.parse(JSON.stringify(Z)))}catch{return!1}}static isValidDnsSubdomain(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=253&&Z.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(Z)}static isValidTag(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(Z)}static isValidUrl(Z){if(typeof Z!="string")return!1;try{return new URL(Z),!0}catch{return!1}}static isValidString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}}var te=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}}}}}'),$=t(27991),T=t.n($),H=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"}}}`),ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),ie=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const I=new Map,L=[te,H,ue,ie];function W(he){if(!(he!=null&&he.length))throw new TypeError("Unknown error");const Z=he[0];throw new TypeError(`${Z.instancePath||"<root>"} ${Z.message}${Z.params?` - ${Object.entries(Z.params).map(([pe,Fe])=>`${pe}: ${Fe}`).join(", ")}`:""}`)}function P(he,Z={}){var pe;const Fe=(pe=Z==null?void 0:Z.disableCache)!==null&&pe!==void 0?pe:!1,Be=Fe?"":JSON.stringify(he);if(!Fe){const Mt=I.get(Be);if(Mt)return Mt}const nt=C(he),It=new(T())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});nt.length&&It.addSchema(nt,void 0,void 0,!0);const Ht=It.compile(he);return Fe||I.set(Be,Ht),Ht}function C(he){if(typeof he!="object")return[];const Z=new Set;he.$id&&Z.add(he.$id);const pe=new Array,Fe=[he];for(;Fe.length;){const Be=Fe.pop();for(const nt of X(Be))if(!Z.has(nt)){Z.add(nt);const It=L.find(Ht=>Ht.$id===nt);It&&(pe.push(It),Fe.push(It))}}return pe}function*X(he){const Z=[he];for(;Z.length;){const pe=Z.pop();if(typeof pe=="object"&&pe)for(const[Fe,Be]of Object.entries(pe))Fe==="$ref"&&typeof Be=="string"?yield Be.split("#")[0]:Z.push(Be)}}function we(he){const Z=compileAjvSchema(he||entityEnvelopeSchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}function Ve(he){const Z=P(he);return pe=>{var Fe;if(Z(pe)===!0)return pe;const nt=(Fe=Z.errors)===null||Fe===void 0?void 0:Fe.filter(It=>["/kind","/apiVersion"].includes(It.instancePath));if((nt==null?void 0:nt.length)&&nt.every(It=>It.keyword==="enum"))return!1;throw W(Z.errors)}}function Ge(he){const Z=compileAjvSchema(he||entitySchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}class Je{static isValidApiVersion(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(Z)}static isValidObjectName(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(Z)}static isValidNamespace(Z){return _.isValidDnsLabel(Z)}static isValidLabelKey(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,Je.isValidObjectName)}static isValidLabelValue(Z){return Z===""||Je.isValidObjectName(Z)}static isValidAnnotationKey(Z){return _.isValidPrefixAndOrSuffix(Z,"/",_.isValidDnsSubdomain,Je.isValidObjectName)}static isValidAnnotationValue(Z){return typeof Z=="string"}}const We={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:he=>typeof he=="string"&&he.length>=1&&he.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(he)};function wt(he={}){return{...We,...he}}class Qe{async enforce(Z){function pe(f,A,M){if(A==null)throw new Error(`${f} must have a value`);let K;try{K=M(A)}catch(oe){throw new Error(`${f} could not be validated, ${oe}`)}if(!K){let oe;switch(M.name){case"isValidLabelValue":case"isValidObjectName":oe="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":oe="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":oe="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":oe="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":oe="a string";break;case"isValidKind":oe="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":oe="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":oe="a non empty string";break;default:oe=void 0;break}const me=oe?` expected ${oe} but found "${A}".`:"";throw new Error(`"${f}" is not valid;${me} 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 Fe(f,A,M){return A===void 0||pe(f,A,M)}pe("apiVersion",Z.apiVersion,this.validators.isValidApiVersion),pe("kind",Z.kind,this.validators.isValidKind),pe("metadata.name",Z.metadata.name,this.validators.isValidEntityName),Fe("metadata.namespace",Z.metadata.namespace,this.validators.isValidNamespace);var Be;for(const[f,A]of Object.entries((Be=Z.metadata.labels)!==null&&Be!==void 0?Be:[]))pe(`labels.${f}`,f,this.validators.isValidLabelKey),pe(`labels.${f}`,A,this.validators.isValidLabelValue);var nt;for(const[f,A]of Object.entries((nt=Z.metadata.annotations)!==null&&nt!==void 0?nt:[]))pe(`annotations.${f}`,f,this.validators.isValidAnnotationKey),pe(`annotations.${f}`,A,this.validators.isValidAnnotationValue);var It;const Ht=(It=Z.metadata.tags)!==null&&It!==void 0?It:[];for(let f=0;f<Ht.length;++f)pe(`tags.${f}`,Ht[f],this.validators.isValidTag);var Mt;const Qt=(Mt=Z.metadata.links)!==null&&Mt!==void 0?Mt:[];for(let f=0;f<Qt.length;++f){var zt,Y,q;pe(`links.${f}.url`,(zt=Qt[f])===null||zt===void 0?void 0:zt.url,CommonValidatorFunctions.isValidUrl),Fe(`links.${f}.title`,(Y=Qt[f])===null||Y===void 0?void 0:Y.title,CommonValidatorFunctions.isNonEmptyString),Fe(`links.${f}.icon`,(q=Qt[f])===null||q===void 0?void 0:q.icon,KubernetesValidatorFunctions.isValidObjectName)}return Z}constructor(Z=makeValidator()){this.validators=Z}}class xe{async enforce(Z){if(!this.validate){const Be=new Ajv({allowUnionTypes:!0});this.validate=Be.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(Z)===!0)return Z;const[Fe]=this.validate.errors||[];throw Fe?new Error(`Malformed envelope, ${Fe.instancePath||"<root>"} ${Fe.message}`):new Error("Malformed envelope, Unknown error")}}function _e(he){let Z=he.indexOf(":");const pe=he.indexOf("/");pe!==-1&&pe<Z&&(Z=-1);const Fe=Z===-1?void 0:he.slice(0,Z),Be=pe===-1?void 0:he.slice(Z+1,pe),nt=he.slice(Math.max(Z+1,pe+1));if(Fe===""||Be===""||nt==="")throw new TypeError(`Entity reference "${he}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Fe,namespace:Be,name:nt}}function jt(he){return{kind:he.kind,namespace:he.metadata.namespace||h,name:he.metadata.name}}function dt(he,Z){if(!he)throw new Error("Entity reference must not be empty");const pe=Z==null?void 0:Z.defaultKind,Fe=(Z==null?void 0:Z.defaultNamespace)||h;let Be,nt,It;if(typeof he=="string"){const Y=_e(he);var Ht;Be=(Ht=Y.kind)!==null&&Ht!==void 0?Ht:pe;var Mt;nt=(Mt=Y.namespace)!==null&&Mt!==void 0?Mt:Fe,It=Y.name}else{var Qt;Be=(Qt=he.kind)!==null&&Qt!==void 0?Qt:pe;var zt;nt=(zt=he.namespace)!==null&&zt!==void 0?zt:Fe,It=he.name}if(Be)if(nt){if(!It){const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Be,namespace:nt,name:It}}function bt(he){let Z,pe,Fe;if("metadata"in he){Z=he.kind;var Be;pe=(Be=he.metadata.namespace)!==null&&Be!==void 0?Be:h,Fe=he.metadata.name}else{Z=he.kind;var nt;pe=(nt=he.namespace)!==null&&nt!==void 0?nt:h,Fe=he.name}return`${Z.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Fe.toLocaleLowerCase("en-US")}`}class ut{async enforce(Z){let pe=Z;for(const Fe of this.policies){const Be=await Fe.enforce(pe);if(!Be)throw new Error(`Policy ${Fe.constructor.name} did not return a result`);pe=Be}return pe}constructor(Z){this.policies=Z}}class Rt{async enforce(Z){for(const pe of this.policies){const Fe=await pe.enforce(Z);if(Fe)return Fe}throw new Error("The entity did not match any known policy")}constructor(Z){this.policies=Z}}const Zt={allOf(he){return new ut(he)},oneOf(he){return new Rt(he)}};var He=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function le(he){let Z;return{async check(pe){return Z||(Z=Ve(he)),Z(pe)===pe}}}const Re=le(He);var Ae=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 Xe=le(Ae);var St=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 Ot=le(St);var ht=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Tt=le(ht);var gt=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 Dt=le(gt),Jt="ownedBy",Xt="ownerOf",cn="consumesApi",Ut="apiConsumedBy",fn="providesApi",gn="apiProvidedBy",jn="dependsOn",En="dependencyOf",Wn="parentOf",An="childOf",dn="memberOf",rn="hasMember",Vn="partOf",Hn="hasPart";var Sn=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 mn=le(Sn);var Tn=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 In=le(Tn);var Kn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const vn=le(Kn),ge="backstage.io/managed-by-location",ne="backstage.io/managed-by-origin-location",Te="backstage.io/source-location";function Ze(he){if(typeof he!="string")throw new TypeError(`Unable to parse location ref '${he}', unexpected argument ${typeof he}`);const Z=he.indexOf(":");if(Z<0)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=he.substring(0,Z).trim(),Fe=he.substring(Z+1).trim();if(!pe||!Fe)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${he}', please prefix it with 'url:', e.g. 'url:${he}'`);return{type:pe,target:Fe}}function qe(he){const{type:Z,target:pe}=he;if(Z){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${Z}:${pe}`}function mt(he){var Z,pe,Fe,Be,nt;const It=(nt=(Z=he.metadata)===null||Z===void 0||(pe=Z.annotations)===null||pe===void 0?void 0:pe[Te])!==null&&nt!==void 0?nt:(Fe=he.metadata)===null||Fe===void 0||(Be=Fe.annotations)===null||Be===void 0?void 0:Be[ge];if(!It)throw new Error(`Entity '${bt(he)}' is missing location`);return Ze(It)}},23196:function(At,Oe,t){"use strict";t.d(Oe,{zx:function(){return Qe},Oi:function(){return Re},VY:function(){return Ni},yW:function(){return _a},XF:function(){return St},mn:function(){return he},NX:function(){return h},ub:function(){return q},mf:function(){return ol},yu:function(){return Cn},h4:function(){return Ji},M6:function(){return Gr},i9:function(){return gl},aR:function(){return Fi},rJ:function(){return Ir},Oh:function(){return Sl},hu:function(){return yl},rU:function(){return Je},nU:function(){return vo},SA:function(){return Yr},sk:function(){return it},Or:function(){return Co},T3:function(){return Xi},g9:function(){return jl},Ex:function(){return wo},Gk:function(){return u},tn:function(){return Ui},Ph:function(){return wn},YE:function(){return ti},v7:function(){return ha},R6:function(){return Ss},tR:function(){return _s},uw:function(){return Ea},qt:function(){return Ti},iA:function(){return Yi},GB:function(){return yn},po:function(){return ur},mZ:function(){return Wo},Pf:function(){return Mr}});var h={};t.r(h),t.d(h,{Nm:function(){return Ot},ht:function(){return gt},LJ:function(){return Tt}});var n=t(52322),z=t(25248),B=t(19928),m=t(2784);function S(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const U=d.alert$().subscribe(fe=>a(ce=>ce.concat(fe)));return()=>{U.unsubscribe()}},[d]);const[N]=o;if(useEffect(()=>{if(N&&N.display==="transient"){const U=setTimeout(()=>{a(fe=>{const ce=fe.filter(ye=>ye!==N);return ce.length===fe.length?fe:ce})},j);return()=>clearTimeout(U)}},[N,j]),o.length===0)return null;const G=()=>{a(U=>U.filter(fe=>fe!==N))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:N.severity,children:_jsxs(Typography,{component:"span",children:[String(N.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=t(79692),k=t(12420);const se=(0,l.Z)(e=>(0,k.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:o,picture:a,customStyles:d}=e,p=se();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(o)})})}var te=t(77277),$=t(86689),T=t(90436),H=t(72779),ue=t.n(H),ie=t(76635),I=t(79635),L=t(39857);function W(){const[e]=(0,I.is)((0,n.jsx)(I.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const P=(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"}),C=e=>/^([a-z+.-]+):/.test(e),X=()=>{try{return(0,z.h_)(z.Ds).getOptionalString("app.baseUrl")}catch{return}},we=()=>{const e="http://sample.dev";var o;const a=(o=X())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,ie.trimEnd)(d,"/")},Ve=e=>{let o=String(e);const a=we(),d=C(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},Ge=e=>{if(e instanceof Array)return e.map(Ge).join(" ").trim();if(typeof e=="object"&&e){var o;return Ge(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},Je=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=P(),v=(0,z.z$)(),j=W()?Ve(a.to):a.to,N=Ge(a.children)||j,G=C(j),U=G&&!!/^https?:/.exec(j),fe=ce=>{e==null||e(ce),o||v.captureEvent("click",N,{attributes:{to:j}})};return G?(0,n.jsxs)($.Z,{...U?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:fe,className:ue()(p.externalLink,a.className),children:[a.children,(0,n.jsx)(T.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)($.Z,{...a,ref:d,component:L.rU,to:j,onClick:fe})}),We=m.forwardRef((e,o)=>(0,n.jsx)(Je,{ref:o,...e,color:"initial"})),Qe=m.forwardRef((e,o)=>(0,n.jsx)(te.Z,{ref:o,component:We,...e}));var xe=t(95544),_e=t(60364),jt=t(83229),dt=t(26639),bt=t(39595),ut=t(61837),Rt=t(80030),Zt=t(19353),He=t(95074);function le(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,z.h_)(z.VE),[j,N]=(0,m.useState)(!1),[{error:G},U]=(0,He.Z)();(0,m.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=ce=>{ce.stopPropagation(),N(!0),U(o)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Rt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>N(!1),open:j,children:(0,n.jsx)(ut.Z,{onClick:fe,"aria-label":p,children:(0,n.jsx)(Zt.Z,{})})})})}function Re(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,N=(0,_e.Z)(),G=N.palette.type==="dark"?dt.Z:bt.Z,U=N.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(xe.Z,{position:"relative",children:[(0,n.jsx)(jt.Z,{customStyle:v,language:a,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:fe=>p!=null&&p.includes(fe)?{style:{backgroundColor:U}}:{},children:o}),j&&(0,n.jsx)(xe.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(le,{text:o})})]})}var Ae=t(41156),Xe=t(88188);function St(e){const{title:o,to:a}=e,d=(0,Ae.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,n.jsx)(ut.Z,{component:L.rU,color:"primary",title:o,size:"small",to:a,children:(0,n.jsx)(Xe.Z,{})}):(0,n.jsx)(te.Z,{component:L.rU,variant:"contained",color:"primary",to:a,children:o}):null}var Ot;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Ot||(Ot={}));var ht;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ht||(ht={}));var Tt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Tt||(Tt={}));var gt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(gt||(gt={}));var Dt=t(27397),Jt=t(11105),Xt=t(97963),cn=t(46506),Ut=t.n(cn),fn=t(54073),gn=t.n(fn),jn=t(10368);const En=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Wn({node:{id:e}}){const o=En(),[a,d]=m.useState(0),[p,v]=m.useState(0),j=m.useRef(null);m.useLayoutEffect(()=>{if(j.current){let{height:fe,width:ce}=j.current.getBBox();fe=Math.round(fe),ce=Math.round(ce),(fe!==p||ce!==a)&&(d(ce),v(fe))}},[a,p]);const N=10,G=a+N*2,U=p+N*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:o.node,width:G,height:U,rx:10}),(0,n.jsx)("text",{ref:j,className:o.text,y:U/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const An="arrow-marker",dn="node",rn="edge",Vn="label",Hn=(0,jn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Sn=e=>(0,n.jsx)(Wn,{...e});function mn({render:e=Sn,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,N=a,G=Hn(),U=m.useRef(null);return m.useLayoutEffect(()=>{if(U.current){let{height:fe,width:ce}=U.current.getBBox();fe=Math.round(fe),ce=Math.round(ce),(fe!==p||ce!==d)&&o(a.id,{...a,height:fe,width:ce})}},[a,d,p,o]),(0,n.jsx)("g",{ref:U,"data-testid":dn,className:G.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:N})})}var Tn=t(76985),In=t(39829),Kn=t(19574),vn=t.n(Kn);const ge=(0,jn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ne({edge:{label:e}}){const o=ge();return(0,n.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Te=(0,jn.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Ze=e=>(0,n.jsx)(ne,{...e});function qe({render:e=Ze,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:N,height:G,points:U}=d,fe=d,ce=Te(),ye=m.useRef(null);m.useLayoutEffect(()=>{if(ye.current){let{height:Ye,width:Pt}=ye.current.getBBox();Ye=Math.round(Ye),Pt=Math.round(Pt),(Ye!==G||Pt!==N)&&o(a,{...d,height:Ye,width:Pt})}},[d,G,N,o,a]);let Ee="";const Me=m.useMemo(()=>Tn.Z().x(Ye=>Ye.x).y(Ye=>Ye.y).curve(In[p]),[p]);if(U){const Ye=U.filter(Pt=>vn()(Pt.x)&&vn()(Pt.y));Ee=Me(Ye)||""}return(0,n.jsxs)(n.Fragment,{children:[Ee&&(0,n.jsx)("path",{"data-testid":rn,className:ce.path,d:Ee}),fe.label?(0,n.jsx)("g",{ref:ye,"data-testid":Vn,className:ce.label,transform:`translate(${v},${j})`,children:e({edge:fe})}):null]})}const mt="workspace";function he(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:j=Ot.TOP_BOTTOM,align:N,nodeMargin:G=50,edgeMargin:U=10,rankMargin:fe=50,paddingX:ce=0,paddingY:ye=0,acyclicer:Ee,ranker:Me=Tt.NETWORK_SIMPLEX,labelPosition:Ye=gt.RIGHT,labelOffset:Pt=10,edgeRanks:qt=1,edgeWeight:on=1,renderLabel:sn,defs:kt,zoom:nn="enabled",curve:_t="curveMonotoneX",fit:Sr="grow",...Cr}=e,wr=(0,Xt.Z)(),[jr,di]=m.useState(100),[Pr,ui]=m.useState(100),en=m.useRef(new(Ut()).graphlib.Graph),[lo,js]=m.useState(((o=en.current.graph())===null||o===void 0?void 0:o.width)||0),[kr,hi]=m.useState(((a=en.current.graph())===null||a===void 0?void 0:a.height)||0),[Mn,hr]=m.useState([]),[Wr,Vr]=m.useState([]),an=Math.max(lo,jr),bn=Math.max(kr,Pr),co=Math.min(kr,Pr),Hr=Sr==="grow"?bn:co,Go=m.useMemo(()=>gn()(pn=>{if(!pn)return;const zn=Jt.Z(pn),ln=Jt.Z(pn.getElementById(mt));function sr(){zn.call(Dt.sP().scaleExtent([1,10]).on("zoom",Er=>{Er.transform.x=Math.min(0,Math.max(Er.transform.x,an-an*Er.transform.k)),Er.transform.y=Math.min(0,Math.max(Er.transform.y,bn-bn*Er.transform.k)),ln.attr("transform",Er.transform)}))}nn==="enabled"?sr():nn==="enable-on-click"&&zn.on("click",()=>sr());const{width:ir,height:Es}=pn.getBoundingClientRect();jr!==ir&&di(ir),Pr!==Es&&ui(Es)},100),[Pr,jr,an,bn,nn]),ra=m.useCallback(()=>{const pn=en.current.nodes(),zn=en.current.edges();pn.forEach(ln=>{p.some(ir=>ir.id===ln)||en.current.removeNode(ln)}),zn.forEach(ln=>{d.some(ir=>ir.from===ln.v&&ir.to===ln.w)||en.current.removeEdge(ln.v,ln.w)}),p.forEach(ln=>{const sr=en.current.nodes().find(ir=>ln.id===ir);if(sr&&en.current.node(sr)){const{width:ir,height:Es,x:Er,y:Wl}=en.current.node(sr);en.current.setNode(sr,{...ln,width:ir,height:Es,x:Er,y:Wl})}else en.current.setNode(ln.id,{...ln,width:0,height:0})}),d.forEach(ln=>{en.current.setEdge(ln.from,ln.to,{...ln,label:ln.label,width:0,height:0,labelpos:Ye,labeloffset:Pt,weight:on,minlen:qt})})},[d,p,Ye,Pt,on,qt]),Ko=m.useMemo(()=>gn()(()=>{Ut().layout(en.current);const{height:pn,width:zn}=en.current.graph(),ln=Math.max(0,pn||0),sr=Math.max(0,zn||0);js(sr),hi(ln),hr(en.current.nodes()),Vr(en.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(en.current.setGraph({rankdir:j,align:N,nodesep:G,edgesep:U,ranksep:fe,marginx:ce,marginy:ye,acyclicer:Ee,ranker:Me}),ra(),Ko(),Ko.cancel),[Ee,N,j,U,ce,ye,G,fe,Me,ra,Ko]);function Ml(pn,zn){return en.current.setNode(pn,zn),Ko(),en.current}function zl(pn,zn){return en.current.setEdge(pn,zn),Ko(),en.current}return(0,n.jsxs)("svg",{ref:Go,...Cr,width:"100%",height:Hr,viewBox:`0 0 ${an} ${bn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:An,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:wr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,n.jsx)("g",{id:mt,children:(0,n.jsxs)("svg",{width:lo,height:kr,y:bn/2-kr/2,x:an/2-lo/2,viewBox:`0 0 ${lo} ${kr}`,children:[Wr.map(pn=>{const zn=en.current.edge(pn);return zn?(0,n.jsx)(qe,{id:pn,setEdge:zl,render:sn,edge:zn,curve:_t},`${pn.v}-${pn.w}`):null}),Mn.map(pn=>{const zn=en.current.node(pn);return zn?(0,n.jsx)(mn,{setNode:Ml,render:v,node:zn},pn):null})]})})]})}var Z;const pe=(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:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Z=e.palette.banner.warning)!==null&&Z!==void 0?Z:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Fe=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=pe(),N=useApi(storageApiRef).forBucket("notifications");var G;const U=(G=N.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,ce]=useState(new Set(U)),ye=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{if(ye!=null&&ye.value){var Me;const Ye=(Me=ye==null?void 0:ye.value)!==null&&Me!==void 0?Me:[];ce(new Set(Ye))}},[ye==null?void 0:ye.value]);const Ee=()=>{N.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ee,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),nt=t.p+"static/missingAnnotation.67f79e98..svg",It=t.p+"static/noInformation.4b426325..svg",Ht=t.p+"static/createComponent.975d1e1e..svg",Mt=t.p+"static/noBuild.1715fa71..svg";const Qt=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),zt=({missing:e})=>{const o=Qt();switch(e){case"field":return(0,n.jsx)("img",{src:nt,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:It,alt:"no Information",className:o.generalImg});case"content":return(0,n.jsx)("img",{src:Ht,alt:"create Component",className:o.generalImg});case"data":return(0,n.jsx)("img",{src:Mt,alt:"no Build",className:o.generalImg});default:return null}},Y=(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 q(e){const{title:o,description:a,missing:d,action:p}=e,v=Y();return(0,n.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(T.Z,{variant:"h5",children:o})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(T.Z,{variant:"body1",children:a})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,n.jsx)(zt,{missing:d}):d.customImage})]})}const f=`apiVersion: backstage.io/v1alpha1
|
|
2
2
|
kind: Component
|
|
3
3
|
metadata:
|
|
4
4
|
name: example
|
|
@@ -500,4 +500,4 @@ ${K.href}
|
|
|
500
500
|
|
|
501
501
|
Feedback:`),ft=(me==null?void 0:me.type)==="github"?(0,En.BT)(oe.href,"blob"):oe.href,ct=rn()(ft),et=`/${ct.organization}/${ct.name}`,Ue=K.cloneNode();switch(me==null?void 0:me.type){case"gitlab":Ue.href=`${oe.origin}${et}/issues/new?issue[title]=${tt}&issue[description]=${it}`;break;case"github":Ue.href=`${oe.origin}${et}/issues/new?title=${tt}&body=${it}`;break;default:return A}return An.render(n.createElement(Wn.Z),Ue),Ue.style.paddingLeft="5px",Ue.title="Leave feedback for this page",Ue.id="git-feedback-link",K==null||K.insertAdjacentElement("beforebegin",Ue),A};var Hn=t(44882);const Sn=()=>f=>{const A=f.querySelector('.md-header label[for="__drawer"]'),M=f.querySelector("article");if(!A||!M)return f;const K=A.cloneNode();return An.render(n.createElement(Hn.Z),K),K.id="toggle-sidebar",K.title="Toggle Sidebar",K.classList.add("md-content__button"),K.style.setProperty("padding","0 0 0 5px"),K.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),M==null||M.prepend(K),f},mn=()=>f=>(((M,K)=>{Array.from(M).filter(oe=>oe.hasAttribute(K)).forEach(oe=>{const me=oe.getAttribute(K);if(me){me.match(/^https?:\/\//i)&&oe.setAttribute("target","_blank");try{const Le=Tn(window.location.href);oe.setAttribute(K,new URL(me,Le).toString())}catch{oe.replaceWith(oe.textContent||me)}}})})(Array.from(f.getElementsByTagName("a")),"href"),f);function Tn(f){const A=new URL(f);return!A.pathname.endsWith("/")&&!A.pathname.endsWith(".html")&&(A.pathname+="/"),A.toString()}const In=({baseUrl:f,onClick:A})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(K=>{K.addEventListener("click",oe=>{const Le=K.getAttribute("href");!Le||Le.startsWith(f)&&!K.hasAttribute("download")&&(oe.preventDefault(),A(oe,Le))})}),M);var Kn=t(15459),vn=t(80030),ge=t(72379),ne=t(41547);const Te=(0,Kn.Z)(f=>({tooltip:{fontSize:"inherit",color:f.palette.text.primary,margin:0,padding:f.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(vn.ZP),Ze=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),qe=({text:f})=>{const[A,M]=(0,n.useState)(!1),K=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(f),M(!0)},[f]),oe=(0,n.useCallback)(()=>{M(!1)},[M]);return(0,h.jsx)(Te,{title:"Copied to clipboard",placement:"left",open:A,onClose:oe,leaveDelay:1e3,children:(0,h.jsx)(se.Z,{className:"md-clipboard md-icon",onClick:K,children:(0,h.jsx)(Ze,{})})})},mt=f=>A=>{const M=A.querySelectorAll("pre > code");for(const oe of M){var K;const me=oe.textContent||"",Le=document.createElement("div");oe==null||(K=oe.parentElement)===null||K===void 0||K.prepend(Le),An.render((0,h.jsx)(ne.Z,{theme:f,children:(0,h.jsx)(qe,{text:me})}),Le)}return A},he=()=>f=>{var A;return(A=f.querySelector(".md-header"))===null||A===void 0||A.remove(),f},Z=()=>f=>{var A,M;return(A=f.querySelector(".md-footer .md-copyright"))===null||A===void 0||A.remove(),(M=f.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),f},pe=({onLoading:f,onLoaded:A})=>M=>(f(),M.addEventListener(m.Ox,function K(){A(),M.removeEventListener(m.Ox,K)}),M),Fe=()=>f=>(f.addEventListener(m.Ox,function A(){if(window.location.hash){var M;const K=window.location.hash.slice(1);(M=f==null?void 0:f.querySelector(`[id="${K}"]`))===null||M===void 0||M.scrollIntoView()}f.removeEventListener(m.Ox,A)}),f),Be=()=>f=>(setTimeout(()=>{const A=f==null?void 0:f.querySelectorAll("li.md-nav__item--active");A.length!==0&&(A.forEach(K=>{const oe=K==null?void 0:K.querySelector("input");oe!=null&&oe.checked||oe==null||oe.click()}),A[A.length-1].scrollIntoView())},200),f),nt=async(f,A)=>{let M;if(typeof f=="string")M=new DOMParser().parseFromString(f,"text/html").documentElement;else if(f instanceof Element)M=f;else throw new Error("dom is not a recognized type");for(const K of A)M=await K(M);return M},It="screen and (max-width: 76.1875em)",Ht=f=>{const A=(0,Ve.s0)(),M=(0,Ge.Z)(),K=(0,Je.Z)(It),oe=Re(),me=fn(),Le=(0,W.z$)(),tt=(0,W.h_)(m.Dl),it=(0,W.h_)(We.q3),{state:ft,path:ct,content:et}=(0,C.DK)(),[Ue,Et]=(0,n.useState)(null),Lt=(0,m.ux)(Ue),Gt=(0,n.useCallback)(()=>{if(!Ue)return;Ue.querySelectorAll(".md-sidebar").forEach(ot=>{if(K)ot.style.top="0px";else{const un=document==null?void 0:document.querySelector(".techdocs-reader-page");var st;const yn=(st=un==null?void 0:un.getBoundingClientRect().top)!==null&&st!==void 0?st:0;var Kt;let Yn=(Kt=Ue.getBoundingClientRect().top)!==null&&Kt!==void 0?Kt:0;const Bn=Ue.querySelector(".md-container > .md-tabs");var On;const Cn=(On=Bn==null?void 0:Bn.getBoundingClientRect().height)!==null&&On!==void 0?On:0;Yn<yn&&(Yn=yn),ot.style.top=`${Math.max(Yn,0)+Cn}px`}ot.style.setProperty("opacity","1")})},[Ue,K]);(0,n.useEffect)(()=>(window.addEventListener("resize",Gt),window.addEventListener("scroll",Gt,!0),()=>{window.removeEventListener("resize",Gt),window.removeEventListener("scroll",Gt,!0)}),[Ue,Gt]);const vt=(0,n.useCallback)(()=>{if(!Ue)return;const pt=Ue.querySelector(".md-footer");pt&&(pt.style.width=`${Ue.getBoundingClientRect().width}px`)},[Ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",vt),()=>{window.removeEventListener("resize",vt)}),[Ue,vt]),(0,n.useEffect)(()=>{Lt||(vt(),Gt())},[ft,Lt,vt,Gt]);const Nt=(0,n.useCallback)((pt,ot)=>nt(pt,[oe,jn({techdocsStorageApi:tt,entityId:f,path:ot}),mn(),Sn(),he(),Z(),Vn(it),me]),[f,it,tt,oe,me]),Bt=(0,n.useCallback)(async pt=>nt(pt,[Fe(),Be(),mt(M),In({baseUrl:window.location.origin,onClick:(ot,st)=>{var Kt;const On=ot.ctrlKey||ot.metaKey,un=new URL(st),yn=`${un.pathname}${un.search}${un.hash}`,Yn=((Kt=ot.target)===null||Kt===void 0?void 0:Kt.innerText)||st,Bn=st.replace(window.location.origin,"");if(Le.captureEvent("click",Yn,{attributes:{to:Bn}}),un.hash)if(On)window.open(yn,"_blank");else{var Cn;A(yn),(Cn=pt==null?void 0:pt.querySelector(`[id="${un.hash.slice(1)}"]`))===null||Cn===void 0||Cn.scrollIntoView()}else On?window.open(yn,"_blank"):A(yn)}}),pe({onLoading:()=>{},onLoaded:()=>{var ot;(ot=pt.querySelector(".md-nav__title"))===null||ot===void 0||ot.removeAttribute("for")}}),pe({onLoading:()=>{Array.from(pt.querySelectorAll(".md-sidebar")).forEach(st=>{st.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,A,Le]);return(0,n.useEffect)(()=>{if(!et)return()=>{};let pt=!0;return Nt(et,ct).then(async ot=>{if(!(ot!=null&&ot.innerHTML)||!pt)return;window.scroll({top:0});const st=await Bt(ot);Et(st)}),()=>{pt=!1}},[et,ct,Nt,Bt]),Ue};var Mt=t(8560);const Qt=()=>{const f=(0,m.$L)(),{shadowRoot:A}=(0,m.x1)(),M=A==null?void 0:A.querySelector('[data-md-component="content"]'),K=A==null?void 0:A.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let oe=K==null?void 0:K.querySelector('[data-techdocs-addons-location="primary sidebar"]');oe||(oe=document.createElement("div"),oe.setAttribute("data-techdocs-addons-location","primary sidebar"),K==null||K.prepend(oe));const me=A==null?void 0:A.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Le=me==null?void 0:me.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Le||(Le=document.createElement("div"),Le.setAttribute("data-techdocs-addons-location","secondary sidebar"),me==null||me.prepend(Le)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Mt.Z,{container:oe,children:f.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,h.jsx)(Mt.Z,{container:M,children:f.renderComponentsByLocation(m.oZ.Content)}),(0,h.jsx)(Mt.Z,{container:Le,children:f.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},zt=(0,z.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Y=(0,C.m1)(f=>{var A;const{withSearch:M=!0,onReady:K}=f,oe=zt(),{entityMetadata:{value:me,loading:Le},entityRef:tt,setShadowRoot:it}=(0,m.x1)(),ft=Ht(tt),ct=(0,n.useCallback)(et=>{it(et),K instanceof Function&&K()},[it,K]);return Le===!1&&!me?(0,h.jsx)(S.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ft?(0,h.jsx)(S.VY,{children:(0,h.jsxs)(B.Z,{container:!0,children:[(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(we,{})}),M&&(0,h.jsx)(B.Z,{className:oe.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:tt,entityTitle:me==null||(A=me.metadata)===null||A===void 0?void 0:A.title})}),(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(m.VA,{element:ft,onAppend:ct,children:(0,h.jsx)(Qt,{})})})]})}):(0,h.jsx)(S.VY,{children:(0,h.jsx)(B.Z,{container:!0,children:(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(we,{})})})})}),q=null},93225:function(At,Oe,t){"use strict";t.d(Oe,{S:function(){return ue}});var h=t(52322),n=t(2784),z=t(18671),B=t(60905),m=t(98069),S=t(73250),l=t(61886),k=t(56941),se=t(25271),_=t(23196),te=t(25248),$=t(76635),T=t(95573);const H=(0,h.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),ue=ie=>{const{children:I}=ie,L=(0,l.$L)(),W=(0,te.h_)(te.Ds),{title:P,setTitle:C,subtitle:X,setSubtitle:we,entityRef:Ve,metadata:{value:Ge,loading:Je},entityMetadata:{value:We,loading:wt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Ge||(C(Ge.site_name),we(()=>{let{site_description:le}=Ge;return(!le||le==="None")&&(le=""),le}))},[Ge,C,we]);const Qe=W.getOptional("app.title")||"Backstage",xe=[P,X,Qe].filter(Boolean).join(" | "),{locationMetadata:_e,spec:jt}=We||{},dt=jt==null?void 0:jt.lifecycle,bt=We?(0,k.hF)(We,se.S4):[],ut=(0,te.tg)(T._Z)(),Rt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_.i9,{label:(0,$.capitalize)((We==null?void 0:We.kind)||"entity"),value:(0,h.jsx)(k.dx,{color:"inherit",entityRef:Ve,title:We==null?void 0:We.metadata.title,defaultKind:"Component"})}),bt.length>0&&(0,h.jsx)(_.i9,{label:"Owner",value:(0,h.jsx)(k.rI,{color:"inherit",entityRefs:bt,defaultKind:"group"})}),dt?(0,h.jsx)(_.i9,{label:"Lifecycle",value:dt}):null,_e&&_e.type!=="dir"&&_e.type!=="file"?(0,h.jsx)(_.i9,{label:"",value:(0,h.jsxs)(B.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(S.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:_e.target}):null]});return!wt&&We===void 0||!Je&&Ge===void 0?null:(0,h.jsxs)(_.h4,{type:"Documentation",typeLink:ut,title:P||H,subtitle:X===""?void 0:X||H,children:[(0,h.jsx)(z.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:xe})}),Rt,I,L.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(At,Oe,t){"use strict";t.d(Oe,{b:function(){return $}});var h=t(52322),n=t(2784),z=t(79692),B=t(15223),m=t(95544),S=t(80030),l=t(61837),k=t(48348),se=t(47603),_=t(61886);const te=(0,z.Z)(T=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:T.spacing(3,3,0)}})),$=T=>{const H=te(),[ue,ie]=(0,n.useState)(null),I=(0,n.useCallback)(Ve=>{ie(Ve.currentTarget)},[]),L=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:W,loading:P}}=(0,_.x1)(),C=(0,_.$L)(),X=C.renderComponentsByLocation(_.oZ.Subheader),we=C.renderComponentsByLocation(_.oZ.Settings);return!X&&!we||P===!1&&!W?null:(0,h.jsx)(B.Z,{classes:H,...T.toolbarProps,children:(0,h.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[X,we?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:I,children:(0,h.jsx)(se.Z,{})})}),(0,h.jsx)(k.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ue,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ue),onClose:L,keepMounted:!0,children:we})]}):null]})})}},95481:function(At,Oe,t){"use strict";t.d(Oe,{DK:function(){return $},m1:function(){return H}});var h=t(52322),n=t(2784),z=t(79635),B=t(61886),m=t(25248),S=t(64279),l=t(77446);function k({contentLoading:ue,content:ie,activeSyncState:I}){return ue||I==="BUILD_READY_RELOAD"||!ie&&I==="CHECKING"?"CHECKING":!ie&&I==="BUILDING"?"INITIAL_BUILD":ie?I==="BUILDING"?"CONTENT_STALE_REFRESHING":I==="BUILD_READY"?"CONTENT_STALE_READY":I==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function se(ue,ie){const I={...ue};switch(ie.type){case"sync":ie.state==="CHECKING"&&(I.buildLog=[]),I.activeSyncState=ie.state,I.syncError=ie.syncError;break;case"contentLoading":I.contentLoading=!0,I.contentError=void 0;break;case"content":typeof ie.path=="string"&&(I.path=ie.path),I.contentLoading=!1,I.content=ie.content,I.contentError=ie.contentError;break;case"buildLog":I.buildLog=I.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(I.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(I.activeSyncState="UP_TO_DATE",I.buildLog=[]),I}function _(ue,ie,I,L){var W,P;const[C,X]=(0,n.useReducer)(se,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),we=(0,m.h_)(B.Dl),{retry:Ve}=(0,l.Z)(async()=>{X({type:"contentLoading"});try{const We=await we.getEntityDocs({kind:ue,namespace:ie,name:I},L);return X({type:"content",content:We,path:L}),We}catch(We){X({type:"content",contentError:We,path:L})}},[we,ue,ie,I,L]),Ge=(0,n.useRef)({content:void 0,reload:()=>{}});return Ge.current={content:C.content,reload:Ve},(0,S.default)(async()=>{X({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{X({type:"sync",state:"BUILDING"})},1e3);try{switch(await we.syncEntityDocs({kind:ue,namespace:ie,name:I},Qe=>{X({type:"buildLog",log:Qe})})){case"updated":Ge.current.content?X({type:"sync",state:"BUILD_READY"}):(Ge.current.reload(),X({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":X({type:"sync",state:"UP_TO_DATE"});break;default:X({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(wt){X({type:"sync",state:"ERROR",syncError:wt})}finally{clearTimeout(We)}},[ue,I,ie,we,X,Ge]),{state:(0,n.useMemo)(()=>k({activeSyncState:C.activeSyncState,contentLoading:C.contentLoading,content:C.content}),[C.activeSyncState,C.content,C.contentLoading]),contentReload:Ve,path:C.path,content:C.content,contentErrorMessage:(W=C.contentError)===null||W===void 0?void 0:W.toString(),syncErrorMessage:(P=C.syncError)===null||P===void 0?void 0:P.toString(),buildLog:C.buildLog}}const te=(0,n.createContext)({}),$=()=>(0,n.useContext)(te),T=({children:ue})=>{const{"*":ie=""}=(0,z.UO)(),{entityRef:I}=(0,B.x1)(),{kind:L,namespace:W,name:P}=I,C=_(L,W,P,ie);return(0,h.jsx)(te.Provider,{value:C,children:ue instanceof Function?ue(C):ue})},H=ue=>ie=>(0,h.jsx)(T,{children:(0,h.jsx)(ue,{...ie})})},95573:function(At,Oe,t){"use strict";t.d(Oe,{Fw:function(){return z},_Z:function(){return n},pd:function(){return B}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),z=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),B=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsSearchResultListItem:function(){return _}});var h=t(52322),n=t(2784),z=t(79692),B=t(49378),m=t(86136),S=t(90436),l=t(23196),k=t(15096);const se=(0,z.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),_=te=>{const{result:$,highlight:T,lineClamp:H=5,asListItem:ue=!0,asLink:ie=!0,title:I,icon:L}=te,W=se(),P=({children:we})=>ie?(0,h.jsx)(l.rU,{noTrack:!0,to:$.location,children:we}):(0,h.jsx)(h.Fragment,{children:we}),C=()=>{const we=T!=null&&T.fields.title?(0,h.jsx)(k.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):$.title,Ve=T!=null&&T.fields.entityTitle?(0,h.jsx)(k.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):$.entityTitle,Ge=T!=null&&T.fields.name?(0,h.jsx)(k.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):$.name;return $?(0,h.jsx)(B.Z,{className:W.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(P,{children:I||(0,h.jsxs)(h.Fragment,{children:[we," | ",Ve!=null?Ve:Ge," docs"]})}),secondary:(0,h.jsx)(S.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:H,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(k.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):$.text})}):null},X=({children:we})=>ue?(0,h.jsxs)(h.Fragment,{children:[L&&(0,h.jsx)(m.Z,{children:L}),(0,h.jsx)("div",{className:W.flexContainer,children:we})]}):(0,h.jsx)(h.Fragment,{children:we});return(0,h.jsx)(X,{children:(0,h.jsx)(C,{})})}},22478:function(At,Oe,t){"use strict";t.d(Oe,{S:function(){return te}});var h=t(52322),n=t(15096),z=t(79692),B=t(27556),m=t(2784),S=t(79635),l=t(55511);const k=(0,z.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),se=$=>$==null?void 0:$.document,_=$=>{const{entityId:T,entityTitle:H,debounceTime:ue=150}=$,[ie,I]=(0,m.useState)(!1),L=(0,S.s0)(),{setFilters:W,result:{loading:P,value:C}}=(0,n.Rx)(),X=k(),[we,Ve]=(0,m.useState)([]);(0,m.useEffect)(()=>{let Qe=!0;if(Qe&&C){const xe=C.results.slice(0,10);Ve(xe)}return()=>{Qe=!1}},[P,C]);const{kind:Ge,name:Je,namespace:We}=T;(0,m.useEffect)(()=>{W(Qe=>({...Qe,kind:Ge,namespace:We,name:Je}))},[Ge,We,Je,W]);const wt=(Qe,xe)=>{if(se(xe)){const{location:_e}=xe.document;L(_e)}};return(0,h.jsx)(B.Z,{className:X.bar,variant:"outlined",children:(0,h.jsx)(n.qO,{classes:{root:X.root},"data-testid":"techdocs-search-bar",size:"small",open:ie,getOptionLabel:()=>"",filterOptions:Qe=>Qe,onClose:()=>{I(!1)},onFocus:()=>{I(!0)},onChange:wt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:we,renderOption:({document:Qe,highlight:xe})=>(0,h.jsx)(l.TechDocsSearchResultListItem,{result:Qe,lineClamp:3,asListItem:!1,asLink:!1,title:Qe.title,highlight:xe}),loading:P,inputDebounceTime:ue,inputPlaceholder:`Search ${H||T.name} docs`,freeSolo:!1})})},te=$=>{const T={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(n.Nd,{initialState:T,children:(0,h.jsx)(_,{...$})})}},53260:function(){}},function(At){var Oe=function(h){return At(At.s=h)};At.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Oe(49636)});var t=At.O()}]);})();
|
|
502
502
|
|
|
503
|
-
//# sourceMappingURL=main.
|
|
503
|
+
//# sourceMappingURL=main.2f5136d8.js.map
|