@techdocs/cli 1.4.7 → 1.5.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -8
- package/dist/cjs/{generate-d9c4c0d9.cjs.js → generate-5fb2bc8c.cjs.js} +4 -2
- package/dist/cjs/generate-5fb2bc8c.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +43 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js → 1032.f8378b05.chunk.js} +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js.map → 1032.f8378b05.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js +3 -0
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js.map +1 -0
- package/dist/embedded-app/static/{184.78d680e0.chunk.js → 184.2d07d6cf.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.78d680e0.chunk.js.map → 184.2d07d6cf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2440.c513a311.chunk.js +3 -0
- package/dist/embedded-app/static/2440.c513a311.chunk.js.map +1 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js +3 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js → 732.b079cbc6.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js.map → 732.b079cbc6.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js → 7560.12e04146.chunk.js} +1 -1
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js.map → 7560.12e04146.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js → 7750.10e99997.chunk.js} +1 -1
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js.map → 7750.10e99997.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.fea20091.chunk.js → 8951.bff6b400.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.fea20091.chunk.js.map → 8951.bff6b400.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.61727faa.chunk.js → 9323.dd670d43.chunk.js} +1 -1
- package/dist/embedded-app/static/{9323.61727faa.chunk.js.map → 9323.dd670d43.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js → 9545.24f95d89.chunk.js} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js.map → 9545.24f95d89.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js +3 -0
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.4dd3806f.js +522 -0
- package/dist/embedded-app/static/main.4dd3806f.js.map +1 -0
- package/dist/embedded-app/static/{runtime.4b61d1bd.js → runtime.4dd3806f.js} +2 -2
- package/dist/embedded-app/static/{runtime.4b61d1bd.js.map → runtime.4dd3806f.js.map} +1 -1
- package/dist/embedded-app/static/vendor.4dd3806f.js +213 -0
- package/dist/embedded-app/static/vendor.4dd3806f.js.map +1 -0
- package/dist/index.cjs.js +6 -2
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/generate-d9c4c0d9.cjs.js.map +0 -1
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +0 -3
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js +0 -3
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.4a158b26.chunk.js +0 -3
- package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +0 -1
- package/dist/embedded-app/static/9770.1e5df227.chunk.js +0 -3
- package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.4b61d1bd.js +0 -522
- package/dist/embedded-app/static/main.4b61d1bd.js.map +0 -1
- package/dist/embedded-app/static/vendor.4b61d1bd.js +0 -213
- package/dist/embedded-app/static/vendor.4b61d1bd.js.map +0 -1
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Rt,Le,r){"use strict";r.d(Le,{n3:function(){return m},MS:function(){return ye}});var n=r(87612),p=r(25271),V=r(23054),f=r(96279),H=r.n(f);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function h(le){return!le.cursor}function Z(le){return!h(le)}class ye{async getEntityAncestors(W,ue){const{kind:D,namespace:A,name:re}=(0,p.of)(W.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(re)}/ancestry`,ue)}async getLocationById(W,ue){return await this.requestOptional("GET",`/locations/${encodeURIComponent(W)}`,ue)}async getEntities(W,ue){const{filter:D=[],fields:A=[],order:re,offset:se,limit:te,after:q}=W!=null?W:{},K=this.getParams(D);if(A.length&&K.push(`fields=${A.map(encodeURIComponent).join(",")}`),re)for(const U of[re].flat())U&&K.push(`order=${encodeURIComponent(U.order)}:${encodeURIComponent(U.field)}`);se!==void 0&&K.push(`offset=${se}`),te!==void 0&&K.push(`limit=${te}`),q!==void 0&&K.push(`after=${encodeURIComponent(q)}`);const R=K.length?`?${K.join("&")}`:"",w=await this.requestRequired("GET",`/entities${R}`,ue),P=(U,xe)=>{var Ce,B;if(((Ce=U.metadata)===null||Ce===void 0?void 0:Ce.name)===void 0||U.kind===void 0||((B=xe.metadata)===null||B===void 0?void 0:B.name)===void 0||xe.kind===void 0)return 0;const Je=(0,p.eE)(U),St=(0,p.eE)(xe);return Je<St?-1:Je>St?1:0};return{items:w.sort(P)}}async getEntitiesByRefs(W,ue){var D,A,re;const se={entityRefs:W.entityRefs};!((D=W.fields)===null||D===void 0)&&D.length&&(se.fields=W.fields);const q=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,K=await this.fetchApi.fetch(q,{headers:{"Content-Type":"application/json",...((A=ue)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(re=ue)===null||re===void 0?void 0:re.token}`}},method:"POST",body:JSON.stringify(se)});if(!K.ok)throw await V.VL.fromResponse(K);const{items:R}=await K.json();return{items:R.map(w=>w!=null?w:void 0)}}async queryEntities(W={},ue){const D=[];if(h(W)){var A,re,se,te;const{fields:K=[],filter:R,limit:w,orderFields:P,fullTextFilter:U}=W;D.push(...this.getParams(R)),w!==void 0&&D.push(`limit=${w}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:Ce,order:B})=>D.push(`orderField=${Ce},${B}`)),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`);const xe=(re=U)===null||re===void 0||(A=re.term)===null||A===void 0?void 0:A.trim();xe&&D.push(`fullTextFilterTerm=${xe}`),!((te=U)===null||te===void 0||(se=te.fields)===null||se===void 0)&&se.length&&D.push(`fullTextFilterFields=${U.fields.join(",")}`)}else{const{fields:K=[],limit:R,cursor:w}=W;D.push(`cursor=${w}`),R!==void 0&&D.push(`limit=${R}`),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`)}const q=D.length?`?${D.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${q}`,ue)}async getEntityByRef(W,ue){const{kind:D,namespace:A,name:re}=(0,p.of)(W);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(re)}`,ue)}async getEntityByName(W,ue){const{kind:D,namespace:A="default",name:re}=W;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(re)}`,ue)}async refreshEntity(W,ue){var D,A;const re=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...((D=ue)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(A=ue)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({entityRef:W})});if(re.status!==200)throw new Error(await re.text())}async getEntityFacets(W,ue){const{filter:D=[],facets:A}=W,re=this.getParams(D);for(const te of A)re.push(`facet=${encodeURIComponent(te)}`);const se=re.length?`?${re.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${se}`,ue)}async addLocation(W,ue){var D,A;const{type:re="url",target:se,dryRun:te}=W,q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${te?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...((D=ue)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(A=ue)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({type:re,target:se})});if(q.status!==201)throw new Error(await q.text());const{location:K,entities:R,exists:w}=await q.json();if(!K)throw new Error(`Location wasn't added: ${se}`);return{location:K,entities:R,exists:w}}async getLocationByRef(W,ue){return(await this.requestRequired("GET","/locations",ue)).map(A=>A.data).find(A=>W===(0,p.NZ)(A))}async removeLocationById(W,ue){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(W)}`,ue)}async removeEntityByUid(W,ue){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(W)}`,ue)}async validateEntity(W,ue,D){var A,re;const se=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...((A=D)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(re=D)===null||re===void 0?void 0:re.token}`}},method:"POST",body:JSON.stringify({entity:W,location:ue})});if(se.ok)return{valid:!0};if(se.status!==400)throw await V.VL.fromResponse(se);const{errors:te=[]}=await se.json();return{valid:!1,errors:te}}async requestIgnored(W,ue,D){var A;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${ue}`,se=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},te=await this.fetchApi.fetch(re,{method:W,headers:se});if(!te.ok)throw await V.VL.fromResponse(te)}async requestRequired(W,ue,D){var A;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${ue}`,se=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},te=await this.fetchApi.fetch(re,{method:W,headers:se});if(!te.ok)throw await V.VL.fromResponse(te);return te.json()}async requestOptional(W,ue,D){var A;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${ue}`,se=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},te=await this.fetchApi.fetch(re,{method:W,headers:se});if(!te.ok){if(te.status===404)return;throw await V.VL.fromResponse(te)}return await te.json()}getParams(W=[]){const ue=[];for(const D of[W].flat()){const A=[];for(const[re,se]of Object.entries(D))for(const te of[se].flat())te===m?A.push(encodeURIComponent(re)):typeof te=="string"&&A.push(`${encodeURIComponent(re)}=${encodeURIComponent(te)}`);A.length&&ue.push(`filter=${A.join(",")}`)}return ue}constructor(W){(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"fetchApi",void 0),this.discoveryApi=W.discoveryApi,this.fetchApi=W.fetchApi||{fetch:H()}}}},25271:function(Rt,Le,r){"use strict";r.d(Le,{Tf:function(){return V},P1:function(){return Zn},q1:function(){return _n},M6:function(){return In},l2:function(){return p},zG:function(){return n},w$:function(){return vn},nP:function(){return pn},aS:function(){return _t},S4:function(){return mt},cz:function(){return nt},wI:function(){return xe},iB:function(){return $t},CV:function(){return Pe},of:function(){return qt},Ou:function(){return we},eE:function(){return lt},NZ:function(){return pe}});const n="default",p="backstage.io/view-url",V="backstage.io/edit-url",f="kubernetes.io/api-server",H="kubernetes.io/api-server-certificate-authority",m="kubernetes.io/auth-provider";var h=r(76635),Z=r.n(h);class ye{async enforce(N){return N.metadata.namespace?N:lodash.merge({metadata:{namespace:this.namespace}},N)}constructor(N=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=N}}class le{static isValidPrefixAndOrSuffix(N,ce,Ae,Ue){if(typeof N!="string")return!1;const _e=N.split(ce);return _e.length===1?Ue(_e[0]):_e.length===2?Ae(_e[0])&&Ue(_e[1]):!1}static isJsonSafe(N){try{return Z().isEqual(N,JSON.parse(JSON.stringify(N)))}catch{return!1}}static isValidDnsSubdomain(N){return typeof N=="string"&&N.length>=1&&N.length<=253&&N.split(".").every(le.isValidDnsLabel)}static isValidDnsLabel(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(N)}static isValidTag(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(N)}static isValidUrl(N){if(typeof N!="string")return!1;try{return new URL(N),!0}catch{return!1}}static isValidString(N){var ce,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ce=Ae.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(N){var ce,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ce=Ae.trim())===null||ce===void 0?void 0:ce.length)>=1}}var W=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}}}}}'),ue=r(27991),D=r.n(ue),A=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"}}}`),re=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}}}}}}'),se=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","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"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 te=new Map,q=[W,A,re,se];function K(G){var N;if(!(!((N=G)===null||N===void 0)&&N.length))throw new TypeError("Unknown error");const ce=G[0];throw new TypeError(`${ce.instancePath||"<root>"} ${ce.message}${ce.params?` - ${Object.entries(ce.params).map(([Ae,Ue])=>`${Ae}: ${Ue}`).join(", ")}`:""}`)}function R(G,N={}){var ce,Ae;const Ue=(Ae=(ce=N)===null||ce===void 0?void 0:ce.disableCache)!==null&&Ae!==void 0?Ae:!1,_e=Ue?"":JSON.stringify(G);if(!Ue){const sn=te.get(_e);if(sn)return sn}const Ct=w(G),Dt=new(D())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Ct.length&&Dt.addSchema(Ct,void 0,void 0,!0);const an=Dt.compile(G);return Ue||te.set(_e,an),an}function w(G){if(typeof G!="object")return[];const N=new Set;G.$id&&N.add(G.$id);const ce=new Array,Ae=[G];for(;Ae.length;){const Ue=Ae.pop();for(const _e of P(Ue))if(!N.has(_e)){N.add(_e);const Ct=q.find(Dt=>Dt.$id===_e);Ct&&(ce.push(Ct),Ae.push(Ct))}}return ce}function*P(G){const N=[G];for(;N.length;){const ce=N.pop();if(typeof ce=="object"&&ce)for(const[Ae,Ue]of Object.entries(ce))Ae==="$ref"&&typeof Ue=="string"?yield Ue.split("#")[0]:N.push(Ue)}}function U(G){const N=compileAjvSchema(G||entityEnvelopeSchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}function xe(G){const N=R(G);return ce=>{var Ae,Ue;if(N(ce)===!0)return ce;const Ct=(Ae=N.errors)===null||Ae===void 0?void 0:Ae.filter(Dt=>["/kind","/apiVersion"].includes(Dt.instancePath));if(!((Ue=Ct)===null||Ue===void 0)&&Ue.length&&Ct.every(Dt=>Dt.keyword==="enum"))return!1;throw K(N.errors)}}function Ce(G){const N=compileAjvSchema(G||entitySchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}class B{static isValidApiVersion(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(N)}static isValidObjectName(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(N)}static isValidNamespace(N){return le.isValidDnsLabel(N)}static isValidLabelKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,B.isValidObjectName)}static isValidLabelValue(N){return N===""||B.isValidObjectName(N)}static isValidAnnotationKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,B.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const Je={isValidApiVersion:B.isValidApiVersion,isValidKind:B.isValidKind,isValidEntityName:B.isValidObjectName,isValidNamespace:B.isValidNamespace,isValidLabelKey:B.isValidLabelKey,isValidLabelValue:B.isValidLabelValue,isValidAnnotationKey:B.isValidAnnotationKey,isValidAnnotationValue:B.isValidAnnotationValue,isValidTag:G=>typeof G=="string"&&G.length>=1&&G.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(G)};function St(G={}){return{...Je,...G}}class Nt{async enforce(N){function ce(Q,y,I){if(y==null)throw new Error(`${Q} must have a value`);let M;try{M=I(y)}catch(z){throw new Error(`${Q} could not be validated, ${z}`)}if(!M){let z;switch(I.name){case"isValidLabelValue":case"isValidObjectName":z="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":z="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":z="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":z="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":z="a string";break;case"isValidKind":z="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":z="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":z="a non empty string";break;default:z=void 0;break}const de=z?` expected ${z} but found "${y}".`:"";throw new Error(`"${Q}" is not valid;${de} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ae(Q,y,I){return y===void 0||ce(Q,y,I)}ce("apiVersion",N.apiVersion,this.validators.isValidApiVersion),ce("kind",N.kind,this.validators.isValidKind),ce("metadata.name",N.metadata.name,this.validators.isValidEntityName),Ae("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var Ue;for(const[Q,y]of Object.entries((Ue=N.metadata.labels)!==null&&Ue!==void 0?Ue:[]))ce(`labels.${Q}`,Q,this.validators.isValidLabelKey),ce(`labels.${Q}`,y,this.validators.isValidLabelValue);var _e;for(const[Q,y]of Object.entries((_e=N.metadata.annotations)!==null&&_e!==void 0?_e:[]))ce(`annotations.${Q}`,Q,this.validators.isValidAnnotationKey),ce(`annotations.${Q}`,y,this.validators.isValidAnnotationValue);var Ct;const Dt=(Ct=N.metadata.tags)!==null&&Ct!==void 0?Ct:[];for(let Q=0;Q<Dt.length;++Q)ce(`tags.${Q}`,Dt[Q],this.validators.isValidTag);var an;const sn=(an=N.metadata.links)!==null&&an!==void 0?an:[];for(let Q=0;Q<sn.length;++Q){var cn,oe,ae;ce(`links.${Q}.url`,(cn=sn[Q])===null||cn===void 0?void 0:cn.url,CommonValidatorFunctions.isValidUrl),Ae(`links.${Q}.title`,(oe=sn[Q])===null||oe===void 0?void 0:oe.title,CommonValidatorFunctions.isNonEmptyString),Ae(`links.${Q}.icon`,(ae=sn[Q])===null||ae===void 0?void 0:ae.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class Wt{async enforce(N){if(!this.validate){const Ue=new Ajv({allowUnionTypes:!0});this.validate=Ue.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[Ae]=this.validate.errors||[];throw Ae?new Error(`Malformed envelope, ${Ae.instancePath||"<root>"} ${Ae.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function kt(G){let N=G.indexOf(":");const ce=G.indexOf("/");ce!==-1&&ce<N&&(N=-1);const Ae=N===-1?void 0:G.slice(0,N),Ue=ce===-1?void 0:G.slice(N+1,ce),_e=G.slice(Math.max(N+1,ce+1));if(Ae===""||Ue===""||_e==="")throw new TypeError(`Entity reference "${G}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ae,namespace:Ue,name:_e}}function $t(G){return{kind:G.kind,namespace:G.metadata.namespace||n,name:G.metadata.name}}function qt(G,N){var ce,Ae;if(!G)throw new Error("Entity reference must not be empty");const Ue=(ce=N)===null||ce===void 0?void 0:ce.defaultKind,_e=((Ae=N)===null||Ae===void 0?void 0:Ae.defaultNamespace)||n;let Ct,Dt,an;if(typeof G=="string"){const Q=kt(G);var sn;Ct=(sn=Q.kind)!==null&&sn!==void 0?sn:Ue;var cn;Dt=(cn=Q.namespace)!==null&&cn!==void 0?cn:_e,an=Q.name}else{var oe;Ct=(oe=G.kind)!==null&&oe!==void 0?oe:Ue;var ae;Dt=(ae=G.namespace)!==null&&ae!==void 0?ae:_e,an=G.name}if(Ct)if(Dt){if(!an){const Q=JSON.stringify(G);throw new Error(`Entity reference ${Q} had missing or empty name`)}}else{const Q=JSON.stringify(G);throw new Error(`Entity reference ${Q} had missing or empty namespace`)}else{const Q=JSON.stringify(G);throw new Error(`Entity reference ${Q} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ct,namespace:Dt,name:an}}function lt(G){let N,ce,Ae;if("metadata"in G){N=G.kind;var Ue;ce=(Ue=G.metadata.namespace)!==null&&Ue!==void 0?Ue:n,Ae=G.metadata.name}else{N=G.kind;var _e;ce=(_e=G.namespace)!==null&&_e!==void 0?_e:n,Ae=G.name}return`${N.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Ae.toLocaleLowerCase("en-US")}`}var dt=r(87612);class ut{async enforce(N){let ce=N;for(const Ae of this.policies){const Ue=await Ae.enforce(ce);if(!Ue)throw new Error(`Policy ${Ae.constructor.name} did not return a result`);ce=Ue}return ce}constructor(N){(0,dt._)(this,"policies",void 0),this.policies=N}}class ht{async enforce(N){for(const ce of this.policies){const Ae=await ce.enforce(N);if(Ae)return Ae}throw new Error("The entity did not match any known policy")}constructor(N){(0,dt._)(this,"policies",void 0),this.policies=N}}const Vt={allOf(G){return new ut(G)},oneOf(G){return new ht(G)}};var Qt=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 be(G){let N;return{async check(ce){return N||(N=xe(G)),N(ce)===ce}}}const Me=be(Qt);var Ge=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const pt=be(Ge);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 tt=be(st);var ft=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const ot=be(ft);var Xe=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 vt=be(Xe),mt="ownedBy",yt="ownerOf",Cn="consumesApi",fn="apiConsumedBy",hn="providesApi",wn="apiProvidedBy",pn="dependsOn",vn="dependencyOf",jn="parentOf",on="childOf",yn="memberOf",En="hasMember",nt="partOf",_t="hasPart";var zt=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 qe=be(zt);var Rn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const ln=be(Rn);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 xn=be(kn),Zn="backstage.io/managed-by-location",_n="backstage.io/managed-by-origin-location",In="backstage.io/source-location",Mn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function we(G){if(typeof G!="string")throw new TypeError(`Unable to parse location ref '${G}', unexpected argument ${typeof G}`);const N=G.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=G.substring(0,N).trim(),Ae=G.substring(N+1).trim();if(!ce||!Ae)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${G}', please prefix it with 'url:', e.g. 'url:${G}'`);if(Mn.test(Ae))throw new TypeError(`Invalid location ref '${G}', target is a javascript: URL`);return{type:ce,target:Ae}}function pe(G){const{type:N,target:ce}=G;if(N){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Mn.test(ce))throw new TypeError(`Invalid location ref '${N}:${ce}', target is a javascript: URL`);return`${N}:${ce}`}function Pe(G){var N,ce,Ae,Ue,_e;const Ct=(_e=(ce=G.metadata)===null||ce===void 0||(N=ce.annotations)===null||N===void 0?void 0:N[In])!==null&&_e!==void 0?_e:(Ue=G.metadata)===null||Ue===void 0||(Ae=Ue.annotations)===null||Ae===void 0?void 0:Ae[Zn];if(!Ct)throw new Error(`Entity '${lt(G)}' is missing location`);return we(Ct)}},98864:function(Rt,Le,r){"use strict";r.d(Le,{rU:function(){return P}});var n=r(52322),p=r(60871),V=r(86689),f=r(79692),H=r(90436),m=r(72779),h=r.n(m),Z=r(76635),ye=r.n(Z),le=r(2784),W=r(73557),ue=r(71597);function D(){const[U]=(0,W.is)((0,n.jsx)(W.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!U.index}const A=(0,f.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"}),re=U=>/^([a-z+.-]+):/.test(U),se=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,te=window.open;if(te&&!te.__backstage){const U=function(...Ce){const B=String(Ce[0]);if(se.test(B))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return te.apply(this,Ce)};U.__backstage=!0,window.open=U}const q=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},K=()=>{const U="http://sample.dev";var xe;const Ce=(xe=q())!==null&&xe!==void 0?xe:"/",{pathname:B}=new URL(Ce,U);return(0,Z.trimEnd)(B,"/")},R=U=>{let xe=String(U);const Ce=K(),B=re(xe),Je=xe.startsWith(Ce);return!B&&!Je&&(xe=Ce.concat(xe)),xe},w=U=>{if(U instanceof Array)return U.map(w).join(" ").trim();if(typeof U=="object"&&U){var xe,Ce;return w((Ce=U)===null||Ce===void 0||(xe=Ce.props)===null||xe===void 0?void 0:xe.children)}return["string","number"].includes(typeof U)?String(U):""},P=le.forwardRef(({onClick:U,noTrack:xe,...Ce},B)=>{const Je=A(),St=(0,p.z$)(),Nt=D()?R(Ce.to):Ce.to,Wt=w(Ce.children)||Nt,kt=re(Nt),$t=kt&&!!/^https?:/.exec(Nt);if(se.test(Nt))throw new Error("Link component rejected javascript: URL as a security precaution");const qt=lt=>{var dt;(dt=U)===null||dt===void 0||dt(lt),xe||St.captureEvent("click",Wt,{attributes:{to:Nt}})};return kt?(0,n.jsxs)(V.Z,{...$t?{target:"_blank",rel:"noopener"}:{},...Ce,...Ce["aria-label"]?{"aria-label":`${Ce["aria-label"]}, Opens in a new window`}:{},ref:B,href:Nt,onClick:qt,className:h()(Je.externalLink,Ce.className),children:[Ce.children,(0,n.jsx)(H.Z,{component:"span",className:Je.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(V.Z,{...Ce,ref:B,component:ue.rU,to:Nt,onClick:qt})})},43909:function(Rt,Le,r){"use strict";r.d(Le,{r:function(){return n.rU}});var n=r(98864)},53974:function(Rt,Le,r){"use strict";r.d(Le,{Oi:function(){return xe},VY:function(){return ds},yW:function(){return Zi},XF:function(){return St},mn:function(){return vn},NX:function(){return ut},ub:function(){return Mn},mf:function(){return Ma},yu:function(){return it},h4:function(){return ii},M6:function(){return zr},i9:function(){return dl},aR:function(){return _r},rJ:function(){return Wr},Oh:function(){return ml},hu:function(){return pl},rU:function(){return le.r},Qj:function(){return ue},nU:function(){return De},SA:function(){return un},sk:function(){return _e},Or:function(){return Jr},T3:function(){return el},g9:function(){return xl},Ex:function(){return Io},Gk:function(){return Xt},tn:function(){return Vn},Ph:function(){return Oo},YE:function(){return aa},v7:function(){return Qn},R6:function(){return Ve},tR:function(){return oa},uw:function(){return $a},qt:function(){return bi},iA:function(){return Hs},GB:function(){return rt},po:function(){return Vr},mZ:function(){return _s},Pf:function(){return vs}});var n=r(52322),p=r(60871),V=r(19928),f=r(2784);function H(e){const[s,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,T=x!=null?x:5e3;useEffect(()=>{const X=u.alert$().subscribe(me=>l(ve=>ve.concat(me)));return()=>{X.unsubscribe()}},[u]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const X=setTimeout(()=>{l(me=>{const ve=me.filter(Ze=>Ze!==$);return ve.length===me.length?me:ve})},T);return()=>clearTimeout(X)}},[$,T]),s.length===0)return null;const ee=()=>{l(X=>X.filter(me=>me!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:g,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:ee,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var m=r(79692);const h=(0,m.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Z(e){const{displayName:s,picture:l,customStyles:u}=e,g=h();let x={...u};const T={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:l,className:g.avatar,style:x,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:g.avatarText,style:T,children:extractInitials(s)})})}var ye=r(77277),le=r(43909);const W=f.forwardRef((e,s)=>(0,n.jsx)(le.r,{ref:s,...e,color:"initial"})),ue=f.forwardRef((e,s)=>(0,n.jsx)(ye.Z,{ref:s,component:W,...e})),D=null;var A=r(95544),re=r(60364),se=r(83229),te=r(26639),q=r(39595),K=r(61837),R=r(80030),w=r(19353),P=r(95074);function U(e){const{text:s,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":g="Copy text"}=e,x=(0,p.h_)(p.VE),[T,$]=(0,f.useState)(!1),[{error:ee},X]=(0,P.Z)();(0,f.useEffect)(()=>{ee&&x.post(ee)},[ee,x]);const me=ve=>{ve.stopPropagation(),$(!0),X(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(R.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>$(!1),open:T,children:(0,n.jsx)(K.Z,{onClick:me,"aria-label":g,children:(0,n.jsx)(w.Z,{})})})})}function xe(e){const{text:s,language:l,showLineNumbers:u=!1,highlightedNumbers:g,customStyle:x,showCopyCodeButton:T=!1}=e,$=(0,re.Z)(),ee=$.palette.type==="dark"?te.Z:q.Z,X=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(A.Z,{position:"relative",children:[(0,n.jsx)(se.Z,{customStyle:x,language:l,style:ee,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:me=>{var ve;return!((ve=g)===null||ve===void 0)&&ve.includes(me)?{style:{backgroundColor:X}}:{}},children:s}),T&&(0,n.jsx)(A.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(U,{text:s})})]})}var Ce=r(41156),B=r(71597),Je=r(88188);function St(e){const{title:s,to:l}=e,u=(0,Ce.Z)(g=>g.breakpoints.down("xs"));return l?u?(0,n.jsx)(K.Z,{component:B.rU,color:"primary",title:s,size:"small",to:l,children:(0,n.jsx)(Je.Z,{})}):(0,n.jsx)(ye.Z,{component:B.rU,variant:"contained",color:"primary",to:l,children:s}):null}var Nt=r(27397),Wt=r(11105),kt=r(97963),$t=r(46506),qt=r.n($t),lt=r(54073),dt=r.n(lt),ut;(function(e){let s;(function(x){x.TOP_BOTTOM="TB",x.BOTTOM_TOP="BT",x.LEFT_RIGHT="LR",x.RIGHT_LEFT="RL"})(s=e.Direction||(e.Direction={}));let l;(function(x){x.UP_LEFT="UL",x.UP_RIGHT="UR",x.DOWN_LEFT="DL",x.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(x){x.NETWORK_SIMPLEX="network-simplex",x.TIGHT_TREE="tight-tree",x.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let g;(function(x){x.LEFT="l",x.RIGHT="r",x.CENTER="c"})(g=e.LabelPosition||(e.LabelPosition={}))})(ut||(ut={}));var ht=r(10368);const Vt=(0,m.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Qt({node:{id:e}}){const s=Vt(),[l,u]=f.useState(0),[g,x]=f.useState(0),T=f.useRef(null);f.useLayoutEffect(()=>{if(T.current){let{height:me,width:ve}=T.current.getBBox();me=Math.round(me),ve=Math.round(ve),(me!==g||ve!==l)&&(u(ve),x(me))}},[l,g]);const $=10,ee=l+$*2,X=g+$*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:ee,height:X,rx:10}),(0,n.jsx)("text",{ref:T,className:s.text,y:X/2,x:ee/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const be="arrow-marker",Me="node",Ge="edge",pt="label",st=(0,ht.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),tt=e=>(0,n.jsx)(Qt,{...e});function ft({render:e=tt,setNode:s,node:l}){const{width:u,height:g,x=0,y:T=0}=l,$=l,ee=st(),X=f.useRef(null);return f.useLayoutEffect(()=>{if(X.current){let{height:me,width:ve}=X.current.getBBox();me=Math.round(me),ve=Math.round(ve),(me!==g||ve!==u)&&s(l.id,{...l,height:me,width:ve})}},[l,u,g,s]),(0,n.jsx)("g",{ref:X,"data-testid":Me,className:ee.node,transform:`translate(${x-u/2},${T-g/2})`,children:e({node:$})})}var ot=r(76985),Xe=r(39829),vt=r(19574),mt=r.n(vt);const yt=(0,ht.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Cn({edge:{label:e}}){const s=yt();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const fn=(0,ht.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"}),hn=e=>(0,n.jsx)(Cn,{...e});function wn({render:e=hn,setEdge:s,id:l,edge:u,curve:g}){const{x=0,y:T=0,width:$,height:ee,points:X}=u,me=u,ve=fn(),Ze=f.useRef(null);f.useLayoutEffect(()=>{if(Ze.current){let{height:gt,width:ct}=Ze.current.getBBox();gt=Math.round(gt),ct=Math.round(ct),(gt!==ee||ct!==$)&&s(l,{...u,height:gt,width:ct})}},[u,ee,$,s,l]);let Ie="";const He=f.useMemo(()=>ot.Z().x(gt=>gt.x).y(gt=>gt.y).curve(Xe[g]),[g]);if(X){const gt=X.filter(ct=>mt()(ct.x)&&mt()(ct.y));Ie=He(gt)||""}return(0,n.jsxs)(n.Fragment,{children:[Ie&&(0,n.jsx)("path",{"data-testid":Ge,className:ve.path,d:Ie}),me.label?(0,n.jsx)("g",{ref:Ze,"data-testid":pt,className:ve.label,transform:`translate(${x},${T})`,children:e({edge:me})}):null]})}const pn="workspace";function vn(e){var s,l;const{edges:u,nodes:g,renderNode:x,direction:T=ut.Direction.TOP_BOTTOM,align:$,nodeMargin:ee=50,edgeMargin:X=10,rankMargin:me=50,paddingX:ve=0,paddingY:Ze=0,acyclicer:Ie,ranker:He=ut.Ranker.NETWORK_SIMPLEX,labelPosition:gt=ut.LabelPosition.RIGHT,labelOffset:ct=10,edgeRanks:Gt=1,edgeWeight:Ln=1,renderLabel:Hn,defs:Ot,zoom:nn="enabled",curve:gn="curveMonotoneX",fit:Gn="grow",...or}=e,$n=(0,kt.Z)(),[Ir,ho]=f.useState(100),[Fr,zo]=f.useState(100),mn=f.useRef(new(qt()).graphlib.Graph),[po,ba]=f.useState(((s=mn.current.graph())===null||s===void 0?void 0:s.width)||0),[fo,Sa]=f.useState(((l=mn.current.graph())===null||l===void 0?void 0:l.height)||0),[li,Ss]=f.useState([]),[Ca,Xn]=f.useState([]),fr=Math.max(po,Ir),Pr=Math.max(fo,Fr),Ao=Math.min(fo,Fr),Kn=Gn==="grow"?Pr:Ao,gr=f.useMemo(()=>dt()(Dn=>{if(!Dn)return;const qn=Wt.Z(Dn),On=Wt.Z(Dn.getElementById(pn));function Ur(){qn.call(Nt.sP().scaleExtent([1,1/0]).on("zoom",eo=>{eo.transform.x=Math.min(0,Math.max(eo.transform.x,fr-fr*eo.transform.k)),eo.transform.y=Math.min(0,Math.max(eo.transform.y,Pr-Pr*eo.transform.k)),On.attr("transform",eo.transform)}))}nn==="enabled"?Ur():nn==="enable-on-click"&&qn.on("click",()=>Ur());const{width:Mr,height:ci}=Dn.getBoundingClientRect();Ir!==Mr&&ho(Mr),Fr!==ci&&zo(ci)},100),[Fr,Ir,fr,Pr,nn]),To=f.useCallback(()=>{const Dn=mn.current.nodes(),qn=mn.current.edges();Dn.forEach(On=>{g.some(Mr=>Mr.id===On)||mn.current.removeNode(On)}),qn.forEach(On=>{u.some(Mr=>Mr.from===On.v&&Mr.to===On.w)||mn.current.removeEdge(On.v,On.w)}),g.forEach(On=>{const Ur=mn.current.nodes().find(Mr=>On.id===Mr);if(Ur&&mn.current.node(Ur)){const{width:Mr,height:ci,x:eo,y:Nl}=mn.current.node(Ur);mn.current.setNode(Ur,{...On,width:Mr,height:ci,x:eo,y:Nl})}else mn.current.setNode(On.id,{...On,width:0,height:0})}),u.forEach(On=>{mn.current.setEdge(On.from,On.to,{...On,label:On.label,width:0,height:0,labelpos:gt,labeloffset:ct,weight:Ln,minlen:Gt})})},[u,g,gt,ct,Ln,Gt]),Zr=f.useMemo(()=>dt()(()=>{qt().layout(mn.current);const{height:Dn,width:qn}=mn.current.graph(),On=Math.max(0,Dn||0),Ur=Math.max(0,qn||0);ba(Ur),Sa(On),Ss(mn.current.nodes()),Xn(mn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(mn.current.setGraph({rankdir:T,align:$,nodesep:ee,edgesep:X,ranksep:me,marginx:ve,marginy:Ze,acyclicer:Ie,ranker:He}),To(),Zr(),Zr.cancel),[Ie,$,T,X,ve,Ze,ee,me,He,To,Zr]);function Cs(Dn,qn){return mn.current.setNode(Dn,qn),Zr(),mn.current}function Dl(Dn,qn){return mn.current.setEdge(Dn,qn),Zr(),mn.current}return(0,n.jsxs)("svg",{ref:gr,...or,width:"100%",height:Kn,viewBox:`0 0 ${fr} ${Pr}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:be,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:$n.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Ot]}),(0,n.jsx)("g",{id:pn,children:(0,n.jsxs)("svg",{width:po,height:fo,y:Pr/2-fo/2,x:fr/2-po/2,viewBox:`0 0 ${po} ${fo}`,children:[Ca.map(Dn=>{const qn=mn.current.edge(Dn);return qn?(0,n.jsx)(wn,{id:Dn,setEdge:Dl,render:Hn,edge:qn,curve:gn},`${Dn.v}-${Dn.w}`):null}),li.map(Dn=>{const qn=mn.current.node(Dn);return qn?(0,n.jsx)(ft,{setNode:Cs,render:x,node:qn},Dn):null})]})})]})}var jn=r(72779),on=r.n(jn),yn,En;const nt=(0,m.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",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(yn=e.palette.banner.closeButtonColor)!==null&&yn!==void 0?yn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(En=e.palette.banner.warning)!==null&&En!==void 0?En:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_t=e=>{var s;const{variant:l,message:u,id:g,fixed:x=!1}=e,T=nt(),ee=useApi(storageApiRef).forBucket("notifications");var X;const me=(X=ee.snapshot("dismissedBanners").value)!==null&&X!==void 0?X:[],[ve,Ze]=useState(new Set(me)),Ie=useObservable(ee.observe$("dismissedBanners"));useEffect(()=>{var gt;if(!((gt=Ie)===null||gt===void 0)&>.value){var ct,Gt;const Ln=(Gt=(ct=Ie)===null||ct===void 0?void 0:ct.value)!==null&&Gt!==void 0?Gt:[];Ze(new Set(Ln))}},[(s=Ie)===null||s===void 0?void 0:s.value]);const He=()=>{ee.set("dismissedBanners",[...ve,g])};return _jsx(Snackbar,{anchorOrigin:x?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ve.has(g),classes:{root:classNames(T.root,!x&&T.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(T.content,T[l]),message:T.message},message:u,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:T.button,onClick:He,children:_jsx(Close,{className:T.icon})},"dismiss")]})})};var zt=r(60905),qe=r(90436),Rn=r.p+"static/missingAnnotation.67f79e98..svg",ln=r.p+"static/noInformation.4b426325..svg",kn=r.p+"static/createComponent.975d1e1e..svg",xn=r.p+"static/noBuild.1715fa71..svg";const Zn=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),_n=({missing:e})=>{const s=Zn();switch(e){case"field":return(0,n.jsx)("img",{src:Rn,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:ln,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:kn,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:xn,alt:"no Build",className:s.generalImg});default:return null}},In=(0,m.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 Mn(e){const{title:s,description:l,missing:u,action:g}=e,x=In();return(0,n.jsxs)(zt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.root,spacing:2,children:[(0,n.jsx)(zt.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(zt.Z,{container:!0,direction:"column",children:[(0,n.jsx)(zt.Z,{item:!0,xs:!0,children:(0,n.jsx)(qe.Z,{variant:"h5",children:s})}),(0,n.jsx)(zt.Z,{item:!0,xs:!0,children:(0,n.jsx)(qe.Z,{variant:"body1",children:l})}),(0,n.jsx)(zt.Z,{item:!0,xs:!0,className:x.action,children:g})]})}),(0,n.jsx)(zt.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof u=="string"?(0,n.jsx)(_n,{missing:u}):u.customImage})]})}const we=`apiVersion: backstage.io/v1alpha1
|
|
2
|
+
kind: Component
|
|
3
|
+
metadata:
|
|
4
|
+
name: example
|
|
5
|
+
description: example.com
|
|
6
|
+
annotations:
|
|
7
|
+
ANNOTATION: value
|
|
8
|
+
spec:
|
|
9
|
+
type: website
|
|
10
|
+
lifecycle: production
|
|
11
|
+
owner: user:guest`,pe=/^.*ANNOTATION.*$/m,Pe=we.match(pe)[0],G=we.split(`
|
|
12
|
+
`).findIndex(e=>pe.test(e)),N=(0,m.Z)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ce(e){return Array.from(Array(e+1).keys(),s=>s+G)}function Ae(e){const s=e.map(l=>Pe.replace("ANNOTATION",l)).join(`
|
|
13
|
+
`);return we.replace(Pe,s)}function Ue(e){const s=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(l=>(0,n.jsx)("code",{children:l})).reduce((l,u)=>(0,n.jsxs)(n.Fragment,{children:[l,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function _e(e){const{annotation:s,readMoreUrl:l}=e,u=Array.isArray(s)?s:[s],g=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",x=N();return(0,n.jsx)(Mn,{missing:"field",title:"Missing Annotation",description:Ue(u),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(qe.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)(A.Z,{className:x.code,children:(0,n.jsx)(xe,{text:Ae(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ce(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(ye.Z,{color:"primary",component:le.r,to:g,children:"Read more"})]})})}var Ct=r(11776),Dt=r(38402),an=r(49378),sn=r(41128),cn=r(27616),oe=r(8284),ae=r(70660),Q=r(91750),y=r(38016);const I=(e,s)=>(s.palette.type==="light"?sn._j:sn.$n)(s.palette[e].light,.6),M=(e,s)=>(s.palette.type==="light"?sn.$n:sn._j)(s.palette[e].light,.9),z=(0,m.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>I(s,e)}})),de=({severity:e})=>{const s=z({severity:e});return(0,n.jsx)(Q.Z,{classes:s})},Se=({severity:e})=>{const s=z({severity:e});return(0,n.jsx)(y.Z,{classes:s})},Oe=(0,m.Z)(e=>({panel:{backgroundColor:({severity:s})=>M(s,e),color:({severity:s})=>I(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>I(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>I(s,e),backgroundColor:({severity:s})=>M(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),et=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function rt(e){const{severity:s="warning",title:l,message:u,children:g,defaultExpanded:x}=e,T=Oe({severity:s}),$=et(s)+(l?`: ${l}`:"");return(0,n.jsxs)(cn.Z,{defaultExpanded:x!=null?x:!1,className:T.panel,role:"alert",children:[(0,n.jsxs)(oe.Z,{expandIcon:(0,n.jsx)(Se,{severity:s}),className:T.summary,children:[(0,n.jsx)(de,{severity:s}),(0,n.jsx)(qe.Z,{className:T.summaryText,variant:"subtitle1",children:$})]}),(u||g)&&(0,n.jsx)(ae.Z,{children:(0,n.jsxs)(zt.Z,{container:!0,children:[u&&(0,n.jsx)(zt.Z,{item:!0,xs:12,children:(0,n.jsx)(qe.Z,{className:T.message,variant:"body1",children:u})}),g&&(0,n.jsx)(zt.Z,{item:!0,xs:12,className:T.details,children:g})]})})]})}const xt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),wt=({error:e,message:s,stack:l,children:u})=>{const g=xt();return(0,n.jsxs)(Ct.Z,{dense:!0,children:[(0,n.jsxs)(Dt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(an.Z,{classes:{secondary:g.text},primary:"Error",secondary:e}),(0,n.jsx)(U,{text:e})]}),(0,n.jsxs)(Dt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(an.Z,{classes:{secondary:g.text},primary:"Message",secondary:s}),(0,n.jsx)(U,{text:s})]}),l&&(0,n.jsxs)(Dt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(an.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:l}),(0,n.jsx)(U,{text:l})]}),u]})};function it(e){const{title:s,error:l,defaultExpanded:u,children:g}=e;return(0,n.jsx)(rt,{severity:"error",title:s!=null?s:l.message,defaultExpanded:u,children:(0,n.jsx)(wt,{error:l.name,message:l.message,stack:l.stack,children:g})})}var ke=r(85256);const bt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Xt(e){var s;const{title:l,error:u,defaultExpanded:g}=e,x=bt();if(u.name!=="ResponseError")return(0,n.jsx)(it,{title:l!=null?l:u.message,defaultExpanded:g,error:u});const{body:T,cause:$}=u,{request:ee,response:X}=T,me=`${X.statusCode}: ${$.name}`,ve=ee&&`${ee.method} ${ee.url}`,Ze=$.message.replace(/\\n/g,`
|
|
14
|
+
`),Ie=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
+
`),He=JSON.stringify(T,void 0,2);return(0,n.jsxs)(it,{title:l!=null?l:u.message,defaultExpanded:g,error:{name:me,message:Ze,stack:Ie},children:[ve&&(0,n.jsxs)(Dt.Z,{alignItems:"flex-start",children:[(0,n.jsx)(an.Z,{classes:{secondary:x.text},primary:"Request",secondary:ee?`${ve}`:void 0}),(0,n.jsx)(U,{text:ve})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ke.Z,{component:"li",className:x.divider}),(0,n.jsx)(Dt.Z,{alignItems:"flex-start",children:(0,n.jsx)(an.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,n.jsx)(xe,{language:"json",text:He,showCopyCodeButton:!0})]})]})}var Tt=r(28316);function Ft(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function en(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function An(e){const s=useRef(null);useEffect(function(){const g=document.querySelector(`#${e}`),x=g||Ft(e);return g||en(x),x.appendChild(s.current),function(){s.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return s.current||(s.current=document.createElement("div")),s.current}return l()}var Kt=null;const jt="core.calloutSeen";function It(){const[e,s]=useState(()=>{const u=localStorage.getItem(jt);return u?JSON.parse(u):{}}),l=useCallback((u,g)=>{const x=localStorage.getItem(jt),$={...x?JSON.parse(x):{},[u]:g};s($),localStorage.setItem(jt,JSON.stringify($))},[]);return{states:e,setState:l}}function Yt(e){const{states:s,setState:l}=It(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:s[e]===!0,markSeen:u}}function Zt(e){const{seen:s,markSeen:l}=Yt(e);return{show:s===!1,hide:l}}const mr=(0,m.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function er(e){var s,l,u,g,x,T,$,ee;const{featureId:X,title:me,description:ve,children:Ze}=e,{show:Ie,hide:He}=useShowCallout(X),gt=usePortal("core.callout"),ct=useRef(null),[Gt,Ln]=useState(),Hn=mr(),Ot=useCallback(()=>{if(ct.current){const nn=ct.current.getBoundingClientRect(),gn=Math.max(nn.width,nn.height),Gn=800,or=nn.x-(gn-nn.width)/2-Gn,$n=nn.y-(gn-nn.height)/2-Gn,Ir=gn+2*Gn,ho=450,Fr=nn.x+nn.width/2-ho,zo=nn.y-(gn-nn.height)/2+gn+20;Ln({dotLeft:or,dotTop:$n,dotSize:Ir,borderWidth:Gn,textTop:zo,textLeft:Fr,textWidth:ho})}},[]);return useEffect(()=>(window.addEventListener("resize",Ot),window.addEventListener("scroll",Ot),()=>{window.removeEventListener("resize",Ot),window.removeEventListener("scroll",Ot)}),[Ot]),useLayoutEffect(Ot,[ct.current,Ot]),Ie?_jsxs(_Fragment,{children:[_jsx(Box,{className:Hn.featureWrapper,ref:ct,children:Ze}),createPortal(_jsx(Box,{className:Hn.backdrop,children:_jsx(ClickAwayListener,{onClickAway:He,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:Hn.dot,"data-testid":"dot",style:{left:(s=Gt)===null||s===void 0?void 0:s.dotLeft,top:(l=Gt)===null||l===void 0?void 0:l.dotTop,width:(u=Gt)===null||u===void 0?void 0:u.dotSize,height:(g=Gt)===null||g===void 0?void 0:g.dotSize,borderWidth:(x=Gt)===null||x===void 0?void 0:x.borderWidth},onClick:He,onKeyDown:He,role:"button",tabIndex:0,children:_jsx(Box,{className:Hn.pulseCircle})}),_jsxs(Box,{className:Hn.text,"data-testid":"text",style:{left:(T=Gt)===null||T===void 0?void 0:T.textLeft,top:($=Gt)===null||$===void 0?void 0:$.textTop,width:(ee=Gt)===null||ee===void 0?void 0:ee.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:me}),_jsx(Typography,{children:ve})]})]})})}),gt)]}):_jsx(_Fragment,{children:Ze})}var sr=r(35292);const bn=(0,m.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ir({color:e="primary",disabled:s=!1,href:l="#",icon:u=(0,n.jsx)(sr.Z,{}),label:g,onClick:x,title:T}){const $=bn();return s?(0,n.jsxs)(A.Z,{title:T,className:on()($.link,$.disabled),children:[u,(0,n.jsx)(qe.Z,{variant:"caption",component:"span",className:$.label,children:g})]}):(0,n.jsxs)(le.r,{title:T,className:on()($.link,$[e]),to:l,onClick:x,children:[u,(0,n.jsx)(qe.Z,{variant:"caption",component:"span",className:$.label,children:g})]})}const Yn=(0,m.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function zr(e){const{links:s}=e,l=Yn();return(0,n.jsx)("nav",{className:l.links,children:s.map((u,g)=>(0,n.jsx)(ir,{...u},g+1))})}const tr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
16
|
+
hsl(0, 0%, ${s}) 0%,
|
|
17
|
+
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
18
|
+
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
19
|
+
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
20
|
+
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
21
|
+
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
22
|
+
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
23
|
+
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
24
|
+
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
25
|
+
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
26
|
+
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
27
|
+
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
28
|
+
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
29
|
+
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
|
+
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
|
+
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
+
`},Yr=100,Lr=10,b=(0,m.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Yr,height:`calc(100% + ${Lr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Lr,background:`linear-gradient(90deg, ${tr(e.palette.type)})`},fadeRight:{right:-Lr,background:`linear-gradient(270deg, ${tr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function c(e){const[[s,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){u([0,0]);return}const x=()=>{const T=g.scrollLeft,$=g.scrollWidth-g.offsetWidth-g.scrollLeft;u([T,$])};return x(),g.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{g.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[s,l]}function C(e,s,l){const[u,g]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const x=window.performance.now(),T=requestAnimationFrame($=>{if(!e.current)return;const ee=$-x,X=Math.abs(u)*ee/s,ve=Math.max(l,X)*Math.sign(u);e.current.scrollBy({left:ve});const Ze=u-ve;Math.sign(u)!==Math.sign(Ze)?g(0):g(Ze)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function E(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=b(e),$=React.useRef(),[ee,X]=c($),me=C($,l,u),ve=Ze=>{$.current&&me(Ze?s:-s)};return _jsxs(Box,{...x,className:T.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:T.container,ref:$,children:g}),_jsx(Box,{className:classNames(T.fade,T.fadeLeft,{[T.fadeHidden]:ee===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:X===0})}),ee>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ve(!1),className:classNames(T.button,T.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),X>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ve(!0),className:classNames(T.button,T.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Y=(0,m.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function ge(e){const s=Y(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const je=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function De(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,n.jsx)(f.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(je,{...e})})}var Qe=r(28865),Ht=r(60251);const rn=(0,m.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),dn=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(dn,e):e,Un=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(dn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},Ut={code:({inline:e,className:s,children:l,...u})=>{const g=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(s||"");return!e&&x?(0,n.jsx)(xe,{language:x[1],text:g}):(0,n.jsx)("code",{className:s,...u,children:l})},h1:Un,h2:Un,h3:Un,h4:Un,h5:Un,h6:Un};function un(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=rn();return(0,n.jsx)(Qe.D,{remarkPlugins:l==="gfm"?[Ht.Z]:[],className:`${$.markdown} ${T}`,children:s,components:Ut,linkTarget:u,transformLinkUri:g,transformImageUri:x})}var ar=r(23054);const lr=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Jn=({request:e,busy:s,setBusy:l})=>{const u=lr(),[g,x]=useState(),T=async()=>{l(!0);try{await e.trigger()}catch(ee){x(isError(ee)?ee.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:T,children:"Log in"})]})};var vr=null;const Ro=(0,m.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function ws(e){const s=Ro(),[l,u]=useState(!1),g=useApi(oauthRequestApiRef),x=useApi(configApiRef);var T;const $=(T=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&T!==void 0?T:!1,ee=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),X=()=>{ee.forEach(me=>me.reject())};return _jsxs(Dialog,{open:Boolean(ee.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:s.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),$?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:ee.map(me=>_jsx(LoginRequestListItem,{request:me,busy:l,setBusy:u},me.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:X,children:"Reject All"})})]})}var to=r(15277),Wo=r.n(to),Or=r(29862);const yr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Jr(e){const[s,l]=(0,f.useState)(!1),u=(0,Or.t)(),g=yr(),x=$=>{u()&&l($)};var T;return(0,n.jsx)(R.ZP,{title:(T=e.title)!==null&&T!==void 0?T:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Wo(),{text:e.text,line:e.line,onToggled:x,containerClassName:g.container})})}var no=r(67358);function Io(e){const s=(0,re.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const g=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(g)},[s.transitions.duration.short]),l?(0,n.jsx)(no.Z,{...e,"data-testid":"progress"}):(0,n.jsx)(A.Z,{display:"none"})}var Vo=r(94339),ro=r(14503),Ho=r(24579),go=r(32552),Pn=r(15459),xr=r(27597);const oo=(0,m.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function so(e){const{link:s,title:l,onClick:u}=e,g=oo();return(0,n.jsxs)(A.Z,{children:[(0,n.jsx)(ke.Z,{}),(0,n.jsx)(le.r,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(A.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,n.jsx)(A.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(qe.Z,{children:(0,n.jsx)("strong",{children:l})})}),(0,n.jsx)(xr.Z,{className:g.arrow})]})})]})}const Go=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(qe.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(qe.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(ue,{to:s.href,variant:"contained",children:s.name})},io=class extends f.Component{componentDidCatch(s,l){console.error(`ErrorBoundary, error: ${s}, info: ${l}`),this.setState({error:s,errorInfo:l})}render(){const{slackChannel:s,children:l}=this.props,{error:u}=this.state;return u?(0,n.jsx)(it,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(Go,{slackChannel:s})}):l}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},mo=(0,m.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ko=(0,Pn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(ro.Z),kr={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Wr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:ee,headerStyle:X,headerProps:me,icon:ve,action:Ze,actionsClassName:Ie,actions:He,cardClassName:gt,actionsTopRight:ct,className:Gt,noPadding:Ln,titleTypographyProps:Hn}=e,Ot=mo();let nn={},gn={};$&&$.split(/[\s]+/g).forEach(Ir=>{nn={...nn,...kr.card[Ir]},gn={...gn,...kr.cardContent[Ir]}});const Gn=()=>!l&&!ve?null:(0,n.jsxs)("div",{className:Ot.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,n.jsx)("div",{className:Ot.subheader,children:l}),ve]}),or=T||(x?{slackChannel:x}:{});return(0,n.jsx)(Vo.Z,{style:nn,className:Gt,children:(0,n.jsxs)(io,{...or,children:[s&&(0,n.jsx)(go.Z,{classes:{root:Ot.header,title:Ot.headerTitle,subheader:Ot.headerSubheader,avatar:Ot.headerAvatar,action:Ot.headerAction,content:Ot.headerContent},title:s,subheader:Gn(),action:Ze,style:{...X},titleTypographyProps:Hn,...me}),ct&&(0,n.jsx)(Ko,{children:ct}),u&&(0,n.jsx)(ke.Z,{}),(0,n.jsx)(Ho.Z,{className:on()(gt,{[Ot.noPadding]:Ln}),style:gn,children:ee}),He&&(0,n.jsx)(ro.Z,{className:Ie,children:He}),g&&(0,n.jsx)(so,{...g})]})})}var Yo=r(39307);const Jo=(0,m.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),vo={fractional:!0,inverse:!1,unit:"%",max:100},yo=({palette:e,value:s,inverse:l,max:u})=>{if(isNaN(s))return"#ddd";const g=u||vo.max,x=l?g-s:s;return x<g/3?e.status.error:x<g*(2/3)?e.status.warning:e.status.ok};function js(e){const[s,l]=useState(null),{getColor:u=yo}=e,g=Jo(e),{palette:x}=useTheme(),{value:T,fractional:$,inverse:ee,unit:X,max:me,description:ve}={...vo,...e},Ze=$?Math.round(T*me):T,Ie=me!==100?Math.round(T):Ze,[He,gt]=useState(!1);return useEffect(()=>{const ct=s,Gt=()=>gt(!0),Ln=()=>gt(!1);return ct&&ve?(ct.addEventListener("mouseenter",Gt),ct.addEventListener("mouseleave",Ln),()=>{ct.removeEventListener("mouseenter",Gt),ct.removeEventListener("mouseleave",Ln)}):()=>{gt(!1)}},[ve,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ze,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Ie,inverse:ee,max:me}),className:g.circle}),ve&&He?_jsx(Box,{className:g.description,children:ve}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Ie}${X}`})]})}const Qo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Xo(e){const s=Qo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:ee,variant:X,getColor:me}=e,ve={inverse:x,description:$,getColor:me,value:g};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:T,variant:X,icon:ee,children:_jsx(Gauge,{...ve})})})}function Es(e){const{value:s,getColor:l=getProgressColor,width:u="thick"}=e,{palette:g}=useTheme();if(isNaN(s))return null;let x=Math.round(s*100*100)/100;x>100&&(x=100);const T=u==="thick"?4:1,$=l({palette:g,value:x,inverse:!1,max:100});return _jsx(Tooltip,{title:`${x}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:x,strokeWidth:T,trailWidth:T,strokeColor:$})})})}var Po=r(21324),cr=r(7089),xo=r(42494),Qr=r(74603),ao=r(56939),lo=r(12231),As=r(73698),dr=r(12420),Lo=r(72379);const Br=(0,m.Z)(e=>(0,dr.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var qo=()=>{const e=Br();return(0,n.jsx)(Lo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const _o=(0,m.Z)(e=>(0,dr.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var es=()=>{const e=_o();return(0,n.jsx)(Lo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const ts=(0,Pn.Z)(e=>(0,dr.Z)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(Qr.Z),ns=(0,m.Z)(e=>(0,dr.Z)({formControl:{margin:e.spacing(1,0),maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Oo(e){const{multiple:s,items:l,label:u,placeholder:g,selected:x,onChange:T,triggerReset:$,native:ee=!1,disabled:X=!1,margin:me}=e,ve=ns(),[Ze,Ie]=(0,f.useState)(x||(s?[]:"")),[He,gt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ie(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Ie(x||(s?[]:""))},[x,s]);const ct=Ot=>{Ie(Ot.target.value),T(Ot.target.value)},Gt=Ot=>{if(X){Ot.preventDefault();return}gt(nn=>s&&!(Ot.target instanceof HTMLElement)?!0:!nn)},Ln=()=>{gt(!1)},Hn=Ot=>()=>{const nn=Ze.filter(gn=>gn!==Ot);Ie(nn),T(nn)};return(0,n.jsx)(A.Z,{className:ve.root,children:(0,n.jsxs)(xo.Z,{className:ve.formControl,children:[(0,n.jsx)(ao.Z,{className:ve.formLabel,children:u}),(0,n.jsxs)(As.Z,{"aria-label":u,value:Ze,native:ee,disabled:X,"data-testid":"select",displayEmpty:!0,multiple:s,margin:me,onChange:ct,open:He,onOpen:Gt,onClose:Ln,input:(0,n.jsx)(ts,{}),label:u,renderValue:Ot=>{var nn;return s&&Ze.length!==0?(0,n.jsx)(A.Z,{className:ve.chips,children:Ot.map(gn=>{var Gn,or;return(0,n.jsx)(cr.Z,{label:(Gn=l.find($n=>$n.value===gn))===null||Gn===void 0?void 0:Gn.label,clickable:!0,onDelete:Hn(gn),className:ve.chip},(or=l.find($n=>$n.value===gn))===null||or===void 0?void 0:or.value)})}):(0,n.jsx)(qe.Z,{children:Ze.length===0?g||"":(nn=l.find(gn=>gn.value===Ot))===null||nn===void 0?void 0:nn.label})},IconComponent:()=>He?(0,n.jsx)(es,{}):(0,n.jsx)(qo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!s&&(0,n.jsx)(lo.Z,{value:[],children:g}),ee?l&&l.map(Ot=>(0,n.jsx)("option",{value:Ot.value,children:Ot.label},Ot.value)):l&&l.map(Ot=>(0,n.jsxs)(lo.Z,{value:Ot.value,children:[s&&(0,n.jsx)(Po.Z,{color:"primary",checked:Ze.includes(Ot.value)||!1,className:ve.checkbox}),Ot.label]},Ot.value))]})]})})}const Xr=()=>{},rs=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:Xr,stepHistory:[],setStepHistory:Xr,onStepChange:Xr});function Rs(e){const{children:s,elevated:l,onStepChange:u,activeStep:g=0}=e,[x,T]=useState(g),[$,ee]=useState([0]);useEffect(()=>{T(g)},[g]);const X=[];let me;return Children.forEach(s,ve=>{isValidElement(ve)&&(ve.props.end?me=ve:X.push(ve))}),_jsxs(_Fragment,{children:[_jsx(rs.Provider,{value:{stepIndex:x,setStepIndex:T,stepHistory:$,setStepHistory:ee,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:X})}),x>=Children.count(s)-1&&me]})}const Is=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Ps=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),os=({text:e,handleClick:s,disabled:l,last:u,stepIndex:g})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${g}`,onClick:s,children:e||(u?"Finish":"Next")}),Ls=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),v=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),j=({actions:e={},children:s})=>{const l=Is(),{stepperLength:u,stepIndex:g,setStepIndex:x,stepHistory:T,setStepHistory:$,onStepChange:ee}=useContext(VerticalStepperContext),X=(Ie,He)=>{He&&He(),ee&&ee(g,Ie),x(Ie)},me=()=>{const Ie=e.nextStep?e.nextStep(g,u-1):g+1;X(Ie,e.onNext),$([...T,Ie])},ve=()=>{T.pop(),X(T[T.length-1],e.onBack),$([...T])},Ze=()=>{X(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(v,{text:e.backText,handleClick:ve,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(Ls,{text:e.skipText,handleClick:me,disabled:!!u&&g>=u||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(os,{text:e.nextText,handleClick:me,disabled:!!u&&g>=u||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(Ps,{text:e.restartText,handleClick:Ze,stepIndex:g}),s]})},k=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function O(e){const{title:s,children:l,end:u,actions:g,...x}=e,T=k();return u?_jsxs(Box,{className:T.end,children:[_jsx(Typography,{variant:"h6",children:s}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ie=(0,m.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ne(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function _(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function he(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Te(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Re(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function ze(e){const s=ie(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Ne=r(74600),We=r(15584);const at=e=>(0,dr.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},Be=e=>(0,dr.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Ke=e=>(0,dr.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),At=(0,Pn.Z)(at,{name:"BackstageMetadataTableTitleCell"})(We.Z),Jt=(0,Pn.Z)(Et,{name:"BackstageMetadataTableCell"})(We.Z),Tn=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Pt=({title:e,children:s,...l})=>_jsxs(TableRow,{children:[e&&_jsx(At,{children:e}),_jsx(Jt,{colSpan:e?1:2,...l,children:s})]}),Lt=(0,Pn.Z)(Be,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Ct.Z,{disablePadding:!0,className:e.root,children:s})),tn=(0,Pn.Z)(Ke,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)(Dt.Z,{className:e.root,children:s})),Sn=(0,dr.Z)({root:{margin:"0 0",listStyleType:"none"}}),ur=e=>(0,dr.Z)({root:{...Sn.root,paddingLeft:e.spacing(1)}}),$r=(0,Pn.Z)(Sn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Lt,{classes:e,children:s})),co=(0,Pn.Z)(ur,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Lt,{classes:e,children:s}));function zn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:Dr(u)},g));return s?_jsx(co,{children:l}):_jsx($r,{children:l})}function Wn(e,s,l){const u=Object.keys(e).map(g=>{const x=Dr(e[g],!0),T=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${T}: `}),x]},g)});return s?_jsx(co,{children:u}):_jsx($r,{children:u})}function Dr(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):e!==null&&typeof e=="object"&&!Array.isArray(e)?Wn(e,s,l):Array.isArray(e)?zn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Sr=({value:e,options:s})=>_jsx(Fragment,{children:Dr(e,s)}),Cr=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Sr,{value:s,options:l})});function wr(e,s){return Object.keys(e).map(l=>_jsx(Cr,{title:l,value:e[l],options:s},l))}function wa(e){const{metadata:s,dense:l=!0,options:u}=e,g=wr(s,u||{});return _jsx(MetadataTable,{dense:l,children:g})}var di=r(49429),ui=r(86136),hi=r(50758),ss=r(79784),qr=r(76635),ko=r(19126),Os=r.n(ko);function pi(e){return qs.stringify(e,{strictNullHandling:!0})}function ks(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Bs(e,s){return ks(e)[s]}function fi(e,s,l){const u={...ks(e),[s]:l};return pi(u)}function gi(e,s=250){const[l,u]=useSearchParams(),g=l.toString(),[x,T]=useState(Bs(g,e));return useEffect(()=>{const $=Bs(g,e);T(ee=>isEqual($,ee)?ee:$)},[g,T,e]),useDebouncedEffect(()=>{const $=fi(g,e,x);g!==$&&u($,{replace:!0})},[u,x,g,e],s),[x,T]}const So={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function is(){var e;const u=(e=(0,p.I_)().get(p.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!u)return So;var g;return{url:u.getString("url"),items:u.getConfigArray("items").flatMap(x=>({title:x.getString("title"),icon:x.getOptionalString("icon"),links:((g=x.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(T=>({url:T.getString("url"),title:T.getString("title")}))}))}}var $s=r(80079);function jr(e,s){const u=(0,p.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)($s.Z,{...s})}function as(e){return jr("brokenImage",e)}function mi(e){return jr("catalog",e)}function ja(e){return jr("chat",e)}function Ea(e){return jr("dashboard",e)}function Aa(e){return jr("docs",e)}function Ta(e){return jr("email",e)}function Ra(e){return jr("github",e)}function Ia(e){return jr("group",e)}function Bo(e){return jr("help",e)}function Pa(e){return jr("user",e)}function vi(e){return jr("warning",e)}const yi=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),xi=({icon:e})=>{const s=(0,p.qD)();var l;const u=e&&(l=s.getSystemIcon(e))!==null&&l!==void 0?l:Bo;return(0,n.jsx)(u,{})};var $o;const La=({link:e})=>(0,n.jsx)(le.r,{to:e.url,children:($o=e.title)!==null&&$o!==void 0?$o:e.url}),Oa=({item:e})=>{var s;return(0,n.jsxs)(lo.Z,{children:[(0,n.jsx)(ui.Z,{children:(0,n.jsx)(xi,{icon:e.icon})}),(0,n.jsx)(an.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((l,u,g)=>[...l,g>0&&(0,n.jsx)("br",{},g),(0,n.jsx)(La,{link:u},u.url)],[])})]})};function bi(e){const{title:s,items:l,children:u}=e,{items:g}=is(),[x,T]=(0,f.useState)(!1),[$,ee]=(0,f.useState)(null),X=yi(),me=(0,Ce.Z)(Ie=>Ie.breakpoints.down("sm")),ve=Ie=>{ee(Ie.currentTarget),T(!0)},Ze=()=>{T(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Z,{display:"flex",ml:1,children:me?(0,n.jsx)(K.Z,{color:"primary",size:"small",onClick:ve,"data-testid":"support-button","aria-label":"Support",children:(0,n.jsx)(Bo,{})}):(0,n.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ve,startIcon:(0,n.jsx)(Bo,{}),children:"Support"})}),(0,n.jsxs)(ss.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ze,children:[(0,n.jsxs)(hi.Z,{className:X.popoverList,autoFocusItem:Boolean($),children:[s&&(0,n.jsx)(lo.Z,{alignItems:"flex-start",children:(0,n.jsx)(qe.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Ie,He)=>(0,n.jsx)(lo.Z,{alignItems:"flex-start",children:Ie},`child-${He}`)),(l!=null?l:g).map((Ie,He)=>(0,n.jsx)(Oa,{item:Ie},`item-${He}`))]}),(0,n.jsx)(di.Z,{children:(0,n.jsx)(ye.Z,{color:"primary",onClick:Ze,"aria-label":"Close",children:"Close"})})]})]})}var ls=r(18671),Er=r(73557),cs=r(84800);const Do=(0,m.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function ds(e){const{className:s,stretch:l,noPadding:u,children:g,...x}=e,T=Do();return(0,n.jsx)("article",{...x,className:on()(T.root,s,{[T.stretch]:l,[T.noPadding]:u}),children:g})}var Si=r(6487),Ci=r(99152);const ka=(0,m.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function _r(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=ka(),$=(0,f.useCallback)((ee,X)=>{u===void 0&&x(X),l&&u!==X&&l(X)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&x(u)},[u]),(0,n.jsx)(A.Z,{className:T.tabsWrapper,children:(0,n.jsx)(Ci.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:g,children:s.map((ee,X)=>(0,f.createElement)(Si.Z,{...ee.tabProps,"data-testid":`header-tab-${X}`,label:ee.label,key:ee.id,value:X,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function wi(e){const s=(0,Er.UO)(),u=e.map(({path:Ze,children:Ie})=>({caseSensitive:!1,path:`${Ze}/*`,element:Ie})).sort((Ze,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(Ze.path.replace(/\/\*$/,"")));var g;const x=(g=(0,Er.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var ee;const[X]=(ee=(0,cs.fp)(u,$))!==null&&ee!==void 0?ee:[],me=X?e.findIndex(Ze=>`${Ze.path}/*`===X.route.path):0;var ve;return{index:me===-1?0:me,element:x,route:(ve=e[me])!==null&&ve!==void 0?ve:e[0]}}function Vn(e){const{routes:s}=e,l=(0,Er.s0)(),{index:u,route:g,element:x}=wi(s),T=(0,f.useMemo)(()=>s.map(ee=>({id:ee.path,label:ee.title,tabProps:ee.tabProps})),[s]),$=ee=>{let{path:X}=s[ee];X=X.replace(/\/\*$/,""),X=X.replace(/^\//,""),l(X)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_r,{tabs:T,selectedIndex:u,onChange:$}),(0,n.jsxs)(ds,{children:[(0,n.jsx)(ls.q,{title:g.title}),x]})]})}const Ds=()=>null;(0,p.R5)(Ds,"core.gatherMountPoints",!0);function ji(e){const s=(0,n.jsx)(Ds,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return ji(l.props.children);if(l.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:g,children:x,tabProps:T}=l.props;return[{path:u,title:g,children:x,tabProps:T}]})}function Ba(e){const s=ji(e.children);return(0,n.jsx)(Vn,{routes:s})}Ba.Route=Ds;const Ei=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function $a(e){const{value:s,subvalue:l}=e,u=Ei();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Z,{className:u.value,children:s}),(0,n.jsx)(A.Z,{className:u.subvalue,children:l})]})}var us=r(67222),hs=r(21070),Ai=r(90324),No=r(98281),Fo=r(48049),Co=r(51209),Ns=r(33375),Fs=r(44233),Zs=r(27604),ps=r(36444),Ti=r(37971),Ri=r(59709),Ii=r(17373),Pi=r(3702),Da=r(93111);const Li=(0,m.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Oi=e=>{var s;const l=Li(),{onChangeFilters:u}=e,[g,x]=(0,f.useState)({...e.selectedFilters}),[T,$]=(0,f.useState)(!1),ee=()=>{x({}),$(X=>!X)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,n.jsxs)(A.Z,{className:l.root,children:[(0,n.jsxs)(A.Z,{className:l.header,children:[(0,n.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,n.jsx)(ye.Z,{color:"primary",onClick:ee,children:"Clear all"})]}),(0,n.jsx)(A.Z,{className:l.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(X=>(0,n.jsx)(Oo,{triggerReset:T,...X.element,selected:g[X.element.label],onChange:me=>x({...g,[X.element.label]:me})},X.element.label))})]})};var fs=r(4614);const Us={Add:(0,f.forwardRef)((e,s)=>(0,n.jsx)(hs.Z,{...e,ref:s})),Check:(0,f.forwardRef)((e,s)=>(0,n.jsx)(No.Z,{...e,ref:s})),Clear:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ns.Z,{...e,ref:s})),Delete:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Fs.Z,{...e,ref:s})),DetailPanel:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Co.Z,{...e,ref:s})),Edit:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Zs.Z,{...e,ref:s})),Export:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Pi.Z,{...e,ref:s})),Filter:(0,f.forwardRef)((e,s)=>(0,n.jsx)(ps.Z,{...e,ref:s})),FirstPage:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ti.Z,{...e,ref:s})),LastPage:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),NextPage:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Co.Z,{...e,ref:s})),PreviousPage:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Fo.Z,{...e,ref:s})),ResetSearch:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ns.Z,{...e,ref:s})),Search:(0,f.forwardRef)((e,s)=>(0,n.jsx)(ps.Z,{...e,ref:s})),SortArrow:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ai.Z,{...e,ref:s})),ThirdStateCheck:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),ViewColumn:(0,f.forwardRef)((e,s)=>(0,n.jsx)(Da.Z,{...e,ref:s}))};function Ms(e,s){const l=s.split(".");let u=e[l[0]];for(let g=1;g<l.length;++g){if(u===void 0)return u;const x=l[g];u=u[x]}return u}const zs=(0,Pn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(us.W$),Ws=(0,Pn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(us.UW),ki=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Bi=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function $i(e,s){return e.map(l=>{var u;const g=(u=l.headerStyle)!==null&&u!==void 0?u:{};let x=l.cellStyle||{};if(l.highlight)if(g.color=s.palette.textContrast,typeof x=="object")x.fontWeight=s.typography.fontWeightBold;else{const T=x;x=($,ee,X)=>({...T($,ee,X),fontWeight:s.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:x}})}function Na(e,s){return(0,qr.transform)(e,(l,u,g)=>{(0,qr.isEqual)(u,s[g])||(l[g]=u)})}const Vs={search:"",filtersOpen:!1,filters:{}};function Di(e){const{toolbarRef:s,setSearch:l,hasFilters:u,selectedFiltersLength:g,toggleFilters:x}=e,T=ki(),$=(0,f.useCallback)(ee=>{e.onSearchChanged(ee),l(ee)},[e,l]);return u?(0,n.jsxs)(A.Z,{className:T.root,children:[(0,n.jsxs)(A.Z,{className:T.root,children:[(0,n.jsx)(K.Z,{onClick:x,"aria-label":"filter list",children:(0,n.jsx)(ps.Z,{})}),(0,n.jsxs)(qe.Z,{className:T.title,children:["Filters (",g,")"]})]}),(0,n.jsx)(Ws,{...e,ref:s,onSearchChanged:$})]}):(0,n.jsx)(Ws,{...e,ref:s,onSearchChanged:$})}function Hs(e){var s,l;const{data:u,columns:g,options:x,title:T,subtitle:$,filters:ee,initialState:X,emptyContent:me,onStateChange:ve,components:Ze,isLoading:Ie,...He}=e,gt=Bi(),ct=(0,re.Z)(),Gt={...Vs,...X},[Ln,Hn]=(0,f.useState)(Gt.filtersOpen),Ot=(0,f.useCallback)(()=>Hn(Xn=>!Xn),[Hn]),[nn,gn]=(0,f.useState)(0),[Gn,or]=(0,f.useState)(u),[$n,Ir]=(0,f.useState)(Gt.filters),ho=$i(g,ct),[Fr,zo]=(0,f.useState)(Gt.search);(0,f.useEffect)(()=>{if(ve){const Xn=Na({search:Fr,filtersOpen:Ln,filters:$n},Vs);ve(Xn)}},[Fr,Ln,$n,ve]);const mn={headerStyle:{textTransform:"uppercase"}},po=(0,f.useCallback)(Xn=>{var fr;return(fr=g.find(Pr=>Pr.title===Xn))===null||fr===void 0?void 0:fr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!$n){or(u);return}const Xn=Object.values($n);if(u&&Xn.flat().length){const fr=u.filter(Pr=>!!Object.entries($n).filter(([,Ao])=>!!Ao.length).every(([Ao,Kn])=>{const gr=Ms(Pr,po(Ao));return Array.isArray(gr)&&Array.isArray(Kn)?gr.some(To=>Kn.includes(To)):Array.isArray(gr)?gr.includes(Kn):Array.isArray(Kn)?Kn.includes(gr):gr===Kn}));or(fr)}else or(u);gn(Xn.flat().length)},[u,$n,po]);const ba=(Xn,fr)=>{const Pr=Kn=>{const gr=new Set,To=Zr=>{Zr!=null&&gr.add(Zr)};return fr&&fr.forEach(Zr=>{const Cs=Ms(Zr,po(Kn));Array.isArray(Cs)?Cs.forEach(To):To(Cs)}),gr},Ao=Kn=>({placeholder:"All results",label:Kn.column,multiple:Kn.type==="multiple-select",items:[...Pr(Kn.column)].sort().map(gr=>({label:gr,value:gr}))});return Xn.map(Kn=>({type:Kn.type,element:Ao(Kn)}))},fo=!!(!((s=ee)===null||s===void 0)&&s.length),Sa=(0,f.useCallback)(Xn=>(0,n.jsx)(Di,{setSearch:zo,hasFilters:fo,selectedFiltersLength:nn,toggleFilters:Ot,...Xn}),[Ot,fo,nn,zo]),li=typeof u!="function"&&u.length===0,Ss=g.length,Ca=(0,f.useCallback)(Xn=>Ie?(0,n.jsx)("tbody",{"data-testid":"loading-indicator",children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Ss,children:(0,n.jsx)(A.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",minHeight:"15rem"},children:(0,n.jsx)(fs.Z,{size:"5rem"})})})})}):me&&li?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Ss,children:me})})}):(0,n.jsx)(us.os,{...Xn}),[li,me,Ss,Ie]);return(0,n.jsxs)(A.Z,{className:gt.root,children:[Ln&&u&&typeof u!="function"&&((l=ee)===null||l===void 0?void 0:l.length)&&(0,n.jsx)(Oi,{filters:ba(ee,u),selectedFilters:$n,onChangeFilters:Ir}),(0,n.jsx)(us.ZP,{components:{Header:zs,Toolbar:Sa,Body:Ca,...Ze},options:{...mn,...x},columns:ho,icons:Us,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(qe.Z,{variant:"h5",component:"h2",children:T}),$&&(0,n.jsx)(qe.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:Gn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...He})]})}Hs.icons=Object.freeze(Us);var Fa=r(44311);function Gs(e,s){const l=e[e.length-1];if(l)return l>=.9?s.palette.status.ok:l>=.5?s.palette.status.warning:s.palette.status.error}function Ks(e){const s=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Gs(e.data,s)})]})}const Ni=e=>(0,m.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Fi=({title:e="Unknown page",className:s})=>(0,n.jsx)(qe.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Zi(e){const{description:s,title:l,titleComponent:u=void 0,children:g,textAlign:x="left"}=e,T=Ni({textAlign:x})(),$=u||(0,n.jsx)(Fi,{title:l,className:T.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ls.q,{title:l}),(0,n.jsxs)(A.Z,{className:T.container,children:[(0,n.jsxs)(A.Z,{className:T.leftItemsBox,children:[$,s&&(0,n.jsx)(qe.Z,{className:T.description,variant:"body2",children:s})]}),(0,n.jsx)(A.Z,{className:T.rightItemsBox,children:g})]})]})}var Ui=r.p+"static/mic-drop.fe3ef4d0..svg";const Za=(0,m.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:e.spacing(10,"auto",4)}}}),{name:"BackstageErrorPageMicDrop"}),wo=()=>{const e=Za();return(0,n.jsx)("img",{src:Ui,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ua=(0,m.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ma(e){const{status:s,statusMessage:l,additionalInfo:u,supportUrl:g}=e,x=Ua(),T=(0,Er.s0)(),$=is();return(0,n.jsxs)(zt.Z,{container:!0,spacing:0,className:x.container,children:[(0,n.jsxs)(zt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(qe.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,n.jsx)(qe.Z,{variant:"body1",className:x.subtitle,children:u}),(0,n.jsx)(qe.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(qe.Z,{variant:"h6",children:[(0,n.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(le.r,{to:g||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(wo,{})]})}var Ys=r(16173);const za=(0,Pn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(qe.Z),Js=(0,Pn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function Mi(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,...ee]=x,X=ee.length?ee.pop():x[x.length-1],me=x.length>3,ve=He=>{g(He.currentTarget)},Ze=()=>{g(null)},Ie=Boolean(u);return(0,n.jsxs)(f.Fragment,{children:[(0,n.jsxs)(Ys.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,n.jsx)(Js,{clone:!0,children:T}),x.length>2&&(0,n.jsx)(Js,{clone:!0,children:$}),me&&(0,n.jsx)(za,{onClick:ve,children:"..."}),(0,n.jsx)(A.Z,{style:{fontStyle:"italic"},children:X})]}),(0,n.jsx)(ss.ZP,{open:Ie,anchorEl:u,onClose:Ze,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(Ct.Z,{children:ee.map((He,gt)=>(0,n.jsx)(Dt.Z,{button:!0,children:(0,n.jsx)(Js,{clone:!0,children:He})},gt))})})]})}const Zo=72,gs=24,zi=18,Vr={drawerWidthClosed:Zo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Zo,iconSize:Zo-gs*2,iconPadding:gs,selectedIndicatorWidth:3,userBadgePadding:zi,userBadgeDiameter:Zo-zi*2,mobileSidebarHeight:56},Qs=e=>({...Vr,...e,iconContainerWidth:Vr.drawerWidthClosed,iconSize:Vr.drawerWidthClosed-Vr.iconPadding*2,userBadgeDiameter:Vr.drawerWidthClosed-Vr.userBadgePadding*2}),ms={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Vr.defaultOpenDelayMs+200},Wi=e=>({...ms,...e}),Wa="@backstage/core/sidebar-intro-dismissed",nr=(0,f.createContext)({sidebarConfig:Vr,submenuConfig:ms}),Vi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Va=r(50023),Ha=r(4190),Ga=r(87685),Hi=r(44882),Nn=r(51837);const Gi={isOpen:!1,setOpen:()=>{}},Xs=(0,f.createContext)(Gi),Ki=(0,Nn.CT)("sidebar-open-state-context");function Yi(e){const{children:s,value:l}=e;return(0,n.jsx)(Xs.Provider,{value:l,children:(0,n.jsx)(Ki.Provider,{value:(0,Nn.EI)({1:l}),children:s})})}const _s=()=>{const e=(0,f.useContext)(Ki),s=(0,f.useContext)(Xs);if(e===void 0)return s||Gi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Ka=r(57998),Ya=r(98864);const Ji={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Qi=(0,f.createContext)(Ji),Xi=(0,Nn.CT)("sidebar-pin-state-context");function Ja(e){const{children:s,value:l}=e;return(0,n.jsx)(Qi.Provider,{value:l,children:(0,n.jsx)(Xi.Provider,{value:(0,Nn.EI)({1:l}),children:s})})}const vs=()=>{const e=(0,f.useContext)(Xi),s=(0,f.useContext)(Qi);if(e===void 0)return s||Ji;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Qa=(0,m.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Xa=e=>{const{to:s,label:l,icon:u,value:g}=e,{sidebarConfig:x}=(0,f.useContext)(nr),T=Qa({sidebarConfig:x}),$=(0,Er.TH)(),{selectedMenuItemIndex:ee,setSelectedMenuItemIndex:X}=(0,f.useContext)(ti),me=(Ze,Ie)=>{X(Ie===ee?-1:Ie)},ve=g===ee&&ee>=0||g!==ee&&!(ee>=0)&&s===$.pathname;return(0,n.jsx)(Ka.Z,{"aria-label":l,label:l,icon:u,component:Ya.rU,to:s||$.pathname,onChange:me,value:g,selected:ve,classes:T})},ys=e=>{const{children:s,to:l,label:u,icon:g,value:x}=e,{isMobile:T}=vs();return T?(0,n.jsx)(Xa,{to:l,label:u,icon:g,value:x}):(0,n.jsx)(n.Fragment,{children:s})},ei=(0,m.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),qi=e=>(0,qr.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),_i=f.createElement(ys).type,ea=({children:e,label:s="Menu",open:l,onClose:u})=>{const{sidebarConfig:g}=(0,f.useContext)(nr),x=ei({sidebarConfig:g});return(0,n.jsxs)(Ha.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,n.jsxs)(A.Z,{className:x.overlayHeader,children:[(0,n.jsx)(qe.Z,{variant:"h3",children:s}),(0,n.jsx)(K.Z,{onClick:u,classes:{root:x.overlayHeaderClose},children:(0,n.jsx)(Ga.Z,{})})]}),(0,n.jsx)(A.Z,{component:"nav",children:e})]})},ti=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ta=e=>{const{sidebarConfig:s}=(0,f.useContext)(nr),{children:l}=e,u=ei({sidebarConfig:s}),g=(0,Er.TH)(),[x,T]=(0,f.useState)(-1);(0,f.useEffect)(()=>{T(-1)},[g.pathname]);let $=(0,p.vJ)(l,X=>X.getElements().filter(me=>me.type===_i));if(l)$.length?$=qi($):$.push((0,n.jsx)(ys,{icon:(0,n.jsx)(Hi.Z,{}),children:l},"default_menu"));else return null;const ee=x>=0&&!$[x].props.to;return(0,n.jsx)(Yi,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(ti.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:T},children:[(0,n.jsx)(ea,{label:$[x]&&$[x].props.label,open:ee,onClose:()=>T(-1),children:$[x]&&$[x].props.children}),(0,n.jsx)(Va.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var Uo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Uo||(Uo={}));const ni={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Uo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Uo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},na=(0,m.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ra=(0,f.createContext)({content:{contentRef:void 0}});function oa(e){const[s,l]=(0,f.useState)(()=>ni.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(nr),g=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{ni.setSidebarPinState(s)},[s]);const T=(0,Ce.Z)(X=>X.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!s),ee=na({isPinned:s,sidebarConfig:u});return(0,n.jsx)(Ja,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:T},children:(0,n.jsx)(ra.Provider,{value:x,children:(0,n.jsx)(A.Z,{className:ee.root,children:e.children})})})}function ri(){var e;const{content:s}=(0,f.useContext)(ra);return{focusContent:(0,f.useCallback)(()=>{var u,g,x;(x=s)===null||x===void 0||(g=x.contentRef)===null||g===void 0||(u=g.current)===null||u===void 0||u.focus()},[s]),contentRef:(e=s)===null||e===void 0?void 0:e.contentRef}}const sa=(0,m.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:s=>({width:s.sidebarConfig.drawerWidthClosed}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var rr;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(rr||(rr={}));const ia=e=>{const{sidebarConfig:s}=(0,f.useContext)(nr),{openDelayMs:l=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:g,children:x}=e,T=sa({sidebarConfig:s}),$=(0,Ce.Z)(Gt=>Gt.breakpoints.down("md"),{noSsr:!0}),[ee,X]=(0,f.useState)(rr.Closed),me=(0,f.useRef)(),{isPinned:ve,toggleSidebarPinState:Ze}=vs(),Ie=()=>{ve||g||(me.current&&(clearTimeout(me.current),me.current=void 0),ee!==rr.Open&&!$&&(me.current=window.setTimeout(()=>{me.current=void 0,X(rr.Open)},l),X(rr.Idle)))},He=()=>{ve||g||(me.current&&(clearTimeout(me.current),me.current=void 0),ee===rr.Idle?X(rr.Closed):ee===rr.Open&&(me.current=window.setTimeout(()=>{me.current=void 0,X(rr.Closed)},u)))},gt=ee===rr.Open&&!$||ve,ct=Gt=>{Gt?(X(rr.Open),Ze()):(X(rr.Closed),Ze())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(la,{}),(0,n.jsx)(Yi,{value:{isOpen:gt,setOpen:ct},children:(0,n.jsx)(A.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ie,onFocus:g?()=>{}:Ie,onMouseLeave:g?()=>{}:He,onBlur:g?()=>{}:He,children:(0,n.jsx)(A.Z,{className:on()(T.drawer,T.drawerWidth,{[T.drawerOpen]:gt}),children:x})})})]})},aa=e=>{var s;const l=Qs((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const g=Wi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:x,disableExpandOnHover:T,openDelayMs:$,closeDelayMs:ee}=e,{isMobile:X}=vs();return X?(0,n.jsx)(ta,{children:x}):(0,n.jsx)(nr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,n.jsx)(ia,{openDelayMs:$,closeDelayMs:ee,disableExpandOnHover:T,children:x})})};function la(){var e;const{sidebarConfig:s}=(0,f.useContext)(nr),{focusContent:l,contentRef:u}=ri(),g=sa({sidebarConfig:s});return!((e=u)===null||e===void 0)&&e.current?(0,n.jsx)(ye.Z,{onClick:l,variant:"contained",className:on()(g.visuallyHidden),children:"Skip to content"}):null}function oi(e,s,l=!1){const u=new URLSearchParams(s.search).toString(),g=Os().parse(u),x=new URLSearchParams(e.search).toString(),T=Os().parse(x),$=l?qr.isEqual:qr.isMatch;return(0,qr.isEqual)(s.pathname,e.pathname)&&$(T,g)}const ca=(0,m.Z)(e=>{var s,l;return{item:{height:48,width:"100%","&:hover":{background:((s=e.palette.navigation.navItem)===null||s===void 0?void 0:s.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),qa=e=>{const{title:s,subtitle:l,to:u,icon:g,dropdownItems:x,exact:T}=e,$=ca(),{setIsHoveredOn:ee}=useContext(SidebarItemWithSubmenuContext),X=()=>{ee(!1)},me=useResolvedPath(u!=null?u:""),ve=useLocation();let Ze=isLocationMatch(ve,me,T);const[Ie,He]=useState(!1),gt=()=>{He(!Ie)};return x!==void 0?(x.some(ct=>{const Gt=resolvePath(ct.to);return Ze=isLocationMatch(ve,Gt,T),Ze}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:gt,onTouchStart:ct=>ct.stopPropagation(),className:classnames($.item,Ze?$.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Ie?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Ie&&_jsx(Box,{className:$.dropdown,children:x.map((ct,Gt)=>_jsx(Tooltip,{title:ct.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:ct.to,underline:"none",className:$.dropdownItem,onClick:X,onTouchStart:Ln=>Ln.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:ct.title})})},Gt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ze?$.selected:void 0),onClick:X,onTouchStart:ct=>ct.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var hr;const da=(0,m.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(hr=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&hr!==void 0?hr:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ua=e=>{const{isOpen:s}=_s(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(nr),g=s?l.drawerWidthOpen:l.drawerWidthClosed,x=da({left:g,submenuConfig:u}),{isHoveredOn:T}=(0,f.useContext)(Vi),[$,ee]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{ee(T)},[T]),(0,n.jsxs)(A.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,n.jsx)(qe.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var ha=r(26739),jo=r(76600),pa=r(83543),fa=r(59797),si=r(98989);const ga=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),al=()=>{const e=ga();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var _a=null;const i=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),t=()=>{const e=i();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var o=null,a,d;const S=e=>(0,m.Z)(s=>{var l,u;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(a=(l=s.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&a!==void 0?a:"#404040"}},highlighted:{background:(d=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&d!==void 0?d:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function L(e){return(0,f.useMemo)(()=>S(e),[e])()}const F=(e,s)=>(0,p.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:x}})=>{if(!u){var T;if(!((T=x)===null||T===void 0)&&T.length){x.forEach(({to:$})=>u=u||oi(s,(0,cs.i3)($)));return}g&&(u=oi(s,(0,cs.i3)(g)))}}),u},[s.pathname]);function J(e){return e.to===void 0}const fe=f.createElement(ua).type,Fe=f.forwardRef(function({to:s,end:l,style:u,className:g,activeStyle:x,caseSensitive:T,activeClassName:$="active","aria-current":ee="page",...X},me){let{pathname:ve}=(0,Er.TH)(),{pathname:Ze}=(0,Er.WU)(s);T||(ve=ve.toLocaleLowerCase("en-US"),Ze=Ze.toLocaleLowerCase("en-US"));let Ie=ve===Ze;!Ie&&!l&&(Ie=ve.startsWith(`${Ze}/`));const He=Ie?ee:void 0;return(0,n.jsx)(B.rU,{...X,to:s,ref:me,"aria-current":He,style:{...u,...Ie?x:void 0},className:on()([g,Ie?$:void 0])})}),Ee=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:ee,children:X,className:me,...ve}=e,{sidebarConfig:Ze}=(0,f.useContext)(nr),Ie=L(Ze),{isOpen:He}=_s(),gt=!He&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},ct=(0,n.jsxs)(A.Z,{style:gt,children:[(0,n.jsx)(l,{fontSize:"small"}),!He&&x?(0,n.jsx)(si.Z,{fontSize:"small"}):(0,n.jsx)(n.Fragment,{})]}),Gt=(0,n.jsx)(ha.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Ie.closedItemIcon]:!He}),children:ct}),Ln=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Z,{"data-testid":"login-button",className:Ie.iconContainer,children:Gt}),u&&(0,n.jsx)(qe.Z,{variant:"subtitle2",component:"span",className:Ie.label,children:u}),(0,n.jsx)("div",{className:Ie.secondaryAction,children:X})]}),Hn=He?Ln:Gt,Ot={onClick:$,className:on()(me,Ie.root,He?Ie.open:Ie.closed,J(e)&&Ie.buttonItem,{[Ie.highlightable]:!T})},nn=(0,p.z$)(),{pathname:gn}=(0,Er.WU)(!J(e)&&e.to?e.to:""),Gn=(0,f.useCallback)(or=>{var $n;if(!ee){const Ir="click",ho=u!=null?u:"Sidebar Item",Fr=gn?{attributes:{to:gn}}:void 0;nn.captureEvent(Ir,ho,Fr)}($n=$)===null||$n===void 0||$n(or)},[nn,u,gn,ee,$]);return J(e)?(0,n.jsx)(ye.Z,{role:"button","aria-label":u,...Ot,ref:s,onClick:Gn,children:Hn}):(0,n.jsx)(Fe,{...Ot,activeClassName:Ie.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ve,onClick:Gn,children:Hn})}),$e=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(nr),u=L(l),[g,x]=(0,f.useState)(!1),T=(0,Er.TH)(),$=F(e,T),ee=(0,Ce.Z)(Ze=>Ze.breakpoints.down("sm")),X=()=>{x(!0)},me=()=>{x(!1)},ve=()=>ee?g?(0,n.jsx)(fa.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(pa.Z,{fontSize:"small",className:u.submenuArrow}):!g&&(0,n.jsx)(si.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)(Vi.Provider,{value:{isHoveredOn:g,setIsHoveredOn:x},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:me,onTouchStart:g?me:X,onMouseEnter:X,className:on()(g&&u.highlighted),children:[(0,n.jsx)(Ee,{hasSubmenu:!0,className:$?u.selected:"",...s,children:ve()}),g&&e]})})},Ve=(0,f.forwardRef)((e,s)=>{const[l]=(0,p.vJ)(e.children,u=>u.getElements().filter(g=>g.type===fe));return l?(0,n.jsx)($e,{...e,children:l}):(0,n.jsx)(Ee,{...e,ref:s})});function Ye(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[l,u]=useState(""),g=L(s),x=e.icon?e.icon:SearchIcon,T=()=>{e.onSearch(l),u("")},$=ve=>{ve.key==="Enter"&&(ve.preventDefault(),T())},ee=ve=>{u(ve.target.value)},X=ve=>{ve.preventDefault(),ve.stopPropagation()},me=ve=>{T(),ve.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(Ve,{icon:x,to:e.to,onClick:me,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:X,onChange:ee,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const Bt=(0,jo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Mt=(0,jo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Qn=(0,jo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Hr=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Ar=(0,jo.Z)("div")(({theme:e})=>{const s=Hr(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Tr=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=L(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(T=>T.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:x,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},br=(0,m.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Fn(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),l=br({sidebarConfig:s}),{text:u,onClose:g}=e,x=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Rr=e=>{const{text:s,onDismiss:l}=e,[u,g]=useState(!1),x=()=>{g(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Fn,{text:s,onClose:x})})},Gr=null,Nr="And your recently viewed plugins will pop up here!";function Bn(e){const{isOpen:s}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:T}=u!=null?u:{},$=()=>{g(X=>({...l,...X,starredItemsDismissed:!0}))},ee=()=>{g(X=>({...l,...X,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Rr,{text:Gr,onDismiss:$}),_jsx(SidebarDivider,{})]}),!T&&_jsx(Rr,{text:Nr,onDismiss:ee})]}):null}const Kr=(0,m.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),Eo=({type:e,typeLink:s,classes:l,pageTitle:u})=>e?s?(0,n.jsxs)(Mi,{className:l.breadcrumb,children:[(0,n.jsx)(le.r,{to:s,children:e}),(0,n.jsx)(qe.Z,{children:u})]}):(0,n.jsx)(qe.Z,{className:l.type,children:e}):null,ma=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=ri(),g=(0,n.jsx)(qe.Z,{ref:u,tabIndex:-1,className:s.title,variant:"h1",children:e});return l?(0,n.jsx)(R.ZP,{title:l,placement:"top-start",children:g}):g},uo=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(qe.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function ii(e){const{children:s,pageTitleOverride:l,style:u,subtitle:g,title:x,tooltip:T,type:$,typeLink:ee}=e,X=Kr(),ve=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Ze=l||x,Ie=x||l,He=`${Ze} | %s | ${ve}`,gt=`${Ze} | ${ve}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ls.q,{titleTemplate:He,defaultTitle:gt}),(0,n.jsxs)("header",{style:u,className:X.header,children:[(0,n.jsxs)(A.Z,{className:X.leftItemsBox,children:[(0,n.jsx)(Eo,{classes:X,type:$,typeLink:ee,pageTitle:Ie}),(0,n.jsx)(ma,{classes:X,pageTitle:Ie,tooltip:T}),(0,n.jsx)(uo,{classes:X,subtitle:g})]}),(0,n.jsx)(zt.Z,{container:!0,className:X.rightItemsBox,spacing:4,children:s})]})]})}const ai=({label:e,secondaryLabel:s,icon:l,disabled:u=!1,onClick:g})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:x=>{g&&g(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Fl(e){const{palette:{common:{white:s}}}=useTheme(),{actionItems:l}=e,[u,g]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:x,style:{color:s,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((T,$)=>_jsx(ai,{...T},`header-action-menu-${$}`))})})]})}const ll=(0,m.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,sn.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),cl=({value:e,className:s})=>(0,n.jsx)(qe.Z,{component:typeof e=="string"?"p":"span",className:s,children:e});function dl(e){const{label:s,value:l,url:u}=e,g=ll(),x=(0,n.jsx)(cl,{className:g.value,value:l||"<Unknown>"});return(0,n.jsx)(zt.Z,{item:!0,children:(0,n.jsxs)(qe.Z,{component:"span",className:g.root,children:[(0,n.jsx)(qe.Z,{className:g.label,children:s}),u?(0,n.jsx)(le.r,{to:u,children:x}):x]})})}const ul=e=>(0,dr.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),hl=(0,m.Z)(ul,{name:"BackstageItemCardHeader"});function pl(e){const{title:s,subtitle:l,children:u}=e,g=hl(e);return(0,n.jsxs)(A.Z,{className:g.root,children:[l&&(0,n.jsx)(qe.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,n.jsx)(qe.Z,{variant:"h6",component:"h4",children:s}),u]})}function Zl(e){var s;const{description:l,tags:u,title:g,type:x,subtitle:T,label:$,onClick:ee,href:X}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:T||x})}),_jsxs(CardContent,{children:[!((s=u)===null||s===void 0)&&s.length?_jsx(Box,{children:u.map((me,ve)=>_jsx(Chip,{size:"small",label:me},ve))}):null,l]}),_jsxs(CardActions,{children:[!X&&_jsx(LinkButton,{to:"#",onClick:ee,color:"primary",children:$}),X&&_jsx(LinkButton,{to:X,color:"primary",children:$})]})]})}const fl=e=>(0,dr.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),gl=(0,m.Z)(fl,{name:"BackstageItemCardGrid"});function ml(e){const{children:s,...l}=e,u=gl(l);return(0,n.jsx)(A.Z,{className:u.root,...l,children:s})}var vl=r(41547);const yl=(0,m.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function el(e){const{themeId:s,children:l}=e,u=yl();return(0,n.jsx)(vl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:u.root,children:l})})}function xl(e){const{themeId:s,children:l,...u}=e;return(0,n.jsxs)(el,{themeId:s,children:[(0,n.jsx)(ii,{...u}),l]})}var pr=r(30195);const Ul=pr.z.object({providerInfo:pr.z.object({}).catchall(pr.z.unknown()).optional(),profile:pr.z.object({email:pr.z.string().optional(),displayName:pr.z.string().optional(),picture:pr.z.string().optional()}),backstageIdentity:pr.z.object({token:pr.z.string(),identity:pr.z.object({type:pr.z.literal("user"),userEntityRef:pr.z.string(),ownershipEntityRefs:pr.z.array(pr.z.string())})})}),tl={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function bl(e){const s=new Date(Date.now()+tl.defaultTokenExpiryMillis);if(!e)return s;const[l,u,g]=e.split("."),x=JSON.parse(window.atob(u));return typeof x.exp!="number"?s:new Date(x.exp*1e3-tl.tokenExpiryMarginMillis)}class Ml{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),l=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:bl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:l,previous:s},l}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const g=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,credentials:"include"});if(!g.ok)throw await ResponseError.fromResponse(g);return proxiedSessionSchema.parse(await g.json())}constructor(s){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const zl=e=>{const s=useApi(discoveryApiRef),[{status:l,error:u},{execute:g}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(g),l==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},Sl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),va=({children:e})=>{const s=Sl();return(0,n.jsx)(zt.Z,{component:"li",item:!0,classes:s,children:e})};var xs=r(87612);class ya{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function Cl(e){const[s,l,u]=e.split(".");return JSON.parse(window.atob(l))}class xa{getUserId(){return this.result.userId}static fromResult(s){return new xa(s)}async getIdToken(){var s,l;return(s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:l,ent:u}=Cl(s);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,l;return{token:await((s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l))}}async signOut(){var s,l;return(s=(l=this.result).signOut)===null||s===void 0?void 0:s.call(l)}constructor(s){(0,xs._)(this,"result",void 0),this.result=s}}class bs{static createGuest(){return new ya}static fromLegacy(s){return xa.fromResult(s)}static create(s){return new bs(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!l)throw new TypeError(`Invalid user entity reference "${s}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,l,u){(0,xs._)(this,"identity",void 0),(0,xs._)(this,"authApi",void 0),(0,xs._)(this,"profile",void 0),(0,xs._)(this,"profilePromise",void 0),this.identity=s,this.authApi=l,this.profile=u}}const wl={Component:({config:e,onSignInStarted:s,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:g,title:x,message:T}=e,$=(0,p.h_)(g),ee=(0,p.h_)(p.VE),X=async()=>{try{s();const me=await $.getBackstageIdentity({instantPopup:!0});if(!me)throw u(),new Error(`The ${x} provider is not configured to support sign-in`);const ve=await $.getProfile();l(bs.create({identity:me.identity,profile:ve,authApi:$}))}catch(me){u(),ee.post(new ar.SP("Login failed",me))}};return(0,n.jsx)(va,{children:(0,n.jsx)(Wr,{variant:"fullHeight",title:x,actions:(0,n.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:X,children:"Sign In"}),children:(0,n.jsx)(qe.Z,{variant:"body1",children:T})})})},loader:async(e,s)=>{const l=e.get(s),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const g=await l.getProfile();return bs.create({identity:u.identity,profile:g,authApi:l})}},jl={Component:({onSignInStarted:e,onSignInSuccess:s})=>(0,n.jsx)(va,{children:(0,n.jsx)(Wr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ya)},children:"Enter"}),children:(0,n.jsxs)(qe.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ya};var El=r(63955),nl=r(86619),rl=r(74828),Al=r(45455),Tl=r.n(Al);const Rl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Il=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),ol=e=>{const{ref:s,...l}=e;return{inputRef:s,...l}},Pl={Component:({onSignInStarted:e,onSignInSuccess:s})=>{var l;const u=Il(),{register:g,handleSubmit:x,formState:T}=(0,El.cI)({mode:"onChange"}),{errors:$}=T,ee=({userId:X,idToken:me})=>{e(),s(bs.fromLegacy({userId:X,getIdToken:me!==void 0?async()=>me:void 0,profile:{email:`${X}@example.com`}}))};return(0,n.jsx)(va,{children:(0,n.jsxs)(Wr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(qe.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:u.form,onSubmit:x(ee),children:[(0,n.jsxs)(xo.Z,{children:[(0,n.jsx)(nl.Z,{...ol(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean($.userId)}),$.userId&&(0,n.jsx)(rl.Z,{error:!0,children:$.userId.message})]}),(0,n.jsxs)(xo.Z,{children:[(0,n.jsx)(nl.Z,{...ol(g("idToken",{required:!1,validate:X=>!X||Rl.test(X)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean($.idToken)}),$.idToken&&(0,n.jsx)(rl.Z,{error:!0,children:$.idToken.message})]}),(0,n.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:u.button,disabled:!(!((l=T)===null||l===void 0)&&l.isDirty)||!Tl()($),children:"Continue"})]})]})})},loader:async()=>{}},Mo="@backstage/core:SignInPage:provider",sl={guest:jl,custom:Pl,common:wl};function il(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Jl(e){return e.reduce((l,u)=>{if(typeof u=="string")return il(u,l),l[u]={components:sl[u],id:u},l;const{id:g}=u;return il(g,l),l[g]={components:sl.common,id:g,config:u},l},{})}const Ql=(e,s)=>{const l=useApi(errorApiRef),u=useApiHolder(),[g,x]=useState(!0),T=useCallback(ee=>{s(IdentityApiSignOutProxy.from({identityApi:ee,signOut:async()=>{var X,me;localStorage.removeItem(Mo),await((X=(me=ee).signOut)===null||X===void 0?void 0:X.call(me))}}))},[s]);useLayoutEffect(()=>{var ee;if(!g)return;const X=localStorage.getItem(Mo);if(X===null){x(!1);return}const me=e[X];if(!me){x(!1);return}let ve=!1;return me.components.loader(u,(ee=me.config)===null||ee===void 0?void 0:ee.apiRef).then(Ze=>{if(ve){localStorage.removeItem(Mo);return}Ze?T(Ze):x(!1)}).catch(Ze=>{localStorage.removeItem(Mo),!ve&&(l.post(Ze),x(!1))}),()=>{ve=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(ee=>{const X=e[ee],{Component:me}=X.components,ve=He=>{T(He)},Ze=()=>{var He,gt;localStorage.setItem(Mo,((gt=X)===null||gt===void 0||(He=gt.config)===null||He===void 0?void 0:He.id)||X.id)},Ie=()=>{localStorage.removeItem(Mo)};return _jsx(me,{config:X.config,onSignInStarted:Ze,onSignInSuccess:ve,onSignInFailure:Ie},X.id)}),[e,T]);return[g,$]},Ll=({onSignInSuccess:e,providers:s=[],title:l,align:u="left"})=>{const g=useApi(configApiRef),x=useStyles(),T=getSignInProviders(s),[$,ee]=useSignInProviders(T,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:x,children:ee})]})]})},Ol=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[ee,X]=useState(!1),me=async({checkExisting:ve,showPopup:Ze})=>{try{let Ie;if(ve&&(Ie=await g.getBackstageIdentity({optional:!0})),!Ie&&(Ze||s)&&(X(!0),Ie=await g.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){X(!0);return}const He=await g.getProfile();l(UserIdentity.create({identity:Ie.identity,authApi:g,profile:He}))}catch(Ie){$(Ie),X(!0)}};return useMountEffect(()=>me({checkExisting:!0})),ee?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{me({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),T&&T.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:T.message})]})})})})]}):_jsx(Progress,{})};function Xl(e){return"provider"in e?_jsx(Ol,{...e}):_jsx(Ll,{...e})}const kl=(0,m.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Bl=(0,Pn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(go.Z);function ql(e){const{slackChannel:s,errorBoundaryProps:l,children:u,title:g,deepLink:x,value:T,onChange:$}=e,ee=kl(),[X,me]=useState(0),ve=$||((He,gt)=>me(gt));let Ze;T?React.Children.map(u,He=>{var gt;if(React.isValidElement(He)&&((gt=He)===null||gt===void 0?void 0:gt.props.value)===T){var ct;Ze=(ct=He)===null||ct===void 0?void 0:ct.props.children}}):React.Children.map(u,(He,gt)=>{if(React.isValidElement(He)&>===X){var ct;Ze=(ct=He)===null||ct===void 0?void 0:ct.props.children}});const Ie=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[g&&_jsx(Bl,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:ee,value:T||X,onChange:ve,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ze}),x&&_jsx(BottomLink,{...x})]})})}const $l=(0,m.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function _l(e){const{children:s,...l}=e,u=$l();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(Rt,Le,r){"use strict";r.d(Le,{fC:function(){return m},CL:function(){return kt},sM:function(){return re},$v:function(){return Ce},v_:function(){return B},hg:function(){return Je},uB:function(){return xe},R5:function(){return tt},bq:function(){return P},Km:function(){return U},Ds:function(){return St},ni:function(){return A},T0:function(){return D},CO:function(){return ln},x8:function(){return yn},rx:function(){return Mn},YO:function(){return kn},P4:function(){return Rn},NT:function(){return yt},NW:function(){return Nt},VE:function(){return Wt},W0:function(){return $t},gP:function(){return qt},IY:function(){return ft},F4:function(){return te},ux:function(){return K},Kp:function(){return se},$4:function(){return lt},p_:function(){return R},ZM:function(){return dt},D:function(){return q},gW:function(){return w},E6:function(){return ut},z$:function(){return Me},h_:function(){return ye},I_:function(){return Z},qD:function(){return Ge},vJ:function(){return _n},tg:function(){return nt},Oi:function(){return _t}});var n=r(52322),p=r(51837),V=r(2784);const f=(0,p.CT)("analytics-context"),H=()=>{const we=(0,V.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=we.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=we=>{const{attributes:pe,children:Pe}=we,N={...H(),...pe},ce=(0,p.EI)({1:N});return(0,n.jsx)(f.Provider,{value:ce,children:Pe})};function h(we,pe){const Pe=G=>_jsx(m,{attributes:pe,children:_jsx(we,{...G})});return Pe.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Pe}function Z(){const we=(0,p.Vt)("api-context");if(!we)throw new Error("API context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ye(we){const Pe=Z().get(we);if(!Pe)throw new Error(`No implementation available for ${we}`);return Pe}function le(we){return function(Pe){const G=ce=>{const Ae=Z(),Ue={};for(const _e in we)if(we.hasOwnProperty(_e)){const Ct=we[_e],Dt=Ae.get(Ct);if(!Dt)throw new Error(`No implementation available for ${Ct}`);Ue[_e]=Dt}return _jsx(Pe,{...ce,...Ue})},N=Pe.displayName||Pe.name||"Component";return G.displayName=`withApis(${N})`,G}}var W=r(87612);class ue{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(pe){if((0,W._)(this,"config",void 0),this.config=pe,!pe.id.split(".").flatMap(G=>G.split("-")).every(G=>G.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${pe.id}'`)}}function D(we){return new ue(we)}function A(we,pe){return"id"in we?{api:we,deps:{},factory:()=>pe}:we}var re;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(re||(re={}));const se=D({id:"core.auth.google"}),te=D({id:"core.auth.github"}),q=D({id:"core.auth.okta"}),K=D({id:"core.auth.gitlab"}),R=D({id:"core.auth.microsoft"}),w=D({id:"core.auth.onelogin"}),P=D({id:"core.auth.bitbucket"}),U=D({id:"core.auth.bitbucket-server"}),xe=D({id:"core.auth.atlassian"}),Ce=D({id:"core.alert"}),B=D({id:"core.analytics"}),Je=D({id:"core.apptheme"}),St=D({id:"core.config"}),Nt=D({id:"core.discovery"}),Wt=D({id:"core.error"});var kt;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(kt||(kt={}));const $t=D({id:"core.featureflags"}),qt=D({id:"core.fetch"}),lt=D({id:"core.identity"}),dt=D({id:"core.oauthrequest"}),ut=D({id:"core.storage"}),ht=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Vt="_ROUTABLE-EXTENSION-RENDERED";class Qt{setContext(pe){this.context=pe}captureEvent(pe,Pe,{value:G,attributes:N}={}){const{_routeNodeType:ce,...Ae}=this.context;if(pe===Vt){ht.mostRecentGatheredNavigation&&(ht.mostRecentRoutableExtensionRender={context:{...Ae,extension:"App"}});return}if(ht.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...ht.mostRecentGatheredNavigation,...ht.mostRecentRoutableExtensionRender})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}ht.mostRecentGatheredNavigation=void 0,ht.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&ce==="gathered"&&Ae.pluginId==="root"){ht.mostRecentGatheredNavigation={action:pe,subject:Pe,value:G,attributes:N,context:Ae};return}try{this.analyticsApi.captureEvent({action:pe,subject:Pe,value:G,attributes:N,context:Ae})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}}constructor(pe,Pe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,W._)(this,"analyticsApi",void 0),(0,W._)(this,"context",void 0),this.analyticsApi=pe,this.context=Pe,ht.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{ht.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...ht.mostRecentGatheredNavigation,...ht.mostRecentRoutableExtensionRender}),ht.mostRecentGatheredNavigation=void 0,ht.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),ht.beforeUnloadRegistered=!0)}}function be(){try{return ye(B)}catch{return{captureEvent:()=>{}}}}function Me(){const we=(0,V.useRef)(null),pe=H(),Pe=be();function G(){return we.current===null&&(we.current=new Qt(Pe)),we.current}const N=G();return N.setContext(pe),N}const Ge=()=>{const we=(0,p.Vt)("app-context");if(!we)throw new Error("App context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("AppContext v1 not available");return pe},pt=(0,p.uW)("component-data-store",()=>new WeakMap),st="__backstage_data";function tt(we,pe,Pe){const G=we;var N;let ce=(N=G[st])!==null&&N!==void 0?N:pt.get(we);if(ce||(ce={map:new Map},Object.defineProperty(G,st,{enumerable:!1,configurable:!0,writable:!1,value:ce}),pt.set(we,ce)),ce.map.has(pe)){const Ae=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ae}"`)}ce.map.set(pe,Pe)}function ft(we,pe){if(!we)return;const Pe=we.type;if(!Pe)return;var G;const N=(G=Pe[st])!==null&&G!==void 0?G:pt.get(Pe);if(N)return N.map.get(pe)}const ot=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Xe=ot,vt=Xe;class mt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(pe,Pe){(0,W._)(this,"id",void 0),(0,W._)(this,"params",void 0),(0,W._)(this,vt,void 0),this.id=pe,this.params=Pe,this[Xe]="absolute"}}function yt(we){var pe;return new mt(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[])}const Cn=/^\w+$/;let fn=null,hn=null;class wn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Pe,G,N){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,hn,void 0),this.id=pe,this.path=Pe,this.parent=G,this.params=N,this[fn]="sub"}}function pn(we){const{id:pe,path:Pe,parent:G}=we,N=Pe.split("/").filter(Ue=>Ue.startsWith(":")).map(Ue=>Ue.substring(1)),ce=[...G.params,...N];if(G.params.some(Ue=>N.includes(Ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Pe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Pe}'`);if(Pe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Pe}'`);for(const Ue of N)if(!Cn.test(Ue))throw new Error(`SubRouteRef path has invalid param, got '${Ue}'`);return new wn(pe,Pe,G,ce)}let vn=ot,jn=vn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Pe,G){(0,W._)(this,"id",void 0),(0,W._)(this,"params",void 0),(0,W._)(this,"optional",void 0),(0,W._)(this,jn,void 0),this.id=pe,this.params=Pe,this.optional=G,this[vn]="external"}}function yn(we){var pe;return new on(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[],Boolean(we.optional))}var En=r(73557);function nt(we){const{pathname:pe}=(0,En.TH)(),Pe=(0,p.Vt)("routing-context");if(!Pe)throw new Error("Routing context is not available");const G=Pe.atVersion(1),N=(0,V.useMemo)(()=>G&&G.resolve(we,{pathname:pe}),[G,we,pe]);if(!Pe)throw new Error("useRouteRef used outside of routing context");if(!G)throw new Error("RoutingContext v1 not available");const ce="optional"in we&&we.optional;if(!N&&!ce)throw new Error(`No path for ${we}`);return N}function _t(we){return(0,En.UO)()}class zt extends V.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Pe,plugin:G}=this.props,{ErrorBoundaryFallback:N}=Pe.getComponents();return pe?(0,n.jsx)(N,{error:pe,resetError:this.handleErrorReset,plugin:G}):this.props.children}constructor(...pe){super(...pe),(0,W._)(this,"state",{error:void 0}),(0,W._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var qe=r(64355);function Rn(we){const{component:pe,mountPoint:Pe,name:G}=we;return kn({component:{lazy:()=>pe().then(N=>{const ce=Ue=>{const _e=Me();try{nt(Pe)}catch(Ct){if(typeof Ct=="object"&&Ct!==null){const{message:Dt}=Ct;if(typeof Dt=="string"&&Dt.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Pe} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw Ct}return(0,V.useEffect)(()=>{_e.captureEvent(Vt,"")},[_e]),(0,n.jsx)(N,{...Ue})},Ae=G||N.displayName||N.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Ae})`,ce},N=>Ae=>{const Ue=Ge(),{BootErrorPage:_e}=Ue.getComponents();return(0,n.jsx)(_e,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Pe},name:G})}function ln(we){const{component:pe,name:Pe}=we;return kn({component:pe,name:Pe})}function kn(we){const{data:pe={},name:Pe}=we;Pe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let G;if("lazy"in we.component){const ce=we.component.lazy;G=(0,V.lazy)(()=>ce().then(Ae=>({default:Ae})))}else G=we.component.sync;const N=Pe||G.displayName||G.name||"Component";return{expose(ce){const Ae=Ue=>{var _e;const Ct=Ge(),{Progress:Dt}=Ct.getComponents(),an=(_e=pe)===null||_e===void 0?void 0:_e["core.mountPoint"];return(0,n.jsx)(V.Suspense,{fallback:(0,n.jsx)(Dt,{}),children:(0,n.jsx)(zt,{app:Ct,plugin:ce,children:(0,n.jsx)(m,{attributes:{pluginId:ce.getId(),...Pe&&{extension:Pe},...an&&{routeRef:an.id}},children:(0,n.jsx)(qe.o,{plugin:ce,children:(0,n.jsx)(G,{...Ue})})})})})};tt(Ae,"core.plugin",ce),tt(Ae,"core.extensionName",Pe);for(const[Ue,_e]of Object.entries(pe))tt(Ae,Ue,_e);return Ae.displayName=`Extension(${N})`,Ae}}}function xn(we,pe,Pe,G){return V.Children.toArray(we).flatMap(N=>{if(!(0,V.isValidElement)(N))return[];if(N.type===V.Fragment)return xn(N.props.children,pe,Pe,G);if(ft(N,"core.featureFlagged")){const ce=N.props;return("with"in ce?pe.isActive(ce.with):!pe.isActive(ce.without))?xn(N.props.children,pe,Pe,G):[]}if(Pe===void 0||Pe(N))return[N];if(G)throw new Error(G);return xn(N.props.children,pe,Pe,G)})}class Zn{selectByComponentData(pe){const Pe=xn(this.node,this.featureFlagsApi,G=>ft(G,pe.key)!==void 0,pe.withStrictError);return new Zn(Pe,this.featureFlagsApi)}findComponentData(pe){return xn(this.node,this.featureFlagsApi,G=>ft(G,pe.key)!==void 0).map(G=>ft(G,pe.key)).filter(G=>G!==void 0)}getElements(){return xn(this.node,this.featureFlagsApi)}constructor(pe,Pe){(0,W._)(this,"node",void 0),(0,W._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Pe}}function _n(we,pe,Pe=[]){const G=ye($t),N=new Zn(we,G);return(0,V.useMemo)(()=>pe(N),[we,...Pe])}class In{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Pe;return(Pe=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Pe!==void 0?Pe:[]}get routes(){var pe;return(pe=this.config.routes)!==null&&pe!==void 0?pe:{}}get externalRoutes(){var pe;return(pe=this.config.externalRoutes)!==null&&pe!==void 0?pe:{}}provide(pe){return pe.expose(this)}__experimentalReconfigure(pe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(pe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var pe;return(pe=this.options)!==null&&pe!==void 0?pe:{}}toString(){return`plugin{${this.config.id}}`}constructor(pe){(0,W._)(this,"config",void 0),(0,W._)(this,"options",void 0),this.config=pe,this.options=void 0}}function Mn(we){return new In(we)}},64355:function(Rt,Le,r){"use strict";r.d(Le,{o:function(){return H},y:function(){return m}});var n=r(52322),p=r(51837),V=r(2784);const f="plugin-context",H=h=>{const{children:Z,plugin:ye}=h,{Provider:le}=(0,p.CT)(f);return(0,n.jsx)(le,{value:(0,p.EI)({1:{plugin:ye}}),children:Z})};function m(){const h=(0,p.Vt)(f);if(!h)throw new Error("Plugin Options context is not available");const Z=h.atVersion(1);if(!Z)throw new Error("Plugin Options v1 is not available");return Z.plugin.getPluginOptions()}},23054:function(Rt,Le,r){"use strict";r.d(Le,{SP:function(){return te},dR:function(){return ue},VL:function(){return K},BD:function(){return p}});function n(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const w=R;return!(typeof w.name!="string"||w.name===""||typeof w.message!="string")}function p(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const w=R;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var V=r(87612),f=r(24852);function H(R,w){var P;const xe={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return!((P=w)===null||P===void 0)&&P.includeStack||delete xe.stack,xe}function m(R){const w=(0,f.deserializeError)(R);return R.stack||(w.stack=void 0),w}function h(R){if(n(R)){const w=String(R);return w!=="[object Object]"?w:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class Z extends Error{constructor(w,P){var U,xe;let Ce=w;if(P!==void 0){const B=h(P);Ce?Ce+=`; caused by ${B}`:Ce=`caused by ${B}`}super(Ce),(0,V._)(this,"cause",void 0),(U=(xe=Error).captureStackTrace)===null||U===void 0||U.call(xe,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=n(P)?P:void 0}}class ye extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class le extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class W extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class ue extends Z{constructor(...w){super(...w),(0,V._)(this,"name","NotFoundError")}}class D extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class A extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class re extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class se extends null{}class te extends Z{constructor(w,P){super(w,P),this.name=n(P)?P.name:"Error"}}async function q(R){try{const P=await R.text();if(P){var w;if(!((w=R.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const U=JSON.parse(P);if(U.error&&U.response)return U}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${P}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class K extends Error{static async fromResponse(w){const P=await q(w),U=P.response.statusCode||w.status,xe=P.error.name||w.statusText,Ce=`Request failed with ${U} ${xe}`,B=m(P.error);return new K({message:Ce,response:w,data:P,cause:B})}constructor(w){super(w.message),(0,V._)(this,"response",void 0),(0,V._)(this,"body",void 0),(0,V._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(Rt,Le,r){"use strict";r.d(Le,{nW:function(){return se},ae:function(){return W},q3:function(){return ue}});var n=r(60871);const p=(0,n.T0)({id:"core.scmauth"});var V=new WeakMap;class f{async getCredentials(q){const K=new URL(q.url),R=_class_private_field_get(this,V).find(w=>w.isUrlSupported(K));if(!R)throw new Error(`No auth provider available for '${q.url}', see https://backstage.io/link?scm-auth`);return R.getCredentials(q)}constructor(q){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_set(this,V,q)}}var H=new WeakMap,m=new WeakMap,h=new WeakMap,Z=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:q,gitlab:K,azure:R,bitbucket:w})=>ye.merge(ye.forGithub(q),ye.forGitlab(K),ye.forAzure(R),ye.forBitbucket(w))})}static forAuthApi(q,K){return new ye("generic",q,K.host,K.scopeMapping)}static forGithub(q,K){var R,w;const P=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"github.com";return new ye("github",q,P,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(q,K){var R,w;const P=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"gitlab.com";return new ye("gitlab",q,P,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(q,K){var R,w;const P=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"dev.azure.com";return new ye("azure",q,P,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(q,K){var R,w;const P=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"bitbucket.org";return new ye("bitbucket",q,P,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...q){return new f(q)}isUrlSupported(q){return q.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(q){var K,R;if(!(!((K=q)===null||K===void 0)&&K.customScopes)||_class_private_field_get(this,Z)==="generic")return[];var w;return(w=(R=q.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,Z)])!==null&&w!==void 0?w:[]}async getCredentials(q){var K;const{url:R,additionalScope:w,...P}=q,U=_class_private_field_get(this,h).default.slice();!((K=w)===null||K===void 0)&&K.repoWrite&&U.push(..._class_private_field_get(this,h).repoWrite);const xe=this.getAdditionalScopesForProvider(w);xe.length&&U.push(...xe);const Ce=[...new Set(U)],B=await _class_private_field_get(this,H).getAccessToken(Ce,P);return{token:B,headers:{Authorization:`Bearer ${B}`}}}constructor(q,K,R,w){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,h,{writable:!0,value:void 0}),_class_private_field_init(this,Z,{writable:!0,value:void 0}),_class_private_field_set(this,H,K),_class_private_field_set(this,m,R),_class_private_field_set(this,h,w),_class_private_field_set(this,Z,q)}}var le=r(40556);class W{static fromConfig(q){return le.Lx.fromConfig(q)}}const ue=(0,n.T0)({id:"integration.scmintegrations"});var D=r(52322),A=r(73250),re=r(2784);const se=te=>{const{type:q}=te,K=(0,n.qD)(),R=A.Z;var w;const P=q&&(w=K.getSystemIcon(q))!==null&&w!==void 0?w:R;return(0,D.jsx)(P,{})}},40556:function(Rt,Le,r){"use strict";r.d(Le,{Lx:function(){return Lr},BT:function(){return Xt}});var n=r(87612),p=r(82717),V=r.n(p),f=r(76635);function H(b){const c=new URL("http://example.com");return c.host=b,c.host===b}function m(b){try{return new URL(b),!0}catch{return!1}}function h(b,c){return{list(){return b},byUrl(C){try{const E=typeof C=="string"?new URL(C):C;return b.find(Y=>c(Y)===E.host)}catch{return}},byHost(C){return b.find(E=>c(E)===C)}}}function Z(b){const{url:c,base:C,lineNumber:E}=b;try{return new URL(c),c}catch{}let Y;if(c.startsWith("/")){const{filepath:ge}=V()(C);Y=new URL(C);const je=(0,f.trimEnd)(Y.pathname.substring(0,Y.pathname.length-ge.length),"/");Y.pathname=`${je}${c}`}else Y=new URL(c,C);return Y.search=new URL(C).search,E&&(Y.hash=`L${E}`),Y.toString()}function ye(b){beforeAll(()=>b.listen({onUnhandledRequest:"error"})),afterAll(()=>b.close()),afterEach(()=>b.resetHandlers())}const le="amazonaws.com";function W(b){const c=b.getOptionalString("endpoint");var C;const E=(C=b.getOptionalBoolean("s3ForcePathStyle"))!==null&&C!==void 0?C:!1;let Y,ge;if(c){try{const rn=new URL(c);Y=rn.host,ge=rn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ge!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else Y=le;const je=b.getOptionalString("accessKeyId"),De=b.getOptionalString("secretAccessKey"),Qe=b.getOptionalString("roleArn"),Ht=b.getOptionalString("externalId");return{host:Y,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:De,roleArn:Qe,externalId:Ht}}function ue(b){const c=b.map(W);return c.some(C=>C.host===le)||c.push({host:le}),c}class D{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Z(c)}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(D,"factory",({config:b})=>{var c;const C=ue((c=b.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new D(E)),E=>E.config.host)});var A=r(88412),re=r(50629),se=r(80956);const te="GB";var q=new WeakMap,K=new WeakMap,R=new WeakMap,w=new WeakMap,P=new WeakMap,U=new WeakMap,xe=new WeakMap;class Ce{static fromRepoUrl(c){const C=new URL(c);let E,Y,ge;const je=C.pathname.split("/").map(dn=>decodeURIComponent(dn));if(je[2]==="_git"?(E=je[1],Y=ge=je[3]):je[3]==="_git"?(E=je[1],Y=je[2],ge=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,Y=je[3],ge=je[5]),!E||!Y||!ge)throw new Error("Azure URL must point to a git repository");var De;const Qe=(De=C.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Ht;const rn=C.searchParams.get("version");if(rn){if(rn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ht=rn.slice(2)}return new Ce(C.origin,E,Y,ge,Qe,Ht)}toRepoUrl(){let c;return(0,A._)(this,R)===(0,A._)(this,w)?c=(0,A._)(this,xe).call(this,(0,A._)(this,K),"_git",(0,A._)(this,w)):c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_git",(0,A._)(this,w)),(0,A._)(this,P)&&c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,U)&&c.searchParams.set("version",te+(0,A._)(this,U)),c.toString()}toFileUrl(){if(!(0,A._)(this,P))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,U)&&c.searchParams.set("version",(0,A._)(this,U)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,P)&&c.searchParams.set("scopePath",(0,A._)(this,P)),(0,A._)(this,U)&&c.searchParams.set("version",(0,A._)(this,U)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,U)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,U)),c.toString()}getOwner(){return(0,A._)(this,K)}getProject(){return(0,A._)(this,R)}getRepo(){return(0,A._)(this,w)}getPath(){return(0,A._)(this,P)}getRef(){return(0,A._)(this,U)}constructor(c,C,E,Y,ge,je){(0,re._)(this,q,{writable:!0,value:void 0}),(0,re._)(this,K,{writable:!0,value:void 0}),(0,re._)(this,R,{writable:!0,value:void 0}),(0,re._)(this,w,{writable:!0,value:void 0}),(0,re._)(this,P,{writable:!0,value:void 0}),(0,re._)(this,U,{writable:!0,value:void 0}),(0,re._)(this,xe,{writable:!0,value:(...De)=>{const Qe=new URL((0,A._)(this,q));return Qe.pathname=De.map(Ht=>encodeURIComponent(Ht)).join("/"),Qe}}),(0,se._)(this,q,c),(0,se._)(this,K,C),(0,se._)(this,R,E),(0,se._)(this,w,Y),(0,se._)(this,P,ge),(0,se._)(this,U,je)}}const B="dev.azure.com",Je=["clientId","clientSecret","tenantId","personalAccessToken"],St=new Map([["ClientSecret",["clientId","clientSecret","tenantId"]],["ManagedIdentity",["clientId"]],["PersonalAccessToken",["personalAccessToken"]]]);function Nt(b){for(const c of St.entries()){const[C,E]=c,Y=Je.filter(ge=>!E.includes(ge));if(E.every(ge=>b[ge]!==void 0)&&Y.every(ge=>b[ge]===void 0))return{kind:C,organizations:b.organizations,...E.reduce((ge,je)=>(ge[je]=b[je],ge),{})}}throw new Error("is not a valid credential")}function Wt(b){var c,C;const E=(C=b.getOptionalString("host"))!==null&&C!==void 0?C:B;let Y=(c=b.getOptionalConfigArray("credentials"))===null||c===void 0?void 0:c.map(Ut=>({organizations:Ut.getOptionalStringArray("organizations"),personalAccessToken:Ut.getOptionalString("personalAccessToken"),tenantId:Ut.getOptionalString("tenantId"),clientId:Ut.getOptionalString("clientId"),clientSecret:Ut.getOptionalString("clientSecret")}));const ge=b.getOptionalString("token");if(b.getOptional("credential")!==void 0&&b.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'credential' and 'credentials' cannot be used together. Use 'credentials' instead.");if(b.getOptional("token")!==void 0&&b.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'token' and 'credentials' cannot be used together. Use 'credentials' instead.");if(ge!==void 0){var je;const Ut=[{personalAccessToken:ge}];var De;Y=(De=(je=Y)===null||je===void 0?void 0:je.concat(Ut))!==null&&De!==void 0?De:Ut}if(b.getOptional("credential")!==void 0){var Qe;const Ut=[{organizations:b.getOptionalStringArray("credential.organizations"),token:b.getOptionalString("credential.token"),tenantId:b.getOptionalString("credential.tenantId"),clientId:b.getOptionalString("credential.clientId"),clientSecret:b.getOptionalString("credential.clientSecret")}];var Ht;Y=(Ht=(Qe=Y)===null||Qe===void 0?void 0:Qe.concat(Ut))!==null&&Ht!==void 0?Ht:Ut}if(!H(E))throw new Error(`Invalid Azure integration config, '${E}' is not a valid host`);let rn;if(Y!==void 0){var dn,Un;const Ut=(dn=Y)===null||dn===void 0?void 0:dn.reduce((un,ar,lr)=>{let Jn;try{Nt(ar)}catch(vr){Jn=vr.message}return Jn!==void 0&&un.push(`credential at position ${lr+1} ${Jn}`),un},Array.of()).concat(Object.entries(Y.filter(un=>un.organizations!==void 0&&un.organizations.length>0).reduce((un,ar,lr)=>{var Jn;return(Jn=ar.organizations)===null||Jn===void 0||Jn.forEach(vr=>{un[vr]||(un[vr]=[]),un[vr].push(lr+1)}),un},{})).filter(([un,ar])=>ar.length>1).reduce((un,[ar,lr])=>(un.push(`organization ${ar} is specified multiple times in credentials at positions ${lr.slice(0,lr.length-1).join(", ")} and ${lr[lr.length-1]}`),un),Array.of()));if(((Un=Ut)===null||Un===void 0?void 0:Un.length)>0)throw new Error(`Invalid Azure integration config for ${E}: ${Ut.join("; ")}`);if(rn=Y.map(un=>Nt(un)),rn.some(un=>un.kind!=="PersonalAccessToken")&&E!==B)throw new Error(`Invalid Azure integration config for ${E}, only personal access tokens can be used with hosts other than ${B}`);if(rn.filter(un=>un.organizations===void 0||un.organizations.length===0).length>1)throw new Error(`Invalid Azure integration config for ${E}, you cannot specify multiple credentials without organizations`)}return{host:E,credentials:rn}}function kt(b){const c=b.map(Wt);return c.some(C=>C.host===B)||c.push({host:B}),c}class $t{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:C,base:E}=c;if(m(C))return C;try{const ge=Ce.fromRepoUrl(E),je=new URL(E);var Y;const De=new URL(`https://a.com${(Y=ge.getPath())!==null&&Y!==void 0?Y:""}`),Qe=new URL(C,De).pathname;return je.searchParams.set("path",Qe),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(C,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)($t,"factory",({config:b})=>{var c;const C=kt((c=b.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new $t(E)),E=>E.config.host)});function qt(b){return AzureUrl.fromRepoUrl(b).toFileUrl()}function lt(b){return AzureUrl.fromRepoUrl(b).toArchiveUrl()}function dt(b){return AzureUrl.fromRepoUrl(b).toCommitsUrl()}const ut="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Vt(b){var c;const C=(c=b.getOptionalString("host"))!==null&&c!==void 0?c:ut;let E=b.getOptionalString("apiBaseUrl");const Y=b.getOptionalString("token"),ge=b.getOptionalString("username"),je=b.getOptionalString("appPassword");if(!H(C))throw new Error(`Invalid Bitbucket integration config, '${C}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):C===ut?E=ht:E=`https://${C}/rest/api/1.0`,{host:C,apiBaseUrl:E,token:Y,username:ge,appPassword:je}}function Qt(b){const c=b.map(Vt);return c.some(C=>C.host===ut)||c.push({host:ut,apiBaseUrl:ht}),c}class be{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const C=Z(c);if(!c.lineNumber)return C;const E=new URL(C);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const C=V()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",C.ref),E.toString()}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(be,"factory",({config:b})=>{var c,C,E;const Y=Qt((E=b.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=b.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(C=b.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&C!==void 0?C:[]]);return h(Y.map(ge=>new be(ge)),ge=>ge.config.host)});var Me=r(96279),Ge=r(48834).lW;async function pt(b,c){const{name:C,owner:E,resource:Y}=parseGitUrl(b),ge=Y==="bitbucket.org";let je=ge?`${c.apiBaseUrl}/repositories/${E}/${C}`:`${c.apiBaseUrl}/projects/${E}/repos/${C}/default-branch`,De=await fetch(je,ft(c));if(De.status===404&&!ge&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${C}/branches/default`,De=await fetch(je,ft(c))),!De.ok){const Ht=`Failed to retrieve default branch from ${je}, ${De.status} ${De.statusText}`;throw new Error(Ht)}let Qe;if(ge)Qe=(await De.json()).mainbranch.name;else{const{displayId:Ht}=await De.json();Qe=Ht}if(!Qe)throw new Error(`Failed to read default branch from ${je}. Response ${De.status} ${De.json()}`);return Qe}async function st(b,c){const{name:C,owner:E,ref:Y,protocol:ge,resource:je,filepath:De}=parseGitUrl(b),Qe=je==="bitbucket.org";let Ht=Y;Ht||(Ht=await pt(b,c));const rn=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return Qe?`${ge}://${je}/${E}/${C}/get/${Ht}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${C}/archive?format=tgz&at=${Ht}&prefix=${E}-${C}${rn}`}function tt(b,c){try{const{owner:C,name:E,ref:Y,filepathtype:ge,filepath:je}=parseGitUrl(b);if(!C||!E||ge!=="browse"&&ge!=="raw"&&ge!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${C}/${E}/src/${Y}/${De}`}return`${c.apiBaseUrl}/projects/${C}/repos/${E}/raw/${De}?at=${Y}`}catch(C){throw new Error(`Incorrect URL: ${b}, ${C}`)}}function ft(b){const c={};if(b.token)c.Authorization=`Bearer ${b.token}`;else if(b.username&&b.appPassword){const C=Ge.from(`${b.username}:${b.appPassword}`,"utf8");c.Authorization=`Basic ${C.toString("base64")}`}return{headers:c}}const ot="bitbucket.org",Xe="https://api.bitbucket.org/2.0";function vt(b){const c=ot,C=Xe,E=b.getString("username"),Y=b.getString("appPassword");return{host:c,apiBaseUrl:C,username:E,appPassword:Y}}function mt(b){const c=b.map(vt);return c.length===0&&c.push({host:ot,apiBaseUrl:Xe}),c}class yt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const C=Z(c);if(c.lineNumber){const E=new URL(C);return E.hash=`lines-${c.lineNumber}`,E.toString()}return C}resolveEditUrl(c){const C=V()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",C.ref),E.toString()}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(yt,"factory",({config:b})=>{var c;const C=mt((c=b.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new yt(E)),E=>E.config.host)});var Cn=r(48834).lW;async function fn(b,c){const{name:C,owner:E}=parseGitUrl(b),Y=`${c.apiBaseUrl}/repositories/${E}/${C}`,ge=await fetch(Y,pn(c));if(!ge.ok){const Qe=`Failed to retrieve default branch from ${Y}, ${ge.status} ${ge.statusText}`;throw new Error(Qe)}const De=(await ge.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${ge.status} ${ge.json()}`);return De}async function hn(b,c){const{name:C,owner:E,ref:Y,protocol:ge,resource:je}=parseGitUrl(b);let De=Y;return De||(De=await fn(b,c)),`${ge}://${je}/${E}/${C}/get/${De}.tar.gz`}function wn(b,c){try{const{owner:C,name:E,ref:Y,filepathtype:ge,filepath:je}=parseGitUrl(b);if(!C||!E||ge!=="src"&&ge!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=je.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${C}/${E}/src/${Y}/${De}`}catch(C){throw new Error(`Incorrect URL: ${b}, ${C}`)}}function pn(b){const c={};if(b.username&&b.appPassword){const C=Cn.from(`${b.username}:${b.appPassword}`,"utf8");c.Authorization=`Basic ${C.toString("base64")}`}return{headers:c}}function vn(b){const c=b.getString("host");let C=b.getOptionalString("apiBaseUrl");const E=b.getOptionalString("token"),Y=b.getOptionalString("username"),ge=b.getOptionalString("password");if(!H(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:C,token:E,username:Y,password:ge}}function jn(b){return b.map(vn)}class on{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const C=Z(c);if(c.lineNumber){const E=new URL(C);return E.hash=c.lineNumber.toString(),E.toString()}return C}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(on,"factory",({config:b})=>{var c;const C=jn((c=b.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new on(E)),E=>E.config.host)});var yn=r(48834).lW;async function En(b,c){const{name:C,owner:E}=parseGitUrl(b);let Y=`${c.apiBaseUrl}/projects/${E}/repos/${C}/default-branch`,ge=await fetch(Y,zt(c));if(ge.status===404&&(Y=`${c.apiBaseUrl}/projects/${E}/repos/${C}/branches/default`,ge=await fetch(Y,zt(c))),!ge.ok){const Qe=`Failed to retrieve default branch from ${Y}, ${ge.status} ${ge.statusText}`;throw new Error(Qe)}const{displayId:je}=await ge.json(),De=je;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${ge.status} ${ge.json()}`);return De}async function nt(b,c){const{name:C,owner:E,ref:Y,filepath:ge}=parseGitUrl(b);let je=Y;je||(je=await En(b,c));const De=ge?`&path=${encodeURIComponent(decodeURIComponent(ge))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${C}/archive?format=tgz&at=${je}&prefix=${E}-${C}${De}`}function _t(b,c){try{const{owner:C,name:E,ref:Y,filepathtype:ge,filepath:je}=parseGitUrl(b);if(!C||!E||ge!=="browse"&&ge!=="raw"&&ge!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${C}/repos/${E}/raw/${De}?at=${Y}`}catch(C){throw new Error(`Incorrect URL: ${b}, ${C}`)}}function zt(b){const c={};if(b.token)c.Authorization=`Bearer ${b.token}`;else if(b.username&&b.password){const C=yn.from(`${b.username}:${b.password}`,"utf8");c.Authorization=`Basic ${C.toString("base64")}`}return{headers:c}}function qe(b){const c=b.getString("host");let C=b.getOptionalString("baseUrl"),E=b.getOptionalString("cloneUrl"),Y=b.getOptionalString("gitilesBaseUrl");const ge=b.getOptionalString("username"),je=b.getOptionalString("password");if(H(c)){if(C&&!m(C))throw new Error(`Invalid Gerrit integration config, '${C}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(Y&&!m(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${c}`,Y?Y=(0,f.trimEnd)(Y,"/"):Y=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=C,{host:c,baseUrl:C,cloneUrl:E,gitilesBaseUrl:Y,username:ge,password:je}}function Rn(b){return b.map(qe)}var ln=r(48834).lW;const kn=")]}'";function xn(b,c){const C=new URL(b.gitilesBaseUrl),E=new URL(c),ge=E.pathname.substring(E.pathname.startsWith("/a/")?2:0).replace(C.pathname,"").split("/").filter(dn=>!!dn),je=ge.indexOf("+");if(je<=0)throw new Error(`Unable to parse project from url: ${c}`);const De=(0,f.trimStart)(ge.slice(0,je).join("/"),"/"),Qe=ge.indexOf("heads");if(Qe<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Ht=ge[Qe+1],rn=ge.slice(Qe+2).join("/");return{branch:Ht,filePath:rn===""?"/":rn,project:De}}function Zn(b,c,C,E){return`${b.gitilesBaseUrl}/${c}/+/refs/heads/${C}/${(0,f.trimStart)(E,"/")}`}function _n(b,c,C,E){const Y=E==="/"||E===""?".tar.gz":`/${E}.tar.gz`;return`${Mn(b)}/${c}/+archive/refs/heads/${C}${Y}`}function In(b){return b.password?"/a/":"/"}function Mn(b){if(!b.baseUrl||!b.gitilesBaseUrl)throw new Error("Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set.");if(b.gitilesBaseUrl.startsWith(b.baseUrl))return b.gitilesBaseUrl.replace(b.baseUrl.concat("/"),b.baseUrl.concat(In(b)));if(b.password)throw new Error("Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed.");return b.gitilesBaseUrl}function we(b,c){const{branch:C,project:E}=xn(b,c);return`${b.baseUrl}${In(b)}projects/${encodeURIComponent(E)}/branches/${C}`}function pe(b,c){const{project:C}=xn(b,c);return`${b.cloneUrl}${In(b)}${C}`}function Pe(b,c){const{branch:C,filePath:E,project:Y}=xn(b,c);return`${b.baseUrl}${In(b)}projects/${encodeURIComponent(Y)}/branches/${C}/files/${encodeURIComponent(E)}/content`}function G(b){return`${b.baseUrl}${In(b)}projects/`}function N(b){const c={};if(!b.password)return c;const C=ln.from(`${b.username}:${b.password}`,"utf8");return c.Authorization=`Basic ${C.toString("base64")}`,{headers:c}}async function ce(b){const c=await b.text();if(c.startsWith(kn))try{return JSON.parse(c.slice(kn.length))}catch(C){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${C}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class Ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:C,base:E,lineNumber:Y}=c;let ge;if(C.startsWith("/")){const{branch:je,project:De}=xn(this.config,E);return Zn(this.config,De,je,C)}return C?ge=new URL(C,E):ge=new URL(E),Y&&(ge.hash=Y.toString()),ge.toString()}resolveEditUrl(c){return c}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(Ae,"factory",({config:b})=>{var c;const C=Rn((c=b.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new Ae(E)),E=>E.config.host)});function Ue(b){const c=b.getString("host");let C=b.getOptionalString("baseUrl");const E=b.getOptionalString("username"),Y=b.getOptionalString("password");if(!H(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${c}`,{host:c,baseUrl:C,username:E,password:Y}}var _e=r(48834).lW;function Ct(b,c){try{var C;const E=(C=b.baseUrl)!==null&&C!==void 0?C:`https://${b.host}`,[Y,ge,je,De,Qe,Ht,...rn]=c.replace(E,"").split("/"),dn=rn.join("/").replace(/^\//,"");return`${E}/${ge}/${je}/_edit/${Ht}/${dn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function Dt(b,c){try{var C;const E=(C=b.baseUrl)!==null&&C!==void 0?C:`https://${b.host}`,[Y,ge,je,De,Qe,Ht,...rn]=c.replace(E,"").split("/"),dn=rn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ge}/${je}/contents/${dn}?ref=${Ht}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function an(b){const c={},{username:C,password:E}=b;return E?(C?c.Authorization=`basic ${_e.from(`${C}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class sn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return Z(c)}resolveEditUrl(c){return Ct(this.config,c)}constructor(c){(0,n._)(this,"config",void 0),this.config=c}}(0,n._)(sn,"factory",({config:b})=>{var c;const E=((c=b.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Y=>Ue(Y));return h(E.map(Y=>new sn(Y)),Y=>Y.config.host)});const cn="github.com",oe="https://api.github.com",ae="https://raw.githubusercontent.com";function Q(b){var c,C;const E=(C=b.getOptionalString("host"))!==null&&C!==void 0?C:cn;let Y=b.getOptionalString("apiBaseUrl"),ge=b.getOptionalString("rawBaseUrl");const je=b.getOptionalString("token"),De=(c=b.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Qe=>({appId:Qe.getNumber("appId"),clientId:Qe.getString("clientId"),clientSecret:Qe.getString("clientSecret"),webhookSecret:Qe.getString("webhookSecret"),privateKey:Qe.getString("privateKey"),allowedInstallationOwners:Qe.getOptionalStringArray("allowedInstallationOwners")}));if(!H(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return Y?Y=(0,f.trimEnd)(Y,"/"):E===cn&&(Y=oe),ge?ge=(0,f.trimEnd)(ge,"/"):E===cn&&(ge=ae),{host:E,apiBaseUrl:Y,rawBaseUrl:ge,token:je,apps:De}}function y(b){const c=b.map(Q);return c.some(C=>C.host===cn)||c.push({host:cn,apiBaseUrl:oe,rawBaseUrl:ae}),c}function I(b,c,C){try{const{owner:E,name:Y,ref:ge,filepathtype:je,filepath:De}=parseGitUrl(b);if(!E||!Y||!ge||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const Qe=De.replace(/^\//,"");return z(c,C)==="api"?`${c.apiBaseUrl}/repos/${E}/${Y}/contents/${Qe}?ref=${ge}`:`${c.rawBaseUrl}/${E}/${Y}/${ge}/${Qe}`}catch(E){throw new Error(`Incorrect URL: ${b}, ${E}`)}}function M(b,c){const C={};return z(b,c)==="api"&&(C.Accept="application/vnd.github.v3.raw"),c.token&&(C.Authorization=`token ${c.token}`),{headers:C}}function z(b,c){return b.apiBaseUrl&&(c.token||!b.rawBaseUrl)?"api":"raw"}var de=r(35355),Se=r(89393),Oe=r(26228);class et{async getOrCreateToken(c,C,E){let Y=this.tokenCache.get(c);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await E(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Y)),!this.appliesToRepo(Y,C))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${C}`);return{accessToken:Y.token}}appliesToRepo(c,C){return C===void 0?!0:c.repositories!==void 0?c.repositories.includes(C):!0}constructor(){(0,n._)(this,"tokenCache",new Map),(0,n._)(this,"isExpired",c=>Oe.ou.local()>c)}}const rt={Accept:"application/vnd.github.machine-man-preview+json"};class xt{async getInstallationCredentials(c,C){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,C,async()=>{const{installationId:Y,suspended:ge}=await this.getInstallationData(c);if(ge)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:rt});let De;if(je.data.repository_selection==="selected"){const Ht=new Se.v({baseUrl:this.baseUrl,auth:je.data.token}),rn=await Ht.paginate(Ht.apps.listReposAccessibleToInstallation);var Qe;De=((Qe=rn.repositories)!==null&&Qe!==void 0?Qe:rn).map(Un=>Un.name)}return{token:je.data.token,expiresAt:Oe.ou.fromISO(je.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(ge=>{var je;return ge.account&&"login"in ge.account&&((je=ge.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const Y=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(c,C){(0,n._)(this,"appClient",void 0),(0,n._)(this,"baseUrl",void 0),(0,n._)(this,"baseAuthConfig",void 0),(0,n._)(this,"cache",new et),(0,n._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=C,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new Se.v({baseUrl:C,headers:rt,authStrategy:de.i,auth:this.baseAuthConfig})}}class wt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(C=>C.getInstallations()))).flat():[]}async getAppToken(c,C){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(c,C).then(Qe=>({credentials:Qe,error:void 0}),Qe=>({credentials:void 0,error:Qe})))),Y=E.find(De=>{var Qe;return(Qe=De.credentials)===null||Qe===void 0?void 0:Qe.accessToken});if(Y)return Y.credentials.accessToken;const je=E.map(De=>De.error).find(De=>{var Qe;return((Qe=De)===null||Qe===void 0?void 0:Qe.name)!=="NotFoundError"});if(je)throw je}constructor(c){var C;(0,n._)(this,"apps",void 0);var E;this.apps=(E=(C=c.apps)===null||C===void 0?void 0:C.map(Y=>new xt(Y,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class it{async getCredentials(c){const C=V()(c.url),E=C.owner||C.name,Y=C.owner?C.name:void 0;let ge="app",je=await this.githubAppCredentialsMux.getAppToken(E,Y);return je||(ge="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ge}}constructor(c,C){(0,n._)(this,"githubAppCredentialsMux",void 0),(0,n._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=C}}(0,n._)(it,"create",b=>new it(new wt(b),b.token));class ke{static fromIntegrations(c){const C=new Map;return c.github.list().forEach(E=>{const Y=SingleInstanceGithubCredentialsProvider.create(E.config);C.set(E.config.host,Y)}),new ke(C)}async getCredentials(c){const C=new URL(c.url),E=this.providers.get(C.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class bt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Xt(Z(c),"tree")}resolveEditUrl(c){return Xt(c,"edit")}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(bt,"factory",({config:b})=>{var c;const C=y((c=b.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new bt(E)),E=>E.config.host)});function Xt(b,c){return b.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(C,E,Y,ge)=>`//${E}/${Y}/${ge}/${c}/`)}const Tt=null;class Ft extends bt{get config(){return super.config}constructor(c){super(c)}}(0,n._)(Ft,"factory",bt.factory);const en=null,An=null,Kt=null,jt="gitlab.com",It="https://gitlab.com/api/v4";function Yt(b){const c=b.getString("host");let C=b.getOptionalString("apiBaseUrl");const E=b.getOptionalString("token");let Y=b.getOptionalString("baseUrl");if(C?C=(0,f.trimEnd)(C,"/"):c===jt&&(C=It),Y?Y=(0,f.trimEnd)(Y,"/"):Y=`https://${c}`,H(c)){if(!C||!m(C))throw new Error(`Invalid GitLab integration config, '${C}' is not a valid apiBaseUrl`);if(!m(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:C,baseUrl:Y}}function Zt(b){const c=b.map(Yt);return c.some(C=>C.host===jt)||c.push({host:jt,apiBaseUrl:It,baseUrl:`https://${jt}`}),c}function mr(b){let c="";return b.host!==jt&&(c=new URL(b.baseUrl).pathname),trimEnd(c,"/")}async function er(b,c){const C=await ir(b,c);return bn(b,C,c).toString()}function sr(b){const{token:c=""}=b;return{headers:{"PRIVATE-TOKEN":c}}}function bn(b,c,C){try{const E=new URL(b),Y=E.pathname.split("/blob/").slice(1).join("/blob/"),[ge,...je]=Y.split("/"),De=getGitLabIntegrationRelativePath(C);return E.pathname=[...De?[De]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${ge}`,E}catch(E){throw new Error(`Incorrect url: ${b}, ${E}`)}}async function ir(b,c){const C=new URL(b);if(!C.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=C.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(c);Y&&(E=E.replace(Y,""));const ge=new URL(`${C.origin}${Y}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(ge.toString(),sr(c)),De=await je.json();if(!je.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${b}, ${E}`)}}class Yn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Z(c)}resolveEditUrl(c){return zr(c,"edit")}constructor(c){(0,n._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,n._)(Yn,"factory",({config:b})=>{var c;const C=Zt((c=b.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(C.map(E=>new Yn(E)),E=>E.config.host)});function zr(b,c){return b.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class tr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,n._)(this,"token",void 0),this.token=c}}(0,n._)(tr,"create",b=>new tr(b.token));class Yr{static fromIntegrations(c){const C=new Map;return c.gitlab.list().forEach(E=>{const Y=SingleInstanceGitlabCredentialsProvider.create(E.config);C.set(E.config.host,Y)}),new Yr(C)}async getCredentials(c){const C=new URL(c.url),E=this.providers.get(C.host);if(!E)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Lr{static fromConfig(c){return new Lr({awsS3:D.factory({config:c}),azure:$t.factory({config:c}),bitbucket:be.factory({config:c}),bitbucketCloud:yt.factory({config:c}),bitbucketServer:on.factory({config:c}),gerrit:Ae.factory({config:c}),github:bt.factory({config:c}),gitlab:Yn.factory({config:c}),gitea:sn.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let C=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(C.length>1){const E=C.filter(Y=>!(Y instanceof be));E.length!==0&&(C=E)}return C[0]}byHost(c){return Object.values(this.byType).map(C=>C.byHost(c)).find(Boolean)}resolveUrl(c){const C=this.byUrl(c.base);return C?C.resolveUrl(c):Z(c)}resolveEditUrl(c){const C=this.byUrl(c);return C?C.resolveEditUrl(c):c}constructor(c){(0,n._)(this,"byType",void 0),this.byType=c}}},81879:function(Rt,Le,r){"use strict";var n={};r.r(n),r.d(n,{TechDocsPlugin:function(){return w.s4}});var p=r(52322),V=r(2784),f=r(28316),H=r(73557),m=r(60871);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),Z=(0,m.T0)({id:"plugin.techdocs.service"});var ye=r(92077),le=r(95481),W=r(7476),ue=r(93225),D=r(86317),A=r(65124),re=r(22478),se=r(85478),te=r(68435),q=r(3482),K=r(42081),R=r(48431),w=r(89258),P=r(52943),U=r(61886),xe=r(13980),Ce=r.n(xe),B=r(87612);class Je{get(t){for(const o of this.holders){const a=o.get(t);if(a)return a}}constructor(...t){(0,B._)(this,"holders",void 0),this.holders=t}}var St=r(51837);const Nt=(0,St.CT)("api-context"),Wt=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,V.useContext)(Nt))===null||t===void 0?void 0:t.atVersion(1),S=d?new Je(o,d):o;return(0,p.jsx)(Nt.Provider,{value:(0,St.EI)({1:S}),children:a})};Wt.propTypes={apis:Ce().shape({get:Ce().func.isRequired}).isRequired,children:Ce().node};class kt{static validateFactories(t,o){for(const a of o){const d=[a],S=new Set;for(;d.length;){const L=d.shift(),F=t.get(L);if(F)for(const J of Object.values(F.deps)){if(J.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);S.has(J)||(S.add(J),d.push(J))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const d=this.factories.get(t);if(!d)return;if(o.includes(d.api))throw new Error(`Circular dependency of api factory for ${d.api}`);const S=this.loadDeps(t,d.deps,[...o,d.api]),L=d.factory(S);return this.apis.set(t.id,L),L}loadDeps(t,o,a){const d={};for(const S in o)if(o.hasOwnProperty(S)){const L=o[S],F=this.load(L,a);if(!F)throw new Error(`No API factory available for dependency ${L} of dependent ${t}`);d[S]=F}return d}constructor(t){(0,B._)(this,"factories",void 0),(0,B._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var $t;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})($t||($t={}));class qt{register(t,o){const a=$t[t],d=this.factories.get(o.api.id);return d&&d.priority>=a?!1:(this.factories.set(o.api.id,{priority:a,factory:o}),!0)}get(t){const o=this.factories.get(t.id);if(o)return o.factory}getAllApis(){const t=new Set;for(const{factory:o}of this.factories.values())t.add(o.api);return t}constructor(){(0,B._)(this,"factories",new Map)}}function lt(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,S=window.screen.width/2-a/2,L=window.screen.height/2-d/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${d},top=${L},left=${S}`);let J="";if(!F||typeof F.closed=="undefined"||F.closed){const $e=new Error("Failed to open auth popup.");$e.name="PopupRejectedError",o($e);return}const fe=$e=>{if($e.source!==F||$e.origin!==i.origin)return;const{data:Ve}=$e;if(Ve.type==="config_info"){J=Ve.targetOrigin;return}if(Ve.type!=="authorization_response")return;const Ye=Ve;if("error"in Ye){const Bt=new Error(Ye.error.message);Bt.name=Ye.error.name,o(Bt)}else t(Ye.response);Ee()},Fe=setInterval(()=>{if(F.closed){const $e=`Login failed, ${J&&J!==window.location.origin?`Incorrect app origin, expected ${J}`:"popup was closed"}`,Ve=new Error($e);Ve.name="PopupClosedError",o(Ve),Ee()}},100);function Ee(){window.removeEventListener("message",fe),clearInterval(Fe)}window.addEventListener("message",fe)})}let dt=!1;function ut(i){return[...i].join(" ")}class ht{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const o=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(d=>{throw new Error(`Auth refresh request failed, ${d}`)});if(!o.ok){const d=new Error(`Auth refresh request failed, ${o.statusText}`);throw d.status=o.status,d}const a=await o.json();if(a.error){const d=new Error(a.error.message);throw a.error.name&&(d.name=a.error.name),d}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!t.ok){const o=new Error(`Logout request failed, ${t.statusText}`);throw o.status=t.status,o}}async showPopup(t){var o,a,d,S,L,F,J,fe;const Fe=this.joinScopesFunc(t),Ee=await this.buildUrl("/start",{scope:Fe,origin:window.location.origin,flow:"popup"}),$e=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((S=this.popupOptions)===null||S===void 0||(d=S.size)===null||d===void 0?void 0:d.width)||450,Ve=!((F=this.popupOptions)===null||F===void 0||(L=F.size)===null||L===void 0)&&L.fullscreen?window.screen.height:((fe=this.popupOptions)===null||fe===void 0||(J=fe.size)===null||J===void 0?void 0:J.height)||730,Ye=await lt({url:Ee,name:`${this.provider.title} Login`,origin:new URL(Ee).origin,width:$e,height:Ve});return await this.sessionTransform(Ye)}async executeRedirect(t){const o=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:o,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,o){const a=await this.discoveryApi.getBaseUrl("auth"),d=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${d}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,d])=>{if(typeof d=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(d)}`;if(d)return encodeURIComponent(a)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(t){(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"joinScopesFunc",void 0),(0,B._)(this,"authRequester",void 0),(0,B._)(this,"sessionTransform",void 0),(0,B._)(this,"enableExperimentalRedirectFlow",void 0),(0,B._)(this,"popupOptions",void 0);const{configApi:o,discoveryApi:a,environment:d,provider:S,joinScopes:L=ut,oauthRequestApi:F,sessionTransform:J=Ee=>Ee,popupOptions:fe}=t;!dt&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),dt=!0);var Fe;this.enableExperimentalRedirectFlow=o&&(Fe=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Fe!==void 0?Fe:!1,this.authRequester=F.createAuthRequester({provider:S,onAuthRequest:async Ee=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ee):this.showPopup(Ee)}),this.discoveryApi=a,this.environment=d,this.provider=S,this.joinScopesFunc=L,this.sessionTransform=J,this.popupOptions=fe}}function Vt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Qt{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Vt(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const d=this.options.sessionScopes(t);for(const S of d)a.add(S)}if(o)for(const d of o)a.add(d);return a}constructor(t){(0,B._)(this,"options",void 0),this.options=t}}var be=r(82394),Me=r.n(be);let Ge=Symbol.observable;class pt{[Ge](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(){(0,B._)(this,"isClosed",!1),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",new(Me())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,B._)(this,"subscribers",new Set)}}let st=Symbol.observable;class tt{[st](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(t){(0,B._)(this,"isClosed",void 0),(0,B._)(this,"currentValue",void 0),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",void 0),(0,B._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Me())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class ft{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,B._)(this,"subject",new tt(m.sM.SignedOut)),(0,B._)(this,"signedIn",!1)}}class ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),d=this.sessionScopesFunc(this.currentSession),S=this.sessionScopesFunc(a);return Vt(S,d)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const o=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=o,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const o=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),o}finally{delete this.refreshPromise}}constructor(t){(0,B._)(this,"connector",void 0),(0,B._)(this,"helper",void 0),(0,B._)(this,"sessionScopesFunc",void 0),(0,B._)(this,"sessionShouldRefreshFunc",void 0),(0,B._)(this,"stateTracker",new ft),(0,B._)(this,"refreshPromise",void 0),(0,B._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d,sessionShouldRefresh:S}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=S,this.helper=new Qt({sessionScopes:d,defaultScopes:a})}}class Xe{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:d,defaultScopes:a})}}const vt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class mt{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=vt,oauthRequestApi:L,defaultScopes:F=[],scopeTransform:J=$e=>$e,popupOptions:fe}=t,Fe=new ht({configApi:o,discoveryApi:a,environment:d,provider:S,oauthRequestApi:L,sessionTransform({backstageIdentity:$e,...Ve}){const Ye={...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:mt.normalizeScopes(J,Ve.providerInfo.scope),expiresAt:Ve.providerInfo.expiresInSeconds?new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3):void 0}};if($e){var Bt;const Mt=(Bt=$e.expiresInSeconds)!==null&&Bt!==void 0?Bt:Ve.providerInfo.expiresInSeconds;Ye.backstageIdentity={token:$e.token,identity:$e.identity,expiresAt:Mt?new Date(Date.now()+Mt*1e3):void 0}}return Ye},popupOptions:fe}),Ee=new ot({connector:Fe,defaultScopes:new Set(F),sessionScopes:$e=>$e.providerInfo.scopes,sessionShouldRefresh:$e=>{var Ve,Ye;let Bt=1/0;return!((Ve=$e.providerInfo)===null||Ve===void 0)&&Ve.expiresAt&&(Bt=Math.min(Bt,($e.providerInfo.expiresAt.getTime()-Date.now())/1e3)),!((Ye=$e.backstageIdentity)===null||Ye===void 0)&&Ye.expiresAt&&(Bt=Math.min(Bt,($e.backstageIdentity.expiresAt.getTime()-Date.now())/1e3)),Bt<60*5}});return new mt({sessionManager:Ee,scopeTransform:J})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const d=mt.normalizeScopes(this.scopeTransform,t),S=await this.sessionManager.getSession({...o,scopes:d});var L;return(L=(a=S)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&L!==void 0?L:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var d;return(d=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&d!==void 0?d:""}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}static normalizeScopes(t,o){if(!o)return new Set;const a=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,B._)(this,"sessionManager",void 0),(0,B._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const yt={id:"github",title:"GitHub",icon:()=>null};class Cn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=yt,oauthRequestApi:L,defaultScopes:F=["read:user"]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:F})}}const fn={id:"gitlab",title:"GitLab",icon:()=>null};class hn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=fn,oauthRequestApi:L,defaultScopes:F=["read_user"]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:F})}}const wn={id:"google",title:"Google",icon:()=>null},pn="https://www.googleapis.com/auth/";class vn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:S="development",provider:L=wn,defaultScopes:F=["openid",`${pn}userinfo.email`,`${pn}userinfo.profile`]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:L,environment:S,defaultScopes:F,scopeTransform(J){return J.map(fe=>fe==="openid"?fe:fe==="profile"||fe==="email"?`${pn}userinfo.${fe}`:fe.startsWith(pn)?fe:`${pn}${fe}`)}})}}const jn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),yn="okta.";class En{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=jn,oauthRequestApi:L,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:F,scopeTransform(J){return J.map(fe=>on.has(fe)||fe.startsWith(yn)?fe:`${yn}${fe}`)}})}}var nt=r(30195);const _t=nt.z.object({profile:nt.z.object({email:nt.z.string().optional(),displayName:nt.z.string().optional(),picture:nt.z.string().optional()}),backstageIdentity:nt.z.object({token:nt.z.string(),identity:nt.z.object({type:nt.z.literal("user"),userEntityRef:nt.z.string(),ownershipEntityRefs:nt.z.array(nt.z.string())})})}),zt={id:"saml",title:"SAML",icon:()=>null};class qe{static create(t){const{discoveryApi:o,environment:a="development",provider:d=zt}=t,S=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),L=new StaticAuthSessionManager({connector:S}),F=new AuthSessionStore({manager:L,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new qe(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Rn={id:"microsoft",title:"Microsoft",icon:()=>null};class ln{static create(t){return new ln(t)}microsoftGraph(){return this.oauth2[ln.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(ln.resourceForScope).filter(S=>S!=="openid"))];if(o.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${o.join(", ")}. Access tokens can only have a single audience.`));var a;const d=(a=o[0])!==null&&a!==void 0?a:ln.MicrosoftGraphID;return Promise.resolve(d)}static resourceForScope(t){var o;const a=(o=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||o===void 0?void 0:o.groups;if(a){const{resourceURI:d}=a;return d.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return ln.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?ln.MicrosoftGraphID:await ln.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=mt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,o)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,B._)(this,"oauth2",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"oauthRequestApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"scopeTransform",void 0);const{configApi:o,environment:a="development",provider:d=Rn,oauthRequestApi:S,discoveryApi:L,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:J=fe=>fe.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=d,this.oauthRequestApi=S,this.discoveryApi=L,this.scopeTransform=J,this.oauth2={[ln.MicrosoftGraphID]:mt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,B._)(ln,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const kn={id:"onelogin",title:"onelogin",icon:()=>null},xn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Zn="onelogin.";class _n{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=kn,oauthRequestApi:L}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(J=>xn.has(J)||J.startsWith(Zn)?J:`${Zn}${J}`)}})}}const In={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Mn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=In,oauthRequestApi:L,defaultScopes:F=["team"]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:F})}}const we={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=we,oauthRequestApi:L,defaultScopes:F=["PROJECT_ADMIN"]}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d,defaultScopes:F})}}const Pe={id:"atlassian",title:"Atlassian",icon:()=>null};class G{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Pe,oauthRequestApi:L}=t;return mt.create({configApi:o,discoveryApi:a,oauthRequestApi:L,provider:S,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,B._)(this,"subject",new pt)}}class ce{captureEvent(t){}}const Ae="theme";class Ue{static createWithStorage(t){const o=new Ue(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ae))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(S=>{S?window.localStorage.setItem(Ae,S):window.localStorage.removeItem(Ae)}),window.addEventListener("storage",S=>{if(S.key===Ae){var L;const F=(L=localStorage.getItem(Ae))!==null&&L!==void 0?L:void 0;o.setActiveThemeId(F)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,B._)(this,"themes",void 0),(0,B._)(this,"activeThemeId",void 0),(0,B._)(this,"subject",void 0),this.themes=t,this.subject=new tt(void 0)}}var _e=r(23054);const Ct=null;function Dt(i,t){let o,a=!1;const d={};try{var S;o=!((S=t)===null||S===void 0)&&S.key?i.getConfig(t.key):i;for(const F of Ct){const J=o.getOptionalNumber(F);J!==void 0&&(d[F]=J,a=!0)}}catch(F){throw new InputError(`Failed to read duration from config, ${F}`)}try{if(!a){const J=Ct.map(fe=>`'${fe}'`).join(", ");throw new Error(`Needs one or more of ${J}`)}const F=o.keys().filter(J=>!Ct.includes(J));if(F.length){const J=F.length===1?"property":"properties",fe=F.map(Ee=>`'${Ee}'`).join(", "),Fe=Ct.map(Ee=>`'${Ee}'`).join(", ");throw new Error(`Unknown ${J} ${fe}; expected one or more of ${Fe}`)}}catch(F){var L;let J="Failed to read duration from config";throw!((L=t)===null||L===void 0)&&L.key&&(J+=` at '${t.key}'`),new InputError(`${J}, ${F}`)}return d}var an=r(9850),sn=r.n(an),cn=r(12782),oe=r.n(cn);const ae=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Q(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function y(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const I={type(i,t,o,a){return`Invalid type in config for key '${i}' in '${t}', got ${o}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,o){return`Unable to convert config value for key '${i}' in '${t}' to a ${o}`}};class M{static fromConfigs(t){return t.length===0?new M(void 0):t.reduce((o,{data:a,context:d,filteredKeys:S,deprecatedKeys:L})=>{const F=new M(a,d,o);if(F.filteredKeys=S,L)for(const{key:J,description:fe}of L)console.warn(`The configuration key '${J}' of ${d} is deprecated and may be removed soon. ${fe||""}`);return F},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var d;return(d=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&d!==void 0?d:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const d=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...d])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=sn()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var S;return d}else if(d===void 0)return a;return oe()({},{value:d},{value:a},(L,F)=>!Q(F)||!Q(L)?F:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(Q(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(I.type(this.fullKey(t),this.context,y(a),"object"));return d}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,d=>{if(!Array.isArray(d))return{expected:"object-array"};for(const[S,L]of d.entries())if(!Q(L))return{expected:"object-array",value:L,key:`${t}[${S}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,S)=>this.copy(d,`${t}[${S}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,d=>typeof d=="number"||typeof d=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(I.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,d=>typeof d=="boolean"||typeof d=="number"||typeof d=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const a=String(o).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(I.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalString(t){return this.readConfigValue(t,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(t){const o=this.getOptionalStringArray(t);if(o===void 0)throw new Error(I.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,d]of o.entries())if(typeof d!="string"||d==="")return{expected:"string-array",value:d,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const d=new M(t,this.context,a,this.fullKey(o));return d.filteredKeys=this.filteredKeys,d}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var d;if(!1)var S;return(d=this.fallback)===null||d===void 0?void 0:d.readConfigValue(t,o)}const L=o(a);if(L!==!0){const{key:F=t,value:J=a,expected:fe}=L;throw new TypeError(I.type(this.fullKey(F),this.context,y(J),fe))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!ae.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,S]of o.entries())if(Q(a))a=a[S];else if(a!==void 0){const L=this.fullKey(o.slice(0,d).join("."));throw new TypeError(I.type(L,this.context,y(a),"object"))}return a}constructor(t,o="mock-config",a,d=""){(0,B._)(this,"data",void 0),(0,B._)(this,"context",void 0),(0,B._)(this,"fallback",void 0),(0,B._)(this,"prefix",void 0),(0,B._)(this,"filteredKeys",void 0),(0,B._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=o,this.fallback=a,this.prefix=d,this.notifiedFilteredKeys=new Set}}const z="Invalid discovery URL pattern,";class de{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let d;try{d=new URL(a)}catch{throw new Error(`${z} URL '${a}' is invalid`)}if(d.hash)throw new Error(`${z} URL must not have a hash`);if(d.search)throw new Error(`${z} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${z} URL must not end with a slash`);return new de(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,B._)(this,"parts",void 0),this.parts=t}}class Se{post(t,o){var a;return!((a=o)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,o)}error$(){return this.errorApi.error$()}constructor(t,o){(0,B._)(this,"alertApi",void 0),(0,B._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=o}}class Oe{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,B._)(this,"subject",new pt)}}class et{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function rt(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class xt{registerFlag(t){rt(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,d]of Object.entries(t.states))this.flags.set(a,d);const o=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const o=JSON.parse(t);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const a=Object.entries(o).filter(([d,S])=>(rt(d),S===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,B._)(this,"registeredFeatureFlags",[]),(0,B._)(this,"flags",void 0)}}function wt(i){let t=i.baseImplementation||r.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const d of a)t=d.apply(t);return{fetch:t}}class it{static create(t){var o,a;const d=ke(t),S=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",L=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new it(t.identityApi,d,S,L)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:S}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof S!="string"||!S||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(S)),t(d))}}constructor(t,o,a,d){(0,B._)(this,"identityApi",void 0),(0,B._)(this,"allowUrl",void 0),(0,B._)(this,"headerName",void 0),(0,B._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=o,this.headerName=a,this.headerValue=d}}function ke(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?bt(i.urlPrefixAllowlist):i.config?bt([i.config.getString("backend.baseUrl")]):()=>!1}function bt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function Xt(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Tt{apply(t){return async(o,a)=>{const d=new Request(o,a),S="plugin://";if(!d.url.startsWith(S))return t(o,a);const{hostname:L,pathname:F,search:J,hash:fe,username:Fe,password:Ee}=new URL(`http://${d.url.substring(S.length)}`);let $e=await this.discoveryApi.getBaseUrl(L);if(Fe||Ee){const Ye=new URL($e),Bt=`${Fe}${Ee?`:${Ee}`:""}@`;$e=`${Ye.protocol}//${Bt}${Ye.host}${Ye.pathname}`}const Ve=`${Xt($e,F)}${J}${fe}`;return t(Ve,typeof o=="string"||Ft(o)?a:o)}}constructor(t){(0,B._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ft(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class en{static resolvePluginProtocol(t){return new Tt(t.discoveryApi)}static injectIdentityAuth(t){return it.create(t)}constructor(){}}function An(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Kt(i,...t){const o=new Set(i);for(const a of t)for(const d of a)o.add(d);return o}class jt{request(t){return new Promise((o,a)=>{this.requests.push({scopes:t,resolve:o,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,o){this.requests=this.requests.filter(a=>An(t,a.scopes)?(a.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(o=>o.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,a)=>Kt(o,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:o=>{t&&this.resolve(t,o)},reject:o=>{t&&this.reject(o)}}}constructor(){(0,B._)(this,"requests",[]),(0,B._)(this,"subject",new tt(this.getCurrentPending()))}}class It{createAuthRequester(t){const o=new jt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const S=this.currentRequests.slice(),L=this.makeAuthRequest(d,t);L?S[a]=L:delete S[a],this.currentRequests=S,this.subject.next(S.filter(Boolean))}}),d=>o.request(d)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const d=await o.onAuthRequest(a);t.resolve(d)},reject:()=>{const d=new Error("Login failed, rejected by user");d.name="RejectedError",t.reject(d)}}}authRequest$(){return this.subject}constructor(){(0,B._)(this,"subject",new tt([])),(0,B._)(this,"currentRequests",[]),(0,B._)(this,"handlerCount",0)}}const Yt=new Map;class Zt{static create(t){var o;return new Zt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Yt.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&d.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const d=localStorage.getItem(this.getKeyName(t));d&&(o=JSON.parse(d,(S,L)=>(typeof L=="object"&&L!==null&&Object.freeze(L),L)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Yt.has(o)||Yt.set(o,new Zt(o,this.errorApi)),Yt.get(o)}async set(t,o){localStorage.setItem(this.getKeyName(t),JSON.stringify(o)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return Zt.hasSubscribed||(Zt.addStorageEventListener(),Zt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===t)}handleStorageChange(t){var o,a;if(!(!((o=t)===null||o===void 0)&&o.startsWith(this.namespace)))return;const d=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);d.includes("/")||this.notifyChanges(decodeURIComponent(d))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const o=this.snapshot(t);for(const a of this.subscribers)a.next(o)}constructor(t,o){(0,B._)(this,"namespace",void 0),(0,B._)(this,"errorApi",void 0),(0,B._)(this,"subscribers",void 0),(0,B._)(this,"observable",void 0),this.namespace=t,this.errorApi=o,this.subscribers=new Set,this.observable=new(Me())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,B._)(Zt,"hasSubscribed",!1);const mr=(0,V.createContext)(void 0);function er(){const[i]=(0,H.is)((0,p.jsx)(H.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var sr=r(84800);const bn=(i,t)=>{try{var o,a,d,S;const F=(o=(0,sr.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter($e=>{var Ve,Ye;return((Ye=$e)===null||Ye===void 0||(Ve=Ye.route.routeRefs)===null||Ve===void 0?void 0:Ve.size)>0}).pop(),J=(a=F)===null||a===void 0?void 0:a.route;if(!J||J.path===""&&i!=="/")return;let fe;J.routeRefs.size===1&&(fe=J.routeRefs.values().next().value);let Fe;J.plugins.size===1&&(Fe=J.plugins.values().next().value);const Ee=Object.entries(((d=F)===null||d===void 0?void 0:d.params)||{}).reduce(($e,[Ve,Ye])=>(Ye!==void 0&&Ve!=="*"&&($e[Ve]=Ye),$e),{});return{extension:"App",pluginId:((S=Fe)===null||S===void 0?void 0:S.getId())||"root",...fe?{routeRef:fe.id}:{},_routeNodeType:J.element,params:Ee}}catch{return}},ir=({pathname:i,search:t,hash:o,attributes:a})=>{const d=(0,m.z$)();return(0,V.useEffect)(()=>{d.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[d,i,t,o,a]),null},Yn=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,H.TH)(),{params:d,...S}=bn(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:S,children:(0,p.jsx)(ir,{pathname:t,search:o,hash:a,attributes:d})})};function zr(i){return er()?tr(i):""}function tr(i){var t;let{pathname:o}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Yr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,V.useState)(),S=(0,m.h_)(m.Ds),L=zr(S);return a?(t.setTarget(a,{signOutTargetUrl:L||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:d})}function Lr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=tr(a),S=`${d}/*`,L=(0,V.useContext)(mr);if(!L)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:J}=L;return o?er()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Yn,{routeObjects:F}),(0,p.jsx)(Yr,{component:o,appIdentityProxy:J,children:(0,p.jsx)(H.Z5,{children:(0,p.jsx)(H.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(Yn,{routeObjects:F}),(0,p.jsx)(Yr,{component:o,appIdentityProxy:J,children:i.children})]}):(J.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:d||"/"}),er()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Yn,{routeObjects:F}),(0,p.jsx)(H.Z5,{children:(0,p.jsx)(H.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(Yn,{routeObjects:F}),i.children]}))}var b=r(88412),c=r(50629),C=r(80956),E=r(64279);function Y(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:V.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:d,contexts:S}=o.shift();V.Children.forEach(a,L=>{if(!(0,V.isValidElement)(L))return;const F={};for(const J in t)if(t.hasOwnProperty(J)){const fe=t[J];F[J]=fe.visit(fe.accumulator,L,d,S[J])}for(const J of i.discoverers){const fe=J(L);fe&&o.push({node:fe,parent:L,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,d])=>[a,d.accumulator]))}function ge(i,t){return()=>({accumulator:i(),visit:t})}function je(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function De(i){var t,o;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((o=i.props)===null||o===void 0)&&o.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const Qe=ge(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),Ht=i=>{const{children:t}=i,o=(0,m.h_)(m.W0),a="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,m.R5)(Ht,"core.featureFlagged",!0);const rn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function dn(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,d;return(d=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&d!==void 0?d:String(o.type)}return String(o)}const Un=i=>{const t=new Set;return i&&t.add(i),t};function Ut(i,t=new Array){return V.Children.forEach(i,o=>{if(!(0,V.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const d=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:d})}Ut(o.props.children,t)}),t}const un=ge(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,L,F,J;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((S=o)===null||S===void 0?void 0:S.props.element)===t)return{...a,isElementAncestor:!0};const fe=(L=t.props)===null||L===void 0?void 0:L.path,Fe=(0,m.IY)(t,"core.mountPoint");if(Fe&&fe)throw new Error(`Path property may not be set directly on a routable extension "${dn(t)}"`);var Ee;const $e=(Ee=(J=a)===null||J===void 0||(F=J.obj)===null||F===void 0?void 0:F.children)!==null&&Ee!==void 0?Ee:i.objects;if(fe!==void 0){if(typeof fe!="string")throw new Error(`Element path must be a string at "${dn(t)}"`);const Bn=fe.startsWith("/")?fe.slice(1):fe,Kr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Ve,Ye,Bt;if(Kr)throw new Error(`Mount point gatherers may not have an element prop "${dn(t)}"`);const Eo={path:Bn,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ve=t.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[rn],plugins:new Set};return $e.push(Eo),{obj:Eo,gatherPath:Bn,routeRef:(Ye=a)===null||Ye===void 0?void 0:Ye.routeRef,gatherRouteRef:(Bt=a)===null||Bt===void 0?void 0:Bt.routeRef}}if(Kr){var Mt,Qn,Hr,Ar;const[Eo,...ma]=Ut(Kr);if(ma.length>0)throw new Error(`Route element with path "${fe}" may not contain multiple routable extensions`);if(!Eo)return a;const{routeRef:uo,plugin:ii}=Eo,ai={path:Bn,element:"mounted",routeRefs:new Set([uo]),caseSensitive:Boolean((Mt=t.props)===null||Mt===void 0?void 0:Mt.caseSensitive),children:[rn],plugins:Un(ii)};return $e.push(ai),i.paths.set(uo,Bn),i.parents.set(uo,(Qn=a)===null||Qn===void 0?void 0:Qn.routeRef),{obj:ai,routeRef:uo!=null?uo:(Hr=a)===null||Hr===void 0?void 0:Hr.routeRef,gatherPath:Bn,gatherRouteRef:(Ar=a)===null||Ar===void 0?void 0:Ar.gatherRouteRef}}}if(Fe){var Tr,br,Fn,Rr;if(((Tr=a)===null||Tr===void 0?void 0:Tr.gatherPath)===void 0)throw new Error(`Routable extension "${dn(t)}" with mount point "${Fe}" must be assigned a path`);(Fn=a)===null||Fn===void 0||(br=Fn.obj)===null||br===void 0||br.routeRefs.add(Fe);const Bn=(0,m.IY)(t,"core.plugin");if(Bn){var Gr,Nr;(Nr=a)===null||Nr===void 0||(Gr=Nr.obj)===null||Gr===void 0||Gr.plugins.add(Bn)}return i.paths.set(Fe,a.gatherPath),i.parents.set(Fe,(Rr=a)===null||Rr===void 0?void 0:Rr.gatherRouteRef),{...a,routeRef:Fe}}return a}),ar=ge(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,L,F,J,fe,Fe,Ee,$e;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Ve=(S=a)===null||S===void 0?void 0:S.obj,Ye=(L=a)===null||L===void 0?void 0:L.routeRef,Bt=(F=a)===null||F===void 0?void 0:F.sticky;const Mt=(J=t.props)===null||J===void 0?void 0:J.path;var Qn;const Hr=(Qn=(fe=Ve)===null||fe===void 0?void 0:fe.children)!==null&&Qn!==void 0?Qn:i.objects,Ar=Boolean((Fe=t.props)===null||Fe===void 0?void 0:Fe.caseSensitive);let Tr=(Ee=a)===null||Ee===void 0?void 0:Ee.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Mt)throw new Error("Mount point gatherer must have a path");Tr=Mt}const br=($e=t.props)===null||$e===void 0?void 0:$e.element;let Fn=(0,m.IY)(t,"core.mountPoint");if(!Fn&&(0,V.isValidElement)(br)&&(Fn=(0,m.IY)(br,"core.mountPoint")),Fn){let Kr=Mt;if(Tr&&(Kr?Tr=void 0:Kr=Tr),!Kr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Fn,Kr),Ye&&Bt?(i.parents.set(Fn,Ye),Mt&&(Ye=Fn,Bt=!1)):(i.parents.set(Fn,Ye),Ye=Fn),Mt)Ve={caseSensitive:Ar,path:Mt,element:"mounted",routeRefs:new Set([Fn]),children:[rn],plugins:Un((0,m.IY)(t.props.element,"core.plugin"))},Hr.push(Ve);else{var Rr;(Rr=Ve)===null||Rr===void 0||Rr.routeRefs.add(Fn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(Bt=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Mt)throw new Error("Mount point gatherer must have a path");if(!Fn){var Nr,Bn;Ve={caseSensitive:Ar,path:Mt,element:"gathered",routeRefs:new Set,children:[rn],plugins:((Bn=a)===null||Bn===void 0||(Nr=Bn.obj)===null||Nr===void 0?void 0:Nr.plugins)||new Set},Hr.push(Ve)}}return{obj:Ve,path:Tr,routeRef:Ye,sticky:Bt}}),lr=ge(()=>new Set,(i,t)=>{if(t.type===Ht){const o=t.props;i.add("with"in o?o.with:o.without)}}),Jn=(0,St.uW)("route-ref-type",()=>Symbol("route-ref-type"));function vr(i){return i[Jn]==="absolute"}function Ro(i){return i[Jn]==="sub"}function ws(i){return i[Jn]==="external"}function to(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Wo(i,t,o){let a,d="";if(vr(i))a=i;else if(Ro(i))a=i.parent,d=i.path;else if(ws(i)){const F=o.get(i);if(!F)return[void 0,""];if(vr(F))a=F;else if(Ro(F))a=F.parent,d=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[Jn]?new Error(`Unknown or invalid route ref type, ${i[Jn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const S=t.get(a);if(S===void 0)return[void 0,""];const L=to(S,d);return[a,L]}function Or(i,t,o,a,d){var S;const L=(S=(0,sr.fp)(d,t))!==null&&S!==void 0?S:[],F=Array();let J=-1;for(let Ee=i;Ee&&(J=L.findIndex($e=>$e.route.routeRefs.has(Ee)),J===-1);Ee=a.get(Ee))F.unshift(Ee);F.length===0&&(J-=1);const fe=J===-1?"":L[J].pathname,Fe=F.slice(0,-1).map(Ee=>{const $e=o.get(Ee);if($e===void 0)throw new Error(`No path for ${Ee}`);if($e.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ee} as it has parameters`);return $e});return`${to(fe,...Fe)}/`}class yr{resolve(t,o){const[a,d]=Wo(t,this.routePaths,this.routeBindings);if(!a)return;let S;typeof o=="string"?S=this.trimPath(o):o.pathname?S={...o,pathname:this.trimPath(o.pathname)}:S=o;const L=this.appBasePath+Or(a,S,this.routePaths,this.routeParents,this.routeObjects);return(...[J])=>to(L,(0,sr.Gn)(d,J))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,S){(0,B._)(this,"routePaths",void 0),(0,B._)(this,"routeParents",void 0),(0,B._)(this,"routeObjects",void 0),(0,B._)(this,"routeBindings",void 0),(0,B._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=o,this.routeObjects=a,this.routeBindings=d,this.appBasePath=S}}const Jr=(0,St.CT)("routing-context"),no=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:S})=>{const L=new yr(i,t,o,a,d),F=(0,St.EI)({1:L});return(0,p.jsx)(Jr.Provider,{value:F,children:S})};function Io(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let d=a,S="";for(;d;){const F=i.get(d);if(F===void 0)throw new Error(`No path for ${d}`);S=to(F,S),d=t.get(d)}const L=S.match(/:(\w+)/g);if(L){for(let F=0;F<L.length;F++)for(let J=F+1;J<L.length;J++)if(L[J]===L[F])throw new Error(`Parameter ${L[J]} is duplicated in path ${S}`)}}}function Vo(i,t){for(const o of t)if(o.externalRoutes){for(const[a,d]of Object.entries(o.externalRoutes))if(!d.optional&&!i.has(d))throw new Error(`External route '${a}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const ro=(0,St.CT)("app-context"),Ho=({appContext:i,children:t})=>{const o=(0,St.EI)({1:i});return(0,p.jsx)(ro.Provider,{value:o,children:t})};function go(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pn(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class xr{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw go("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw go("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pn("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(o=>o.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pn("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,B._)(this,"target",void 0),(0,B._)(this,"waitForTarget",void 0),(0,B._)(this,"resolveTarget",()=>{}),(0,B._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var oo=r(72164);function so(i,t,o){if(i!==void 0){const d=o.find(S=>S.id===i);if(d)return d}if(t){const d=o.find(S=>S.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const Go=()=>{const i=(0,V.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,V.useState)(i.matches);return(0,V.useEffect)(()=>{const a=d=>{o(d.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function io({children:i}){const t=(0,m.h_)(m.hg),o=(0,oo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?Go():!1,d=so(o,a,t.getInstalledThemes());if(!d)throw new Error("App has no themes");return(0,p.jsx)(d.Provider,{children:i})}const mo=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const o=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const d=JSON.parse(i);Array.isArray(d)?o.push(...d):o.push({data:d,context:"env"})}catch(d){throw new Error(`Failed to load runtime configuration, ${d}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Ko{add(t,o){return this.apis.push([t.id,o]),o}build(){return new kr(new Map(this.apis))}constructor(){(0,B._)(this,"apis",[])}}class kr{static builder(){return new Ko}static from(t){return new kr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new kr(new Map([[t.id,o]]))}with(t,o){return new kr(new Map([...this.apis,[t.id,o]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,B._)(this,"apis",void 0),this.apis=t}}function Wr(i){const t=new Map;return i&&i({bind:(a,d)=>{for(const[S,L]of Object.entries(d)){const F=a[S];if(!F)throw new Error(`Key ${S} is not an existing external route`);if(!L&&!F.optional)throw new Error(`External route ${S} is required but was undefined`);L&&t.set(F,L)}}}),t}function Yo(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Jo(i,t,o){var a;const d=Boolean(i),S=(0,E.default)(i||(()=>Promise.resolve([])));let L;if(d&&S.loading){const{Progress:fe}=t;L=(0,p.jsx)(fe,{})}else if(S.error){const{BootErrorPage:fe}=t;L=(0,p.jsx)(fe,{step:"load-config",error:S.error})}const{ThemeProvider:F=io}=t;if(L)return{node:(0,p.jsx)(Wt,{apis:kr.with(m.hg,o),children:(0,p.jsx)(F,{children:L})})};let J;if(!((a=S.value)===null||a===void 0)&&a.length){const fe=M.fromConfigs(S.value),Fe=fe.getOptionalString("app.baseUrl"),Ee=fe.getOptionalString("backend.baseUrl");let $e=S.value;const Ve={data:{},context:"relative-resolver"};if(Fe&&Ee){const Ye=new URL(Fe).origin,Bt=new URL(Ee).origin;if(Ye===Bt){const Mt=Yo(Ee);Ee!==Mt&&(Ve.data.backend={baseUrl:Mt})}}if(Fe){const Ye=Yo(Fe);Fe!==Ye&&(Ve.data.app={baseUrl:Ye})}Object.keys(Ve.data).length&&($e=$e.concat([Ve])),J=M.fromConfigs($e)}else J=M.fromConfigs([]);return{api:J}}class vo{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,B._)(this,"app",void 0),this.app=t}}var yo=new WeakMap;class js{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const o=this.getProvider();return()=>(0,p.jsx)(o,{children:t})}getProvider(){if((0,b._)(this,yo))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,C._)(this,yo,!0);const t=new vo(this);let o=!1;return({children:d})=>{const S=(0,V.useRef)(!0),L=(0,V.useMemo)(()=>Ue.createWithStorage(this.themes),[]),{routing:F,featureFlags:J,routeBindings:fe}=(0,V.useMemo)(()=>{const Ve=Y({root:d,discoverers:[je,De],collectors:{routing:er()?ar:un,collectedPlugins:Qe,featureFlags:lr}});return Ve.collectedPlugins.forEach(Ye=>this.plugins.add(Ye)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ve,routeBindings:Wr(this.bindRoutes)}},[d]);o||(o=!0,Io(F.paths,F.parents),Vo(fe,this.plugins));const Fe=Jo(this.configLoader,this.components,L),Ee="api"in Fe;if(Ee){const{api:Ve}=Fe;this.configApi=Ve}if("node"in Fe)return Fe.node;if(Ee&&S.current){S.current=!1;const Ve=this.getApiHolder().get(m.W0);if(Ve){for(const Mt of this.featureFlags)Ve.registerFlag({...Mt,pluginId:""});for(const Mt of this.plugins.values())if("getFeatureFlags"in Mt)for(const Qn of Mt.getFeatureFlags())Ve.registerFlag({name:Qn.name,pluginId:Mt.getId()});else for(const Qn of Mt.output())Qn.type==="feature-flag"&&Ve.registerFlag({name:Qn.name,pluginId:Mt.getId()});const Ye=Ve.getRegisteredFlags(),Bt=new Set(Ye.map(Mt=>Mt.name));for(const Mt of J)Bt.has(Mt)||Ve.registerFlag({name:Mt,pluginId:""})}}const{ThemeProvider:$e=io}=this.components;return(0,p.jsx)(Wt,{apis:this.getApiHolder(),children:(0,p.jsx)(Ho,{appContext:t,children:(0,p.jsx)($e,{children:(0,p.jsx)(no,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:fe,basePath:zr(Fe.api),children:(0,p.jsx)(mr.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return Lr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const o of t.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return kt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>Ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new xt});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const o of t.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return kt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new kt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const o=new Set;for(const a of t){const d=a.getId();if(o.has(d))throw new Error(`Duplicate plugin found '${d}'`);o.add(d)}}constructor(t){(0,B._)(this,"apiHolder",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"apis",void 0),(0,B._)(this,"icons",void 0),(0,B._)(this,"plugins",void 0),(0,B._)(this,"featureFlags",void 0),(0,B._)(this,"components",void 0),(0,B._)(this,"themes",void 0),(0,B._)(this,"configLoader",void 0),(0,B._)(this,"defaultApis",void 0),(0,B._)(this,"bindRoutes",void 0),(0,B._)(this,"appIdentityProxy",new xr),(0,B._)(this,"apiFactoryRegistry",void 0),(0,c._)(this,yo,{writable:!0,value:!1});var o;this.apis=(o=t.apis)!==null&&o!==void 0?o:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var d;this.featureFlags=(d=t.featureFlags)!==null&&d!==void 0?d:[],this.components=t.components,this.themes=t.themes;var S;this.configLoader=(S=t.configLoader)!==null&&S!==void 0?S:mo;var L;this.defaultApis=(L=t.defaultApis)!==null&&L!==void 0?L:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new qt}}function Qo(i){return new js(i)}let Xo=!1;const Es=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,V.useMemo)(()=>er(),[]),S=[...(0,m.vJ)(i.children,L=>L.getElements().flatMap(F=>{var J;let fe=F.props.path;if(fe==="")return[];var Fe;fe=(Fe=(J=fe)===null||J===void 0?void 0:J.replace(/\/\*$/,""))!==null&&Fe!==void 0?Fe:"/";let Ee=a?F:F.props.element;return!a&&!Ee&&(Ee=F,Xo||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Xo=!0)),[{path:fe,element:Ee,children:F.props.children?[{path:fe==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,J)=>J.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(o,{})}];return(0,H.V$)(S)},Po=(0,m.T0)({id:"plugin.permission.api"});var cr;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(cr||(cr={}));function xo(i,t){return i.name===t.name}function Qr(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function ao(i){return i.attributes.action==="create"}function lo(i){return i.attributes.action==="read"}function As(i){return i.attributes.action==="update"}function dr(i){return i.attributes.action==="delete"}function Lo(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Br({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var Ts=r(96279),qo=r.n(Ts),_o=r(9571);const bo=nt.z.lazy(()=>nt.z.object({rule:nt.z.string(),resourceType:nt.z.string(),params:nt.z.record(nt.z.any()).optional()}).or(nt.z.object({anyOf:nt.z.array(bo).nonempty()})).or(nt.z.object({allOf:nt.z.array(bo).nonempty()})).or(nt.z.object({not:bo}))),es=nt.z.object({result:nt.z.literal(cr.ALLOW).or(nt.z.literal(cr.DENY))}),ts=nt.z.union([nt.z.object({result:nt.z.literal(cr.ALLOW).or(nt.z.literal(cr.DENY))}),nt.z.object({result:nt.z.literal(cr.CONDITIONAL),pluginId:nt.z.string(),resourceType:nt.z.string(),conditions:bo})]),ns=(i,t)=>nt.z.object({items:nt.z.array(nt.z.intersection(nt.z.object({id:nt.z.string()}),i)).refine(o=>o.length===t.size&&o.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Oo{async authorize(t,o){return this.makeRequest(t,es,o)}async authorizeConditional(t,o){return this.makeRequest(t,ts,o)}async makeRequest(t,o,a){var d;if(!this.enabled)return t.map(Ee=>({result:cr.ALLOW}));const S={items:t.map(Ee=>({id:_o.Z(),...Ee}))},L=await this.discovery.getBaseUrl("permission"),F=await qo()(`${L}/authorize`,{method:"POST",body:JSON.stringify(S),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!F.ok)throw await _e.VL.fromResponse(F);const J=await F.json(),Fe=ns(o,new Set(S.items.map(({id:Ee})=>Ee))).parse(J).items.reduce((Ee,$e)=>(Ee[$e.id]=$e,Ee),{});return S.items.map(Ee=>Fe[Ee.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,B._)(this,"enabled",void 0),(0,B._)(this,"discovery",void 0),this.discovery=t.discovery;var o;this.enabled=(o=t.config.getOptionalBoolean("permission.enabled"))!==null&&o!==void 0?o:!1}}class Xr{static create(t){const{config:o,discovery:a,identity:d}=t,S=new Oo({discovery:a,config:o});return new Xr(S,d)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,o){(0,B._)(this,"permissionClient",void 0),(0,B._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=o}}var rs=r(69984);function Rs(i){const t=(0,m.h_)(Po),{data:o,error:a}=(0,rs.ZP)(i,async d=>{if(Qr(d.permission)&&!d.resourceRef)return cr.DENY;const{result:S}=await t.authorize(d);return S});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===cr.ALLOW}}const Is=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,S=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),L=useApp(),{NotFoundErrorPage:F}=L.getComponents();let J=a===void 0?_jsx(F,{}):a;return S.loading?J=null:S.allowed&&(J=i.element),_jsx(Route,{...d,element:J})};function Ps(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),d=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:S}=d.getComponents();return _jsx(S,{})}const os=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>de.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new ce}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new Se(i,new Oe);return et.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>Zt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:o})=>wt({middleware:[en.resolvePluginProtocol({discoveryApi:o}),en.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new It}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>vn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>ln.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Cn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>En.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>hn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>_n.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Mn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>pe.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>G.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Po,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>Xr.create({config:i,discovery:t,identity:o})})];var Ls=r(77277),v=r(53974),j=r(71597);function k({children:i}){return(0,H.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(H.VA,{children:i})}const O=()=>(0,p.jsx)(v.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),ie=({step:i,error:t})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(k,{children:(0,p.jsx)(v.mf,{status:"501",statusMessage:o})})},ne=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(v.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(Ls.Z,{variant:"outlined",onClick:t,children:"Retry"})})},_={Progress:v.Ex,Router:j.VK,NotFoundErrorPage:O,BootErrorPage:ie,ErrorBoundaryFallback:ne};var he=r(43642),Te=r(80079),Re=r(90941),ze=r(32915),Ne=r(40562),We=r(21853),at=r(60744),Et=r(66569),Be=r(30254),Ke=r(13384),At=r(15933),Jt=r(58838),Tn=r(86737),Pt=r(4989),Lt=r(44407),tn=r(18628),Sn=r(84219),ur=r(98685),$r=r(39781),co=r(39412);const zn={brokenImage:Te.Z,catalog:tn.Z,scaffolder:ze.Z,techdocs:Ne.Z,search:We.Z,chat:at.Z,dashboard:Et.Z,docs:Be.Z,email:Ke.Z,github:Jt.Z,group:Sn.Z,help:Tn.Z,"kind:api":At.Z,"kind:component":Lt.Z,"kind:domain":he.Z,"kind:group":Sn.Z,"kind:location":Pt.Z,"kind:system":Re.Z,"kind:user":ur.Z,"kind:resource":co.Z,user:ur.Z,warning:$r.Z};var Wn=r(73689),Dr=r(93606);const Sr={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},Cr={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function wr(i){var t;const{colors:o,shape:a,options:d}=i,L=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,F=`${a}, ${L}`;var J;const fe=(J=(t=d)===null||t===void 0?void 0:t.fontColor)!==null&&J!==void 0?J:"#FFFFFF";return{colors:o,shape:a,backgroundImage:F,fontColor:fe}}const wa={home:wr({colors:Cr.teal,shape:Sr.wave}),documentation:wr({colors:Cr.pinkSea,shape:Sr.wave2}),tool:wr({colors:Cr.purpleSky,shape:Sr.round}),service:wr({colors:Cr.marineBlue,shape:Sr.wave}),website:wr({colors:Cr.veryBlue,shape:Sr.wave}),library:wr({colors:Cr.rubyRed,shape:Sr.wave}),other:wr({colors:Cr.darkGrey,shape:Sr.wave}),app:wr({colors:Cr.toastyOrange,shape:Sr.wave}),apis:wr({colors:Cr.teal,shape:Sr.wave2}),card:wr({colors:Cr.greens,shape:Sr.wave})},di=16,ui='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',hi="home";function ss(i){const{palette:t,htmlFontSize:o=di,fontFamily:a=ui,defaultPageTheme:d=hi,pageTheme:S=wa,typography:L}=i;if(!S[d])throw new Error(`${d} is not defined in pageTheme.`);const F={htmlFontSize:o,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}};var J;return{palette:t,typography:L!=null?L:F,page:S[d],getPageTheme:({themeId:fe})=>(J=S[fe])!==null&&J!==void 0?J:S[d]}}var qr=r(47591);const ko={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,qr._j)(i.palette.link,.3),background:(0,qr.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({marginRight:i.spacing(1),marginBottom:i.spacing(1)}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({width:i.spacing(3),height:i.spacing(3),margin:i.spacing(0,.75,0,-.75)}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:i.spacing(0,.5,0,-.5)})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}},MuiLink:{defaultProps:{underline:"hover"}}},Os=i=>(...t)=>{const o=t.length===0?[1]:t,a=(d,S)=>typeof d=="string"?d:S*d;return o.map(d=>{const S=a(d,i);return typeof S=="number"?`${S}px`:S}).join(" ")};function pi(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function ks(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=Os(a)),Object.fromEntries(Object.entries(t).map(([d,S])=>typeof S=="function"?[d,S({theme:o})]:[d,S]))}return t}}const Bs=/^&.Mui-([\w-]+)$/;function fi(i){let t=i;if(!i||typeof i!="object")return t;for(const o of Object.keys(i)){const a=i[o];if(!(!a||typeof a!="object"))for(const d of Object.keys(a)){const S=d,L=S.match(Bs);if(L){const[,F]=L,{[S]:J,...fe}=a;J&&(t={...t,[o]:fe,[F]:J})}}}return t}function gi(i,t={}){const o={},a={};for(const d of Object.keys(t)){const S=t[d];S&&("styleOverrides"in S&&(d==="MuiCssBaseline"?o[d]=pi(i,S.styleOverrides):o[d]=fi(ks(i,S.styleOverrides))),"defaultProps"in S&&(a[d]=S.defaultProps))}return{overrides:o,props:a}}var So=new WeakMap;class is{getTheme(t){return(0,b._)(this,So).get(t)}constructor(t,o){(0,c._)(this,So,{writable:!0,value:new Map}),(0,C._)(this,So,new Map),t&&(0,b._)(this,So).set("v4",t),o&&(0,b._)(this,So).set("v5",o)}}function $s(i){const t=ss(i),o={...ko,...i.components},a=(0,Dr.Z)({...t,components:o}),d=gi(a,o),S={...(0,Wn.Z)(t),...d};return new is(S,a)}function jr(i){const t=adaptV4Theme(i),o=createTheme(i);return new is(o,t)}const as={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},mi={light:$s({palette:as.light}),dark:$s({palette:as.dark})};var ja=r(68542);ja.Z.configure(i=>`v5-${i}`);var Ea=r(87561),Aa=r(12536),Ta=r(19219),Ra=r(41547),Ia=r(3493),Bo=r(81887);const Pa=(0,Aa.Z)({productionPrefix:"jss4-"});function vi(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,d=o.getTheme("v4"),S=o.getTheme("v5");let L;a||(L=(0,p.jsx)(Ea.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[L,t]});return d&&(F=(0,p.jsx)(Ta.ZP,{generateClassName:Pa,children:(0,p.jsx)(Ra.Z,{theme:d,children:F})})),S&&(F=(0,p.jsx)(Ia.Z,{injectFirst:!0,children:(0,p.jsx)(Bo.Z,{theme:S,children:F})})),F}function yi(i){var t,o,a,d;return{props:{MuiGrid:(o=ko)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(d=ko)===null||d===void 0||(a=d.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...ss(i)}}function xi(i){return gi(i,ko).overrides}function $o(i){const t=yi(i),o=(0,Wn.Z)(t),a=xi(o);return{...o,overrides:a}}const La=$o({palette:as.light}),Oa=$o({palette:as.dark});var bi=r(98192),ls=r(15222);const Er=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(ls.Z,{}),Provider:({children:i})=>(0,p.jsx)(vi,{theme:mi.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(bi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vi,{theme:mi.dark,children:i})}];function cs(i){var t,o,a,d,S,L,F,J,fe,Fe,Ee,$e;return Qo({...i,apis:(fe=(t=i)===null||t===void 0?void 0:t.apis)!==null&&fe!==void 0?fe:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{..._,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(d=i)===null||d===void 0?void 0:d.configLoader,defaultApis:os,icons:{...zn,...(S=i)===null||S===void 0?void 0:S.icons},plugins:(Fe=(L=i)===null||L===void 0?void 0:L.plugins)!==null&&Fe!==void 0?Fe:[],featureFlags:(Ee=(F=i)===null||F===void 0?void 0:F.featureFlags)!==null&&Ee!==void 0?Ee:[],themes:($e=(J=i)===null||J===void 0?void 0:J.themes)!==null&&$e!==void 0?$e:Er})}var Do=r(25271),ds=r(76635);async function Si({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,ds.isArray)(a))return;var d;const S=new Set((d=o.snapshot("entityRefs").value)!==null&&d!==void 0?d:[]);a.filter(ds.isString).map(L=>L.split(":")).filter(L=>L.length===4&&L[0]==="entity").map(([L,F,J,fe])=>(0,Do.eE)({kind:F,namespace:J,name:fe})).forEach(L=>S.add(L)),await o.set("entityRefs",Array.from(S)),await t.remove("starredEntities")}class Ci{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,B._)(this,"settingsStore",void 0),(0,B._)(this,"starredEntities",void 0),(0,B._)(this,"subscribers",new Set),(0,B._)(this,"observable",new(Me())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Si(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var d;this.starredEntities=new Set((d=a.value)!==null&&d!==void 0?d:[]),this.notifyChanges()}})}}var ka=r(8799),_r=r(79692),wi=r(12420),Vn=r(39709),Ds=r(19928);function ji(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(S=>{var L;return((L=S.facets.kind)===null||L===void 0?void 0:L.map(F=>F.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function Ba(i,t,o){let a=i;return t&&(a=a.filter(S=>t.some(L=>L.toLocaleLowerCase("en-US")===S.toLocaleLowerCase("en-US")))),o&&!i.some(S=>S.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((S,L)=>(S[L.toLocaleLowerCase("en-US")]=L,S),{})}const Ei=(0,_r.Z)(i=>(0,wi.Z)({root:{...i.typography.h4}}));function $a(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,d=Ei(),{allKinds:S}=useAllKinds(),{filters:L,updateFilters:F,queryParameters:{kind:J}}=useEntityList(),fe=useMemo(()=>[J].flat()[0],[J]);var Fe;const[Ee,$e]=useState((Fe=fe!=null?fe:(t=L.kind)===null||t===void 0?void 0:t.value)!==null&&Fe!==void 0?Fe:o);useEffect(()=>{fe&&$e(fe)},[fe]),useEffect(()=>{var Ye;if(!((Ye=L.kind)===null||Ye===void 0)&&Ye.value){var Bt;$e((Bt=L.kind)===null||Bt===void 0?void 0:Bt.value)}},[L.kind]),useEffect(()=>{F({kind:Ee?new EntityKindFilter(Ee):void 0})},[Ee,F]);const Ve=filterKinds(S,a,Ee);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ee.toLocaleLowerCase("en-US"),onChange:Ye=>$e(Ye.target.value),classes:d,children:Object.keys(Ve).map(Ye=>_jsx(MenuItem,{value:Ye,children:`${pluralize(Ve[Ye])}`},Ye))})}var us=r(86359),hs=r(95544),Ai=r(99688),No=r(12231),Fo=r(86136),Co=r(49378),Ns=r(85256),Fs=r(80030),Zs=r(61837),ps=r(79784),Ti=r(50758),Ri=r(31654),Ii=r(43054),Pi=r(65759),Da=r(49280),Li=r(96641);function Oi(i){const{entity:t,loading:o,error:a}=(0,Li.ce)(),{allowed:d,loading:S,error:L}=Rs({permission:i,resourceRef:t?(0,Do.eE)(t):void 0});return o||S?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:d,error:L}}const fs="catalog-entity",Us=Br({name:"catalog.entity.read",attributes:{action:"read"},resourceType:fs}),Ms=Br({name:"catalog.entity.create",attributes:{action:"create"}}),zs=Br({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:fs}),Ws=Br({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:fs}),ki=Br({name:"catalog.location.read",attributes:{action:"read"}}),Bi=Br({name:"catalog.location.create",attributes:{action:"create"}}),$i=Br({name:"catalog.location.delete",attributes:{action:"delete"}}),Na=[Us,Ms,zs,Ws,ki,Bi,$i];var Vs=r(49166);function Di(i){var t,o,a,d;const{unregisterEntityOptions:S,isUnregisterAllowed:L,onUnregisterEntity:F,onClose:J}=i,fe=typeof((t=S)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Fe;const Ee=(Fe=!L||(fe?!!(!((o=S)===null||o===void 0)&&o.disableUnregister):((a=S)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Fe!==void 0?Fe:!1;let $e=(0,p.jsx)(p.Fragment,{});return((d=S)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&($e=(0,p.jsxs)(No.Z,{onClick:()=>{J(),F()},disabled:Ee,children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Vs.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:$e})}const Hs=(0,_r.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Fa(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:d}=i,[S,L]=(0,V.useState)(),F=Hs(),fe=Oi(zs).allowed,Fe=Bt=>{L(Bt.currentTarget)},Ee=()=>{L(void 0)},$e=(0,m.h_)(m.$v),Ve=(0,V.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>$e.post({message:"Copied!",severity:"info",display:"transient"}))},[$e]),Ye=t&&[...t.map(Bt=>(0,p.jsxs)(No.Z,{onClick:()=>{Ee(),Bt.onClick()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Bt.Icon,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:Bt.title})]},Bt.title)),(0,p.jsx)(Ns.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Fs.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(Zs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!S,role:"button",onClick:Fe,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)(Ii.Z,{})})}),(0,p.jsx)(ps.ZP,{open:Boolean(S),onClose:Ee,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ti.Z,{autoFocusItem:Boolean(S),children:[Ye,(0,p.jsx)(Di,{unregisterEntityOptions:o,isUnregisterAllowed:fe,onUnregisterEntity:a,onClose:Ee}),(0,p.jsxs)(No.Z,{onClick:()=>{Ee(),d()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Ri.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(No.Z,{onClick:()=>{Ee(),Ve()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Pi.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Copy entity URL"})]})]})})]})}const Gs="plugin.catalog.entityLayoutRoute",Ks=()=>null;(0,m.R5)(Ks,Gs,!0),(0,m.R5)(Ks,"core.gatherMountPoints",!0);function Ni(i){const{entity:t,title:o}=i;return(0,p.jsxs)(hs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(hs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,p.jsx)(Vn.LH,{entity:t})]})}function Fi(i,t,o,a){var d,S,L,F,J;const fe=(J=i!=null?i:(d=a)===null||d===void 0?void 0:d.kind)!==null&&J!==void 0?J:"";var Fe;const Ee=(Fe=t!=null?t:(S=a)===null||S===void 0?void 0:S.metadata.namespace)!==null&&Fe!==void 0?Fe:"";var $e,Ve,Ye;return{headerTitle:`${(Ye=(Ve=($e=(L=a)===null||L===void 0?void 0:L.metadata.title)!==null&&$e!==void 0?$e:o)!==null&&Ve!==void 0?Ve:(F=a)===null||F===void 0?void 0:F.metadata.name)!==null&&Ye!==void 0?Ye:""}${Ee&&Ee!==Do.zG?` in ${Ee}`:""}`,headerType:(()=>{let Mt=fe.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Mt+=" \u2014 ",Mt+=a.spec.type.toLocaleLowerCase("en-US")),Mt})()}}function Zi(i){var t;const{entity:o}=i,a=(0,Vn.hF)(o,Do.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(v.i9,{label:"Owner",value:(0,p.jsx)(Vn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(v.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ui=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,children:L,NotFoundComponent:F}=i,{kind:J,namespace:fe,name:Fe}=(0,m.Oi)(Vn.wi),{entity:Ee,loading:$e,error:Ve}=(0,Vn.ce)(),Ye=(0,H.TH)(),Bt=(0,m.vJ)(L,Nr=>Nr.selectByComponentData({key:Gs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Bn})=>{if(Ee){if(Bn.if&&!Bn.if(Ee))return[]}else return[];return[{path:Bn.path,title:Bn.title,children:Bn.children,tabProps:Bn.tabProps}]}),[Ee]),{headerTitle:Mt,headerType:Qn}=Fi(J,fe,Fe,Ee),[Hr,Ar]=(0,V.useState)(!1),[Tr,br]=(0,V.useState)(!1),Fn=(0,H.s0)(),Rr=async()=>{Ar(!1),br(!1),Fn("/")};(0,V.useEffect)(()=>{Ar(!1),br(!1)},[Ye.pathname]);var Gr;return(0,p.jsxs)(v.T3,{themeId:(Gr=(a=Ee)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Gr!==void 0?Gr:"home",children:[(0,p.jsx)(v.h4,{title:(0,p.jsx)(Ni,{title:Mt,entity:Ee}),pageTitleOverride:Mt,type:Qn,children:Ee&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Zi,{entity:Ee}),(0,p.jsx)(Fa,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,onUnregisterEntity:()=>Ar(!0),onInspectEntity:()=>br(!0)})]})}),$e&&(0,p.jsx)(v.Ex,{}),Ee&&(0,p.jsx)(v.tn,{routes:Bt}),Ve&&(0,p.jsx)(v.VY,{children:(0,p.jsx)(Ai.Z,{severity:"error",children:Ve.toString()})}),!$e&&!Ve&&!Ee&&(0,p.jsx)(v.VY,{children:F||(0,p.jsxs)(v.GB,{title:"Entity not found",children:["There is no ",J," with the requested"," ",(0,p.jsx)(v.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Vn.pp,{open:Hr,entity:Ee,onConfirm:Rr,onClose:()=>Ar(!1)}),(0,p.jsx)(Vn.U_,{open:Tr,entity:Ee,onClose:()=>br(!1)})]})};Ui.Route=Ks;function Za(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[S,L]=useState(!1),F=useApi(catalogApiRef),J=useApi(alertApiRef),fe=async()=>{L(!0);try{const Fe=d.metadata.uid;await F.removeEntityByUid(Fe),a()}catch(Fe){assertError(Fe),J.post({message:Fe.message})}finally{L(!1)}};return _jsxs(Dialog,{open:t,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:S,onClick:fe,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var wo=r(19625);function Ua(i){var t,o,a;return((a=i)===null||a===void 0||(o=a.metadata)===null||o===void 0||(t=o.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function Ma(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:d}=useEntity(),S=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:d,onConfirm:S,onClose:()=>a(!1)})]})}async function Ys(i,t){var o,a;const d=(o=i.relations)===null||o===void 0?void 0:o.map(L=>L.targetRef);if(!d||((a=d)===null||a===void 0?void 0:a.length)<1||d.length>1e3)return[];const S=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((L,F)=>S.items[F]===void 0)}async function za(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ys(i,o)).length>0}function Js(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:d}=useAsync(async()=>Ys(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!d||d.length===0?null:_jsx(_Fragment,{children:_jsxs(Alert,{severity:"warning",children:["This entity has relations to other entities, which can't be found in the catalog. ",_jsx("br",{}),"Entities not found are: ",d.join(", ")]})})}var Mi=r(4791);const Zo=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function gs(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(d=>{var S,L;return{errors:((L=(S=d.entity.status)===null||S===void 0?void 0:S.items)!==null&&L!==void 0?L:[]).filter(Zo).map(fe=>fe.error).filter(fe=>Boolean(fe)),entity:d.entity}}).filter(d=>d.errors.length>0)}}async function zi(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await gs(stringifyEntityRef(i),o)).items.length>0}function Vr(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:d,value:S}=useAsync(async()=>gs(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!S?null:_jsx(_Fragment,{children:S.items.map((L,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(L.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:L.entity})]}),L.errors.map((J,fe)=>_jsx(ResponseErrorPanel,{error:J},fe))]},F))})}const Qs="core.backstage.entitySwitch",ms=i=>null;(0,m.R5)(ms,Qs,!0);const Wi=i=>{var t;const{entity:o,loading:a}=(0,Vn.ce)(),d=(0,m.I_)(),S=(0,m.vJ)(i.children,J=>J.selectByComponentData({key:Qs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(fe=>{var Fe;if(a&&!o)return[];const{if:Ee,children:$e}=fe.props;return o?[{if:(Fe=Ee)===null||Fe===void 0?void 0:Fe(o,{apis:d}),children:$e}]:[{if:Ee===void 0,children:$e}]}),[d,o,a]);if(S.some(J=>typeof J.if=="object"&&"then"in J.if))return(0,p.jsx)(Wa,{results:S,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const J=S.filter(fe=>fe.if).map(fe=>fe.children);return J.length===0?nr(S):(0,p.jsx)(p.Fragment,{children:J})}var F;return(F=(t=S.find(J=>J.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:nr(S)};function Wa({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,E.default)(async()=>{const d=i.map(async({if:L,children:F})=>{try{if(await L)return F}catch{}return null});if(t==="all"){const L=(await Promise.all(d)).filter(Boolean);return L.length===0?nr(i):(0,p.jsx)(p.Fragment,{children:L})}var S;return(S=(await Promise.all(d)).find(Boolean))!==null&&S!==void 0?S:nr(i)},[i]);return o||!a?null:a}function nr(i){var t,o;return(o=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&o!==void 0?o:null}Wi.Case=ms;const Vi=null,Va=Vn._i.Filters,Ha=Vn._i.Content;var Ga=r(85877),Hi=r(15096);const Nn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Vn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new Mi.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Vn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ci({storageApi:i})})],routes:{catalogIndex:wo._Z,catalogEntity:Vn.wi},externalRoutes:{createComponent:wo.yw,viewTechDoc:wo.jU,createFromTemplate:wo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Gi=Nn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:wo._Z})),Xs=Nn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Vn.wi})),Ki=Nn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,8799)).then(i=>i.AboutCard)}})),Yi=Nn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),_s=Nn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Ka=Nn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),Ya=Nn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),Ji=Nn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),Qi=Nn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),Xi=Nn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),Ja=Nn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),vs=Nn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),Qa=Nn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),Xa=Nn.provide((0,Hi.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var ys=r(32838);class ei{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,o){const d=`${await this.getApiOrigin()}/${o}`,S=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(S.status===404)throw new Error("Page not found");return S.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const d=await this.getApiOrigin();return new URL(t,`${d}/${a}`).toString()}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}class qi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}const _i=[(0,m.ni)({api:U.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new ei({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:U.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new qi({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:ys.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>ys.ae.fromConfig(i)})],ea={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ti={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function ta(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Uo(){const i=await mo(),t=await ta();return[...i,{context:"detected",data:t?ea:ti}]}var ni=r(58845);const na=(0,_r.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var oa=()=>{const i=na();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const ri=(0,_r.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var rr=()=>{const i=ri();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ia=(0,_r.Z)({root:{width:v.po.drawerWidthClosed,height:3*v.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:v.po.drawerWidthClosed,marginLeft:24}}),aa=()=>{const i=ia(),{isOpen:t}=(0,v.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(v.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(oa,{}):(0,p.jsx)(rr,{})})})},la=({children:i})=>(0,p.jsxs)(v.tR,{children:[(0,p.jsxs)(v.YE,{children:[(0,p.jsx)(aa,{}),(0,p.jsx)(v.v7,{}),(0,p.jsx)(v.R6,{icon:ni.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var oi=r(32388),ca=r(4142);const qa=(0,_r.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var hr;(function(i){i.LIGHT="light",i.DARK="dark"})(hr||(hr={}));const da=()=>{const i=(0,m.h_)(m.hg),t=qa(),[o,a]=(0,V.useState)(i.getActiveThemeId()===hr.DARK?hr.DARK:hr.LIGHT),d={[hr.LIGHT]:{icon:ca.Z,title:"Dark theme"},[hr.DARK]:{icon:oi.Z,title:"Light theme"}},{title:S,icon:L}=d[o],F=()=>{a(J=>{const fe=J===hr.LIGHT?hr.DARK:hr.LIGHT;return i.setActiveThemeId(fe),fe})};return(0,p.jsx)(hs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(Fs.ZP,{title:S,arrow:!0,children:(0,p.jsx)(Zs.Z,{size:"small",onClick:F,children:(0,p.jsx)(L,{className:t.headerIcon})})})})},ua=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(ue.S,{}),(0,p.jsx)(D.F,{withSearch:!1})]}),ha=(0,p.jsx)(ua,{}),jo=cs({apis:_i,configLoader:Uo,plugins:Object.values(n)}),pa=jo.getProvider(),fa=jo.getRouter(),si=w.s4.provide((0,U.KY)({name:"ThemeToggleAddon",component:da,location:U.oZ.Header})),ga=(0,p.jsxs)(Es,{children:[(0,p.jsx)(H.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(H.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Xs,{})}),(0,p.jsx)(H.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(q.u,{})}),(0,p.jsxs)(H.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[ha,(0,p.jsx)(U.DR,{children:(0,p.jsx)(si,{})})]})]});var _a=()=>(0,p.jsx)(pa,{children:(0,p.jsx)(fa,{children:(0,p.jsx)(la,{children:ga})})});f.render((0,p.jsx)(_a,{}),document.getElementById("root"))},51837:function(Rt,Le,r){"use strict";r.d(Le,{CT:function(){return m},EI:function(){return ye},uW:function(){return f},Vt:function(){return h}});function n(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=n(),V=le=>`__@backstage/${le}__`;function f(le,W){const ue=V(le);let D=p[ue];return D||(D=W(),p[ue]=D,D)}var H=r(2784);function m(le){return f(le,()=>(0,H.createContext)(void 0))}function h(le){return(0,H.useContext)(m(le))}function Z(le){return{set(W){globalThis[`__@backstage/${le}__`]=createContext(createVersionedValueMap(W))},reset(){delete globalThis[`__@backstage/${le}__`]}}}function ye(le){Object.freeze(le);const W={atVersion(ue){return le[ue]}};return Object.defineProperty(W,"$map",{configurable:!0,enumerable:!0,get(){return le}}),W}},96641:function(Rt,Le,r){"use strict";r.d(Le,{X2:function(){return ye},ce:function(){return le},h$:function(){return h}});var n=r(52322),p=r(25271),V=r(60871),f=r(51837),H=r(2784);const m=(0,f.CT)("entity-context"),h=W=>{const{children:ue,entity:D,loading:A,error:re,refresh:se}=W,te={entity:D,loading:A,error:re,refresh:se};return(0,n.jsx)(m.Provider,{value:(0,f.EI)({1:te}),children:(0,n.jsx)(V.fC,{attributes:{...D?{entityRef:(0,p.eE)(D)}:void 0},children:ue})})},Z=W=>_jsx(h,{entity:W.entity,loading:!Boolean(W.entity),error:void 0,refresh:void 0,children:W.children});function ye(){const W=(0,f.Vt)("entity-context");if(!W)throw new Error("Entity context is not available");const ue=W.atVersion(1);if(!ue)throw new Error("EntityContext v1 not available");if(!ue.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:ue.entity}}function le(){const W=(0,f.Vt)("entity-context");if(!W)throw new Error("Entity context is not available");const ue=W.atVersion(1);if(!ue)throw new Error("EntityContext v1 not available");const{entity:D,loading:A,error:re,refresh:se}=ue;return{entity:D,loading:A,error:re,refresh:se}}},39709:function(Rt,Le,r){"use strict";r.d(Le,{h$:function(){return lt.h$},n3:function(){return n.n3},_i:function(){return K},tW:function(){return nt},df:function(){return Ue},UO:function(){return pt},ph:function(){return os},dq:function(){return wt},nl:function(){return Is},dx:function(){return Tt},rI:function(){return en},u3:function(){return tr},xE:function(){return Lr},sL:function(){return b},LH:function(){return je},U_:function(){return lo},pp:function(){return qo},EW:function(){return Oo},Ah:function(){return V},wi:function(){return ke},hF:function(){return U.hF},CV:function(){return U.CV},$3:function(){return cn},p3:function(){return f},ce:function(){return lt.ce},X2:function(){return lt.X2},wp:function(){return st},ZW:function(){return jn},eK:function(){return yt},CR:function(){return hn}});var n=r(4791),p=r(60871);const V=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var H=r(82394);class m{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const k of this.subscribers)k.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var h=r(52322),Z=r(2784),ye=r(41156),le=r(60364),W=r(77277),ue=r(4190),D=r(95544),A=r(90436),re=r(60905),se=r(36444);const te=v=>{var j,k;const O=(0,ye.Z)(Te=>{var Re;return Te.breakpoints.down((k=(Re=v.options)===null||Re===void 0?void 0:Re.drawerBreakpoint)!==null&&k!==void 0?k:"md")}),ie=(0,le.Z)(),[ne,_]=(0,Z.useState)(!1);var he;return O?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{style:{marginTop:ie.spacing(1),marginLeft:ie.spacing(1)},onClick:()=>_(!0),startIcon:(0,h.jsx)(se.Z,{}),children:"Filters"}),(0,h.jsx)(ue.ZP,{open:ne,onClose:()=>_(!1),anchor:(he=(j=v.options)===null||j===void 0?void 0:j.drawerAnchor)!==null&&he!==void 0?he:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(D.Z,{m:2,children:[(0,h.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:ie.spacing(1)},children:"Filters"}),v.children]})})]}):(0,h.jsx)(re.Z,{item:!0,lg:2,children:v.children})},q=v=>(0,h.jsx)(re.Z,{item:!0,xs:12,lg:10,children:v.children}),K=v=>(0,h.jsx)(re.Z,{container:!0,style:{position:"relative"},children:v.children});K.Filters=te,K.Content=q;var R=r(53974),w=r(87612),P=r(25271),U=r(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Ce{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class B{filterEntity(j){var k;return this.values.every(O=>((k=j.metadata.tags)!==null&&k!==void 0?k:[]).includes(O))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Je{filterEntity(j){const k=this.toUpperArray(this.value.split(/\s/)),O=this.toUpperArray([j.metadata.tags]),ie=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const ne of k)if(O.every(_=>_!==ne)&&ie.every(_=>!_.includes(ne)))return!1;return!0}toUpperArray(j){return j.flat().filter(k=>Boolean(k)).map(k=>k.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class St{filterEntity(j){return this.values.some(k=>(0,U.hF)(j,P.S4).some(O=>(0,P.eE)(O)===k))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((k,O)=>{try{return k.push((0,P.eE)((0,P.of)(O,{defaultKind:"Group"}))),k}catch{return k}},[])}}class Nt{filterEntity(j){return this.values.some(k=>{var O;return((O=j.spec)===null||O===void 0?void 0:O.lifecycle)===k})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Wt{filterEntity(j){return this.values.some(k=>j.metadata.namespace===k)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class kt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,k,O){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=k,this.isStarredEntity=O}}class $t{filterEntity(j){var k;const O=(k=j.metadata.annotations)===null||k===void 0?void 0:k["backstage.io/orphan"];return O!==void 0&&this.value.toString()===O}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class qt{filterEntity(j){var k,O,ie;const ne=((ie=j)===null||ie===void 0||(O=ie.status)===null||O===void 0||(k=O.items)===null||k===void 0?void 0:k.length)>0;return ne!==void 0&&this.value===ne}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var lt=r(96641),dt=r(76635),ut=r(19126),ht=r.n(ut),Vt=r(73557),Qt=r(69294),be=r(48760),Me=r(90736);const Ge=(0,Z.createContext)(void 0),pt=v=>{const j=(0,Me.default)(),k=(0,p.h_)(V),[O,ie]=(0,Z.useState)({}),ne=(0,Vt.TH)();var _;const he=(0,Z.useMemo)(()=>(_=ht().parse(ne.search,{ignoreQueryPrefix:!0}).filters)!==null&&_!==void 0?_:{},[ne]),[Te,Re]=(0,Z.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Ne},We]=(0,Qt.default)(async()=>{const Be=(0,dt.compact)(Object.values(O)),Ke=(0,U.Gz)(Be),At=(0,U.wq)(Be),Jt=(0,U.wq)((0,dt.compact)(Object.values(Te.appliedFilters))),Tn=Object.keys(O).reduce((Lt,tn)=>{var Sn;const ur=O[tn];return!((Sn=ur)===null||Sn===void 0)&&Sn.toQueryValue&&(Lt[tn]=ur.toQueryValue()),Lt},{});if((0,dt.isEqual)(Jt,At))Re({appliedFilters:O,backendEntities:Te.backendEntities,entities:Te.backendEntities.filter(Ke)});else{const Lt=await k.getEntities({filter:At});Re({appliedFilters:O,backendEntities:Lt.items,entities:Lt.items.filter(Ke)})}if(j()){var Pt;const Lt=ht().parse(ne.search,{ignoreQueryPrefix:!0}),tn=ht().stringify({...Lt,filters:Tn},{addQueryPrefix:!0,arrayFormat:"repeat"}),Sn=`${window.location.pathname}${tn}`;(Pt=window.history)===null||Pt===void 0||Pt.replaceState(null,document.title,Sn)}},[k,he,O,Te],{loading:!0});(0,be.Z)(We,10,[O]);const at=(0,Z.useCallback)(Be=>{ie(Ke=>{const At=typeof Be=="function"?Be(Ke):Be;return{...Ke,...At}})},[]),Et=(0,Z.useMemo)(()=>({filters:Te.appliedFilters,entities:Te.entities,backendEntities:Te.backendEntities,updateFilters:at,queryParameters:he,loading:ze,error:Ne}),[Te,at,he,ze,Ne]);return(0,h.jsx)(Ge.Provider,{value:Et,children:v.children})};function st(){const v=(0,Z.useContext)(Ge);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var tt=r(64279),ft=r(18149),ot=r.n(ft),Xe=r(829),vt=r.n(Xe);function mt(){var v;const j=(0,p.h_)(V),{filters:{kind:k,type:O},queryParameters:{type:ie},updateFilters:ne}=st(),_=(0,Z.useMemo)(()=>[ie].flat().filter(Boolean),[ie]);var he;const[Te,Re]=(0,Z.useState)(_.length?_:(he=(v=O)===null||v===void 0?void 0:v.getTypes())!==null&&he!==void 0?he:[]);(0,Z.useEffect)(()=>{_.length&&Re(_)},[_]);const[ze,Ne]=(0,Z.useState)([]),We=(0,Z.useMemo)(()=>{var At;return(At=k)===null||At===void 0?void 0:At.value},[k]),{error:at,loading:Et,value:Be}=(0,tt.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(Jt=>Jt.facets["spec.type"]||[]):[],[We,j]),Ke=(0,Z.useRef)(Be);return(0,Z.useEffect)(()=>{const At=Ke.current;if(Ke.current=Be,Et||!We||At===Be||!Be)return;const Jt=[...new Set(vt()(Be,Pt=>-Pt.count).map(Pt=>Pt.value.toLocaleLowerCase("en-US")))];Ne(Jt);const Tn=Te.filter(Pt=>Jt.includes(Pt));ot()(Te,Tn)||Re(Tn)},[Et,We,Te,Re,Be]),(0,Z.useEffect)(()=>{ne({type:Te.length?new Ce(Te):void 0})},[Te,ne]),{loading:Et,error:at,availableTypes:ze,selectedTypes:Te,setSelectedTypes:Re}}function yt(v,j){var k,O,ie,ne;const _=(O=j)===null||O===void 0||(k=O.type)===null||k===void 0?void 0:k.toLocaleLowerCase("en-US"),he=(ne=j)===null||ne===void 0||(ie=ne.kind)===null||ie===void 0?void 0:ie.toLocaleLowerCase("en-US"),Te=(0,p.h_)(V),{loading:Re,value:ze,error:Ne}=(0,tt.default)(async()=>{var We,at;const Et=(We=v.relations)===null||We===void 0?void 0:We.filter(Ke=>(!_||Ke.type.toLocaleLowerCase("en-US")===_)&&(!he||(0,P.of)(Ke.targetRef).kind===he));if(!(!((at=Et)===null||at===void 0)&&at.length))return[];const{items:Be}=await Te.getEntitiesByRefs({entityRefs:Et.map(Ke=>Ke.targetRef)});return Be.filter(Ke=>Boolean(Ke))},[v,_,he]);return{entities:ze,loading:Re,error:Ne}}var Cn=r(72164);function fn(v){return typeof v=="string"?v:(0,P.eE)(v)}function hn(){const v=(0,p.h_)(f),j=(0,Cn.Z)(v.starredEntitie$(),new Set),k=(0,Z.useCallback)(ie=>j.has(fn(ie)),[j]),O=(0,Z.useCallback)(ie=>v.toggleStarred(fn(ie)).then(),[v]);return{starredEntities:j,toggleStarredEntity:O,isStarredEntity:k}}function wn(v){return typeof v=="string"?v:(0,P.eE)(v)}function pn(v){const j=(0,p.h_)(f),[k,O]=(0,Z.useState)(!1);return(0,Z.useEffect)(()=>{const ne=j.starredEntitie$().subscribe({next(_){O(_.has(wn(v)))}});return()=>{ne.unsubscribe()}},[v,j]),{toggleStarredEntity:(0,Z.useCallback)(()=>j.toggleStarred(wn(v)).then(),[v,j]),isStarredEntity:k}}var vn=r(75435);function jn(){const v=(0,p.h_)(p.$4),{loading:j,value:k}=(0,tt.default)(async()=>{const{ownershipEntityRefs:ie}=await v.getBackstageIdentity();return ie},[]),O=(0,Z.useMemo)(()=>{const ie=new Set(k!=null?k:[]);return ne=>{const _=(0,vn.h)(ne,P.S4).map(P.eE);for(const he of _)if(ie.has(he))return!0;return!1}},[k]);return(0,Z.useMemo)(()=>({loading:j,isOwnedEntity:O}),[j,O])}function on(){const v=(0,p.h_)(V),{error:j,loading:k,value:O}=(0,tt.default)(async()=>await v.getEntityFacets({facets:["kind"]}).then(ne=>{var _;return((_=ne.facets.kind)===null||_===void 0?void 0:_.map(he=>he.value).sort())||[]}),[v]);return{loading:k,error:j,allKinds:O!=null?O:[]}}function yn(v,j,k){let O=v;return j&&(O=O.filter(ne=>j.some(_=>_.toLocaleLowerCase("en-US")===ne.toLocaleLowerCase("en-US")))),k&&!v.some(ne=>ne.toLocaleLowerCase("en-US")===k.toLocaleLowerCase("en-US"))&&(O=O.concat([k])),O.sort().reduce((ne,_)=>(ne[_.toLocaleLowerCase("en-US")]=_,ne),{})}function En(v){var j;const{filters:k,queryParameters:{kind:O},updateFilters:ie}=st(),ne=(0,Z.useMemo)(()=>[O].flat()[0],[O]);var _;const[he,Te]=(0,Z.useState)((_=ne!=null?ne:(j=k.kind)===null||j===void 0?void 0:j.value)!==null&&_!==void 0?_:v.initialFilter);(0,Z.useEffect)(()=>{ne&&Te(ne)},[ne]),(0,Z.useEffect)(()=>{var We;if(!((We=k.kind)===null||We===void 0)&&We.value){var at;Te((at=k.kind)===null||at===void 0?void 0:at.value)}},[k.kind]),(0,Z.useEffect)(()=>{ie({kind:he?new xe(he):void 0})},[he,ie]);const{allKinds:Re,loading:ze,error:Ne}=on();return{loading:ze,error:Ne,allKinds:Re!=null?Re:[],selectedKind:he,setSelectedKind:Te}}const nt=v=>{const{allowedKinds:j,hidden:k,initialFilter:O="component"}=v,ie=(0,p.h_)(p.$v),{error:ne,allKinds:_,selectedKind:he,setSelectedKind:Te}=En({initialFilter:O});if((0,Z.useEffect)(()=>{ne&&ie.post({message:"Failed to load entity kinds",severity:"error"})},[ne,ie]),ne)return null;const Re=yn(_,j,he),ze=Object.keys(Re).map(Ne=>({value:Ne,label:Re[Ne]}));return k?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Kind",items:ze,selected:he.toLocaleLowerCase("en-US"),onChange:Ne=>Te(String(Ne))})})};var _t=r(79692),zt=r(38016),qe=r(88013),Rn=r(21324),ln=r(5806),kn=r(19996),xn=r(25505);const Zn=(0,h.jsx)(xn.Z,{fontSize:"small"}),_n=(0,h.jsx)(kn.Z,{fontSize:"small"});function In({selected:v}){return(0,h.jsx)(Rn.Z,{icon:Zn,checkedIcon:_n,checked:v})}const Mn=(0,Z.memo)(v=>{var j;const{selected:k,value:O,availableOptions:ie,showCounts:ne}=v,_=ne?`${O} (${(j=ie)===null||j===void 0?void 0:j[O]})`:O;return(0,h.jsx)(ln.Z,{control:(0,h.jsx)(In,{selected:k}),label:_,onClick:he=>he.preventDefault()})});var we=r(86619),pe=r(72779),Pe=r.n(pe);const G=(0,_t.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(v){const j=G();return(0,h.jsx)(we.Z,{variant:"outlined",...v,className:Pe()(j.input,v.className)})}function ce(v){var j;const{label:k,name:O,path:ie,showCounts:ne,Filter:_,InputProps:he,initialSelectedOptions:Te=[]}=v,{updateFilters:Re,filters:ze,queryParameters:{[O]:Ne}}=st(),We=(0,p.h_)(V),{value:at}=(0,tt.default)(async()=>{var Lt;const tn=ie,{facets:Sn}=await We.getEntityFacets({facets:[tn],filter:(Lt=ze.kind)===null||Lt===void 0?void 0:Lt.getCatalogFilters()});return Object.fromEntries(Sn[tn].map(({value:ur,count:$r})=>[ur,$r]))},[ze.kind]),Et=(0,Z.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var Be;const[Ke,At]=(0,Z.useState)(Et.length?Et:(Be=(j=ze[O])===null||j===void 0?void 0:j.values)!==null&&Be!==void 0?Be:Te);(0,Z.useEffect)(()=>{Et.length&&At(Et)},[Et]);const Jt=Object.keys(at!=null?at:{}),Tn=Ke.length&&Jt.length;(0,Z.useEffect)(()=>{Re({[O]:Tn?new _(Ke):void 0})},[O,Tn,Ke,_,Re]);const Pt=ze[O];return Pt&&typeof Pt=="object"&&!("values"in Pt)||!Jt.length||Jt.length<=1?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:[k,(0,h.jsx)(qe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Jt,value:Ke,onChange:(Lt,tn)=>At(tn),renderOption:(Lt,{selected:tn})=>(0,h.jsx)(Mn,{selected:tn,value:Lt,availableOptions:at,showCounts:!!ne}),size:"small",popupIcon:(0,h.jsx)(zt.Z,{"data-testid":`${String(O)}-picker-expand`}),renderInput:Lt=>(0,h.jsx)(N,{...Lt,...he})})]})})}const Ae=(0,_t.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ue=v=>{const{initialFilter:j=[]}=v,k=Ae();return(0,h.jsx)(ce,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Nt,InputProps:{className:k.input},initialSelectedOptions:j})};var _e=r(6232),Ct=r(98685),Dt=r(62367),an=r(72579),sn=r.n(an);function cn(v,j){var k,O;const ie=(k=j)===null||k===void 0?void 0:k.defaultKind;let ne,_,he;if("metadata"in v?(ne=v.kind,_=v.metadata.namespace,he=v.metadata.name):(ne=v.kind,_=v.namespace,he=v.name),(_===void 0||_==="")&&(_=P.zG),((O=j)===null||O===void 0?void 0:O.defaultNamespace)!==void 0){var Te;((Te=j)===null||Te===void 0?void 0:Te.defaultNamespace)===_&&(_=void 0)}else _===P.zG&&(_=void 0);return ne=ne.toLocaleLowerCase("en-US"),ne=ie&&ie.toLocaleLowerCase("en-US")===ne?void 0:ne,`${ne?`${ne}:`:""}${_?`${_}/`:""}${he}`}function oe(v,j){for(const k of["spec.profile.displayName","metadata.title"]){const O=sn()(v,k);if(O&&typeof O=="string")return O}return j}function ae({enabled:v}){const j=(0,p.h_)(V),[k]=(0,Z.useState)(async()=>{if(!v)return[];const O="relations.ownedBy";return j.getEntityFacets({facets:[O]}).then(ie=>ie.facets[O].map(ne=>ne.value).map(ne=>{const{kind:_,name:he,namespace:Te}=(0,P.of)(ne);return{apiVersion:"backstage.io/v1beta1",kind:_,metadata:{name:he,namespace:Te}}}).sort((ne,_)=>(ne.metadata.namespace||"").localeCompare(_.metadata.namespace||"","en-US")||ne.metadata.name.localeCompare(_.metadata.name,"en-US")||ne.kind.localeCompare(_.kind,"en-US"))).catch(()=>[])});return(0,Qt.default)(async(O,ie)=>{var ne;const _=await k;if(!_)return{items:[]};var he;const Te=(he=(ne=ie)===null||ne===void 0?void 0:ne.limit)!==null&&he!==void 0?he:20,{text:Re,start:ze}=Q(O),Ne=_.filter(at=>M(Re,at)),We=ze+Te;return{items:Ne.slice(0,We),...I({entities:Ne,limit:We,payload:{text:Re,start:We}})}},[k],{loading:!0,value:{items:[]}})}function Q(v){return y(v)&&v.cursor?JSON.parse(atob(v.cursor)):{text:v.text||"",start:0}}function y(v){return!!v.cursor}function I({entities:v,limit:j,payload:k}){return v.length>j?{cursor:btoa(JSON.stringify(k))}:{}}function M(v,j){var k;const O=v.trim();return j.kind.includes(O)||((k=j.metadata.namespace)===null||k===void 0?void 0:k.includes(O))||j.metadata.name.includes(O)}function z(){const v=(0,p.h_)(V);return(0,Qt.default)(async(j,k)=>{var O;const ie=j,ne=j;var _;const he=(_=(O=k)===null||O===void 0?void 0:O.limit)!==null&&_!==void 0?_:20;if(ne.cursor){const Re=await v.queryEntities({cursor:ne.cursor,limit:he});return{cursor:Re.pageInfo.nextCursor,items:[...ne.items,...Re.items]}}const Te=await v.queryEntities({fullTextFilter:{term:ie.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:he});return{cursor:Te.pageInfo.nextCursor,items:Te.items}},[],{loading:!0})}var de=r(21638);function Se({mode:v,initialSelectedOwnersRefs:j}){const k=v==="owners-only",O=z(),ie=ae({enabled:k}),[ne,_]=k?ie:O;return[ne,_,Oe({enabled:!k,initialSelectedOwnersRefs:j})]}function Oe({enabled:v,initialSelectedOwnersRefs:j}){const k=(0,Z.useRef)({}),O=(0,p.h_)(V),[,ie]=(0,Qt.default)(async()=>{(await O.getEntitiesByRefs({entityRefs:j})).items.forEach(_=>{_&&(k.current[(0,P.eE)(_)]=_)})},[]);return(0,de.n)(()=>{v&&j.length>0&&ie()}),{getEntity:ne=>k.current[ne],setEntity:ne=>{k.current[(0,P.eE)(ne)]=ne}}}const et=(0,_t.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),rt=(0,h.jsx)(xn.Z,{fontSize:"small"}),xt=(0,h.jsx)(kn.Z,{fontSize:"small"}),wt=v=>{var j,k,O;const ie=et(),{mode:ne="owners-only"}=v||{},{updateFilters:_,filters:he,queryParameters:{owners:Te}}=st(),[Re,ze]=(0,Z.useState)(""),Ne=(0,Z.useMemo)(()=>[Te].flat().filter(Boolean),[Te]);var We;const[at,Et]=(0,Z.useState)(Ne.length?Ne:(We=(j=he.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:Be,loading:Ke},At,Jt]=Se({mode:ne,initialSelectedOwnersRefs:at});(0,_e.b)(()=>At({text:Re}),[Re,At],250);const Tn=((k=Be)===null||k===void 0?void 0:k.items)||[];return(0,Z.useEffect)(()=>{if(Ne.length){const Pt=new St(Ne);Et(Pt.values)}},[Ne]),(0,Z.useEffect)(()=>{_({owners:at.length?new St(at):void 0})},[at,_]),["user","group"].includes(((O=he.kind)===null||O===void 0?void 0:O.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(qe.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Ke,options:Tn,value:at,getOptionSelected:(Pt,Lt)=>typeof Lt=="string"?(0,P.eE)(Pt)===Lt:Pt===Lt,getOptionLabel:Pt=>{const Lt=typeof Pt=="string"?Jt.getEntity(Pt)||(0,P.of)(Pt,{defaultKind:"group",defaultNamespace:"default"}):Pt;return oe(Lt,cn(Lt))},onChange:(Pt,Lt)=>{ze(""),Et(Lt.map(tn=>{const Sn=typeof tn=="string"?tn:(0,P.eE)(tn);return typeof tn!="string"&&Jt.setEntity(tn),Sn}))},filterOptions:Pt=>Pt,renderOption:(Pt,{selected:Lt})=>{const tn=Pt.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(ln.Z,{control:(0,h.jsx)(Rn.Z,{icon:rt,checkedIcon:xt,checked:Lt}),onClick:Sn=>Sn.preventDefault(),label:(0,h.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[tn?(0,h.jsx)(Dt.Z,{fontSize:"small"}):(0,h.jsx)(Ct.Z,{fontSize:"small"}),"\xA0",oe(Pt,cn(Pt,{defaultKind:Pt.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(zt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Pt=>(0,h.jsx)(we.Z,{...Pt,className:ie.input,onChange:Lt=>{ze(Lt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Pt=>{var Lt;const tn=Pt.currentTarget;Math.abs(tn.scrollHeight-tn.clientHeight-tn.scrollTop)<1&&(!((Lt=Be)===null||Lt===void 0)&&Lt.cursor)&&At({items:Be.items,cursor:Be.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var it=r(51837);const ke=(0,it.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function bt(v){var j,k;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(k=(j=v.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&k!==void 0?k:DEFAULT_NAMESPACE,name:v.metadata.name}}var Xt=r(80030);const Tt=(0,Z.forwardRef)((v,j)=>{var k;const{entityRef:O,defaultKind:ie,title:ne,children:_,...he}=v,Te=(0,p.tg)(ke);let Re,ze,Ne;if(typeof O=="string"){const Ke=(0,P.of)(O);Re=Ke.kind,ze=Ke.namespace,Ne=Ke.name}else"metadata"in O?(Re=O.kind,ze=O.metadata.namespace,Ne=O.metadata.name):(Re=O.kind,ze=O.namespace,Ne=O.name);Re=Re.toLocaleLowerCase("en-US");var We;ze=(We=(k=ze)===null||k===void 0?void 0:k.toLocaleLowerCase("en-US"))!==null&&We!==void 0?We:P.zG;const at={kind:Re,namespace:ze,name:Ne},Et=cn({kind:Re,namespace:ze,name:Ne},{defaultKind:ie}),Be=(0,h.jsxs)(R.rU,{...he,ref:j,to:Te(at),children:[_,!_&&(ne!=null?ne:Et)]});return ne?(0,h.jsx)(Xt.ZP,{title:Et,children:Be}):Be});function Ft(v){const{entityRefs:j,defaultKind:k,getTitle:O,...ie}=v,ne=(0,p.h_)(V),{value:_=new Array,loading:he,error:Te}=(0,tt.default)(async()=>{const Re=j.reduce((Ne,We)=>typeof We=="object"&&"metadata"in We?Ne:[...Ne,(0,P.of)(We)],new Array),ze=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Re.length>0?[...(await ne.getEntities({filter:Re.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...ze]:ze},[j]);return he?(0,h.jsx)(R.Ex,{}):Te?(0,h.jsx)(R.yu,{error:Te}):(0,h.jsx)(h.Fragment,{children:_.map((Re,ze)=>(0,h.jsxs)(Z.Fragment,{children:[ze>0&&", ",(0,h.jsx)(Tt,{...ie,defaultKind:k,entityRef:Re,title:O(Re)})]},ze))})}function en(v){const{entityRefs:j,defaultKind:k,fetchEntities:O,getTitle:ie,...ne}=v;return O?(0,h.jsx)(Ft,{...ne,defaultKind:k,entityRefs:j,getTitle:ie}):(0,h.jsx)(h.Fragment,{children:j.map((_,he)=>(0,h.jsxs)(Z.Fragment,{children:[he>0&&", ",(0,h.jsx)(Tt,{...ne,defaultKind:k,entityRef:_,title:ie?ie(_):void 0})]},he))})}const An=v=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(v.entity)),children:_jsx(InfoIcon,{})})},Kt=v=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${v.email}`,to:`mailto:${v.email}`,children:_jsx(EmailIcon,{})}),jt=v=>{var j;const k=(j=v.entity.spec.profile)===null||j===void 0?void 0:j.email;return k?_jsx(EmailCardAction,{email:k}):null},It=v=>{var j;const k=(j=v.entity.spec.profile)===null||j===void 0?void 0:j.email;return k?_jsx(EmailCardAction,{email:k}):null},Yt=(0,_t.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Zt=4,mr=v=>{var j,k,O;const{entityRef:ie,children:ne,delayTime:_=500}=v,he=Yt(),Te=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Ne]=useState(!1),We=useMemo(()=>debounce(()=>Ne(!0),_),[_]),[{loading:at,error:Et,value:Be},Ke]=useAsyncFn(async()=>{const Jt=Te.get(catalogApiRef);if(Jt){const Tn=await Jt.getEntityByRef(ie);if(!Tn)throw new Error(`${ie} not found`);return Tn}},[Te,ie]),At=()=>{Ne(!1),We.cancel()};return useEffect(()=>{Re.isOpen&&!Be&&!Et&&!at&&Ke()},[Re.isOpen,Ke,Be,Et,at]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:ne})}),ze&&_jsx(HoverPopover,{PaperProps:{className:he.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),at&&_jsx(Progress,{}),Be&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Be.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Be.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Be.kind}),Be.metadata.description&&_jsx(Typography,{className:he.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(j=Be.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,Zt).map(Jt=>_jsx(Chip,{size:"small",label:Jt},Jt)),((k=Be.metadata.tags)===null||k===void 0?void 0:k.length)&&((O=Be.metadata.tags)===null||O===void 0?void 0:O.length)>Zt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},er=(0,_t.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),sr=()=>{var v;const j=er(),{filters:k,updateFilters:O}=useEntityList();var ie;const[ne,_]=useState((ie=(v=k.text)===null||v===void 0?void 0:v.value)!==null&&ie!==void 0?ie:"");return useDebounce(()=>{O({text:ne.length?new EntityTextFilter(ne):void 0})},250,[ne,O]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:he=>_(he.target.value),value:ne,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>_(""),edge:"end",disabled:ne.length===0,children:_jsx(Clear,{})})})})})})},bn=Object.freeze({createEntityRefColumn(v){const{defaultKind:j}=v;function k(O){var ie;return((ie=O.metadata)===null||ie===void 0?void 0:ie.title)||cn(O,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(O,ie){return k(ie).includes(O)},customSort(O,ie){return k(O).localeCompare(k(ie))},render:O=>{var ie;return(0,h.jsx)(Tt,{entityRef:O,defaultKind:j,title:(ie=O.metadata)===null||ie===void 0?void 0:ie.title})}}},createEntityRelationColumn(v){const{title:j,relation:k,defaultKind:O,filter:ie}=v;function ne(he){return(0,U.hF)(he,k,ie)}function _(he){return ne(he).map(Te=>cn(Te,{defaultKind:O})).join(", ")}return{title:j,customFilterAndSearch(he,Te){return _(Te).includes(he)},customSort(he,Te){return _(he).localeCompare(_(Te))},render:he=>(0,h.jsx)(en,{entityRefs:ne(he),defaultKind:O})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:P.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:P.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:P.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,h.jsx)(R.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ir=[bn.createEntityRefColumn({defaultKind:"system"}),bn.createDomainColumn(),bn.createOwnerColumn(),bn.createMetadataDescriptionColumn()],Yn=[bn.createEntityRefColumn({defaultKind:"component"}),bn.createSystemColumn(),bn.createOwnerColumn(),bn.createSpecTypeColumn(),bn.createSpecLifecycleColumn(),bn.createMetadataDescriptionColumn()],zr=(0,_t.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),tr=v=>{const{entities:j,title:k,emptyContent:O,variant:ie="gridItem",columns:ne,tableOptions:_={}}=v,he=zr(),Te={minWidth:"0",width:"100%"};return ie==="gridItem"&&(Te.height="calc(100% - 10px)"),(0,h.jsx)(R.iA,{columns:ne,title:k,style:Te,emptyContent:O&&(0,h.jsx)("div",{className:he.empty,children:O}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,..._},data:j})};tr.columns=bn,tr.systemEntityColumns=ir,tr.componentEntityColumns=Yn;const Yr=(0,_t.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Lr=v=>{const j=Yr();return(0,h.jsx)(ce,{label:"Tags",name:"tags",path:"metadata.tags",Filter:B,showCounts:v.showCounts,InputProps:{className:j.input}})},b=v=>{const{hidden:j,initialFilter:k}=v,O=(0,p.h_)(p.$v),{error:ie,availableTypes:ne,selectedTypes:_,setSelectedTypes:he}=mt();if((0,Z.useEffect)(()=>{ie&&O.post({message:"Failed to load entity types",severity:"error"}),k&&he([k])},[ie,O,k,he]),ne.length===0||ie)return null;const Te=[{value:"all",label:"all"},...ne.map(ze=>({value:ze,label:ze}))];var Re;return j?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Type",items:Te,selected:(Re=Te.length>1?_[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:ze=>he(ze==="all"?[]:[String(ze)])})})};var c=r(15459),C=r(61837),E=r(11640),Y=r(28347);const ge=(0,c.Z)({root:{color:"#f3ba37"}})(E.Z),je=v=>{const{toggleStarredEntity:j,isStarredEntity:k}=pn(v.entity);return(0,h.jsx)(C.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>j(),children:(0,h.jsx)(Xt.ZP,{title:k?"Remove from favorites":"Add to favorites",children:k?(0,h.jsx)(ge,{}):(0,h.jsx)(Y.Z,{})})})};var De=r(8629),Qe=r(79249),Ht=r(38724),rn=r(99152),dn=r(6487),Un=r(49429),Ut=r(55999),un=r(39412);const ar=un.Z;function lr(v,j){if(v)return v.toLocaleLowerCase("en-US");if(j)try{return(0,P.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Jn(v,j){const k=(0,p.qD)(),O=lr(v,j);return O&&k.getSystemIcon(`kind:${O}`)||ar}function vr(v){const{kind:j,entityRef:k,...O}=v,ie=Jn(j,k);return(0,h.jsx)(ie,{...O})}const Ro=(0,_t.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function ws(v){var j,k;const O=(0,p.h_)(V),ie=(0,P.eE)(v),{loading:ne,error:_,value:he}=(0,tt.default)(async()=>{const Te=await O.getEntityAncestors({entityRef:ie}),Re=new Array,ze=new Array;for(const Ne of Te.items){const We=(0,P.eE)(Ne.entity),at=We===Te.rootEntityRef;Re.push({id:We,root:at,...Ne.entity});for(const Et of Ne.parentEntityRefs)ze.push({from:We,to:Et})}return{nodes:Re,edges:ze}},[ie]);return{loading:ne,error:_,nodes:((j=he)===null||j===void 0?void 0:j.nodes)||[],edges:((k=he)===null||k===void 0?void 0:k.edges)||[]}}function to({node:v}){const j=Ro(),k=(0,Vt.s0)(),O=(0,p.tg)(ke),[ie,ne]=(0,Z.useState)(0),[_,he]=(0,Z.useState)(0),Te=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{if(Te.current){let{height:Ke,width:At}=Te.current.getBBox();Ke=Math.round(Ke),At=Math.round(At),(Ke!==_||At!==ie)&&(ne(At),he(Ke))}},[ie,_]);const Re=10,ze=_,Ne=ze+Re,We=Ne+ie+Re*2,at=_+Re*2,Et=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?cn({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),Be=()=>{k(O({kind:v.kind,namespace:v.metadata.namespace||P.zG,name:v.metadata.name}))};return(0,h.jsxs)("g",{onClick:Be,className:j.clickable,children:[(0,h.jsx)("rect",{className:Pe()(j.node,v.root?"secondary":"primary"),width:We,height:at,rx:10}),(0,h.jsx)(vr,{kind:v.kind,y:Re,x:Re,width:ze,height:ze,className:Pe()(j.text,v.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Te,className:Pe()(j.text,v.root?"secondary":"primary"),y:at/2,x:Ne+(ie+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function Wo(v){const{loading:j,error:k,nodes:O,edges:ie}=ws(v.entity);return j?(0,h.jsx)(R.Ex,{}):k?(0,h.jsx)(R.Gk,{error:k}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(Ut.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,h.jsx)(R.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,h.jsx)(D.Z,{mt:4,children:(0,h.jsx)(R.mn,{nodes:O,edges:ie,renderNode:to,direction:R.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Or=r(11776),yr=r(38402),Jr=r(86136),no=r(99688),Io=r(49378),Vo=r(54506),ro=r(94339),Ho=r(24579),go=r(27685);const Pn=(0,_t.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function xr(v){const j=Pn();return(0,h.jsx)(Io.Z,{...v,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function oo(v){const j=Pn();return(0,h.jsx)(Vo.Z,{className:j.monospace,children:v.children})}function so(v){return(0,h.jsx)(D.Z,{mt:2,children:(0,h.jsx)(ro.Z,{variant:"outlined",children:(0,h.jsxs)(Ho.Z,{children:[(0,h.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,h.jsx)(mo,{to:v.helpLink})]}),v.children]})})})}function Go(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function io(v){const[j,k]=v.entry,O=Go(k);return(0,h.jsxs)(yr.Z,{children:[v.indent&&(0,h.jsx)(Jr.Z,{}),(0,h.jsx)(xr,{primary:j,secondary:O?(0,h.jsx)(R.rU,{to:O,children:k}):k})]})}function mo(v){const j=Pn();return(0,h.jsx)(R.rU,{to:v.to,className:j.helpIcon,children:(0,h.jsx)(go.Z,{fontSize:"inherit"})})}const Ko=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function kr(v){var j,k,O;const ie=(0,p.h_)(V),ne=(0,P.eE)(v),_=(j=v.metadata.annotations)===null||j===void 0?void 0:j[P.P1],he=(k=v.metadata.annotations)===null||k===void 0?void 0:k[P.q1],{loading:Te,error:Re,value:ze}=(0,tt.default)(async()=>!_&&!he?[]:(await ie.getEntities({filter:[..._?[{[`metadata.annotations.${P.P1}`]:_}]:[],...he?[{[`metadata.annotations.${P.q1}`]:he}]:[]]})).items,[_,he]);return{loading:Te,error:Re,location:_,originLocation:he,colocatedEntities:(O=ze)===null||O===void 0?void 0:O.filter(Ne=>(0,P.eE)(Ne)!==ne)}}function Wr(v){return(0,h.jsxs)(Or.Z,{dense:!0,children:[v.header&&(0,h.jsx)(io,{entry:v.header},"header"),v.entities.map(j=>(0,h.jsxs)(yr.Z,{children:[(0,h.jsx)(Jr.Z,{children:(0,h.jsx)(vr,{kind:j.kind})}),(0,h.jsx)(xr,{primary:(0,h.jsx)(Tt,{entityRef:j})})]},(0,P.eE)(j)))]})}function Yo(v){var j;const{entity:k}=v,{loading:O,error:ie,location:ne,originLocation:_,colocatedEntities:he}=kr(k);if(O)return(0,h.jsx)(R.Ex,{});if(ie)return(0,h.jsx)(R.Gk,{error:ie});if(!ne&&!_)return(0,h.jsx)(no.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=he)===null||j===void 0)&&j.length))return(0,h.jsx)(no.Z,{severity:"info",children:"There were no other entities on this location."});if(ne===_)return(0,h.jsx)(Wr,{entities:he});const Te=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[P.P1])===ne}),Re=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[P.q1])===_});return(0,h.jsxs)(h.Fragment,{children:[Te.length>0&&(0,h.jsx)(Wr,{entities:Te,header:["At the same location",ne]}),Re.length>0&&(0,h.jsx)(Wr,{entities:Re,header:["At the same origin",_]})]})}function Jo(v){const j=Ko();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(Ut.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,h.jsx)("div",{className:j.root,children:(0,h.jsx)(Yo,{entity:v.entity})})]})}function vo(v){return Object.fromEntries([...Object.entries(v)].sort((j,k)=>j[0]<k[0]?-1:1))}function yo(v){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(Ut.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(Ut.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:JSON.stringify(vo(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var js=r(3440),Qo=r.n(js);const Xo=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function Es(v){var j,k,O;const ie=Xo(),{apiVersion:ne,kind:_,metadata:he,spec:Te,relations:Re=[],status:ze={}}=v.entity,Ne=Qo()(vt()(Re,We=>We.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ie.root,children:[(0,h.jsx)(so,{title:"Identity",children:(0,h.jsxs)(Or.Z,{dense:!0,children:[(0,h.jsx)(yr.Z,{children:(0,h.jsx)(xr,{primary:"apiVersion",secondary:ne})}),(0,h.jsx)(yr.Z,{children:(0,h.jsx)(xr,{primary:"kind",secondary:_})}),((j=Te)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(yr.Z,{children:(0,h.jsx)(xr,{primary:"spec.type",secondary:Te.type})}),he.uid&&(0,h.jsx)(yr.Z,{children:(0,h.jsx)(xr,{primary:"uid",secondary:he.uid})}),he.etag&&(0,h.jsx)(yr.Z,{children:(0,h.jsx)(xr,{primary:"etag",secondary:he.etag})})]})}),(0,h.jsxs)(so,{title:"Metadata",children:[!!Object.keys(he.annotations||{}).length&&(0,h.jsx)(Or.Z,{dense:!0,subheader:(0,h.jsxs)(oo,{children:["Annotations",(0,h.jsx)(mo,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(he.annotations).map(We=>(0,h.jsx)(io,{indent:!0,entry:We},We[0]))}),!!Object.keys(he.labels||{}).length&&(0,h.jsx)(Or.Z,{dense:!0,subheader:(0,h.jsx)(oo,{children:"Labels"}),children:Object.entries(he.labels).map(We=>(0,h.jsx)(io,{indent:!0,entry:We},We[0]))}),!!(!((k=he.tags)===null||k===void 0)&&k.length)&&(0,h.jsx)(Or.Z,{dense:!0,subheader:(0,h.jsx)(oo,{children:"Tags"}),children:he.tags.map((We,at)=>(0,h.jsxs)(yr.Z,{children:[(0,h.jsx)(Jr.Z,{}),(0,h.jsx)(xr,{primary:We})]},`${We}-${at}`))})]}),!!Re.length&&(0,h.jsx)(so,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([We,at],Et)=>(0,h.jsx)("div",{children:(0,h.jsx)(Or.Z,{dense:!0,subheader:(0,h.jsx)(oo,{children:We}),children:at.map(Be=>(0,h.jsxs)(yr.Z,{children:[(0,h.jsx)(Jr.Z,{children:(0,h.jsx)(vr,{entityRef:Be.targetRef})}),(0,h.jsx)(xr,{primary:(0,h.jsx)(Tt,{entityRef:Be.targetRef})})]},Be.targetRef))})},Et))}),!!(!((O=ze.items)===null||O===void 0)&&O.length)&&(0,h.jsx)(so,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ze.items.map((We,at)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(A.Z,{children:[We.level,": ",We.type]}),(0,h.jsx)(D.Z,{ml:2,children:We.message})]},at))})]})]})}var Po=r(10921);function cr(v){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(Ut.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(Ut.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:Po.ZP.stringify(vo(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const xo=(0,_t.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Qr(v){const{children:j,value:k,index:O,...ie}=v,ne=xo();return(0,h.jsx)("div",{role:"tabpanel",hidden:k!==O,id:`vertical-tabpanel-${O}`,"aria-labelledby":`vertical-tab-${O}`,className:ne.tabContents,...ie,children:k===O&&(0,h.jsx)(D.Z,{pl:3,pr:3,children:j})})}function ao(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function lo(v){const j=xo(),[k,O]=Z.useState(0);return(0,Z.useEffect)(()=>{O(0)},[v.open]),v.entity?(0,h.jsxs)(De.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,h.jsx)(Qe.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(Ht.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(rn.Z,{orientation:"vertical",variant:"scrollable",value:k,onChange:(ie,ne)=>O(ne),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(dn.Z,{label:"Overview",...ao(0)}),(0,h.jsx)(dn.Z,{label:"Ancestry",...ao(1)}),(0,h.jsx)(dn.Z,{label:"Colocated",...ao(2)}),(0,h.jsx)(dn.Z,{label:"Raw JSON",...ao(3)}),(0,h.jsx)(dn.Z,{label:"Raw YAML",...ao(4)})]}),(0,h.jsx)(Qr,{value:k,index:0,children:(0,h.jsx)(Es,{entity:v.entity})}),(0,h.jsx)(Qr,{value:k,index:1,children:(0,h.jsx)(Wo,{entity:v.entity})}),(0,h.jsx)(Qr,{value:k,index:2,children:(0,h.jsx)(Jo,{entity:v.entity})}),(0,h.jsx)(Qr,{value:k,index:3,children:(0,h.jsx)(yo,{entity:v.entity})}),(0,h.jsx)(Qr,{value:k,index:4,children:(0,h.jsx)(cr,{entity:v.entity})})]})}),(0,h.jsx)(Un.Z,{children:(0,h.jsx)(W.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var As=r(85256);function dr(v){var j;const k=(0,p.h_)(V),O=(j=v.metadata.annotations)===null||j===void 0?void 0:j[P.q1],ie=v.metadata.uid,ne=O==="bootstrap:bootstrap",_=(0,tt.default)(async()=>{const Et=k.getLocationByRef(O);let Be;if(!O)Be=Promise.resolve([]);else{const Ke=`metadata.annotations.${P.q1}`;Be=k.getEntities({filter:{[Ke]:O},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Et,Be]).then(([Ke,At])=>({location:Ke,colocatedEntities:At}))},[k,v]),he=(0,Z.useCallback)(async function(){const{location:Be}=_.value;await k.removeLocationById(Be.id)},[k,_]),Te=(0,Z.useCallback)(async function(){await k.removeEntityByUid(ie)},[k,ie]);if(ne)return{type:"bootstrap",location:O,deleteEntity:Te};const{loading:Re,error:ze,value:Ne}=_;if(Re)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:at}=Ne;return We?{type:"unregister",location:O,colocatedEntities:at.map(P.iB),unregisterLocation:he,deleteEntity:Te}:{type:"only-delete",deleteEntity:Te}}var Lo=r(23054);const Br=(0,_t.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Ts=({entity:v,onConfirm:j,onClose:k})=>{const O=(0,p.h_)(p.$v),ie=(0,p.h_)(p.Ds),ne=Br(),_=dr(v),[he,Te]=(0,Z.useState)(!1),[Re,ze]=(0,Z.useState)(!1);var Ne;const We=(Ne=ie.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",at=(0,Z.useCallback)(async function(){if("unregisterLocation"in _){ze(!0);try{await _.unregisterLocation(),j()}catch(At){(0,Lo.BD)(At),O.post({message:At.message})}finally{ze(!1)}}},[O,j,_]),Et=(0,Z.useCallback)(async function(){if("deleteEntity"in _){ze(!0);try{await _.deleteEntity();var At;const Jt=(At=v.metadata.title)!==null&&At!==void 0?At:v.metadata.name;j(),O.post({message:`Removed entity ${Jt}`,severity:"success",display:"transient"})}catch(Jt){(0,Lo.BD)(Jt),O.post({message:Jt.message})}finally{ze(!1)}}},[O,j,_,v]),Be=()=>(0,h.jsx)(Un.Z,{className:ne.dialogActions,children:(0,h.jsx)(W.Z,{onClick:k,color:"primary",children:"Cancel"})});return _.type==="loading"?(0,h.jsx)(R.Ex,{}):_.type==="error"?(0,h.jsx)(R.Gk,{error:_.error}):_.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(no.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',_.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[!he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"}),(0,h.jsx)(Be,{})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,h.jsx)(W.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]})]})]}):_.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,h.jsx)(W.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]}):_.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ut.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(Ut.Z,{component:"ul",children:_.colocatedEntities.map(Ke=>(0,h.jsx)("li",{children:(0,h.jsx)(Tt,{entityRef:Ke})},`${Ke.kind}:${Ke.namespace}/${Ke.name}`))}),(0,h.jsx)(Ut.Z,{children:"Located at the following location:"}),(0,h.jsx)(Ut.Z,{component:"ul",children:(0,h.jsx)("li",{children:_.location})}),(0,h.jsxs)(Ut.Z,{children:["To undo, just re-register the entity in ",We,"."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[(0,h.jsx)(W.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:at,children:"Unregister Location"}),!he&&(0,h.jsx)(D.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(W.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"})})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(As.Z,{})}),(0,h.jsx)(Ut.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,h.jsx)(W.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"})]})]}):(0,h.jsx)(no.Z,{severity:"error",children:"Internal error: Unknown state"})},qo=v=>{const{open:j,onConfirm:k,onClose:O,entity:ie}=v;return(0,h.jsxs)(De.Z,{open:j,onClose:O,children:[(0,h.jsx)(Qe.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(Ht.Z,{children:(0,h.jsx)(Ts,{entity:ie,onConfirm:k,onClose:O})})]})};var _o=r(12231),bo=r(9520),es=r(47603);const ts=(0,_t.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ns(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:es.Z},{id:"starred",label:"Starred",icon:E.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Oo=v=>{const{initialFilter:j,availableFilters:k}=v,O=ts(),ie=(0,p.h_)(p.Ds);var ne;const _=(ne=ie.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Company",{filters:he,updateFilters:Te,backendEntities:Re,queryParameters:{kind:ze,user:Ne},loading:We}=st(),at=["starred","all"],Et=ns(_).map(zn=>({...zn,items:zn.items.filter(({id:Wn})=>["group","user"].some(Dr=>Dr===ze)?at.includes(Wn):!k||k.includes(Wn))})).filter(({items:zn})=>!!zn.length),{isStarredEntity:Be}=hn(),{isOwnedEntity:Ke,loading:At}=jn(),Jt=We||At,Tn=(0,Z.useMemo)(()=>new kt("owned",Ke,Be),[Ke,Be]),Pt=(0,Z.useMemo)(()=>new kt("starred",Ke,Be),[Ke,Be]),Lt=(0,Z.useMemo)(()=>[Ne].flat()[0],[Ne]),[tn,Sn]=(0,Z.useState)(Lt!=null?Lt:j),ur=(0,Z.useMemo)(()=>Re.filter((0,U.Gz)((0,dt.compact)(Object.values({...he,user:void 0})))),[he,Re]),$r=(0,Z.useMemo)(()=>({all:ur.length,starred:ur.filter(zn=>Pt.filterEntity(zn)).length,owned:ur.filter(zn=>Tn.filterEntity(zn)).length}),[ur,Pt,Tn]);(0,Z.useEffect)(()=>{Lt&&Sn(Lt)},[Lt]),(0,Z.useEffect)(()=>{!Jt&&tn&&tn!=="all"&&$r[tn]===0&&Sn("all")},[Jt,$r,tn,Sn]),(0,Z.useEffect)(()=>{Te({user:tn?new kt(tn,Ke,Be):void 0})},[tn,Ke,Be,Te]);var co;return(0,h.jsx)(ro.Z,{className:O.root,children:Et.map(zn=>(0,h.jsxs)(Z.Fragment,{children:[(0,h.jsx)(A.Z,{variant:"subtitle2",component:"span",className:O.title,children:zn.name}),(0,h.jsx)(ro.Z,{className:O.groupWrapper,children:(0,h.jsx)(Or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":zn.name,children:zn.items.map(Wn=>{var Dr;return(0,h.jsxs)(_o.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Sn(Wn.id),selected:Wn.id===((Dr=he.user)===null||Dr===void 0?void 0:Dr.value),className:O.menuItem,disabled:$r[Wn.id]===0,"data-testid":`user-picker-${Wn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Wn.icon&&(0,h.jsx)(Jr.Z,{className:O.listIcon,children:(0,h.jsx)(Wn.icon,{fontSize:"small"})}),(0,h.jsx)(Io.Z,{children:(0,h.jsxs)(A.Z,{variant:"body1",children:[Wn.label," "]})}),(0,h.jsx)(bo.Z,{children:(co=$r[Wn.id])!==null&&co!==void 0?co:"-"})]},Wn.id)})})})]},zn.name))})},Xr=(0,_t.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),rs=(0,h.jsx)(xn.Z,{fontSize:"small"}),Rs=(0,h.jsx)(kn.Z,{fontSize:"small"}),Is=()=>{const v=Xr(),{updateFilters:j}=st(),[k,O]=(0,Z.useState)([]);function ie(he){j({orphan:he?new $t(he):void 0})}function ne(he){j({error:he?new qt(he):void 0})}const _=["Is Orphan","Has Error"];return(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(qe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:_,value:k,onChange:(he,Te)=>{O(Te),ie(Te.includes("Is Orphan")),ne(Te.includes("Has Error"))},renderOption:(he,{selected:Te})=>(0,h.jsx)(ln.Z,{control:(0,h.jsx)(Rn.Z,{icon:rs,checkedIcon:Rs,checked:Te}),onClick:Re=>Re.preventDefault(),label:he}),size:"small",popupIcon:(0,h.jsx)(zt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,h.jsx)(we.Z,{...he,className:v.input,variant:"outlined"})})]})})},Ps=(0,_t.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),os=()=>{const v=Ps();return(0,h.jsx)(ce,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Wt,InputProps:{className:v.input}})};function Ls(v){var j;const{children:k,value:O}=v;var ie;const[ne,_]=useState((ie=(j=O)===null||j===void 0?void 0:j.filters)!==null&&ie!==void 0?ie:{}),he=useCallback(Be=>{_(Ke=>{const At=typeof Be=="function"?Be(Ke):Be;return{...Ke,...At}})},[]),Te=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,ze,Ne,We,at;const Et=useMemo(()=>{var Be,Ke,At,Jt,Tn,Pt;return{entities:(Re=(Be=O)===null||Be===void 0?void 0:Be.entities)!==null&&Re!==void 0?Re:Te.entities,backendEntities:(ze=(Ke=O)===null||Ke===void 0?void 0:Ke.backendEntities)!==null&&ze!==void 0?ze:Te.backendEntities,updateFilters:(Ne=(At=O)===null||At===void 0?void 0:At.updateFilters)!==null&&Ne!==void 0?Ne:he,filters:ne,loading:(We=(Jt=O)===null||Jt===void 0?void 0:Jt.loading)!==null&&We!==void 0?We:!1,queryParameters:(at=(Tn=O)===null||Tn===void 0?void 0:Tn.queryParameters)!==null&&at!==void 0?at:Te.queryParameters,error:(Pt=O)===null||Pt===void 0?void 0:Pt.error}},[O,Te,ne,he]);return _jsx(EntityListContext.Provider,{value:Et,children:k})}},75435:function(Rt,Le,r){"use strict";r.d(Le,{h:function(){return p}});var n=r(25271);function p(V,f,H){var m,h,Z;let ye=((h=V)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(le=>le.type===f).map(le=>(0,n.of)(le.targetRef)))||[];return!((Z=H)===null||Z===void 0)&&Z.kind&&(ye=ye.filter(le=>le.kind.toLocaleLowerCase("en-US")===H.kind.toLocaleLowerCase("en-US"))),ye}},49280:function(Rt,Le,r){"use strict";r.d(Le,{hF:function(){return V.h},CV:function(){return H},wq:function(){return n},Gz:function(){return p}});function n(h){return h.reduce((Z,ye)=>({...Z,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function p(h){return Z=>h.every(ye=>!ye.filterEntity||ye.filterEntity(Z))}var V=r(75435),f=r(25271);function H(h,Z){var ye;const le=(ye=h.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(le)try{var W;const ue=(0,f.Ou)(le),D=Z.byUrl(ue.target);return{locationTargetUrl:ue.target,integrationType:(W=D)===null||W===void 0?void 0:W.type}}catch{return}}function m(h,Z){const ye=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),le=getEntityRelations(Z,RELATION_OWNED_BY).map(stringifyEntityRef);for(const W of le)if(ye.has(W))return!0;return!1}},8799:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{AboutCard:function(){return qt},AboutContent:function(){return kt},AboutField:function(){return Je}});var n=r(52322),p=r(25271),V=r(53974),f=r(60871),H=r(32838),m=r(39709),h=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const Z=(0,p.wI)(h),ye={async check(lt){return Z(lt)===lt}},le=lt=>lt.apiVersion==="scaffolder.backstage.io/v1beta3"&<.kind==="Template";var W=r(79692),ue=r(94339),D=r(32552),A=r(61837),re=r(85256),se=r(24579),te=r(88188),q=r(52866),K=r(30254),R=r(27604),w=r(2784),P=r(19625),U=r(60905),xe=r(7089),Ce=r(90436);const B=(0,W.Z)(lt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:lt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Je(lt){const{label:dt,value:ut,gridSizes:ht,children:Vt}=lt,Qt=B(),be=(0,f.vJ)(Vt,Ge=>Ge.getElements()),Me=be.length>0?be:(0,n.jsx)(Ce.Z,{variant:"body2",className:Qt.value,children:ut||"unknown"});return(0,n.jsxs)(U.Z,{item:!0,...ht,children:[(0,n.jsx)(Ce.Z,{variant:"h2",className:Qt.label,children:dt}),Me]})}var St=r(24851);const Nt=(0,W.Z)({description:{wordBreak:"break-word"}});function Wt(lt,dt,ut){if(dt==="url"||lt.includes("://"))return lt;const ht=ut.type==="file"?`file://${ut.target}`:ut.target;return dt==="file"||ut.type==="file"?new URL(lt,ht).href:ht}function kt(lt){var dt,ut,ht,Vt,Qt,be,Me,Ge,pt,st,tt,ft,ot,Xe,vt,mt;const{entity:yt}=lt,Cn=Nt(),fn=yt.kind.toLocaleLowerCase("en-US")==="system",hn=yt.kind.toLocaleLowerCase("en-US")==="resource",wn=yt.kind.toLocaleLowerCase("en-US")==="component",pn=yt.kind.toLocaleLowerCase("en-US")==="api",vn=yt.kind.toLocaleLowerCase("en-US")==="template",jn=yt.kind.toLocaleLowerCase("en-US")==="location",on=yt.kind.toLocaleLowerCase("en-US")==="group",yn=(0,m.hF)(yt,p.cz,{kind:"system"}),En=(0,m.hF)(yt,p.cz,{kind:"component"}),nt=(0,m.hF)(yt,p.cz,{kind:"domain"}),_t=(0,m.hF)(yt,p.S4);let zt;try{zt=(0,p.CV)(yt)}catch{zt=void 0}return(0,n.jsxs)(U.Z,{container:!0,children:[(0,n.jsx)(Je,{label:"Description",gridSizes:{xs:12},children:(0,n.jsx)(V.SA,{className:Cn.description,content:((ut=yt)===null||ut===void 0||(dt=ut.metadata)===null||dt===void 0?void 0:dt.description)||"No description"})}),(0,n.jsx)(Je,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,n.jsx)(m.rI,{entityRefs:_t,defaultKind:"group"})}),(fn||nt.length>0)&&(0,n.jsx)(Je,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:nt.length>0&&(0,n.jsx)(m.rI,{entityRefs:nt,defaultKind:"domain"})}),(pn||wn||hn||yn.length>0)&&(0,n.jsx)(Je,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:yn.length>0&&(0,n.jsx)(m.rI,{entityRefs:yn,defaultKind:"system"})}),wn&&En.length>0&&(0,n.jsx)(Je,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,n.jsx)(m.rI,{entityRefs:En,defaultKind:"component"})}),(pn||wn||hn||vn||on||jn||typeof((Vt=yt)===null||Vt===void 0||(ht=Vt.spec)===null||ht===void 0?void 0:ht.type)=="string")&&(0,n.jsx)(Je,{label:"Type",value:(be=yt)===null||be===void 0||(Qt=be.spec)===null||Qt===void 0?void 0:Qt.type,gridSizes:{xs:12,sm:6,lg:4}}),(pn||wn||typeof((Ge=yt)===null||Ge===void 0||(Me=Ge.spec)===null||Me===void 0?void 0:Me.lifecycle)=="string")&&(0,n.jsx)(Je,{label:"Lifecycle",value:(st=yt)===null||st===void 0||(pt=st.spec)===null||pt===void 0?void 0:pt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,n.jsx)(Je,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((ft=yt)===null||ft===void 0||(tt=ft.metadata)===null||tt===void 0?void 0:tt.tags)||[]).map(qe=>(0,n.jsx)(xe.Z,{size:"small",label:qe},qe))}),jn&&(((Xe=yt)===null||Xe===void 0||(ot=Xe.spec)===null||ot===void 0?void 0:ot.targets)||((mt=yt)===null||mt===void 0||(vt=mt.spec)===null||vt===void 0?void 0:vt.target))&&(0,n.jsx)(Je,{label:"Targets",gridSizes:{xs:12},children:(0,n.jsx)(St.s,{cols:1,items:(yt.spec.targets||[yt.spec.target]).map(qe=>qe).map(qe=>{var Rn,ln;return{text:qe,href:Wt(qe,((ln=yt)===null||ln===void 0||(Rn=ln.spec)===null||Rn===void 0?void 0:Rn.type)||"unknown",zt)}})})})]})}const $t=(0,W.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function qt(lt){var dt,ut,ht,Vt,Qt,be,Me;const{variant:Ge}=lt,pt=(0,f.qD)(),st=$t(),{entity:tt}=(0,m.X2)(),ft=(0,f.h_)(H.q3),ot=(0,f.h_)(m.Ah),Xe=(0,f.h_)(f.$v),vt=(0,f.h_)(f.VE),mt=(0,f.tg)(P.jU),yt=(0,f.tg)(P.ql),Cn=(0,m.CV)(tt,ft),fn=(dt=tt.metadata.annotations)===null||dt===void 0?void 0:dt[p.Tf],hn={label:"View Source",disabled:!Cn,icon:(0,n.jsx)(H.nW,{type:(ut=Cn)===null||ut===void 0?void 0:ut.integrationType}),href:(ht=Cn)===null||ht===void 0?void 0:ht.locationTargetUrl},wn={label:"View TechDocs",disabled:!(!((Vt=tt.metadata.annotations)===null||Vt===void 0)&&Vt["backstage.io/techdocs-ref"])||!mt,icon:(0,n.jsx)(K.Z,{}),href:mt&&mt({namespace:tt.metadata.namespace||p.zG,kind:tt.kind,name:tt.metadata.name})},pn=[hn,wn];if(le(tt)){var vn;const _t=(vn=pt.getSystemIcon("scaffolder"))!==null&&vn!==void 0?vn:te.Z,zt={label:"Launch Template",icon:(0,n.jsx)(_t,{}),disabled:!yt,href:yt&&yt({templateName:tt.metadata.name,namespace:tt.metadata.namespace||p.zG})};pn.push(zt)}let jn="";Ge==="gridItem"?jn=st.gridItemCard:Ge==="fullHeight"&&(jn=st.fullHeightCard);let on="";Ge==="gridItem"?on=st.gridItemCardContent:Ge==="fullHeight"&&(on=st.fullHeightCardContent);const yn=(Qt=tt.metadata.annotations)===null||Qt===void 0?void 0:Qt[p.P1],En=((be=yn)===null||be===void 0?void 0:be.startsWith("url:"))||((Me=yn)===null||Me===void 0?void 0:Me.startsWith("file:")),nt=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(tt)),Xe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(_t){vt.post(_t)}},[ot,Xe,vt,tt]);return(0,n.jsxs)(ue.Z,{className:jn,children:[(0,n.jsx)(D.Z,{title:"About",action:(0,n.jsxs)(n.Fragment,{children:[En&&(0,n.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:nt,children:(0,n.jsx)(q.Z,{})}),(0,n.jsx)(A.Z,{component:V.rU,"aria-label":"Edit",disabled:!fn,title:"Edit Metadata",to:fn!=null?fn:"#",children:(0,n.jsx)(R.Z,{})})]}),subheader:(0,n.jsx)(V.M6,{links:pn})}),(0,n.jsx)(re.Z,{}),(0,n.jsx)(se.Z,{className:on,children:(0,n.jsx)(kt,{entity:tt})})]})}},86359:function(Rt,Le,r){"use strict";r.d(Le,{E:function(){return K}});var n=r(52322),p=r(25271),V=r(53974),f=r(39709),H=r(90436),m=r(15459),h=r(27604),Z=r(2997),ye=r(11640),le=r(28347),W=r(76635),ue=r(2784),D=r(7089);const A=Object.freeze({createNameColumn(R){function w(P){var U,xe;return((U=P.metadata)===null||U===void 0?void 0:U.title)||(0,f.$3)(P,{defaultKind:(xe=R)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:U}){return w(P).localeCompare(w(U))},render:({entity:P})=>{var U,xe;return(0,n.jsx)(f.dx,{entityRef:P,defaultKind:((U=R)===null||U===void 0?void 0:U.defaultKind)||"Component",title:(xe=P.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,n.jsx)(f.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,n.jsx)(f.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var w,P,U,xe;return(0,n.jsx)(n.Fragment,{children:(((P=R)===null||P===void 0||(w=P.spec)===null||w===void 0?void 0:w.targets)||((xe=R)===null||xe===void 0||(U=xe.spec)===null||U===void 0?void 0:U.target))&&(0,n.jsx)(V.Or,{text:(R.spec.targets||[R.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:R})=>(0,n.jsx)(V.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,n.jsx)(n.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(w=>(0,n.jsx)(D.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(R){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=R)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(R,w){var P;return{title:((P=w)===null||P===void 0?void 0:P.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:U})=>{var xe,Ce;const B=(xe=U.metadata)===null||xe===void 0?void 0:xe.labels,Je=B&&B[R]||((Ce=w)===null||Ce===void 0?void 0:Ce.defaultValue);return(0,n.jsx)(n.Fragment,{children:Je&&(0,n.jsx)(D.Z,{label:Je,size:"small",variant:"outlined"},Je)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var re=r(19928),se=r.n(re);const te=(0,m.Z)({root:{color:"#f3ba37"}})(ye.Z),q=(R,w)=>{const P=U=>U.metadata.title||(0,f.$3)(U,{defaultKind:"Component"});return P(R).localeCompare(P(w))},K=R=>{var w,P,U,xe;const{columns:Ce,actions:B,tableOptions:Je,subtitle:St,emptyContent:Nt}=R,{isStarredEntity:Wt,toggleStarredEntity:kt}=(0,f.CR)(),{loading:$t,error:qt,entities:lt,filters:dt}=(0,f.wp)(),ut=(0,ue.useMemo)(()=>{var ot;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(ot=dt.kind)===null||ot===void 0?void 0:ot.value}),...Xe(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Xe(){var vt;const mt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((vt=dt.kind)===null||vt===void 0?void 0:vt.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return lt.every(yt=>yt.metadata.namespace==="default")?mt:[...mt,A.createNamespaceColumn()]}}},[(w=dt.kind)===null||w===void 0?void 0:w.value,lt]),ht=dt.type===void 0;var Vt;const Qt=(0,W.capitalize)((Vt=(P=dt.user)===null||P===void 0?void 0:P.value)!==null&&Vt!==void 0?Vt:"all");if(qt)return(0,n.jsx)("div",{children:(0,n.jsx)(V.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,n.jsx)(V.Oi,{language:"text",text:qt.toString()})})});const be=[({entity:ot})=>{var Xe;const vt=(Xe=ot.metadata.annotations)===null||Xe===void 0?void 0:Xe[p.l2],mt="View";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{variant:"srOnly",children:mt}),(0,n.jsx)(Z.Z,{fontSize:"small"})]}),tooltip:mt,disabled:!vt,onClick:()=>{vt&&window.open(vt,"_blank")}}},({entity:ot})=>{var Xe;const vt=(Xe=ot.metadata.annotations)===null||Xe===void 0?void 0:Xe[p.Tf],mt="Edit";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{variant:"srOnly",children:mt}),(0,n.jsx)(h.Z,{fontSize:"small"})]}),tooltip:mt,disabled:!vt,onClick:()=>{vt&&window.open(vt,"_blank")}}},({entity:ot})=>{const Xe=Wt(ot),vt=Xe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{variant:"srOnly",children:vt}),Xe?(0,n.jsx)(te,{}):(0,n.jsx)(le.Z,{})]}),tooltip:vt,onClick:()=>kt(ot)}}],Me=lt.sort(q).map(ot=>{const Xe=(0,f.hF)(ot,p.cz,{kind:"system"}),vt=(0,f.hF)(ot,p.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:vt.map(mt=>(0,f.$3)(mt,{defaultKind:"group"})).join(", "),ownedByRelations:vt,partOfSystemRelationTitle:Xe.map(mt=>(0,f.$3)(mt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Xe}}}),Ge=(Ce||ut).find(ot=>ot.title==="Type");Ge&&(Ge.hidden=!ht);const pt=Me.length>20,st=((U=dt.kind)===null||U===void 0?void 0:U.value)||"",tt=((xe=dt.type)===null||xe===void 0?void 0:xe.value)||"",ft=[Qt,tt,se()(st)].filter(ot=>ot).join(" ");return(0,n.jsx)(V.iA,{isLoading:$t,columns:Ce||ut,options:{paging:pt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!$t,padding:"dense",pageSizeOptions:[20,50,100],...Je},title:`${ft} (${lt.length})`,data:Me,actions:B||be,subtitle:St,emptyContent:Nt})};K.columns=A},85877:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{EntityLabelsCard:function(){return ue},hasLabels:function(){return D}});var n=r(52322),p=r(39709),V=r(2784),f=r(53974),H=r(79692),m=r(90436),h=r(77277);const Z=`metadata:
|
|
34
|
+
name: example
|
|
35
|
+
labels:
|
|
36
|
+
javaVersion: 1.2.3`,ye=(0,H.Z)(A=>({code:{borderRadius:6,margin:A.spacing(2,0),background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function le(){const A=ye();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:A.code,children:(0,n.jsx)(f.Oi,{text:Z,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(h.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const W=(0,H.Z)(A=>({key:{fontWeight:"bold"}})),ue=A=>{var re,se;const{variant:te,title:q}=A,{entity:K}=(0,p.X2)(),R=W(),w=[{render:U=>(0,n.jsx)(m.Z,{className:R.key,variant:"body2",children:U.key})},{field:"value"}],P=(se=K)===null||se===void 0||(re=se.metadata)===null||re===void 0?void 0:re.labels;return(0,n.jsx)(f.rJ,{title:q||"Labels",variant:te,children:!P||Object.keys(P).length===0?(0,n.jsx)(le,{}):(0,n.jsx)(f.iA,{columns:w,data:Object.keys(P).map(U=>({key:U,value:P[U]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(P).length>5}})})};function D(A){var re,se,te,q;return!((se=A)===null||se===void 0||(re=se.metadata)===null||re===void 0)&&re.labels?Object.keys((q=A)===null||q===void 0||(te=q.metadata)===null||te===void 0?void 0:te.labels).some(Boolean):!1}},24851:function(Rt,Le,r){"use strict";r.d(Le,{s:function(){return re}});var n=r(52322),p=r(90348),V=r(11861),f=r(2784),H=r(79692),m=r(95544),h=r(90436),Z=r(52160),ye=r(53974);const le=(0,H.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function W(se){const{href:te,text:q,Icon:K}=se,R=le();return(0,n.jsxs)(m.Z,{display:"flex",children:[(0,n.jsx)(m.Z,{mr:1,className:R.svgIcon,children:(0,n.jsx)(h.Z,{component:"div",children:K?(0,n.jsx)(K,{}):(0,n.jsx)(Z.Z,{})})}),(0,n.jsx)(m.Z,{flexGrow:"1",children:(0,n.jsx)(ye.rU,{to:te,target:"_blank",rel:"noopener",children:q||te})})]})}var ue=r(41156);const D={xs:1,sm:1,md:1,lg:2,xl:3};function A(se){const te=[(0,ue.Z)(P=>P.breakpoints.up("xl"))?"xl":null,(0,ue.Z)(P=>P.breakpoints.up("lg"))?"lg":null,(0,ue.Z)(P=>P.breakpoints.up("md"))?"md":null,(0,ue.Z)(P=>P.breakpoints.up("sm"))?"sm":null,(0,ue.Z)(P=>P.breakpoints.up("xs"))?"xs":null];let q=1;if(typeof se=="number")q=se;else{var K,R;const P=(R=te.find(U=>U!==null))!==null&&R!==void 0?R:"xs";var w;q=(w=(K=se)===null||K===void 0?void 0:K[P])!==null&&w!==void 0?w:D[P]}return q}function re(se){const{items:te,cols:q=void 0}=se,K=A(q);return(0,n.jsx)(p.Z,{rowHeight:"auto",cols:K,children:te.map(({text:R,href:w,Icon:P},U)=>(0,n.jsx)(V.Z,{children:(0,n.jsx)(W,{href:w,text:R!=null?R:w,Icon:P})},U))})}},19625:function(Rt,Le,r){"use strict";r.d(Le,{_Z:function(){return H},jU:function(){return V},ql:function(){return f},yw:function(){return p}});var n=r(60871);const p=(0,n.x8)({id:"create-component",optional:!0}),V=(0,n.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,n.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),H=(0,n.NT)({id:"catalog"})},15096:function(Rt,Le,r){"use strict";r.d(Le,{FA:function(){return ye},qO:function(){return ut},Nd:function(){return B},E5:function(){return an},Rx:function(){return w}});var n=r(60871);const p=(0,n.T0)({id:"plugin.search.queryservice"});class V{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(ae){_define_property(this,"mockedResults",void 0),this.mockedResults=ae}}var f=r(52322),H=r(2784),m=r(38402),h=r(79692);const Z=(0,h.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=oe=>{const{text:ae,preTag:Q,postTag:y}=oe,I=Z(),M=(0,H.useMemo)(()=>ae.split(new RegExp(`(${Q}.+?${y})`)),[y,Q,ae]);return(0,f.jsx)(f.Fragment,{children:M.map((z,de)=>z.includes(Q)?(0,f.jsx)("mark",{className:I.highlight,children:z.replace(new RegExp(`${Q}|${y}`,"g"),"")},de):z)})};var le=r(50581),W=r(61837),ue=r(86619),D=r(77277),A=r(21853),re=r(48760),se=r(76635),te=r(64279),q=r(1849),K=r(51837);const R=(0,K.CT)("search-context"),w=()=>{const oe=(0,H.useContext)(R);if(!oe)throw new Error("useSearch must be used within a SearchContextProvider");const ae=oe.atVersion(1);if(!ae)throw new Error("No SearchContext v1 found");return ae},P=()=>(0,H.useContext)(R)!==void 0,U={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},xe=(oe=U)=>{var ae,Q,y,I;const M=(0,n.h_)(p),[z,de]=(0,H.useState)(oe.term),[Se,Oe]=(0,H.useState)(oe.types),[et,rt]=(0,H.useState)(oe.filters),[xt,wt]=(0,H.useState)(oe.pageLimit),[it,ke]=(0,H.useState)(oe.pageCursor),bt=(0,q.Z)(z),Xt=(0,q.Z)(et),Tt=(0,te.default)(()=>M.query({term:z,types:Se,filters:et,pageLimit:xt,pageCursor:it}),[z,Se,et,xt,it]),Ft=!Tt.loading&&!Tt.error&&((ae=Tt.value)===null||ae===void 0?void 0:ae.nextPageCursor),en=!Tt.loading&&!Tt.error&&((Q=Tt.value)===null||Q===void 0?void 0:Q.previousPageCursor),An=(0,H.useCallback)(()=>{var It;ke((It=Tt.value)===null||It===void 0?void 0:It.nextPageCursor)},[(y=Tt.value)===null||y===void 0?void 0:y.nextPageCursor]),Kt=(0,H.useCallback)(()=>{var It;ke((It=Tt.value)===null||It===void 0?void 0:It.previousPageCursor)},[(I=Tt.value)===null||I===void 0?void 0:I.previousPageCursor]);return(0,H.useEffect)(()=>{bt!==void 0&&z!==bt&&ke(void 0)},[z,bt,ke]),(0,H.useEffect)(()=>{Xt!==void 0&&!(0,se.isEqual)(et,Xt)&&ke(void 0)},[et,Xt,ke]),{result:Tt,term:z,setTerm:de,types:Se,setTypes:Oe,filters:et,setFilters:rt,pageLimit:xt,setPageLimit:wt,pageCursor:it,setPageCursor:ke,fetchNextPage:Ft?An:void 0,fetchPreviousPage:en?Kt:void 0}},Ce=oe=>{const{initialState:ae,children:Q}=oe,y=xe(ae);return(0,f.jsx)(n.fC,{attributes:{searchTypes:y.types.sort().join(",")},children:(0,f.jsx)(R.Provider,{value:(0,K.EI)({1:y}),children:Q})})},B=oe=>{const{initialState:ae,inheritParentContextIfAvailable:Q,children:y}=oe,I=P(),M=(0,n.h_)(n.Ds),z=ae!=null?ae:{},de=M.has("search.query.pageLimit")?{pageLimit:M.getNumber("search.query.pageLimit")}:{},Se={...U,...z,...de};return I&&Q?(0,f.jsx)(f.Fragment,{children:y}):(0,f.jsx)(Ce,{initialState:Se,children:y})},Je=({children:oe})=>{var ae;const Q=et=>(0,q.Z)(et)!==et,y=(0,n.z$)(),{term:I,result:M}=w();var z;const de=(z=(ae=M.value)===null||ae===void 0?void 0:ae.numberOfResults)!==null&&z!==void 0?z:void 0,Oe=Q(M.loading)&&!M.loading;return(0,H.useEffect)(()=>{I&&Oe&&y.captureEvent("search",I,{value:de})},[y,I,de,Oe]),(0,f.jsx)(f.Fragment,{children:oe})};function St(oe){return(0,H.forwardRef)((ae,Q)=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(oe,{...ae,ref:Q})}))}const Nt=St((0,H.forwardRef)((oe,ae)=>{const{onChange:Q,onKeyDown:y=()=>{},onClear:I=()=>{},onSubmit:M=()=>{},debounceTime:z=200,clearButton:de=!0,fullWidth:Se=!0,value:Oe,label:et,placeholder:rt,inputProps:xt={},InputProps:wt={},endAdornment:it,...ke}=oe,bt=(0,n.h_)(n.Ds),[Xt,Tt]=(0,H.useState)("");(0,H.useEffect)(()=>{Tt(Zt=>Zt!==Oe?String(Oe):Zt)},[Oe]),(0,re.Z)(()=>Q(Xt),z,[Xt]);const Ft=(0,H.useCallback)(Zt=>{Tt(Zt.target.value)},[Tt]),en=(0,H.useCallback)(Zt=>{y&&y(Zt),M&&Zt.key==="Enter"&&M()},[y,M]),An=(0,H.useCallback)(()=>{Q(""),I&&I()},[Q,I]),Kt=et?void 0:"Search",jt=rt!=null?rt:`Search in ${bt.getOptionalString("app.title")||"Backstage"}`,It=(0,f.jsx)(le.Z,{position:"start",children:(0,f.jsx)(W.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),Yt=(0,f.jsx)(le.Z,{position:"end",children:(0,f.jsx)(D.Z,{"aria-label":"Clear",size:"small",onClick:An,onKeyDown:Zt=>{Zt.key==="Enter"&&Zt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Je,{children:(0,f.jsx)(ue.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:ae,value:Xt,label:et,placeholder:jt,InputProps:{startAdornment:It,endAdornment:de?Yt:it,...wt},inputProps:{"aria-label":Kt,...xt},fullWidth:Se,onChange:Ft,onKeyDown:en,...ke})})})),Wt=St((0,H.forwardRef)((oe,ae)=>{const{value:Q="",onChange:y,...I}=oe,{term:M,setTerm:z}=w();(0,H.useEffect)(()=>{Q&&z(String(Q))},[Q,z]);const de=(0,H.useCallback)(Se=>{y?y(Se):z(Se)},[y,z]);return(0,f.jsx)(n.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Nt,{...I,ref:ae,value:M,onChange:de})})}));var kt=r(4614),$t=r(88013);const qt=(0,h.Z)(oe=>({loading:{right:oe.spacing(1),position:"absolute"}})),lt=oe=>ae=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(oe,{...ae})}),dt=()=>{const oe=qt();return(0,f.jsx)(kt.Z,{className:oe.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},ut=lt(function(ae){const{loading:Q,value:y,onChange:I=()=>{},options:M=[],getOptionLabel:z=Ft=>String(Ft),inputPlaceholder:de,inputDebounceTime:Se,freeSolo:Oe=!0,fullWidth:et=!0,clearOnBlur:rt=!1,"data-testid":xt="search-autocomplete",...wt}=ae,{setTerm:it}=w(),ke=(0,H.useCallback)(Ft=>Ft?typeof Ft=="string"?Ft:z(Ft):"",[z]),bt=(0,H.useMemo)(()=>ke(y),[y,ke]),Xt=(0,H.useCallback)((Ft,en,An,Kt)=>{it(ke(en)),I(Ft,en,An,Kt)},[ke,it,I]),Tt=(0,H.useCallback)(({InputProps:{ref:Ft,className:en,endAdornment:An},InputLabelProps:Kt,...jt})=>(0,f.jsx)(Wt,{...jt,ref:Ft,clearButton:!1,value:bt,placeholder:de,debounceTime:Se,endAdornment:Q?(0,f.jsx)(dt,{}):An,InputProps:{className:en}}),[Q,bt,de,Se]);return(0,f.jsx)($t.ZP,{...wt,"data-testid":xt,value:y,onChange:Xt,options:M,getOptionLabel:z,renderInput:Tt,freeSolo:Oe,fullWidth:et,clearOnBlur:rt})}),ht=oe=>{const{icon:ae,primaryText:Q,primaryTextTypographyProps:y,secondaryText:I,secondaryTextTypographyProps:M,disableTextTypography:z}=oe;return _jsxs(_Fragment,{children:[ae?_jsx(ListItemIcon,{children:ae}):null,_jsx(ListItemText,{primary:Q,primaryTypographyProps:y,secondary:I,secondaryTypographyProps:M,disableTypography:z})]})};var Vt=r(42494),Qt=r(84899),be=r(5806),Me=r(21324),Ge=r(56939),pt=r(73698),st=r(12231),tt=r(90436),ft=r(7089),ot=r(69294);const Xe=(oe,ae,Q=[],y=250)=>{const I=(0,H.useRef)({}),M=oe||(()=>Promise.resolve([])),[z,de]=(0,ot.default)(M,[ae],{loading:!0});if((0,re.Z)(()=>{I.current[ae]===void 0&&(I.current[ae]=de(ae).then(Oe=>(I.current[ae]=Oe,Oe)))},y,[de,ae]),Q.length)return{loading:!1,value:Q};const Se=I.current[ae];return Array.isArray(Se)?{loading:!1,value:Se}:z},vt=(oe,ae)=>{const{setFilters:Q}=w();(0,H.useEffect)(()=>{ae&&[ae].flat().length>0&&Q(y=>({...y,[oe]:ae}))},[])},mt=oe=>{const{className:ae,defaultValue:Q,name:y,values:I,valuesDebounceMs:M,label:z,filterSelectedOptions:de,limitTags:Se,multiple:Oe}=oe,[et,rt]=(0,H.useState)("");vt(y,Q);const xt=typeof I=="function"?I:void 0,wt=typeof I=="function"?void 0:I,{value:it,loading:ke}=Xe(xt,et,wt,M),{filters:bt,setFilters:Xt}=w(),Tt=bt[y]||(Oe?[]:null),Ft=(Kt,jt)=>{Xt(It=>{const{[y]:Yt,...Zt}=It;return jt?{...Zt,[y]:jt}:{...Zt}})},en=Kt=>(0,f.jsx)(ue.Z,{...Kt,name:"search",variant:"outlined",label:z,fullWidth:!0}),An=(Kt,jt)=>Kt.map((It,Yt)=>(0,f.jsx)(ft.Z,{label:It,color:"primary",...jt({index:Yt})}));return(0,f.jsx)($t.ZP,{filterSelectedOptions:de,limitTags:Se,multiple:Oe,className:ae,id:`${Oe?"multi-":""}select-filter-${y}--select`,options:it||[],loading:ke,value:Tt,onChange:Ft,onInputChange:(Kt,jt)=>rt(jt),renderInput:en,renderTags:An})},yt=(0,h.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),Cn=oe=>{const{className:ae,defaultValue:Q,label:y,name:I,values:M=[],valuesDebounceMs:z}=oe,de=yt(),{filters:Se,setFilters:Oe}=w();vt(I,Q);const et=typeof M=="function"?M:void 0,rt=typeof M=="function"?void 0:M,{value:xt=[],loading:wt}=Xe(et,"",rt,z),it=bt=>{const{target:{value:Xt,checked:Tt}}=bt;Oe(Ft=>{const{[I]:en,...An}=Ft,Kt=(en||[]).filter(It=>It!==Xt),jt=Tt?[...Kt,Xt]:Kt;return jt.length?{...An,[I]:jt}:An})};var ke;return(0,f.jsxs)(Vt.Z,{className:ae,disabled:wt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[y?(0,f.jsx)(Qt.Z,{className:de.label,children:y}):null,xt.map(bt=>(0,f.jsx)(be.Z,{classes:{root:de.checkboxWrapper,label:de.textWrapper},label:bt,control:(0,f.jsx)(Me.Z,{color:"primary",inputProps:{"aria-labelledby":bt},value:bt,name:bt,onChange:it,checked:((ke=Se[I])!==null&&ke!==void 0?ke:[]).includes(bt)})},bt))]})},fn=oe=>{const{className:ae,defaultValue:Q,label:y,name:I,values:M,valuesDebounceMs:z}=oe,de=yt();vt(I,Q);const Se=typeof M=="function"?M:void 0,Oe=typeof M=="function"?void 0:M,{value:et=[],loading:rt}=Xe(Se,"",Oe,z),{filters:xt,setFilters:wt}=w(),it=ke=>{const{target:{value:bt}}=ke;wt(Xt=>{const{[I]:Tt,...Ft}=Xt;return bt?{...Ft,[I]:bt}:Ft})};return(0,f.jsxs)(Vt.Z,{disabled:rt,className:ae,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[y?(0,f.jsx)(Ge.Z,{className:de.label,margin:"dense",children:y}):null,(0,f.jsxs)(pt.Z,{variant:"outlined",value:xt[I]||"",onChange:it,children:[(0,f.jsx)(st.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),et.map(ke=>(0,f.jsx)(st.Z,{value:ke,children:(0,f.jsx)(tt.Z,{variant:"inherit",noWrap:!0,children:ke})},ke))]})]})},hn=oe=>{const{component:ae,...Q}=oe;return(0,f.jsx)(ae,{...Q})};hn.Checkbox=oe=>(0,f.jsx)(hn,{...oe,component:Cn}),hn.Select=oe=>(0,f.jsx)(hn,{...oe,component:fn}),hn.Autocomplete=oe=>(0,f.jsx)(hn,{...oe,component:mt});var wn=r(48834).lW;const pn=oe=>wn.from(oe.toString(),"utf-8").toString("base64"),vn=oe=>oe?Number(wn.from(oe,"base64").toString("utf-8")):0,jn=oe=>{const{total:ae=-1,cursor:Q,hasNextPage:y,onCursorChange:I,limit:M=25,limitLabel:z="Results per page:",limitText:de=({from:it,to:ke})=>ae>0?`of ${ae}`:`${it}-${ke}`,limitOptions:Se,onLimitChange:Oe,...et}=oe,rt=useMemo(()=>vn(Q),[Q]),xt=useCallback((it,ke)=>{var bt;(bt=I)===null||bt===void 0||bt(pn(ke))},[I]),wt=useCallback(it=>{var ke;const bt=it.target.value;(ke=Oe)===null||ke===void 0||ke(parseInt(bt,10))},[Oe]);return _jsx(TablePagination,{...et,component:"div",count:ae,page:rt,nextIconButtonProps:{...y!==void 0&&{disabled:!y}},onPageChange:xt,rowsPerPage:M,labelRowsPerPage:z,labelDisplayedRows:de,rowsPerPageOptions:Se,onRowsPerPageChange:wt})},on=oe=>{const{pageLimit:ae,setPageLimit:Q,pageCursor:y,setPageCursor:I,fetchNextPage:M}=useSearch(),z=useCallback(de=>{Q(de),I(void 0)},[Q,I]);return _jsx(jn,{...oe,hasNextPage:!!M,limit:ae,onLimitChange:z,cursor:y,onCursorChange:I})};var yn=r(53974);const En=oe=>{const{children:ae}=oe,Q=useSearch(),{result:y,...I}=Q;return ae(y,I)},nt=oe=>{const{query:ae,children:Q}=oe,y=useApi(searchApiRef),I=useAsync(()=>{const{term:M="",types:z=[],filters:de={},...Se}=ae;return y.query({...Se,term:M,types:z,filters:de})},[ae]);return Q(I,ae)},_t=oe=>{const{query:ae,children:Q}=oe;return ae?_jsx(nt,{query:ae,children:Q}):_jsx(En,{children:Q})},zt=oe=>{const{query:ae,children:Q,noResultsComponent:y=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...I}=oe;return _jsx(_t,{query:ae,children:({loading:M,error:z,value:de})=>{var Se;return M?_jsx(Progress,{}):z?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:z}):!((Se=de)===null||Se===void 0)&&Se.results.length?isFunction(Q)?Q(de):_jsx(SearchResultListItemExtensions,{...I,results:de.results,children:Q}):y}})},qe=oe=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(zt,{...oe})}),Rn=({result:oe,highlight:ae,icon:Q,secondaryAction:y,lineClamp:I=5})=>{var M,z,de,Se,Oe;return oe?_jsxs(_Fragment,{children:[Q&&_jsx(ListItemIcon,{children:Q}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:oe.location,children:!((M=ae)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((z=ae)===null||z===void 0?void 0:z.fields.title)||"",preTag:((de=ae)===null||de===void 0?void 0:de.preTag)||"",postTag:((Se=ae)===null||Se===void 0?void 0:Se.postTag)||""}):oe.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:I,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((Oe=ae)===null||Oe===void 0)&&Oe.fields.text?_jsx(HighlightedSearchResultText,{text:ae.fields.text,preTag:ae.preTag,postTag:ae.postTag}):oe.text})}),y&&_jsx(Box,{alignItems:"flex-end",children:y})]}):null},ln=oe=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Rn,{...oe})}),kn=oe=>{var ae;const{error:Q,loading:y,resultItems:I,renderResultItem:M=Oe=>_jsx(DefaultResultListItem,{result:Oe.document},Oe.document.location),disableRenderingWithNoResults:z,noResultsComponent:de=z?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Se}=oe;return y?_jsx(Progress,{}):Q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Q}):!((ae=I)===null||ae===void 0)&&ae.length?_jsx(List,{...Se,children:I.map(M)}):_jsx(_Fragment,{children:de})},xn=oe=>{const{query:ae,renderResultItem:Q,children:y,...I}=oe,M=useSearchResultListItemExtensions(y);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:ae,children:({loading:z,error:de,value:Se})=>{var Oe;return _jsx(kn,{...I,error:de,loading:z,resultItems:(Oe=Se)===null||Oe===void 0?void 0:Oe.results,renderResultItem:Q!=null?Q:M})}})})};var Zn=r(19126);const _n=(0,h.Z)(oe=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:oe.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:oe.palette.text.secondary,margin:oe.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:oe.palette.text.secondary,margin:oe.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:oe.spacing(.5)}})),In=oe=>{const ae=_n(),{label:Q,children:y,...I}=oe;return _jsx(Chip,{...I,className:ae.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[Q,": ",y]})})},Mn=()=>null,we=(0,h.Z)(oe=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:oe.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:oe.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),pe=oe=>{const ae=we(),{label:Q,value:y="None",onChange:I,onDelete:M}=oe,z=useCallback(de=>{I(de.target.value)},[I]);return _jsx(In,{label:Q,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:ae.root,onChange:z,contentEditable:!0,suppressContentEditableWarning:!0,children:y})})},Pe=(0,h.Z)(oe=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:oe.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),G=oe=>{const ae=Pe(),{label:Q,value:y="none",onChange:I,onDelete:M,children:z}=oe,de=useCallback(Se=>{I(Se.target.value)},[I]);return _jsx(In,{label:Q,onDelete:M,children:_jsxs(Select,{className:ae.root,value:y,onChange:de,input:_jsx(InputBase,{}),IconComponent:Mn,children:[_jsx(MenuItem,{value:"none",children:"None"}),z]})})};function N(oe){var ae,Q;const y=_n(),[I,M]=useState(null),{error:z,loading:de,icon:Se,title:Oe,titleProps:et={},link:rt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:y.listSubheaderLinkIcon})]}),linkProps:xt={},filterOptions:wt,renderFilterOption:it=Yt=>_jsx(MenuItem,{value:String(Yt),children:Yt},String(Yt)),filterFields:ke,renderFilterField:bt,resultItems:Xt,renderResultItem:Tt=Yt=>_jsx(DefaultResultListItem,{result:Yt.document},Yt.document.location),disableRenderingWithNoResults:Ft,noResultsComponent:en=Ft?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...An}=oe,Kt=useCallback(Yt=>{M(Yt.currentTarget)},[]),jt=useCallback(()=>{M(null)},[]);if(de)return _jsx(Progress,{});if(z)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:z});if(!(!((ae=Xt)===null||ae===void 0)&&ae.length))return _jsx(_Fragment,{children:en});var It;return _jsxs(List,{...An,children:[_jsxs(ListSubheader,{className:y.listSubheader,children:[Se,_jsx(Typography,{className:y.listSubheaderName,component:"strong",...et,children:Oe}),wt?_jsx(Chip,{className:y.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Kt}):null,wt?_jsx(Menu,{id:"filters-menu",anchorEl:I,open:Boolean(I),onClose:jt,onClick:jt,keepMounted:!0,children:wt.map(it)}):null,(Q=ke)===null||Q===void 0?void 0:Q.map(Yt=>{var Zt;return(It=(Zt=bt)===null||Zt===void 0?void 0:Zt(Yt))!==null&&It!==void 0?It:null}),_jsx(Link,{className:y.listSubheaderLink,to:"/search",...xt,children:rt})]}),Xt.map(Tt)]})}function ce(oe){const{query:ae,children:Q,renderResultItem:y,linkProps:I={},...M}=oe,z=useSearchResultListItemExtensions(Q);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:ae,children:({loading:de,error:Se,value:Oe},{term:et,types:rt,pageCursor:xt,filters:wt={}})=>{var it;const ke=`/search?${qs.stringify({term:et,types:rt,filters:wt,pageCursor:xt,query:et},{arrayFormat:"brackets"})}`;return _jsx(N,{...M,error:Se,loading:de,linkProps:{to:ke,...I},filterFields:Object.keys(wt),resultItems:(it=Oe)===null||it===void 0?void 0:it.results,renderResultItem:y!=null?y:z})}})})}const Ae=(0,h.Z)(oe=>({root:{display:"flex",justifyContent:"space-between",gap:oe.spacing(2),margin:oe.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:oe,fetchPreviousPage:ae}=useSearch(),Q=Ae();return!oe&&!ae?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:Q.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!ae,onClick:ae,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!oe,onClick:oe,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},_e="search.results.list.items.extensions.v1",Ct=(oe,ae)=>{for(const y of oe){var Q;if(!(!isValidElement(y)||!(!((Q=getComponentData(y,_e))===null||Q===void 0)&&Q(ae))))return cloneElement(y,{rank:ae.rank,highlight:ae.highlight,result:ae.document,...y.props})}return null},Dt=oe=>{const{rank:ae,result:Q,noTrack:y,children:I,alignItems:M="flex-start",...z}=oe,de=(0,n.z$)(),Se=(0,H.useCallback)(()=>{y||Q&&de.captureEvent("discover",Q.title,{attributes:{to:Q.location},value:ae})},[ae,Q,y,de]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:Se,...z,children:I})},an=oe=>{const{name:ae,component:Q,predicate:y=()=>!0}=oe;return(0,n.YO)({name:ae,component:{lazy:()=>Q().then(I=>M=>(0,f.jsx)(Dt,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,H.createElement)(I,M)}))},data:{[_e]:y}})},sn=oe=>{const ae=useElementFilter(oe,Q=>Q.selectByComponentData({key:_e}).getElements(),[oe]);return useCallback((Q,y)=>{const I=Ct(ae,Q);return _jsx(Fragment,{children:I!=null?I:_jsx(Dt,{rank:Q.rank,result:Q.document,children:_jsx(DefaultResultListItem,{rank:Q.rank,highlight:Q.highlight,result:Q.document})})},y)},[ae])},cn=oe=>{const{results:ae,children:Q,...y}=oe,I=sn(Q);return _jsx(List,{...y,children:ae.map(I)})}},61886:function(Rt,Le,r){"use strict";r.d(Le,{Ox:function(){return kt},jM:function(){return H},Zz:function(){return m},oZ:function(){return B},DR:function(){return h},ZS:function(){return xe},VA:function(){return lt},KY:function(){return ye},gT:function(){return A},Dl:function(){return re},ux:function(){return qt},$L:function(){return D},x1:function(){return Ce}});var n=r(52322),p=r(2784),V=r(73557),f=r(60871);const H="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",h=()=>null;(0,f.R5)(h,m,!0);const Z=be=>`${H}.${be.toLocaleLowerCase("en-US")}`;function ye(be){const{name:Me,component:Ge}=be;return(0,f.YO)({name:Me,component:{sync:pt=>(0,n.jsx)(Ge,{...pt})},data:{[H]:be,[Z(Me)]:!0}})}const le=(be,Me)=>be.selectByComponentData({key:Me}).getElements()[0],W=be=>be.selectByComponentData({key:m}).selectByComponentData({key:H}),ue=be=>be.selectByComponentData({key:m}).findComponentData({key:H}),D=()=>{const be=(0,V.pC)(),Me=(0,f.vJ)(be,W),Ge=(0,f.vJ)(be,ue),pt=(0,p.useCallback)(ft=>{if(!Me||!ft)return null;const ot=Z(ft.name);var Xe;return(Xe=le(Me,ot))!==null&&Xe!==void 0?Xe:null},[Me]),st=(0,p.useCallback)(ft=>{const ot=Ge.find(Xe=>Xe.name===ft);return ot?pt(ot):null},[Ge,pt]),tt=(0,p.useCallback)(ft=>{const ot=Ge.filter(Xe=>Xe.location===ft);return ot.length?ot.map(pt):null},[Ge,pt]);return{renderComponentByName:st,renderComponentsByLocation:tt}},A=(0,f.T0)({id:"plugin.techdocs.service"}),re=(0,f.T0)({id:"plugin.techdocs.storageservice"});var se=r(64279),te=r(77446),q=r(25271),K=r(51837);function R(be,Me){return Me.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(be.kind=be.kind.toLocaleLowerCase(),be.name=be.name.toLocaleLowerCase(),be.namespace=be.namespace.toLocaleLowerCase()),be}const w=(be,Me)=>(0,q.eE)(be)===(0,q.eE)(Me),P={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},U=(0,K.CT)("techdocs-reader-page-context"),xe=(0,p.memo)(be=>{const{entityRef:Me,children:Ge}=be,pt=(0,f.h_)(A),st=(0,f.h_)(f.Ds),tt=(0,se.default)(async()=>pt.getEntityMetadata(Me),[Me]),ft=(0,te.Z)(async()=>pt.getTechDocsMetadata(Me),[Me]),[ot,Xe]=(0,p.useState)(P.title),[vt,mt]=(0,p.useState)(P.subtitle),[yt,Cn]=(0,p.useState)(P.shadowRoot);(0,p.useEffect)(()=>{yt&&!ft.value&&!ft.loading&&ft.retry()},[ft.value,ft.loading,yt,ft.retry,ft]);const fn={metadata:ft,entityRef:R(Me,st),entityMetadata:tt,shadowRoot:yt,setShadowRoot:Cn,title:ot,setTitle:Xe,subtitle:vt,setSubtitle:mt},hn=(0,K.EI)({1:fn});return(0,n.jsx)(f.fC,{attributes:{entityRef:(0,q.eE)(Me)},children:(0,n.jsx)(U.Provider,{value:hn,children:Ge instanceof Function?Ge(fn):Ge})})},(be,Me)=>w(be.entityRef,Me.entityRef)),Ce=()=>{const be=(0,p.useContext)(U);if(be===void 0)return P;const Me=be.atVersion(1);if(Me===void 0)throw new Error("No context found for version 1.");return Me},B=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Je=r(70882),St=r(50236),Nt=r(19219),Wt=r(53974);const kt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",$t=be=>{(0,p.useEffect)(()=>{var Me,Ge;if(!be)return()=>{};const pt=be.querySelectorAll('head > link[rel="stylesheet"]');var st;let tt=(st=(Me=pt)===null||Me===void 0?void 0:Me.length)!==null&&st!==void 0?st:0;const ft=new CustomEvent(kt);if(!tt)return be.dispatchEvent(ft),()=>{};const ot=()=>{--tt===0&&be.dispatchEvent(ft)};return(Ge=pt)===null||Ge===void 0||Ge.forEach(Xe=>{Xe.addEventListener("load",ot)}),()=>{var Xe;(Xe=pt)===null||Xe===void 0||Xe.forEach(vt=>{vt.removeEventListener("load",ot)})}},[be])},qt=be=>{const[Me,Ge]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!be)return()=>{};Ge(!0);const pt=be.style;pt.setProperty("opacity","0");const st=()=>{Ge(!1),pt.setProperty("opacity","1")};return be.addEventListener(kt,st),()=>{be.removeEventListener(kt,st)}},[be]),Me},lt=be=>{const{element:Me,onAppend:Ge,children:pt}=be,[st,tt]=(0,p.useState)((0,Je.Ue)({...(0,St.Z)(),insertionPoint:void 0}));$t(Me);const ft=qt(Me),ot=(0,p.useCallback)(Xe=>{if(!Me||!Xe)return;tt((0,Je.Ue)({...(0,St.Z)(),insertionPoint:Me.querySelector("head")||void 0}));let vt=Xe.shadowRoot;vt||(vt=Xe.attachShadow({mode:"open"})),vt.replaceChildren(Me),typeof Ge=="function"&&Ge(vt)},[Me,Ge]);return(0,n.jsxs)(n.Fragment,{children:[ft&&(0,n.jsx)(Wt.Ex,{}),(0,n.jsxs)(Nt.ZP,{jss:st,sheetsManager:new Map,children:[(0,n.jsx)("div",{ref:ot,"data-testid":"techdocs-native-shadowroot"}),pt]})]})};var dt=r(54073);const ut=()=>{const{shadowRoot:be}=useTechDocsReaderPage();return be},ht=be=>{const Me=ut();return Me?be.map(Ge=>{var pt;return(pt=Me)===null||pt===void 0?void 0:pt.querySelectorAll(Ge)}).filter(Ge=>Ge.length).map(Ge=>Array.from(Ge)).flat():[]},Vt=be=>be.toString()&&be.rangeCount&&be.getRangeAt(0).getBoundingClientRect().top,Qt=(be=0)=>{const Me=ut(),[Ge,pt]=useState(null),st=useMemo(()=>debounce(()=>{const tt=Me,ft=tt.getSelection?tt.getSelection():document.getSelection();ft&&Vt(ft)?pt(ft):pt(null)},be),[Me,pt,be]);return useEffect(()=>(window.document.addEventListener("selectionchange",st),()=>{st.cancel(),window.document.removeEventListener("selectionchange",st)}),[st]),Ge}},52943:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{EmbeddedDocsRouter:function(){return se},Router:function(){return re},isTechDocsAvailable:function(){return A}});var n=r(52322),p=r(2784),V=r(73557),f=r(39709),H=r(53974),m=r(25271),h=r(89258),Z=r(65124),ye=r(86317);const le=({entity:te})=>{const q=(0,m.iB)(te);return(0,n.jsxs)(h.I6,{entityRef:q,children:[(0,n.jsx)(Z.b,{}),(0,n.jsx)(ye.F,{withSearch:!1})]})};var W=r(18662),ue=r(7476);const D="backstage.io/techdocs-ref",A=te=>{var q,K,R;return Boolean((R=te)===null||R===void 0||(K=R.metadata)===null||K===void 0||(q=K.annotations)===null||q===void 0?void 0:q[D])},re=()=>(0,n.jsxs)(V.Z5,{children:[(0,n.jsx)(V.AW,{path:"/",element:(0,n.jsx)(W.TechDocsIndexPage,{})}),(0,n.jsx)(V.AW,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(ue.TechDocsReaderPage,{})})]}),se=te=>{var q;const{children:K}=te,{entity:R}=(0,f.X2)(),w=(0,V.V$)([{path:"/*",element:(0,n.jsx)(le,{entity:R}),children:[{path:"*",element:K}]}]);return((q=R.metadata.annotations)===null||q===void 0?void 0:q[D])?w:(0,n.jsx)(H.sk,{annotation:D})}},92077:function(Rt,Le,r){"use strict";r.d(Le,{k:function(){return m},p:function(){return H}});var n=r(87612),p=r(23054),V=r(54847),f=r.n(V);class H{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(Z){const{kind:ye,namespace:le,name:W}=Z,D=`${await this.getApiOrigin()}/metadata/techdocs/${le}/${ye}/${W}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}async getEntityMetadata(Z){const{kind:ye,namespace:le,name:W}=Z,D=`${await this.getApiOrigin()}/metadata/entity/${le}/${ye}/${W}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}constructor(Z){(0,n._)(this,"configApi",void 0),(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"fetchApi",void 0),this.configApi=Z.configApi,this.discoveryApi=Z.discoveryApi,this.fetchApi=Z.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var Z;return(Z=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&Z!==void 0?Z:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(Z,ye){const{kind:le,namespace:W,name:ue}=Z,A=`${await this.getStorageUrl()}/${W}/${le}/${ue}/${ye}`,re=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let se="";switch(re.status){case 404:throw se="Page not found. ",ye||(se+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(se);case 500:throw se="Could not generate documentation or an error in the TechDocs backend. ",new Error(se);default:break}return re.text()}async syncEntityDocs(Z,ye=()=>{}){const{kind:le,namespace:W,name:ue}=Z,A=`${await this.getApiOrigin()}/sync/${W}/${le}/${ue}`,{token:re}=await this.identityApi.getCredentials();return new Promise((se,te)=>{const q=new V.EventSourcePolyfill(A,{withCredentials:!0,headers:re?{Authorization:`Bearer ${re}`}:{}});q.addEventListener("log",K=>{K.data&&ye(JSON.parse(K.data))}),q.addEventListener("finish",K=>{let R=!1;K.data&&({updated:R}=JSON.parse(K.data)),se(R?"updated":"cached")}),q.onerror=K=>{switch(q.close(),K.status){case 404:te(new p.dR(K.message));return;default:te(new Error(K.data));return}}})}async getBaseUrl(Z,ye,le){const{kind:W,namespace:ue,name:D}=ye,re=`${await this.getApiOrigin()}/static/docs/${ue}/${W}/${D}/${le}`;return new URL(Z,re.endsWith("/")?re:`${re}/`).toString()}constructor(Z){(0,n._)(this,"configApi",void 0),(0,n._)(this,"discoveryApi",void 0),(0,n._)(this,"identityApi",void 0),(0,n._)(this,"fetchApi",void 0),this.configApi=Z.configApi,this.discoveryApi=Z.discoveryApi,this.identityApi=Z.identityApi,this.fetchApi=Z.fetchApi}}},51953:function(Rt,Le,r){"use strict";r.d(Le,{D:function(){return n}});function n(p,V){return V.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(Rt,Le,r){"use strict";r.d(Le,{u:function(){return Z}});var n=r(52322),p=r(2784),V=r(53974),f=r(39709),H=r(42081),m=r(48431),h=r(68435);const Z=ye=>{const{initialFilter:le="owned",columns:W,actions:ue}=ye;return(0,n.jsx)(H.j,{children:(0,n.jsxs)(V.VY,{children:[(0,n.jsx)(V.yW,{title:"",children:(0,n.jsx)(V.qt,{children:"Discover documentation in your ecosystem."})}),(0,n.jsx)(f.UO,{children:(0,n.jsxs)(f._i,{children:[(0,n.jsxs)(f._i.Filters,{children:[(0,n.jsx)(m.f,{}),(0,n.jsx)(f.EW,{initialFilter:le}),(0,n.jsx)(f.dq,{}),(0,n.jsx)(f.xE,{})]}),(0,n.jsx)(f._i.Content,{children:(0,n.jsx)(h.n,{actions:ue,columns:W})})]})})]})})}},85478:function(Rt,Le,r){"use strict";r.d(Le,{f:function(){return W}});var n=r(52322),p=r(95573),V=r(51953),f=r(60871),H=r(53974),m=r(94339),h=r(16111),Z=r(24579),ye=r(14503),le=r(2784);const W=se=>{var te;const{entities:q}=se,K=(0,f.tg)(p.Fw),R=(0,f.h_)(f.Ds);if(!q)return null;var w,P;return(0,n.jsx)(H.Oh,{"data-testid":"docs-explore",children:!((te=q)===null||te===void 0)&&te.length?q.map((U,xe)=>(0,n.jsxs)(m.Z,{children:[(0,n.jsx)(h.Z,{children:(0,n.jsx)(H.hu,{title:(w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name})}),(0,n.jsx)(Z.Z,{children:U.metadata.description}),(0,n.jsx)(ye.Z,{children:(0,n.jsx)(H.Qj,{to:K({namespace:(0,V.D)((P=U.metadata.namespace)!==null&&P!==void 0?P:"default",R),kind:(0,V.D)(U.kind,R),name:(0,V.D)(U.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},xe)):null})};var ue=r(39709);const D={title:"All Documentation",filterPredicate:()=>!0},A=se=>{const{entities:te,group:q}=se,{loading:K,isOwnedEntity:R}=useEntityOwnership(),w=te.filter(U=>q.filterPredicate==="ownedByUser"?K?!1:R(U):typeof q.filterPredicate=="function"&&q.filterPredicate(U)),P=(()=>typeof q.title=="string"?_jsx(ContentHeader,{title:q.title}):q.title)();return w.length===0?null:_jsxs(Content,{children:[P,_jsx(DocsCardGrid,{entities:w})]})},re=se=>{const{loading:te,error:q,entities:K}=useEntityList();if(q)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:q.toString()})});if(te)return _jsx(Progress,{});if(K.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var R,w;return K.sort((P,U)=>((R=P.metadata.title)!==null&&R!==void 0?R:P.metadata.name).localeCompare((w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name)),_jsx(Content,{children:(se.groups||[D]).map((P,U)=>_jsx(A,{entities:K,group:P},`${P.title}-${U}`))})}},68435:function(Rt,Le,r){"use strict";r.d(Le,{H:function(){return K},n:function(){return R}});var n=r(52322),p=r(2784),V=r(95074),f=r(76635),H=r(53974),m=r(39709),h=r(60871),Z=r(25271),ye=r(95573),le=r(39981),W=r(2337),ue=r(11640),D=r(28347);const A=(0,W.Z)({root:{color:"#f3ba37"}})(ue.Z),re={createCopyDocsUrlAction(w){return P=>({icon:()=>(0,n.jsx)(le.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${P.resolved.docsUrl}`)})},createStarEntityAction(w,P){return U=>{const xe=U.entity,Ce=w(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ce?(0,n.jsx)(A,{}):(0,n.jsx)(D.Z,{}),tooltip:Ce?"Remove from favorites":"Add to favorites",onClick:()=>P(xe)}}}};function se(w){return w.metadata.title||w.metadata.name}const te={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,n.jsx)(H.uw,{value:(0,n.jsx)(H.rU,{to:w.resolved.docsUrl,children:se(w.entity)}),subvalue:w.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,n.jsx)(m.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var q=r(51953);const K=w=>{const{entities:P,title:U,loading:xe,columns:Ce,actions:B,options:Je}=w,[,St]=(0,V.Z)(),Nt=(0,h.tg)(ye.Fw),Wt=(0,h.h_)(h.Ds);if(!P)return null;const kt=P.map(lt=>{const dt=(0,m.hF)(lt,Z.S4);var ut;return{entity:lt,resolved:{docsUrl:Nt({namespace:(0,q.D)((ut=lt.metadata.namespace)!==null&&ut!==void 0?ut:"default",Wt),kind:(0,q.D)(lt.kind,Wt),name:(0,q.D)(lt.metadata.name,Wt)}),ownedByRelations:dt,ownedByRelationsTitle:dt.map(ht=>(0,m.$3)(ht,{defaultKind:"group"})).join(", ")}}}),$t=[te.createNameColumn(),te.createOwnerColumn(),te.createTypeColumn()],qt=[re.createCopyDocsUrlAction(St)];return(0,n.jsx)(n.Fragment,{children:xe||kt&&kt.length>0?(0,n.jsx)(H.iA,{isLoading:xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Je},data:kt,columns:Ce||$t,actions:B||qt,title:U?`${U} (${kt.length})`:`All (${kt.length})`}):(0,n.jsx)(H.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,n.jsx)(H.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};K.columns=te,K.actions=re;const R=w=>{var P;const{columns:U,actions:xe,options:Ce}=w,{loading:B,error:Je,entities:St,filters:Nt}=(0,m.wp)(),{isStarredEntity:Wt,toggleStarredEntity:kt}=(0,m.CR)(),[,$t]=(0,V.Z)();var qt;const lt=(0,f.capitalize)((qt=(P=Nt.user)===null||P===void 0?void 0:P.value)!==null&&qt!==void 0?qt:"all"),dt=[re.createCopyDocsUrlAction($t),re.createStarEntityAction(Wt,kt)];return Je?(0,n.jsx)(H.GB,{severity:"error",title:"Could not load available documentation.",children:(0,n.jsx)(H.Oi,{language:"text",text:Je.toString()})}):(0,n.jsx)(K,{title:lt,entities:St,loading:B,actions:xe||dt,columns:U,options:Ce})};R.columns=te,R.actions=re},18662:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{TechDocsIndexPage:function(){return H}});var n=r(52322),p=r(2784),V=r(73557),f=r(3482);const H=m=>(0,V.pC)()||(0,n.jsx)(f.u,{...m})},42081:function(Rt,Le,r){"use strict";r.d(Le,{j:function(){return H}});var n=r(52322),p=r(2784),V=r(53974),f=r(60871);const H=m=>{const{children:h}=m,Z=(0,f.h_)(f.Ds);var ye;const le=`Documentation available in ${(ye=Z.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,n.jsx)(V.g9,{title:"Documentation",subtitle:le,themeId:"documentation",children:h})}},48431:function(Rt,Le,r){"use strict";r.d(Le,{f:function(){return f}});var n=r(2784),p=r(39709);class V{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:H}=(0,p.wp)();return(0,n.useEffect)(()=>{H({techdocs:new V})},[H]),null}},89258:function(Rt,Le,r){"use strict";r.d(Le,{I6:function(){return W},Jl:function(){return le},s4:function(){return m}});var n=r(61886),p=r(92077),V=r(95573),f=r(60871),H=r(15096);const m=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:n.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,identityApi:re,fetchApi:se})=>new p.k({configApi:D,discoveryApi:A,identityApi:re,fetchApi:se})}),(0,f.ni)({api:n.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,fetchApi:re})=>new p.p({configApi:D,discoveryApi:A,fetchApi:re})})],routes:{root:V._Z,docRoot:V.Fw,entityContent:V.pd}}),h=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(D=>D.Router),mountPoint:V._Z})),Z=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(D=>D.EmbeddedDocsRouter),mountPoint:V.pd})),ye=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(D=>D.TechDocsCustomHome),mountPoint:V._Z})),le=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(D=>D.TechDocsIndexPage),mountPoint:V._Z})),W=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(D=>D.TechDocsReaderPage),mountPoint:V.Fw})),ue=m.provide((0,H.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(D=>D.TechDocsSearchResultListItem),predicate:D=>D.type==="techdocs"}))},7476:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{TechDocsReaderLayout:function(){return W},TechDocsReaderPage:function(){return ue}});var n=r(52322),p=r(2784),V=r(73557),f=r(53974),H=r(61886),m=r(86317),h=r(93225),Z=r(65124),ye=r(95573),le=r(60871);const W=D=>{const{withSearch:A,withHeader:re=!0}=D;return(0,n.jsxs)(f.T3,{themeId:"documentation",children:[re&&(0,n.jsx)(h.S,{}),(0,n.jsx)(Z.b,{}),(0,n.jsx)(m.F,{withSearch:A})]})},ue=D=>{const{kind:A,name:re,namespace:se}=(0,le.Oi)(ye.Fw),{children:te,entityRef:q={kind:A,name:re,namespace:se}}=D,K=(0,V.pC)();if(!te){const w=K?p.Children.toArray(K.props.children):[];var R;const U=w.flatMap(xe=>{var Ce,B;return(R=(B=xe)===null||B===void 0||(Ce=B.props)===null||Ce===void 0?void 0:Ce.children)!==null&&R!==void 0?R:[]}).find(xe=>!(0,le.IY)(xe,H.Zz)&&!(0,le.IY)(xe,H.jM));return(0,n.jsx)(H.ZS,{entityRef:q,children:U||(0,n.jsx)(W,{})})}return(0,n.jsx)(H.ZS,{entityRef:q,children:({metadata:w,entityMetadata:P,onReady:U})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(f.T3,{themeId:"documentation",children:te instanceof Function?te({entityRef:q,techdocsMetadataValue:w.value,entityMetadataValue:P.value,onReady:U}):te})})})}},86317:function(Rt,Le,r){"use strict";r.d(Le,{F:function(){return ae}});var n=r(52322),p=r(2784),V=r(79692),f=r(60905),H=r(61886),m=r(53974),h=r(22478),Z=r(4614),ye=r(77277),le=r(99688),W=r(12420),ue=r(90436),D=r(61837),A=r(4190),re=r(87685);const se=(0,V.Z)(y=>(0,W.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),te=({buildLog:y,onClose:I})=>{const M=se(),z=y.length===0?"Waiting for logs...":y.join(`
|
|
37
|
+
`);return(0,n.jsxs)(f.Z,{container:!0,direction:"column",className:M.root,spacing:0,wrap:"nowrap",children:[(0,n.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,n.jsx)(ue.Z,{variant:"h5",children:"Build Details"}),(0,n.jsx)(D.Z,{title:"Close the drawer",onClick:I,color:"inherit",children:(0,n.jsx)(re.Z,{})},"dismiss")]}),(0,n.jsx)(f.Z,{item:!0,xs:!0,children:(0,n.jsx)(m.nU,{text:z,classes:{root:M.logs}})})]})},q=({buildLog:y})=>{const I=se(),[M,z]=(0,p.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye.Z,{color:"inherit",onClick:()=>z(!0),children:"Show Build Logs"}),(0,n.jsx)(A.ZP,{classes:{paper:I.paper},anchor:"right",open:M,onClose:()=>z(!1),children:(0,n.jsx)(te,{buildLog:y,onClose:()=>z(!1)})})]})};var K=r(60871);const R=({errorMessage:y})=>{const I=(0,K.h_)(K.Ds).getOptionalString("techdocs.builder");let M="";return I!=="local"&&(M="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,n.jsx)(m.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:M})};var w=r(95481);const P=(0,V.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),U=()=>{let y=null;const I=P(),{state:M,contentReload:z,contentErrorMessage:de,syncErrorMessage:Se,buildLog:Oe}=(0,w.DK)();return M==="INITIAL_BUILD"&&(y=(0,n.jsx)(le.Z,{classes:{root:I.root},variant:"outlined",severity:"info",icon:(0,n.jsx)(Z.Z,{size:"24px"}),action:(0,n.jsx)(q,{buildLog:Oe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),M==="CONTENT_STALE_REFRESHING"&&(y=(0,n.jsx)(le.Z,{variant:"outlined",severity:"info",icon:(0,n.jsx)(Z.Z,{size:"24px"}),action:(0,n.jsx)(q,{buildLog:Oe}),classes:{root:I.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(y=(0,n.jsx)(le.Z,{variant:"outlined",severity:"success",action:(0,n.jsx)(ye.Z,{color:"inherit",onClick:()=>z(),children:"Refresh"}),classes:{root:I.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(y=(0,n.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,n.jsx)(q,{buildLog:Oe}),classes:{root:I.root,message:I.message},children:["Building a newer version of this documentation failed."," ",Se]})),M==="CONTENT_NOT_FOUND"&&(y=(0,n.jsxs)(n.Fragment,{children:[Se&&(0,n.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,n.jsx)(q,{buildLog:Oe}),classes:{root:I.root,message:I.message},children:["Building a newer version of this documentation failed."," ",Se]}),(0,n.jsx)(R,{errorMessage:de})]})),y};var xe=r(60364),Ce=r(41156),B=r(32838),Je=r(35368),St=r.n(Je);const Nt=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Wt=/^https:\/\/fonts\.googleapis\.com/,kt=/^https:\/\/fonts\.gstatic\.com/,$t=y=>y.nodeName==="LINK",qt=y=>{var I;const M=((I=y)===null||I===void 0?void 0:I.getAttribute("href"))||"",z=M.match(Nt),de=M.match(Wt),Se=M.match(kt);return z||de||Se},lt=y=>($t(y)&&!qt(y)&&y.remove(),y),dt=y=>y.nodeName==="IFRAME",ut=(y,I)=>{const M=y.getAttribute("src")||"";try{const{host:z}=new URL(M);return I.includes(z)}catch{return!1}},ht=y=>I=>(dt(I)&&!ut(I,y)&&I.remove(),I),Vt=()=>{const y=(0,K.h_)(K.Ds);return(0,p.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},Qt=()=>{const y=Vt();return(0,p.useCallback)(async I=>{var M;const z=(M=y)===null||M===void 0?void 0:M.getOptionalStringArray("allowedIframeHosts");St().addHook("beforeSanitizeElements",lt);const de=["link"];return z&&(de.push("iframe"),St().addHook("beforeSanitizeElements",ht(z))),St().sanitize(I.outerHTML,{ADD_TAGS:de,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var be=r(41128),Me=({theme:y})=>`
|
|
38
|
+
/*================== Variables ==================*/
|
|
39
|
+
/*
|
|
40
|
+
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
+
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
:host {
|
|
45
|
+
/* FONT */
|
|
46
|
+
--md-default-fg-color: ${y.palette.text.primary};
|
|
47
|
+
--md-default-fg-color--light: ${y.palette.text.secondary};
|
|
48
|
+
--md-default-fg-color--lighter: ${(0,be.$n)(y.palette.text.secondary,.7)};
|
|
49
|
+
--md-default-fg-color--lightest: ${(0,be.$n)(y.palette.text.secondary,.3)};
|
|
50
|
+
|
|
51
|
+
/* BACKGROUND */
|
|
52
|
+
--md-default-bg-color:${y.palette.background.default};
|
|
53
|
+
--md-default-bg-color--light: ${y.palette.background.paper};
|
|
54
|
+
--md-default-bg-color--lighter: ${(0,be.$n)(y.palette.background.paper,.7)};
|
|
55
|
+
--md-default-bg-color--lightest: ${(0,be.$n)(y.palette.background.paper,.3)};
|
|
56
|
+
|
|
57
|
+
/* PRIMARY */
|
|
58
|
+
--md-primary-fg-color: ${y.palette.primary.main};
|
|
59
|
+
--md-primary-fg-color--light: ${y.palette.primary.light};
|
|
60
|
+
--md-primary-fg-color--dark: ${y.palette.primary.dark};
|
|
61
|
+
--md-primary-bg-color: ${y.palette.primary.contrastText};
|
|
62
|
+
--md-primary-bg-color--light: ${(0,be.$n)(y.palette.primary.contrastText,.7)};
|
|
63
|
+
|
|
64
|
+
/* ACCENT */
|
|
65
|
+
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
+
|
|
67
|
+
/* SHADOW */
|
|
68
|
+
--md-shadow-z1: ${y.shadows[1]};
|
|
69
|
+
--md-shadow-z2: ${y.shadows[2]};
|
|
70
|
+
--md-shadow-z3: ${y.shadows[3]};
|
|
71
|
+
|
|
72
|
+
/* EXTENSIONS */
|
|
73
|
+
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
+
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
+
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
+
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
+
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
+
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
+
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
+
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
+
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
+
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
+
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
+
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
+
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
+
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
+
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
+
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
+
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
+
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
+
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
+
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
+
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
+
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
+
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
+
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
+
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
+
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
+
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
+
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
+
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host > * {
|
|
105
|
+
/* CODE */
|
|
106
|
+
--md-code-fg-color: ${y.palette.text.primary};
|
|
107
|
+
--md-code-bg-color: ${y.palette.background.paper};
|
|
108
|
+
--md-code-hl-color: ${(0,be.Fq)(y.palette.warning.main,.5)};
|
|
109
|
+
--md-code-hl-keyword-color: ${y.palette.type==="dark"?y.palette.primary.light:y.palette.primary.dark};
|
|
110
|
+
--md-code-hl-function-color: ${y.palette.type==="dark"?y.palette.secondary.light:y.palette.secondary.dark};
|
|
111
|
+
--md-code-hl-string-color: ${y.palette.type==="dark"?y.palette.success.light:y.palette.success.dark};
|
|
112
|
+
--md-code-hl-number-color: ${y.palette.type==="dark"?y.palette.error.light:y.palette.error.dark};
|
|
113
|
+
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
+
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
+
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
+
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
+
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
+
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
+
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
+
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
+
|
|
122
|
+
/* TYPESET */
|
|
123
|
+
--md-typeset-font-size: 1rem;
|
|
124
|
+
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
+
--md-typeset-a-color: ${y.palette.link};
|
|
126
|
+
--md-typeset-table-color: ${y.palette.text.primary};
|
|
127
|
+
--md-typeset-del-color: ${y.palette.type==="dark"?(0,be.Fq)(y.palette.error.dark,.5):(0,be.Fq)(y.palette.error.light,.5)};
|
|
128
|
+
--md-typeset-ins-color: ${y.palette.type==="dark"?(0,be.Fq)(y.palette.success.dark,.5):(0,be.Fq)(y.palette.success.light,.5)};
|
|
129
|
+
--md-typeset-mark-color: ${y.palette.type==="dark"?(0,be.Fq)(y.palette.warning.dark,.5):(0,be.Fq)(y.palette.warning.light,.5)};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media screen and (max-width: 76.1875em) {
|
|
133
|
+
:host > * {
|
|
134
|
+
/* TYPESET */
|
|
135
|
+
--md-typeset-font-size: .9rem;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media screen and (max-width: 600px) {
|
|
140
|
+
:host > * {
|
|
141
|
+
/* TYPESET */
|
|
142
|
+
--md-typeset-font-size: .7rem;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`,Ge=({theme:y})=>`
|
|
146
|
+
/*================== Reset ==================*/
|
|
147
|
+
|
|
148
|
+
body {
|
|
149
|
+
--md-text-color: var(--md-default-fg-color);
|
|
150
|
+
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
+
--md-text-font-family: ${y.typography.fontFamily};
|
|
152
|
+
font-family: var(--md-text-font-family);
|
|
153
|
+
background-color: unset;
|
|
154
|
+
}
|
|
155
|
+
`;const pt="224px";var st=({theme:y,sidebar:I})=>`
|
|
156
|
+
/*================== Layout ==================*/
|
|
157
|
+
|
|
158
|
+
/* mkdocs material v9 compat */
|
|
159
|
+
.md-nav__title {
|
|
160
|
+
color: var(--md-default-fg-color);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.md-grid {
|
|
164
|
+
max-width: 100%;
|
|
165
|
+
margin: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.md-nav {
|
|
169
|
+
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
+
}
|
|
171
|
+
.md-nav__link {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
}
|
|
176
|
+
.md-nav__icon {
|
|
177
|
+
height: 20px !important;
|
|
178
|
+
width: 20px !important;
|
|
179
|
+
margin-left:${y.spacing(1)}px;
|
|
180
|
+
}
|
|
181
|
+
.md-nav__icon svg {
|
|
182
|
+
margin: 0;
|
|
183
|
+
width: 20px !important;
|
|
184
|
+
height: 20px !important;
|
|
185
|
+
}
|
|
186
|
+
.md-nav__icon:after {
|
|
187
|
+
width: 20px !important;
|
|
188
|
+
height: 20px !important;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
+
text-decoration: underline;
|
|
193
|
+
color: var(--md-typeset-a-color);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.md-main__inner {
|
|
197
|
+
margin-top: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.md-sidebar {
|
|
201
|
+
bottom: 75px;
|
|
202
|
+
position: fixed;
|
|
203
|
+
width: 16rem;
|
|
204
|
+
overflow-y: auto;
|
|
205
|
+
overflow-x: hidden;
|
|
206
|
+
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
+
scrollbar-width: thin;
|
|
208
|
+
}
|
|
209
|
+
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
+
width: calc(12.1rem);
|
|
211
|
+
}
|
|
212
|
+
.md-sidebar--secondary {
|
|
213
|
+
right: ${y.spacing(3)}px;
|
|
214
|
+
}
|
|
215
|
+
.md-sidebar::-webkit-scrollbar {
|
|
216
|
+
width: 5px;
|
|
217
|
+
}
|
|
218
|
+
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
+
width: 5px;
|
|
220
|
+
height: 5px;
|
|
221
|
+
}
|
|
222
|
+
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
+
background: #eee;
|
|
224
|
+
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
+
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
+
border-radius: 3px;
|
|
227
|
+
}
|
|
228
|
+
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
+
width: 5px;
|
|
230
|
+
background: rgb(193, 193, 193);
|
|
231
|
+
border: transparent;
|
|
232
|
+
border-radius: 3px;
|
|
233
|
+
}
|
|
234
|
+
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
+
background: rgb(125, 125, 125);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.md-content {
|
|
239
|
+
max-width: calc(100% - 16rem * 2);
|
|
240
|
+
margin-left: 16rem;
|
|
241
|
+
margin-bottom: 50px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.md-footer {
|
|
245
|
+
position: fixed;
|
|
246
|
+
bottom: 0px;
|
|
247
|
+
pointer-events: none;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.md-footer-nav__link, .md-footer__link {
|
|
251
|
+
pointer-events: all;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.md-footer__title {
|
|
255
|
+
background-color: unset;
|
|
256
|
+
}
|
|
257
|
+
.md-footer-nav__link, .md-footer__link {
|
|
258
|
+
width: 16rem;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.md-dialog {
|
|
262
|
+
background-color: unset;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@media screen and (min-width: 76.25em) {
|
|
266
|
+
.md-sidebar {
|
|
267
|
+
height: auto;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@media screen and (max-width: 76.1875em) {
|
|
272
|
+
.md-nav {
|
|
273
|
+
transition: none !important;
|
|
274
|
+
background-color: var(--md-default-bg-color)
|
|
275
|
+
}
|
|
276
|
+
.md-nav--primary .md-nav__title {
|
|
277
|
+
cursor: auto;
|
|
278
|
+
color: var(--md-default-fg-color);
|
|
279
|
+
font-weight: 700;
|
|
280
|
+
white-space: normal;
|
|
281
|
+
line-height: 1rem;
|
|
282
|
+
height: auto;
|
|
283
|
+
display: flex;
|
|
284
|
+
flex-flow: column;
|
|
285
|
+
row-gap: 1.6rem;
|
|
286
|
+
padding: 1.2rem .8rem .8rem;
|
|
287
|
+
background-color: var(--md-default-bg-color);
|
|
288
|
+
}
|
|
289
|
+
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
+
box-shadow: none;
|
|
291
|
+
}
|
|
292
|
+
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
+
border-top: none;
|
|
294
|
+
}
|
|
295
|
+
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
+
display: none;
|
|
297
|
+
}
|
|
298
|
+
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
+
color: var(--md-default-fg-color);
|
|
300
|
+
position: static;
|
|
301
|
+
height: auto;
|
|
302
|
+
margin: 0 0 0 -0.2rem;
|
|
303
|
+
}
|
|
304
|
+
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
+
padding-top: 0;
|
|
306
|
+
}
|
|
307
|
+
.md-nav--primary .md-nav__item {
|
|
308
|
+
border-top: none;
|
|
309
|
+
}
|
|
310
|
+
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
+
font-size : var(--md-typeset-font-size);
|
|
312
|
+
}
|
|
313
|
+
.md-nav .md-source {
|
|
314
|
+
display: none;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.md-sidebar {
|
|
318
|
+
height: 100%;
|
|
319
|
+
}
|
|
320
|
+
.md-sidebar--primary {
|
|
321
|
+
width: 12.1rem !important;
|
|
322
|
+
z-index: 200;
|
|
323
|
+
left: ${I.isPinned?`calc(-12.1rem + ${pt})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
+
}
|
|
325
|
+
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
+
display: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.md-content {
|
|
330
|
+
max-width: 100%;
|
|
331
|
+
margin-left: 0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.md-header__button {
|
|
335
|
+
margin: 0.4rem 0;
|
|
336
|
+
margin-left: 0.4rem;
|
|
337
|
+
padding: 0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.md-overlay {
|
|
341
|
+
left: 0;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.md-footer {
|
|
345
|
+
position: static;
|
|
346
|
+
padding-left: 0;
|
|
347
|
+
}
|
|
348
|
+
.md-footer-nav__link {
|
|
349
|
+
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
+
width: 50%;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
@media screen and (max-width: 600px) {
|
|
355
|
+
.md-sidebar--primary {
|
|
356
|
+
left: -12.1rem !important;
|
|
357
|
+
width: 12.1rem;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
@media print {
|
|
363
|
+
.md-sidebar,
|
|
364
|
+
#toggle-sidebar {
|
|
365
|
+
display: none;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.md-content {
|
|
369
|
+
margin: 0;
|
|
370
|
+
width: 100%;
|
|
371
|
+
max-width: 100%;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
`;const tt=["h1","h2","h3","h4","h5","h6"];var ft=({theme:y})=>`
|
|
375
|
+
/*================== Typeset ==================*/
|
|
376
|
+
|
|
377
|
+
.md-typeset {
|
|
378
|
+
font-size: var(--md-typeset-font-size);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
${tt.reduce((I,M)=>{var z;const de=(z=y.typography.htmlFontSize)!==null&&z!==void 0?z:16,Se=y.typography[M],{lineHeight:Oe,fontFamily:et,fontWeight:rt,fontSize:xt}=Se,wt=it=>{let ke=1;return typeof it=="number"&&(ke=it/de*.6),typeof it=="string"&&(ke=it.replace("rem","")),`calc(${ke} * var(--md-typeset-font-size))`};return I.concat(`
|
|
382
|
+
.md-typeset ${M} {
|
|
383
|
+
color: var(--md-default-fg-color);
|
|
384
|
+
line-height: ${Oe};
|
|
385
|
+
font-family: ${et};
|
|
386
|
+
font-weight: ${rt};
|
|
387
|
+
font-size: ${wt(xt)};
|
|
388
|
+
}
|
|
389
|
+
`)},"")}
|
|
390
|
+
|
|
391
|
+
.md-typeset .md-content__button {
|
|
392
|
+
color: var(--md-default-fg-color);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.md-typeset hr {
|
|
396
|
+
border-bottom: 0.05rem dotted ${y.palette.divider};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.md-typeset details {
|
|
400
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
401
|
+
}
|
|
402
|
+
.md-typeset details summary {
|
|
403
|
+
padding-left: 2.5rem !important;
|
|
404
|
+
}
|
|
405
|
+
.md-typeset details summary:before,
|
|
406
|
+
.md-typeset details summary:after {
|
|
407
|
+
top: 50% !important;
|
|
408
|
+
width: 20px !important;
|
|
409
|
+
height: 20px !important;
|
|
410
|
+
transform: rotate(0deg) translateY(-50%) !important;
|
|
411
|
+
}
|
|
412
|
+
.md-typeset details[open] > summary:after {
|
|
413
|
+
transform: rotate(90deg) translateX(-50%) !important;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.md-typeset blockquote {
|
|
417
|
+
color: var(--md-default-fg-color--light);
|
|
418
|
+
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.md-typeset table:not([class]) {
|
|
422
|
+
font-size: var(--md-typeset-font-size);
|
|
423
|
+
border: 1px solid var(--md-default-fg-color);
|
|
424
|
+
border-bottom: none;
|
|
425
|
+
border-collapse: collapse;
|
|
426
|
+
}
|
|
427
|
+
.md-typeset table:not([class]) th {
|
|
428
|
+
font-weight: bold;
|
|
429
|
+
}
|
|
430
|
+
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
431
|
+
border-bottom: 1px solid var(--md-default-fg-color);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
435
|
+
background-color: hsla(0, 0%, 0%, 0.32);
|
|
436
|
+
}
|
|
437
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
438
|
+
background-color: hsla(0, 0%, 0%, 0.87);
|
|
439
|
+
}
|
|
440
|
+
`,ot=()=>`
|
|
441
|
+
/*================== Animations ==================*/
|
|
442
|
+
/*
|
|
443
|
+
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
444
|
+
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
445
|
+
*/
|
|
446
|
+
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
447
|
+
transition: none;
|
|
448
|
+
}
|
|
449
|
+
`,Xe=({theme:y})=>`
|
|
450
|
+
/*================== Extensions ==================*/
|
|
451
|
+
|
|
452
|
+
/* HIGHLIGHT */
|
|
453
|
+
.highlight .md-clipboard:after {
|
|
454
|
+
content: unset;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.highlight .nx {
|
|
458
|
+
color: ${y.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* CODE HILITE */
|
|
462
|
+
.codehilite .gd {
|
|
463
|
+
background-color: ${y.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.codehilite .gi {
|
|
467
|
+
background-color: ${y.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* TABBED */
|
|
471
|
+
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
472
|
+
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
473
|
+
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
474
|
+
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
475
|
+
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
476
|
+
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
477
|
+
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
478
|
+
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
479
|
+
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
480
|
+
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
481
|
+
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
482
|
+
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
483
|
+
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
484
|
+
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
485
|
+
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
486
|
+
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
487
|
+
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
488
|
+
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
489
|
+
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
490
|
+
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
491
|
+
color: var(--md-accent-fg-color);
|
|
492
|
+
border-color: var(--md-accent-fg-color);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/* TASK-LIST */
|
|
496
|
+
.task-list-control .task-list-indicator::before {
|
|
497
|
+
background-color: ${y.palette.action.disabledBackground};
|
|
498
|
+
}
|
|
499
|
+
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
500
|
+
background-color: ${y.palette.success.main};
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/* ADMONITION */
|
|
504
|
+
.admonition {
|
|
505
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
506
|
+
}
|
|
507
|
+
.admonition .admonition-title {
|
|
508
|
+
padding-left: 2.5rem !important;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.admonition .admonition-title:before {
|
|
512
|
+
top: 50% !important;
|
|
513
|
+
width: 20px !important;
|
|
514
|
+
height: 20px !important;
|
|
515
|
+
transform: translateY(-50%) !important;
|
|
516
|
+
}
|
|
517
|
+
`;const vt=[Me,Ge,st,ft,ot,Xe],mt=()=>(0,m.Pf)(),yt=()=>{const y=mt(),I=(0,xe.Z)();return(0,p.useMemo)(()=>{const M={theme:I,sidebar:y};return vt.reduce((z,de)=>z+de(M),"")},[I,y])},Cn=()=>{const y=yt();return(0,p.useCallback)(I=>(I.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),I),[y])},fn=(y,I,M)=>{const z=y==="src"&&I.endsWith(".svg"),de=!I.match(/^([a-z]*:)?\/\//i),Se=I.startsWith(M);return z&&(de||Se)},hn=({techdocsStorageApi:y,entityId:I,path:M})=>async z=>{const de=await y.getApiOrigin(),Se=async(Oe,et)=>{for(const rt of Oe)if(rt.hasAttribute(et)){const xt=rt.getAttribute(et);if(!xt)return;const wt=await y.getBaseUrl(xt,I,M);if(fn(et,xt,de))try{const ke=await(await fetch(wt,{credentials:"include"})).text();rt.setAttribute(et,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(ke)))}`)}catch{rt.setAttribute("alt",`Error: ${xt}`)}else rt.setAttribute(et,wt)}};return await Promise.all([Se(z.querySelectorAll("img"),"src"),Se(z.querySelectorAll("script"),"src"),Se(z.querySelectorAll("source"),"src"),Se(z.querySelectorAll("link"),"href"),Se(z.querySelectorAll("a[download]"),"href")]),z};var wn=r(40556),pn=r(67097),vn=r(28316),jn=r(82717),on=r.n(jn);const yn=y=>I=>{var M,z,de,Se,Oe,et;const rt=I.querySelector('[title="Edit this page"]');if(!rt||!rt.href)return I;const xt=new URL(rt.href),wt=y.byUrl(xt);if(((M=wt)===null||M===void 0?void 0:M.type)!=="github"&&((z=wt)===null||z===void 0?void 0:z.type)!=="gitlab")return I;const it=((de=I.querySelector("article>h1"))===null||de===void 0?void 0:de.childNodes[0].textContent)||"",ke=encodeURIComponent(`Documentation Feedback: ${it}`),bt=encodeURIComponent(`Page source:
|
|
518
|
+
${rt.href}
|
|
519
|
+
|
|
520
|
+
Feedback:`),Xt=((Se=wt)===null||Se===void 0?void 0:Se.type)==="github"?(0,wn.BT)(xt.href,"blob"):xt.href,Tt=on()(Xt),Ft=`/${Tt.organization}/${Tt.name}`,en=rt.cloneNode();switch((Oe=wt)===null||Oe===void 0?void 0:Oe.type){case"gitlab":en.href=`${xt.origin}${Ft}/issues/new?issue[title]=${ke}&issue[description]=${bt}`;break;case"github":en.href=`${xt.origin}${Ft}/issues/new?title=${ke}&body=${bt}`;break;default:return I}return vn.render(p.createElement(pn.Z),en),en.style.paddingLeft="5px",en.title="Leave feedback for this page",en.id="git-feedback-link",(et=rt)===null||et===void 0||et.insertAdjacentElement("beforebegin",en),I};var En=r(44882);const nt=()=>y=>{var I;const M=y.querySelector('.md-header label[for="__drawer"]'),z=y.querySelector("article");if(!M||!z)return y;const de=M.cloneNode();return vn.render(p.createElement(En.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(I=z)===null||I===void 0||I.prepend(de),y},_t=()=>y=>(((M,z)=>{Array.from(M).filter(de=>de.hasAttribute(z)).forEach(de=>{const Se=de.getAttribute(z);if(Se){Se.match(/^https?:\/\//i)&&de.setAttribute("target","_blank");try{const Oe=zt(window.location.href);de.setAttribute(z,new URL(Se,Oe).toString())}catch{de.replaceWith(de.textContent||Se)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function zt(y){const I=new URL(y);return!I.pathname.endsWith("/")&&!I.pathname.endsWith(".html")&&(I.pathname+="/"),I.toString()}const qe=({baseUrl:y,onClick:I})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(z=>{z.addEventListener("click",de=>{const Oe=z.getAttribute("href");Oe&&Oe.startsWith(y)&&!z.hasAttribute("download")&&(de.preventDefault(),I(de,Oe))})}),M);var Rn=r(15459),ln=r(80030),kn=r(72379),xn=r(41547),Zn=r(95074);const _n=(0,Rn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(ln.ZP),In=()=>(0,n.jsx)(kn.Z,{children:(0,n.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"})}),Mn=({text:y})=>{const[I,M]=(0,p.useState)(!1),[,z]=(0,Zn.Z)(),de=(0,p.useCallback)(()=>{z(y),M(!0)},[y,z]),Se=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,n.jsx)(_n,{title:"Copied to clipboard",placement:"left",open:I,onClose:Se,leaveDelay:1e3,children:(0,n.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:de,children:(0,n.jsx)(In,{})})})},we=y=>I=>{const M=I.querySelectorAll("pre > code");for(const Se of M){var z,de;const Oe=Se.textContent||"",et=document.createElement("div");(de=Se)===null||de===void 0||(z=de.parentElement)===null||z===void 0||z.prepend(et),vn.render((0,n.jsx)(xn.Z,{theme:y,children:(0,n.jsx)(Mn,{text:Oe})}),et)}return I},pe=()=>y=>{var I;return(I=y.querySelector(".md-header"))===null||I===void 0||I.remove(),y},Pe=()=>y=>{var I,M;return(I=y.querySelector(".md-footer .md-copyright"))===null||I===void 0||I.remove(),(M=y.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),y},G=({onLoading:y,onLoaded:I})=>M=>(y(),M.addEventListener(H.Ox,function z(){I(),M.removeEventListener(H.Ox,z)}),M),N=()=>y=>(y.addEventListener(H.Ox,function I(){if(window.location.hash){var M,z;const de=window.location.hash.slice(1);(z=y)===null||z===void 0||(M=z.querySelector(`[id="${de}"]`))===null||M===void 0||M.scrollIntoView()}y.removeEventListener(H.Ox,I)}),y),ce=()=>y=>(setTimeout(()=>{var I;const M=(I=y)===null||I===void 0?void 0:I.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(de=>{var Se,Oe;const et=(Se=de)===null||Se===void 0?void 0:Se.querySelector("input");if(!(!((Oe=et)===null||Oe===void 0)&&Oe.checked)){var rt;(rt=et)===null||rt===void 0||rt.click()}}),M[M.length-1].scrollIntoView())},200),y),Ae=async(y,I)=>{let M;if(typeof y=="string")M=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)M=y;else throw new Error("dom is not a recognized type");for(const z of I)M=await z(M);return M};var Ue=r(73557);function _e(y,I){const M=new URL(I),z=`${M.origin}${M.pathname.replace(/\/$/,"")}`,de=y.replace(z,"").replace(/^\/+/,""),Se=new URL(`http://localhost/${de}`);return`${Se.pathname}${Se.search}${Se.hash}`}function Ct(){const y=(0,Ue.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(de=>{let Se=de;if(M)try{Se=_e(de,M)}catch{}y(Se)},[y,M])}const Dt="screen and (max-width: 76.1875em)",an=y=>{const I=Ct(),M=(0,xe.Z)(),z=(0,Ce.Z)(Dt),de=Qt(),Se=Cn(),Oe=(0,K.z$)(),et=(0,K.h_)(H.Dl),rt=(0,K.h_)(B.q3),{state:xt,path:wt,content:it}=(0,w.DK)(),[ke,bt]=(0,p.useState)(null),Xt=(0,H.ux)(ke),Tt=(0,p.useCallback)(()=>{if(!ke)return;ke.querySelectorAll(".md-sidebar").forEach(jt=>{if(z)jt.style.top="0px";else{var It,Yt,Zt;const bn=(It=document)===null||It===void 0?void 0:It.querySelector(".techdocs-reader-page");var mr;const ir=(mr=(Yt=bn)===null||Yt===void 0?void 0:Yt.getBoundingClientRect().top)!==null&&mr!==void 0?mr:0;var er;let Yn=(er=ke.getBoundingClientRect().top)!==null&&er!==void 0?er:0;const zr=ke.querySelector(".md-container > .md-tabs");var sr;const tr=(sr=(Zt=zr)===null||Zt===void 0?void 0:Zt.getBoundingClientRect().height)!==null&&sr!==void 0?sr:0;Yn<ir&&(Yn=ir),jt.style.top=`${Math.max(Yn,0)+tr}px`}jt.style.setProperty("opacity","1")})},[ke,z]);(0,p.useEffect)(()=>(window.addEventListener("resize",Tt),window.addEventListener("scroll",Tt,!0),()=>{window.removeEventListener("resize",Tt),window.removeEventListener("scroll",Tt,!0)}),[ke,Tt]);const Ft=(0,p.useCallback)(()=>{if(!ke)return;const Kt=ke.querySelector(".md-footer");Kt&&(Kt.style.width=`${ke.getBoundingClientRect().width}px`)},[ke]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ft),()=>{window.removeEventListener("resize",Ft)}),[ke,Ft]),(0,p.useEffect)(()=>{Xt||(Ft(),Tt())},[xt,Xt,Ft,Tt]);const en=(0,p.useCallback)((Kt,jt)=>Ae(Kt,[de,hn({techdocsStorageApi:et,entityId:y,path:jt}),_t(),nt(),pe(),Pe(),yn(rt),Se]),[y,rt,et,de,Se]),An=(0,p.useCallback)(async Kt=>Ae(Kt,[N(),ce(),we(M),qe({baseUrl:window.location.origin,onClick:(jt,It)=>{var Yt;const Zt=jt.ctrlKey||jt.metaKey,mr=new URL(It),er=((Yt=jt.target)===null||Yt===void 0?void 0:Yt.innerText)||It,sr=It.replace(window.location.origin,"");if(Oe.captureEvent("click",er,{attributes:{to:sr}}),mr.hash)if(Zt)window.open(It,"_blank");else{var bn,ir;I(It),(ir=Kt)===null||ir===void 0||(bn=ir.querySelector(`[id="${mr.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else Zt?window.open(It,"_blank"):I(It)}}),G({onLoading:()=>{},onLoaded:()=>{var jt;(jt=Kt.querySelector(".md-nav__title"))===null||jt===void 0||jt.removeAttribute("for")}}),G({onLoading:()=>{Array.from(Kt.querySelectorAll(".md-sidebar")).forEach(It=>{It.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,I,Oe]);return(0,p.useEffect)(()=>{if(!it)return()=>{};let Kt=!0;return en(it,wt).then(async jt=>{var It;if(!(!((It=jt)===null||It===void 0)&&It.innerHTML)||!Kt)return;window.scroll({top:0});const Yt=await An(jt);bt(Yt)}),()=>{Kt=!1}},[it,wt,en,An]),ke};var sn=r(8560);const cn=()=>{var y,I,M,z,de;const Se=(0,H.$L)(),{shadowRoot:Oe}=(0,H.x1)(),et=(y=Oe)===null||y===void 0?void 0:y.querySelector('[data-md-component="content"]'),rt=(I=Oe)===null||I===void 0?void 0:I.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let xt=(M=rt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!xt){var wt;xt=document.createElement("div"),xt.setAttribute("data-techdocs-addons-location","primary sidebar"),(wt=rt)===null||wt===void 0||wt.prepend(xt)}const it=(z=Oe)===null||z===void 0?void 0:z.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let ke=(de=it)===null||de===void 0?void 0:de.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!ke){var bt;ke=document.createElement("div"),ke.setAttribute("data-techdocs-addons-location","secondary sidebar"),(bt=it)===null||bt===void 0||bt.prepend(ke)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(sn.Z,{container:xt,children:Se.renderComponentsByLocation(H.oZ.PrimarySidebar)}),(0,n.jsx)(sn.Z,{container:et,children:Se.renderComponentsByLocation(H.oZ.Content)}),(0,n.jsx)(sn.Z,{container:ke,children:Se.renderComponentsByLocation(H.oZ.SecondarySidebar)})]})},oe=(0,V.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),ae=(0,w.m1)(y=>{var I,M;const{withSearch:z=!0,onReady:de}=y,Se=oe(),{entityMetadata:{value:Oe,loading:et},entityRef:rt,setShadowRoot:xt}=(0,H.x1)(),wt=an(rt),it=(0,p.useCallback)(ke=>{xt(ke),de instanceof Function&&de()},[xt,de]);return et===!1&&!Oe?(0,n.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):wt?(0,n.jsx)(m.VY,{children:(0,n.jsxs)(f.Z,{container:!0,children:[(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(U,{})}),z&&(0,n.jsx)(f.Z,{className:Se.search,xs:"auto",item:!0,children:(0,n.jsx)(h.S,{entityId:rt,entityTitle:(M=Oe)===null||M===void 0||(I=M.metadata)===null||I===void 0?void 0:I.title})}),(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(H.VA,{element:wt,onAppend:it,children:(0,n.jsx)(cn,{})})})]})}):(0,n.jsx)(m.VY,{children:(0,n.jsx)(f.Z,{container:!0,children:(0,n.jsx)(f.Z,{xs:12,item:!0,children:(0,n.jsx)(U,{})})})})}),Q=null},93225:function(Rt,Le,r){"use strict";r.d(Le,{S:function(){return se}});var n=r(52322),p=r(2784),V=r(18671),f=r(60905),H=r(98069),m=r(60364),h=r(73250),Z=r(61886),ye=r(39709),le=r(25271),W=r(53974),ue=r(60871),D=r(76635),A=r(95573);const re=(0,n.jsx)(H.Z,{animation:"wave",variant:"text",height:40}),se=te=>{var q,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:P}=te,U=(0,Z.$L)(),xe=(0,ue.h_)(ue.Ds),{title:Ce,setTitle:B,subtitle:Je,setSubtitle:St,entityRef:Nt,metadata:{value:Wt,loading:kt},entityMetadata:{value:$t,loading:qt}}=(0,Z.x1)();(0,p.useEffect)(()=>{Wt&&(B(Wt.site_name),St(()=>{let{site_description:st}=Wt;return(!st||st==="None")&&(st=""),st}))},[Wt,B,St]);const lt=xe.getOptional("app.title")||"Backstage",dt=[Ce,Je,lt].filter(Boolean).join(" | "),{locationMetadata:ut,spec:ht}=$t||{},Vt=(q=ht)===null||q===void 0?void 0:q.lifecycle,Qt=$t?(0,ye.hF)($t,le.S4):[],be=(0,ue.tg)(A._Z)(),Me=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(W.i9,{label:(0,D.capitalize)(((K=$t)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,n.jsx)(ye.dx,{color:"inherit",entityRef:Nt,title:(R=$t)===null||R===void 0?void 0:R.metadata.title,defaultKind:"Component"})}),Qt.length>0&&(0,n.jsx)(W.i9,{label:"Owner",value:(0,n.jsx)(ye.rI,{color:"inherit",entityRefs:Qt,defaultKind:"group"})}),Vt?(0,n.jsx)(W.i9,{label:"Lifecycle",value:Vt}):null,ut&&ut.type!=="dir"&&ut.type!=="file"?(0,n.jsx)(W.i9,{label:"",value:(0,n.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,n.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,n.jsx)(h.Z,{style:{marginTop:"-25px"}})}),(0,n.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:ut.target}):null]});return!qt&&$t===void 0||!kt&&Wt===void 0?null:(0,n.jsxs)(W.h4,{type:"Documentation",typeLink:be,title:Ce||re,subtitle:Je===""?void 0:Je||re,children:[(0,n.jsx)(V.Z,{titleTemplate:"%s",children:(0,n.jsx)("title",{children:dt})}),Me,P,U.renderComponentsByLocation(Z.oZ.Header)]})}},65124:function(Rt,Le,r){"use strict";r.d(Le,{b:function(){return ue}});var n=r(52322),p=r(2784),V=r(79692),f=r(15223),H=r(95544),m=r(80030),h=r(61837),Z=r(48348),ye=r(47603),le=r(61886);const W=(0,V.Z)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),ue=D=>{const A=W(),[re,se]=(0,p.useState)(null),te=(0,p.useCallback)(xe=>{se(xe.currentTarget)},[]),q=(0,p.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,le.x1)(),w=(0,le.$L)(),P=w.renderComponentsByLocation(le.oZ.Subheader),U=w.renderComponentsByLocation(le.oZ.Settings);return!P&&!U||R===!1&&!K?null:(0,n.jsx)(f.Z,{classes:A,...D.toolbarProps,children:(0,n.jsxs)(H.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,U?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.ZP,{title:"Settings",children:(0,n.jsx)(h.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:te,children:(0,n.jsx)(ye.Z,{})})}),(0,n.jsx)(Z.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:re,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(re),onClose:q,keepMounted:!0,children:(0,n.jsx)("div",{children:U})})]}):null]})})}},95481:function(Rt,Le,r){"use strict";r.d(Le,{DK:function(){return ue},m1:function(){return A}});var n=r(52322),p=r(2784),V=r(73557),f=r(61886),H=r(60871),m=r(64279),h=r(77446);function Z({contentLoading:re,content:se,activeSyncState:te}){return re||te==="BUILD_READY_RELOAD"||!se&&te==="CHECKING"?"CHECKING":!se&&te==="BUILDING"?"INITIAL_BUILD":se?te==="BUILDING"?"CONTENT_STALE_REFRESHING":te==="BUILD_READY"?"CONTENT_STALE_READY":te==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(re,se){const te={...re};switch(se.type){case"sync":se.state==="CHECKING"&&(te.buildLog=[]),te.activeSyncState=se.state,te.syncError=se.syncError;break;case"contentLoading":te.contentLoading=!0,te.contentError=void 0;break;case"content":typeof se.path=="string"&&(te.path=se.path),te.contentLoading=!1,te.content=se.content,te.contentError=se.contentError;break;case"buildLog":te.buildLog=te.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(te.activeSyncState)&&["contentLoading","content"].includes(se.type)&&(te.activeSyncState="UP_TO_DATE",te.buildLog=[]),te}function le(re,se,te,q){var K,R;const[w,P]=(0,p.useReducer)(ye,{activeSyncState:"CHECKING",path:q,contentLoading:!0,buildLog:[]}),U=(0,H.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{P({type:"contentLoading"});try{const Je=await U.getEntityDocs({kind:re,namespace:se,name:te},q);return P({type:"content",content:Je,path:q}),Je}catch(Je){P({type:"content",contentError:Je,path:q})}},[U,re,se,te,q]),Ce=(0,p.useRef)({content:void 0,reload:()=>{}});return Ce.current={content:w.content,reload:xe},(0,m.default)(async()=>{P({type:"sync",state:"CHECKING"});const Je=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await U.syncEntityDocs({kind:re,namespace:se,name:te},Nt=>{P({type:"buildLog",log:Nt})})){case"updated":Ce.current.content?P({type:"sync",state:"BUILD_READY"}):(Ce.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(St){P({type:"sync",state:"ERROR",syncError:St})}finally{clearTimeout(Je)}},[re,te,se,U,P,Ce]),{state:(0,p.useMemo)(()=>Z({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(R=w.syncError)===null||R===void 0?void 0:R.toString(),buildLog:w.buildLog}}const W=(0,p.createContext)({}),ue=()=>(0,p.useContext)(W),D=re=>{const{children:se}=re,{"*":te=""}=(0,V.UO)(),{entityRef:q}=(0,f.x1)(),{kind:K,namespace:R,name:w}=q,P=le(K,R,w,te);return(0,n.jsx)(W.Provider,{value:P,children:se instanceof Function?se(P):se})},A=re=>se=>(0,n.jsx)(D,{children:(0,n.jsx)(re,{...se})})},95573:function(Rt,Le,r){"use strict";r.d(Le,{Fw:function(){return V},_Z:function(){return p},pd:function(){return f}});var n=r(60871);const p=(0,n.NT)({id:"techdocs:index-page"}),V=(0,n.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,n.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Rt,Le,r){"use strict";r.r(Le),r.d(Le,{TechDocsSearchResultListItem:function(){return le}});var n=r(52322),p=r(2784),V=r(79692),f=r(49378),H=r(86136),m=r(90436),h=r(53974),Z=r(15096);const ye=(0,V.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),le=W=>{const{result:ue,highlight:D,lineClamp:A=5,asListItem:re=!0,asLink:se=!0,title:te,icon:q}=W,K=ye(),R=({children:U})=>se?(0,n.jsx)(h.rU,{noTrack:!0,to:ue.location,children:U}):(0,n.jsx)(n.Fragment,{children:U}),w=()=>{var U,xe,Ce,B;const Je=!((U=D)===null||U===void 0)&&U.fields.title?(0,n.jsx)(Z.FA,{text:D.fields.title,preTag:D.preTag,postTag:D.postTag}):ue.title,St=!((xe=D)===null||xe===void 0)&&xe.fields.entityTitle?(0,n.jsx)(Z.FA,{text:D.fields.entityTitle,preTag:D.preTag,postTag:D.postTag}):ue.entityTitle,Nt=!((Ce=D)===null||Ce===void 0)&&Ce.fields.name?(0,n.jsx)(Z.FA,{text:D.fields.name,preTag:D.preTag,postTag:D.postTag}):ue.name;return ue?(0,n.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,n.jsx)(R,{children:te||(0,n.jsxs)(n.Fragment,{children:[Je," | ",St!=null?St:Nt," docs"]})}),secondary:(0,n.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((B=D)===null||B===void 0)&&B.fields.text?(0,n.jsx)(Z.FA,{text:D.fields.text,preTag:D.preTag,postTag:D.postTag}):ue.text})}):null},P=({children:U})=>re?(0,n.jsxs)(n.Fragment,{children:[q&&(0,n.jsx)(H.Z,{children:typeof q=="function"?q(ue):q}),(0,n.jsx)("div",{className:K.flexContainer,children:U})]}):(0,n.jsx)(n.Fragment,{children:U});return(0,n.jsx)(P,{children:(0,n.jsx)(w,{})})}},22478:function(Rt,Le,r){"use strict";r.d(Le,{S:function(){return Z}});var n=r(52322),p=r(15096),V=r(2784),f=r(73557),H=r(55511);const m=ye=>{var le;return(le=ye)===null||le===void 0?void 0:le.document},h=ye=>{const{entityId:le,entityTitle:W,debounceTime:ue=150}=ye,[D,A]=(0,V.useState)(!1),re=(0,f.s0)(),{setFilters:se,result:{loading:te,value:q}}=(0,p.Rx)(),[K,R]=(0,V.useState)([]);(0,V.useEffect)(()=>{let Ce=!0;if(Ce&&q){const B=q.results.slice(0,10);R(B)}return()=>{Ce=!1}},[te,q]);const{kind:w,name:P,namespace:U}=le;(0,V.useEffect)(()=>{se(Ce=>({...Ce,kind:w,namespace:U,name:P}))},[w,U,P,se]);const xe=(Ce,B)=>{if(m(B)){const{location:Je}=B.document;re(Je)}};return(0,n.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,getOptionLabel:()=>"",filterOptions:Ce=>Ce,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Ce,highlight:B})=>(0,n.jsx)(H.TechDocsSearchResultListItem,{result:Ce,lineClamp:3,asListItem:!1,asLink:!1,title:Ce.title,highlight:B}),loading:te,inputDebounceTime:ue,inputPlaceholder:`Search ${W||le.name} docs`,freeSolo:!1})},Z=ye=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:ye.entityId};return(0,n.jsx)(p.Nd,{initialState:le,children:(0,n.jsx)(h,{...ye})})}},53260:function(){}},function(Rt){var Le=function(n){return Rt(Rt.s=n)};Rt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Le(81879)});var r=Rt.O()}]);})();
|
|
521
|
+
|
|
522
|
+
//# sourceMappingURL=main.4dd3806f.js.map
|