@techdocs/cli 1.3.1 → 1.3.2-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.
Files changed (44) hide show
  1. package/CHANGELOG.md +17 -3
  2. package/dist/embedded-app/index.html +1 -1
  3. package/dist/embedded-app/static/{1032.4eeed38c.chunk.js → 1032.8fd35a67.chunk.js} +2 -2
  4. package/dist/embedded-app/static/{1032.4eeed38c.chunk.js.map → 1032.8fd35a67.chunk.js.map} +1 -1
  5. package/dist/embedded-app/static/{1105.ea587869.chunk.js → 1105.a64b1340.chunk.js} +2 -2
  6. package/dist/embedded-app/static/{1105.ea587869.chunk.js.map → 1105.a64b1340.chunk.js.map} +1 -1
  7. package/dist/embedded-app/static/{184.c0ade3a9.chunk.js → 184.e1d97cce.chunk.js} +2 -2
  8. package/dist/embedded-app/static/{184.c0ade3a9.chunk.js.map → 184.e1d97cce.chunk.js.map} +1 -1
  9. package/dist/embedded-app/static/{2440.82725a72.chunk.js → 2440.c7f26fd3.chunk.js} +2 -2
  10. package/dist/embedded-app/static/{2440.82725a72.chunk.js.map → 2440.c7f26fd3.chunk.js.map} +1 -1
  11. package/dist/embedded-app/static/{5458.ab22b201.chunk.js → 5458.44fc0038.chunk.js} +2 -2
  12. package/dist/embedded-app/static/{5458.ab22b201.chunk.js.map → 5458.44fc0038.chunk.js.map} +1 -1
  13. package/dist/embedded-app/static/{5837.9510a1b9.chunk.js → 5837.51740a39.chunk.js} +2 -2
  14. package/dist/embedded-app/static/{5837.9510a1b9.chunk.js.map → 5837.51740a39.chunk.js.map} +1 -1
  15. package/dist/embedded-app/static/{732.d703f6a9.chunk.js → 732.52925e05.chunk.js} +2 -2
  16. package/dist/embedded-app/static/{732.d703f6a9.chunk.js.map → 732.52925e05.chunk.js.map} +1 -1
  17. package/dist/embedded-app/static/{7560.1af568e5.chunk.js → 7560.ecd330c0.chunk.js} +2 -2
  18. package/dist/embedded-app/static/{7560.1af568e5.chunk.js.map → 7560.ecd330c0.chunk.js.map} +1 -1
  19. package/dist/embedded-app/static/7670.7845e3d0.chunk.js +3 -0
  20. package/dist/embedded-app/static/7670.7845e3d0.chunk.js.map +1 -0
  21. package/dist/embedded-app/static/{7750.1bdc8262.chunk.js → 7750.0502b5b8.chunk.js} +2 -2
  22. package/dist/embedded-app/static/{7750.1bdc8262.chunk.js.map → 7750.0502b5b8.chunk.js.map} +1 -1
  23. package/dist/embedded-app/static/{9545.efced59f.chunk.js → 9545.35d3c232.chunk.js} +2 -2
  24. package/dist/embedded-app/static/{9545.efced59f.chunk.js.map → 9545.35d3c232.chunk.js.map} +1 -1
  25. package/dist/embedded-app/static/{9770.b9672083.chunk.js → 9770.885849b9.chunk.js} +2 -2
  26. package/dist/embedded-app/static/{9770.b9672083.chunk.js.map → 9770.885849b9.chunk.js.map} +1 -1
  27. package/dist/embedded-app/static/main.dd3e123f.js +503 -0
  28. package/dist/embedded-app/static/main.dd3e123f.js.map +1 -0
  29. package/dist/embedded-app/static/module-octokit.991a0781.js +5 -0
  30. package/dist/embedded-app/static/module-octokit.991a0781.js.map +1 -0
  31. package/dist/embedded-app/static/{runtime.6fc07bc1.js → runtime.dd3e123f.js} +2 -2
  32. package/dist/embedded-app/static/runtime.dd3e123f.js.map +1 -0
  33. package/dist/embedded-app/static/vendor.dd3e123f.js +270 -0
  34. package/dist/embedded-app/static/vendor.dd3e123f.js.map +1 -0
  35. package/dist/index.cjs.js +5 -5
  36. package/dist/index.cjs.js.map +1 -1
  37. package/package.json +5 -5
  38. package/dist/embedded-app/static/main.6fc07bc1.js +0 -497
  39. package/dist/embedded-app/static/main.6fc07bc1.js.map +0 -1
  40. package/dist/embedded-app/static/module-octokit.c67cdf8f.js +0 -5
  41. package/dist/embedded-app/static/module-octokit.c67cdf8f.js.map +0 -1
  42. package/dist/embedded-app/static/runtime.6fc07bc1.js.map +0 -1
  43. package/dist/embedded-app/static/vendor.6fc07bc1.js +0 -231
  44. package/dist/embedded-app/static/vendor.6fc07bc1.js.map +0 -1
@@ -0,0 +1,503 @@
1
+ (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Oe,t){"use strict";t.d(Oe,{n3:function(){return m},MS:function(){return S}});var h=t(25271),n=t(23054),z=t(96279),B=t.n(z);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class S{async getEntityAncestors(k,ie){const{kind:_,namespace:ne,name:D}=(0,h.of)(k.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(ne)}/${encodeURIComponent(D)}/ancestry`,ie)}async getLocationById(k,ie){return await this.requestOptional("GET",`/locations/${encodeURIComponent(k)}`,ie)}async getEntities(k,ie){const{filter:_=[],fields:ne=[],order:D,offset:O,limit:V,after:ee}=k!=null?k:{},ae=[];for(const L of[_].flat()){const C=[];for(const[X,Ie]of Object.entries(L))for(const Ke of[Ie].flat())Ke===m?C.push(encodeURIComponent(X)):typeof Ke=="string"&&C.push(`${encodeURIComponent(X)}=${encodeURIComponent(Ke)}`);C.length&&ae.push(`filter=${C.join(",")}`)}if(ne.length&&ae.push(`fields=${ne.map(encodeURIComponent).join(",")}`),D)for(const L of[D].flat())L&&ae.push(`order=${encodeURIComponent(L.order)}:${encodeURIComponent(L.field)}`);O!==void 0&&ae.push(`offset=${O}`),V!==void 0&&ae.push(`limit=${V}`),ee!==void 0&&ae.push(`after=${encodeURIComponent(ee)}`);const T=ae.length?`?${ae.join("&")}`:"",R=await this.requestRequired("GET",`/entities${T}`,ie),W=(L,C)=>{var X,Ie;if(((X=L.metadata)===null||X===void 0?void 0:X.name)===void 0||L.kind===void 0||((Ie=C.metadata)===null||Ie===void 0?void 0:Ie.name)===void 0||C.kind===void 0)return 0;const Ke=(0,h.eE)(L),Fe=(0,h.eE)(C);return Ke<Fe?-1:Ke>Fe?1:0};return{items:R.sort(W)}}async getEntitiesByRefs(k,ie){var _;const ne={entityRefs:k.entityRefs};!((_=k.fields)===null||_===void 0)&&_.length&&(ne.fields=k.fields);const O=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,V=await this.fetchApi.fetch(O,{headers:{"Content-Type":"application/json",...(ie==null?void 0:ie.token)&&{Authorization:`Bearer ${ie==null?void 0:ie.token}`}},method:"POST",body:JSON.stringify(ne)});if(!V.ok)throw await n.VL.fromResponse(V);const{items:ee}=await V.json();return{items:ee}}async getEntityByRef(k,ie){const{kind:_,namespace:ne,name:D}=(0,h.of)(k);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(ne)}/${encodeURIComponent(D)}`,ie)}async getEntityByName(k,ie){const{kind:_,namespace:ne="default",name:D}=k;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(ne)}/${encodeURIComponent(D)}`,ie)}async refreshEntity(k,ie){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ie==null?void 0:ie.token)&&{Authorization:`Bearer ${ie==null?void 0:ie.token}`}},method:"POST",body:JSON.stringify({entityRef:k})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(k,ie){const{filter:_=[],facets:ne}=k,D=[];for(const V of[_].flat()){const ee=[];for(const[ae,T]of Object.entries(V))for(const R of[T].flat())R===m?ee.push(encodeURIComponent(ae)):typeof R=="string"&&ee.push(`${encodeURIComponent(ae)}=${encodeURIComponent(R)}`);ee.length&&D.push(`filter=${ee.join(",")}`)}for(const V of ne)D.push(`facet=${encodeURIComponent(V)}`);const O=D.length?`?${D.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${O}`,ie)}async addLocation(k,ie){const{type:_="url",target:ne,dryRun:D}=k,O=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${D?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ie==null?void 0:ie.token)&&{Authorization:`Bearer ${ie==null?void 0:ie.token}`}},method:"POST",body:JSON.stringify({type:_,target:ne})});if(O.status!==201)throw new Error(await O.text());const{location:V,entities:ee,exists:ae}=await O.json();if(!V)throw new Error(`Location wasn't added: ${ne}`);return{location:V,entities:ee,exists:ae}}async getLocationByRef(k,ie){return(await this.requestRequired("GET","/locations",ie)).map(ne=>ne.data).find(ne=>k===(0,h.NZ)(ne))}async removeLocationById(k,ie){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(k)}`,ie)}async removeEntityByUid(k,ie){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(k)}`,ie)}async validateEntity(k,ie,_){const ne=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:k,location:ie})});if(ne.ok)return{valid:!0};if(ne.status!==400)throw await n.VL.fromResponse(ne);const{errors:D=[]}=await ne.json();return{valid:!1,errors:D}}async requestIgnored(k,ie,_){const ne=`${await this.discoveryApi.getBaseUrl("catalog")}${ie}`,D=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},O=await this.fetchApi.fetch(ne,{method:k,headers:D});if(!O.ok)throw await n.VL.fromResponse(O)}async requestRequired(k,ie,_){const ne=`${await this.discoveryApi.getBaseUrl("catalog")}${ie}`,D=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},O=await this.fetchApi.fetch(ne,{method:k,headers:D});if(!O.ok)throw await n.VL.fromResponse(O);return await O.json()}async requestOptional(k,ie,_){const ne=`${await this.discoveryApi.getBaseUrl("catalog")}${ie}`,D=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},O=await this.fetchApi.fetch(ne,{method:k,headers:D});if(!O.ok){if(O.status===404)return;throw await n.VL.fromResponse(O)}return await O.json()}constructor(k){this.discoveryApi=k.discoveryApi,this.fetchApi=k.fetchApi||{fetch:B()}}}},25271:function(At,Oe,t){"use strict";t.d(Oe,{Tf:function(){return z},P1:function(){return ge},q1:function(){return re},M6:function(){return Ae},l2:function(){return n},zG:function(){return h},w$:function(){return En},nP:function(){return wn},aS:function(){return Hn},S4:function(){return Jt},cz:function(){return Vn},iB:function(){return wt},CV:function(){return mt},of:function(){return dt},Ou:function(){return Ze},eE:function(){return bt},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",z="backstage.io/edit-url",B="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",S="kubernetes.io/auth-provider";var l=t(76635),k=t.n(l);class ie{async enforce($){return $.metadata.namespace?$:lodash.merge({metadata:{namespace:this.namespace}},$)}constructor($=DEFAULT_NAMESPACE){this.namespace=$}}class _{static isValidPrefixAndOrSuffix($,pe,Ue,Be){if(typeof $!="string")return!1;const nt=$.split(pe);return nt.length===1?Be(nt[0]):nt.length===2?Ue(nt[0])&&Be(nt[1]):!1}static isJsonSafe($){try{return k().isEqual($,JSON.parse(JSON.stringify($)))}catch{return!1}}static isValidDnsSubdomain($){return typeof $=="string"&&$.length>=1&&$.length<=253&&$.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel($){return typeof $=="string"&&$.length>=1&&$.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test($)}static isValidTag($){return typeof $=="string"&&$.length>=1&&$.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test($)}static isValidUrl($){if(typeof $!="string")return!1;try{return new URL($),!0}catch{return!1}}static isValidString($){var pe;return typeof $=="string"&&((pe=$==null?void 0:$.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString($){var pe;return typeof $=="string"&&((pe=$==null?void 0:$.trim())===null||pe===void 0?void 0:pe.length)>=1}}var ne=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),D=t(27991),O=t.n(D),V=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"}}}`),ee=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}}}}}}'),ae=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const T=new Map,R=[ne,V,ee,ae];function W(he){if(!(he!=null&&he.length))throw new TypeError("Unknown error");const $=he[0];throw new TypeError(`${$.instancePath||"<root>"} ${$.message}${$.params?` - ${Object.entries($.params).map(([pe,Ue])=>`${pe}: ${Ue}`).join(", ")}`:""}`)}function L(he,$={}){var pe;const Ue=(pe=$==null?void 0:$.disableCache)!==null&&pe!==void 0?pe:!1,Be=Ue?"":JSON.stringify(he);if(!Ue){const Mt=T.get(Be);if(Mt)return Mt}const nt=C(he),It=new(O())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});nt.length&&It.addSchema(nt,void 0,void 0,!0);const Ht=It.compile(he);return Ue||T.set(Be,Ht),Ht}function C(he){if(typeof he!="object")return[];const $=new Set;he.$id&&$.add(he.$id);const pe=new Array,Ue=[he];for(;Ue.length;){const Be=Ue.pop();for(const nt of X(Be))if(!$.has(nt)){$.add(nt);const It=R.find(Ht=>Ht.$id===nt);It&&(pe.push(It),Ue.push(It))}}return pe}function*X(he){const $=[he];for(;$.length;){const pe=$.pop();if(typeof pe=="object"&&pe)for(const[Ue,Be]of Object.entries(pe))Ue==="$ref"&&typeof Be=="string"?yield Be.split("#")[0]:$.push(Be)}}function Ie(he){const $=compileAjvSchema(he||entityEnvelopeSchema);return pe=>{if($(pe)===!0)return pe;throw throwAjvError($.errors)}}function Ke(he){const $=L(he);return pe=>{var Ue;if($(pe)===!0)return pe;const nt=(Ue=$.errors)===null||Ue===void 0?void 0:Ue.filter(It=>["/kind","/apiVersion"].includes(It.instancePath));if((nt==null?void 0:nt.length)&&nt.every(It=>It.keyword==="enum"))return!1;throw W($.errors)}}function Fe(he){const $=compileAjvSchema(he||entitySchema);return pe=>{if($(pe)===!0)return pe;throw throwAjvError($.errors)}}class He{static isValidApiVersion($){return _.isValidPrefixAndOrSuffix($,"/",_.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind($){return typeof $=="string"&&$.length>=1&&$.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test($)}static isValidObjectName($){return typeof $=="string"&&$.length>=1&&$.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test($)}static isValidNamespace($){return _.isValidDnsLabel($)}static isValidLabelKey($){return _.isValidPrefixAndOrSuffix($,"/",_.isValidDnsSubdomain,He.isValidObjectName)}static isValidLabelValue($){return $===""||He.isValidObjectName($)}static isValidAnnotationKey($){return _.isValidPrefixAndOrSuffix($,"/",_.isValidDnsSubdomain,He.isValidObjectName)}static isValidAnnotationValue($){return typeof $=="string"}}const We={isValidApiVersion:He.isValidApiVersion,isValidKind:He.isValidKind,isValidEntityName:He.isValidObjectName,isValidNamespace:He.isValidNamespace,isValidLabelKey:He.isValidLabelKey,isValidLabelValue:He.isValidLabelValue,isValidAnnotationKey:He.isValidAnnotationKey,isValidAnnotationValue:He.isValidAnnotationValue,isValidTag:he=>typeof he=="string"&&he.length>=1&&he.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(he)};function jt(he={}){return{...We,...he}}class Qe{async enforce($){function pe(f,A,M){if(A==null)throw new Error(`${f} must have a value`);let K;try{K=M(A)}catch(se){throw new Error(`${f} could not be validated, ${se}`)}if(!K){let se;switch(M.name){case"isValidLabelValue":case"isValidObjectName":se="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":se="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":se="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":se="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":se="a string";break;case"isValidKind":se="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":se="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":se="a non empty string";break;default:se=void 0;break}const xe=se?` expected ${se} but found "${A}".`:"";throw new Error(`"${f}" is not valid;${xe} 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 Ue(f,A,M){return A===void 0||pe(f,A,M)}pe("apiVersion",$.apiVersion,this.validators.isValidApiVersion),pe("kind",$.kind,this.validators.isValidKind),pe("metadata.name",$.metadata.name,this.validators.isValidEntityName),Ue("metadata.namespace",$.metadata.namespace,this.validators.isValidNamespace);var Be;for(const[f,A]of Object.entries((Be=$.metadata.labels)!==null&&Be!==void 0?Be:[]))pe(`labels.${f}`,f,this.validators.isValidLabelKey),pe(`labels.${f}`,A,this.validators.isValidLabelValue);var nt;for(const[f,A]of Object.entries((nt=$.metadata.annotations)!==null&&nt!==void 0?nt:[]))pe(`annotations.${f}`,f,this.validators.isValidAnnotationKey),pe(`annotations.${f}`,A,this.validators.isValidAnnotationValue);var It;const Ht=(It=$.metadata.tags)!==null&&It!==void 0?It:[];for(let f=0;f<Ht.length;++f)pe(`tags.${f}`,Ht[f],this.validators.isValidTag);var Mt;const Qt=(Mt=$.metadata.links)!==null&&Mt!==void 0?Mt:[];for(let f=0;f<Qt.length;++f){var zt,Y,q;pe(`links.${f}.url`,(zt=Qt[f])===null||zt===void 0?void 0:zt.url,CommonValidatorFunctions.isValidUrl),Ue(`links.${f}.title`,(Y=Qt[f])===null||Y===void 0?void 0:Y.title,CommonValidatorFunctions.isNonEmptyString),Ue(`links.${f}.icon`,(q=Qt[f])===null||q===void 0?void 0:q.icon,KubernetesValidatorFunctions.isValidObjectName)}return $}constructor($=makeValidator()){this.validators=$}}class ye{async enforce($){if(!this.validate){const Be=new Ajv({allowUnionTypes:!0});this.validate=Be.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate($)===!0)return $;const[Ue]=this.validate.errors||[];throw Ue?new Error(`Malformed envelope, ${Ue.instancePath||"<root>"} ${Ue.message}`):new Error("Malformed envelope, Unknown error")}}function _e(he){let $=he.indexOf(":");const pe=he.indexOf("/");pe!==-1&&pe<$&&($=-1);const Ue=$===-1?void 0:he.slice(0,$),Be=pe===-1?void 0:he.slice($+1,pe),nt=he.slice(Math.max($+1,pe+1));if(Ue===""||Be===""||nt==="")throw new TypeError(`Entity reference "${he}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ue,namespace:Be,name:nt}}function wt(he){return{kind:he.kind,namespace:he.metadata.namespace||h,name:he.metadata.name}}function dt(he,$){if(!he)throw new Error("Entity reference must not be empty");const pe=$==null?void 0:$.defaultKind,Ue=($==null?void 0:$.defaultNamespace)||h;let Be,nt,It;if(typeof he=="string"){const Y=_e(he);var Ht;Be=(Ht=Y.kind)!==null&&Ht!==void 0?Ht:pe;var Mt;nt=(Mt=Y.namespace)!==null&&Mt!==void 0?Mt:Ue,It=Y.name}else{var Qt;Be=(Qt=he.kind)!==null&&Qt!==void 0?Qt:pe;var zt;nt=(zt=he.namespace)!==null&&zt!==void 0?zt:Ue,It=he.name}if(Be)if(nt){if(!It){const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(he);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Be,namespace:nt,name:It}}function bt(he){let $,pe,Ue;if("metadata"in he){$=he.kind;var Be;pe=(Be=he.metadata.namespace)!==null&&Be!==void 0?Be:h,Ue=he.metadata.name}else{$=he.kind;var nt;pe=(nt=he.namespace)!==null&&nt!==void 0?nt:h,Ue=he.name}return`${$.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Ue.toLocaleLowerCase("en-US")}`}class ut{async enforce($){let pe=$;for(const Ue of this.policies){const Be=await Ue.enforce(pe);if(!Be)throw new Error(`Policy ${Ue.constructor.name} did not return a result`);pe=Be}return pe}constructor($){this.policies=$}}class Rt{async enforce($){for(const pe of this.policies){const Ue=await pe.enforce($);if(Ue)return Ue}throw new Error("The entity did not match any known policy")}constructor($){this.policies=$}}const Zt={allOf(he){return new ut(he)},oneOf(he){return new Rt(he)}};var Ge=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ce(he){let $;return{async check(pe){return $||($=Ke(he)),$(pe)===pe}}}const Re=ce(Ge);var Ee=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Xe=ce(Ee);var St=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const Ot=ce(St);var ht=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Tt=ce(ht);var gt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const Dt=ce(gt),Jt="ownedBy",Xt="ownerOf",cn="consumesApi",Ut="apiConsumedBy",fn="providesApi",gn="apiProvidedBy",wn="dependsOn",En="dependencyOf",Wn="parentOf",An="childOf",dn="memberOf",rn="hasMember",Vn="partOf",Hn="hasPart";var Sn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const mn=ce(Sn);var Tn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const In=ce(Tn);var Kn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const vn=ce(Kn),ge="backstage.io/managed-by-location",re="backstage.io/managed-by-origin-location",Ae="backstage.io/source-location";function Ze(he){if(typeof he!="string")throw new TypeError(`Unable to parse location ref '${he}', unexpected argument ${typeof he}`);const $=he.indexOf(":");if($<0)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=he.substring(0,$).trim(),Ue=he.substring($+1).trim();if(!pe||!Ue)throw new TypeError(`Unable to parse location ref '${he}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${he}', please prefix it with 'url:', e.g. 'url:${he}'`);return{type:pe,target:Ue}}function qe(he){const{type:$,target:pe}=he;if($){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${$}:${pe}`}function mt(he){var $,pe,Ue,Be,nt;const It=(nt=($=he.metadata)===null||$===void 0||(pe=$.annotations)===null||pe===void 0?void 0:pe[Ae])!==null&&nt!==void 0?nt:(Ue=he.metadata)===null||Ue===void 0||(Be=Ue.annotations)===null||Be===void 0?void 0:Be[ge];if(!It)throw new Error(`Entity '${bt(he)}' is missing location`);return Ze(It)}},23196:function(At,Oe,t){"use strict";t.d(Oe,{zx:function(){return Qe},Oi:function(){return Re},VY:function(){return Ni},yW:function(){return _a},XF:function(){return St},mn:function(){return he},NX:function(){return h},ub:function(){return q},mf:function(){return ol},yu:function(){return Cn},h4:function(){return Ji},M6:function(){return Gr},i9:function(){return gl},aR:function(){return Fi},rJ:function(){return Ir},Oh:function(){return Sl},hu:function(){return yl},rU:function(){return He},nU:function(){return vo},SA:function(){return Yr},sk:function(){return it},Or:function(){return Co},T3:function(){return Xi},g9:function(){return wl},Ex:function(){return jo},Gk:function(){return u},tn:function(){return Ui},Ph:function(){return jn},YE:function(){return ti},v7:function(){return ha},R6:function(){return Ss},tR:function(){return _s},uw:function(){return Ea},qt:function(){return Ti},iA:function(){return Yi},GB:function(){return yn},po:function(){return ur},mZ:function(){return Wo},Pf:function(){return Mr}});var h={};t.r(h),t.d(h,{Nm:function(){return Ot},ht:function(){return gt},LJ:function(){return Tt}});var n=t(52322),z=t(25248),B=t(19928),m=t(2784);function S(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,w=v!=null?v:5e3;useEffect(()=>{const U=d.alert$().subscribe(fe=>a(de=>de.concat(fe)));return()=>{U.unsubscribe()}},[d]);const[N]=o;if(useEffect(()=>{if(N&&N.display==="transient"){const U=setTimeout(()=>{a(fe=>{const de=fe.filter(ve=>ve!==N);return de.length===fe.length?fe:de})},w);return()=>clearTimeout(U)}},[N,w]),o.length===0)return null;const G=()=>{a(U=>U.filter(fe=>fe!==N))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:N.severity,children:_jsxs(Typography,{component:"span",children:[String(N.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=t(79692),k=t(12420);const ie=(0,l.Z)(e=>(0,k.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:o,picture:a,customStyles:d}=e,p=ie();let v={...d};const w={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:w,children:extractInitials(o)})})}var ne=t(77277),D=t(86689),O=t(90436),V=t(72779),ee=t.n(V),ae=t(76635),T=t(79635),R=t(39857);function W(){const[e]=(0,T.is)((0,n.jsx)(T.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const L=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),C=e=>/^([a-z+.-]+):/.test(e),X=()=>{try{return(0,z.h_)(z.Ds).getOptionalString("app.baseUrl")}catch{return}},Ie=()=>{const e="http://sample.dev";var o;const a=(o=X())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,ae.trimEnd)(d,"/")},Ke=e=>{let o=String(e);const a=Ie(),d=C(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},Fe=e=>{if(e instanceof Array)return e.map(Fe).join(" ").trim();if(typeof e=="object"&&e){var o;return Fe(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},He=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=L(),v=(0,z.z$)(),w=W()?Ke(a.to):a.to,N=Fe(a.children)||w,G=C(w),U=G&&!!/^https?:/.exec(w),fe=de=>{e==null||e(de),o||v.captureEvent("click",N,{attributes:{to:w}})};return G?(0,n.jsxs)(D.Z,{...U?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:w,onClick:fe,className:ee()(p.externalLink,a.className),children:[a.children,(0,n.jsx)(O.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(D.Z,{...a,ref:d,component:R.rU,to:w,onClick:fe})}),We=m.forwardRef((e,o)=>(0,n.jsx)(He,{ref:o,...e,color:"initial"})),Qe=m.forwardRef((e,o)=>(0,n.jsx)(ne.Z,{ref:o,component:We,...e}));var ye=t(95544),_e=t(60364),wt=t(83229),dt=t(26639),bt=t(39595),ut=t(61837),Rt=t(80030),Zt=t(19353),Ge=t(95074);function ce(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,z.h_)(z.VE),[w,N]=(0,m.useState)(!1),[{error:G},U]=(0,Ge.Z)();(0,m.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=de=>{de.stopPropagation(),N(!0),U(o)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Rt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>N(!1),open:w,children:(0,n.jsx)(ut.Z,{onClick:fe,"aria-label":p,children:(0,n.jsx)(Zt.Z,{})})})})}function Re(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:w=!1}=e,N=(0,_e.Z)(),G=N.palette.type==="dark"?dt.Z:bt.Z,U=N.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)(ye.Z,{position:"relative",children:[(0,n.jsx)(wt.Z,{customStyle:v,language:a,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:fe=>p!=null&&p.includes(fe)?{style:{backgroundColor:U}}:{},children:o}),w&&(0,n.jsx)(ye.Z,{position:"absolute",top:0,right:0,children:(0,n.jsx)(ce,{text:o})})]})}var Ee=t(41156),Xe=t(88188);function St(e){const{title:o,to:a}=e,d=(0,Ee.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,n.jsx)(ut.Z,{component:R.rU,color:"primary",title:o,size:"small",to:a,children:(0,n.jsx)(Xe.Z,{})}):(0,n.jsx)(ne.Z,{component:R.rU,variant:"contained",color:"primary",to:a,children:o}):null}var Ot;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Ot||(Ot={}));var ht;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ht||(ht={}));var Tt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Tt||(Tt={}));var gt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(gt||(gt={}));var Dt=t(27397),Jt=t(11105),Xt=t(97963),cn=t(46506),Ut=t.n(cn),fn=t(54073),gn=t.n(fn),wn=t(10368);const En=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Wn({node:{id:e}}){const o=En(),[a,d]=m.useState(0),[p,v]=m.useState(0),w=m.useRef(null);m.useLayoutEffect(()=>{if(w.current){let{height:fe,width:de}=w.current.getBBox();fe=Math.round(fe),de=Math.round(de),(fe!==p||de!==a)&&(d(de),v(fe))}},[a,p]);const N=10,G=a+N*2,U=p+N*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:o.node,width:G,height:U,rx:10}),(0,n.jsx)("text",{ref:w,className:o.text,y:U/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const An="arrow-marker",dn="node",rn="edge",Vn="label",Hn=(0,wn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Sn=e=>(0,n.jsx)(Wn,{...e});function mn({render:e=Sn,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:w=0}=a,N=a,G=Hn(),U=m.useRef(null);return m.useLayoutEffect(()=>{if(U.current){let{height:fe,width:de}=U.current.getBBox();fe=Math.round(fe),de=Math.round(de),(fe!==p||de!==d)&&o(a.id,{...a,height:fe,width:de})}},[a,d,p,o]),(0,n.jsx)("g",{ref:U,"data-testid":dn,className:G.node,transform:`translate(${v-d/2},${w-p/2})`,children:e({node:N})})}var Tn=t(76985),In=t(39829),Kn=t(19574),vn=t.n(Kn);const ge=(0,wn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function re({edge:{label:e}}){const o=ge();return(0,n.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Ae=(0,wn.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Ze=e=>(0,n.jsx)(re,{...e});function qe({render:e=Ze,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:w=0,width:N,height:G,points:U}=d,fe=d,de=Ae(),ve=m.useRef(null);m.useLayoutEffect(()=>{if(ve.current){let{height:Je,width:Pt}=ve.current.getBBox();Je=Math.round(Je),Pt=Math.round(Pt),(Je!==G||Pt!==N)&&o(a,{...d,height:Je,width:Pt})}},[d,G,N,o,a]);let we="";const ze=m.useMemo(()=>Tn.Z().x(Je=>Je.x).y(Je=>Je.y).curve(In[p]),[p]);if(U){const Je=U.filter(Pt=>vn()(Pt.x)&&vn()(Pt.y));we=ze(Je)||""}return(0,n.jsxs)(n.Fragment,{children:[we&&(0,n.jsx)("path",{"data-testid":rn,className:de.path,d:we}),fe.label?(0,n.jsx)("g",{ref:ve,"data-testid":Vn,className:de.label,transform:`translate(${v},${w})`,children:e({edge:fe})}):null]})}const mt="workspace";function he(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:w=Ot.TOP_BOTTOM,align:N,nodeMargin:G=50,edgeMargin:U=10,rankMargin:fe=50,paddingX:de=0,paddingY:ve=0,acyclicer:we,ranker:ze=Tt.NETWORK_SIMPLEX,labelPosition:Je=gt.RIGHT,labelOffset:Pt=10,edgeRanks:qt=1,edgeWeight:on=1,renderLabel:sn,defs:kt,zoom:nn="enabled",curve:_t="curveMonotoneX",fit:Sr="grow",...Cr}=e,jr=(0,Xt.Z)(),[wr,di]=m.useState(100),[Pr,ui]=m.useState(100),en=m.useRef(new(Ut()).graphlib.Graph),[lo,ws]=m.useState(((o=en.current.graph())===null||o===void 0?void 0:o.width)||0),[kr,hi]=m.useState(((a=en.current.graph())===null||a===void 0?void 0:a.height)||0),[Mn,hr]=m.useState([]),[Wr,Vr]=m.useState([]),an=Math.max(lo,wr),bn=Math.max(kr,Pr),co=Math.min(kr,Pr),Hr=Sr==="grow"?bn:co,Go=m.useMemo(()=>gn()(pn=>{if(!pn)return;const zn=Jt.Z(pn),ln=Jt.Z(pn.getElementById(mt));function sr(){zn.call(Dt.sP().scaleExtent([1,10]).on("zoom",Er=>{Er.transform.x=Math.min(0,Math.max(Er.transform.x,an-an*Er.transform.k)),Er.transform.y=Math.min(0,Math.max(Er.transform.y,bn-bn*Er.transform.k)),ln.attr("transform",Er.transform)}))}nn==="enabled"?sr():nn==="enable-on-click"&&zn.on("click",()=>sr());const{width:ir,height:Es}=pn.getBoundingClientRect();wr!==ir&&di(ir),Pr!==Es&&ui(Es)},100),[Pr,wr,an,bn,nn]),ra=m.useCallback(()=>{const pn=en.current.nodes(),zn=en.current.edges();pn.forEach(ln=>{p.some(ir=>ir.id===ln)||en.current.removeNode(ln)}),zn.forEach(ln=>{d.some(ir=>ir.from===ln.v&&ir.to===ln.w)||en.current.removeEdge(ln.v,ln.w)}),p.forEach(ln=>{const sr=en.current.nodes().find(ir=>ln.id===ir);if(sr&&en.current.node(sr)){const{width:ir,height:Es,x:Er,y:Wl}=en.current.node(sr);en.current.setNode(sr,{...ln,width:ir,height:Es,x:Er,y:Wl})}else en.current.setNode(ln.id,{...ln,width:0,height:0})}),d.forEach(ln=>{en.current.setEdge(ln.from,ln.to,{...ln,label:ln.label,width:0,height:0,labelpos:Je,labeloffset:Pt,weight:on,minlen:qt})})},[d,p,Je,Pt,on,qt]),Ko=m.useMemo(()=>gn()(()=>{Ut().layout(en.current);const{height:pn,width:zn}=en.current.graph(),ln=Math.max(0,pn||0),sr=Math.max(0,zn||0);ws(sr),hi(ln),hr(en.current.nodes()),Vr(en.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(en.current.setGraph({rankdir:w,align:N,nodesep:G,edgesep:U,ranksep:fe,marginx:de,marginy:ve,acyclicer:we,ranker:ze}),ra(),Ko(),Ko.cancel),[we,N,w,U,de,ve,G,fe,ze,ra,Ko]);function Ml(pn,zn){return en.current.setNode(pn,zn),Ko(),en.current}function zl(pn,zn){return en.current.setEdge(pn,zn),Ko(),en.current}return(0,n.jsxs)("svg",{ref:Go,...Cr,width:"100%",height:Hr,viewBox:`0 0 ${an} ${bn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:An,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:jr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,n.jsx)("g",{id:mt,children:(0,n.jsxs)("svg",{width:lo,height:kr,y:bn/2-kr/2,x:an/2-lo/2,viewBox:`0 0 ${lo} ${kr}`,children:[Wr.map(pn=>{const zn=en.current.edge(pn);return zn?(0,n.jsx)(qe,{id:pn,setEdge:zl,render:sn,edge:zn,curve:_t},`${pn.v}-${pn.w}`):null}),Mn.map(pn=>{const zn=en.current.node(pn);return zn?(0,n.jsx)(mn,{setNode:Ml,render:v,node:zn},pn):null})]})})]})}var $;const pe=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:($=e.palette.banner.warning)!==null&&$!==void 0?$:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Ue=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=pe(),N=useApi(storageApiRef).forBucket("notifications");var G;const U=(G=N.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,de]=useState(new Set(U)),ve=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{if(ve!=null&&ve.value){var ze;const Je=(ze=ve==null?void 0:ve.value)!==null&&ze!==void 0?ze:[];de(new Set(Je))}},[ve==null?void 0:ve.value]);const we=()=>{N.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:we,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),nt=t.p+"static/missingAnnotation.67f79e98..svg",It=t.p+"static/noInformation.4b426325..svg",Ht=t.p+"static/createComponent.975d1e1e..svg",Mt=t.p+"static/noBuild.1715fa71..svg";const Qt=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),zt=({missing:e})=>{const o=Qt();switch(e){case"field":return(0,n.jsx)("img",{src:nt,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:It,alt:"no Information",className:o.generalImg});case"content":return(0,n.jsx)("img",{src:Ht,alt:"create Component",className:o.generalImg});case"data":return(0,n.jsx)("img",{src:Mt,alt:"no Build",className:o.generalImg});default:return null}},Y=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function q(e){const{title:o,description:a,missing:d,action:p}=e,v=Y();return(0,n.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(O.Z,{variant:"h5",children:o})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,children:(0,n.jsx)(O.Z,{variant:"body1",children:a})}),(0,n.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,n.jsx)(zt,{missing:d}):d.customImage})]})}const f=`apiVersion: backstage.io/v1alpha1
2
+ 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`,A=/^.*ANNOTATION.*$/m,M=f.match(A)[0],K=f.split(`
12
+ `).findIndex(e=>A.test(e)),se=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function xe(e){return Array.from(Array(e+1).keys(),o=>o+K)}function Pe(e){const o=e.map(a=>M.replace("ANNOTATION",a)).join(`
13
+ `);return f.replace(M,o)}function tt(e){const o=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(a=>(0,n.jsx)("code",{children:a})).reduce((a,d)=>(0,n.jsxs)(n.Fragment,{children:[a,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function it(e){const{annotation:o,readMoreUrl:a}=e,d=Array.isArray(o)?o:[o],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=se();return(0,n.jsx)(q,{missing:"field",title:"Missing Annotation",description:tt(d),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)(ye.Z,{className:v.code,children:(0,n.jsx)(Re,{text:Pe(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:xe(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(ne.Z,{color:"primary",component:He,to:p,children:"Read more"})]})})}var ft=t(11776),ct=t(38402),et=t(49378),Me=t(41128),Et=t(27616),Lt=t(8284),Gt=t(70660),vt=t(91750),Nt=t(38016);const Bt=(e,o)=>(o.palette.type==="light"?Me._j:Me.$n)(o.palette[e].light,.6),pt=(e,o)=>(o.palette.type==="light"?Me.$n:Me._j)(o.palette[e].light,.9),ot=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Bt(o,e)}})),st=({severity:e})=>{const o=ot({severity:e});return(0,n.jsx)(vt.Z,{classes:o})},Kt=({severity:e})=>{const o=ot({severity:e});return(0,n.jsx)(Nt.Z,{classes:o})},On=(0,l.Z)(e=>({panel:{backgroundColor:({severity:o})=>pt(o,e),color:({severity:o})=>Bt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Bt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Bt(o,e),backgroundColor:({severity:o})=>pt(o,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"}),un=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function yn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:v}=e,w=On({severity:o}),N=un(o)+(a?`: ${a}`:"");return(0,n.jsxs)(Et.Z,{defaultExpanded:v!=null?v:!1,className:w.panel,role:"alert",children:[(0,n.jsxs)(Lt.Z,{expandIcon:(0,n.jsx)(Kt,{severity:o}),className:w.summary,children:[(0,n.jsx)(st,{severity:o}),(0,n.jsx)(O.Z,{className:w.summaryText,variant:"subtitle1",children:N})]}),(d||p)&&(0,n.jsx)(Gt.Z,{children:(0,n.jsxs)(Be.Z,{container:!0,children:[d&&(0,n.jsx)(Be.Z,{item:!0,xs:12,children:(0,n.jsx)(O.Z,{className:w.message,variant:"body1",children:d})}),p&&(0,n.jsx)(Be.Z,{item:!0,xs:12,className:w.details,children:p})]})})]})}const Yn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Bn=({error:e,message:o,stack:a,children:d})=>{const p=Yn();return(0,n.jsxs)(ft.Z,{dense:!0,children:[(0,n.jsxs)(ct.Z,{alignItems:"flex-start",children:[(0,n.jsx)(et.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(ce,{text:e})]}),(0,n.jsxs)(ct.Z,{alignItems:"flex-start",children:[(0,n.jsx)(et.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,n.jsx)(ce,{text:o})]}),a&&(0,n.jsxs)(ct.Z,{alignItems:"flex-start",children:[(0,n.jsx)(et.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,n.jsx)(ce,{text:a})]}),d]})};function Cn(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,n.jsx)(yn,{severity:"error",title:o!=null?o:a.message,defaultExpanded:d,children:(0,n.jsx)(Bn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var nr=t(85256);const j=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function u(e){var o;const{title:a,error:d,defaultExpanded:p}=e,v=j();if(d.name!=="ResponseError")return(0,n.jsx)(Cn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:w,cause:N}=d,{request:G,response:U}=w,fe=`${U.statusCode}: ${N.name}`,de=G&&`${G.method} ${G.url}`,ve=N.message.replace(/\\n/g,`
14
+ `),we=(o=N.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
15
+ `),ze=JSON.stringify(w,void 0,2);return(0,n.jsxs)(Cn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:fe,message:ve,stack:we},children:[de&&(0,n.jsxs)(ct.Z,{alignItems:"flex-start",children:[(0,n.jsx)(et.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${de}`:void 0}),(0,n.jsx)(ce,{text:de})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nr.Z,{component:"li",className:v.divider}),(0,n.jsx)(ct.Z,{alignItems:"flex-start",children:(0,n.jsx)(et.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Re,{language:"json",text:ze,showCopyCodeButton:!0})]})]})}var b=t(28316);function E(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Q(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function me(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||E(e);return p||Q(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return o.current||(o.current=document.createElement("div")),o.current}return a()}var be=null;const ke="core.calloutSeen";function Ve(){const[e,o]=useState(()=>{const d=localStorage.getItem(ke);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(ke),N={...v?JSON.parse(v):{},[d]:p};o(N),localStorage.setItem(ke,JSON.stringify(N))},[]);return{states:e,setState:a}}function Wt(e){const{states:o,setState:a}=Ve(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function tn(e){const{seen:o,markSeen:a}=Wt(e);return{show:o===!1,hide:a}}const Rn=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function Ar(e){const{featureId:o,title:a,description:d,children:p}=e,{show:v,hide:w}=useShowCallout(o),N=usePortal("core.callout"),G=useRef(null),[U,fe]=useState(),de=Rn(),ve=useCallback(()=>{if(G.current){const we=G.current.getBoundingClientRect(),ze=Math.max(we.width,we.height),Je=800,Pt=we.x-(ze-we.width)/2-Je,qt=we.y-(ze-we.height)/2-Je,on=ze+2*Je,sn=450,kt=we.x+we.width/2-sn,nn=we.y-(ze-we.height)/2+ze+20;fe({dotLeft:Pt,dotTop:qt,dotSize:on,borderWidth:Je,textTop:nn,textLeft:kt,textWidth:sn})}},[]);return useEffect(()=>(window.addEventListener("resize",ve),window.addEventListener("scroll",ve),()=>{window.removeEventListener("resize",ve),window.removeEventListener("scroll",ve)}),[ve]),useLayoutEffect(ve,[G.current,ve]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:de.featureWrapper,ref:G,children:p}),createPortal(_jsx(Box,{className:de.backdrop,children:_jsx(ClickAwayListener,{onClickAway:w,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:de.dot,"data-testid":"dot",style:{left:U==null?void 0:U.dotLeft,top:U==null?void 0:U.dotTop,width:U==null?void 0:U.dotSize,height:U==null?void 0:U.dotSize,borderWidth:U==null?void 0:U.borderWidth},onClick:w,onKeyDown:w,role:"button",tabIndex:0,children:_jsx(Box,{className:de.pulseCircle})}),_jsxs(Box,{className:de.text,"data-testid":"text",style:{left:U==null?void 0:U.textLeft,top:U==null?void 0:U.textTop,width:U==null?void 0:U.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),N)]}):_jsx(_Fragment,{children:p})}var uo=t(35292);const ho=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function Or({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,n.jsx)(uo.Z,{}),label:p,onClick:v,title:w}){const N=ho();return o?(0,n.jsxs)(ye.Z,{title:w,className:ee()(N.link,N.disabled),children:[d,(0,n.jsx)(O.Z,{variant:"caption",component:"span",className:N.label,children:p})]}):(0,n.jsxs)(He,{title:w,className:ee()(N.link,N[e]),to:a,onClick:v,children:[d,(0,n.jsx)(O.Z,{variant:"caption",component:"span",className:N.label,children:p})]})}const pr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Gr(e){const{links:o}=e,a=pr();return(0,n.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,n.jsx)(Or,{...d},p+1))})}const Br=e=>{const o=e==="dark"?"16%":"97%";return`
16
+ hsl(0, 0%, ${o}) 0%,
17
+ hsla(0, 0%, ${o}, 0.987) 8.1%,
18
+ hsla(0, 0%, ${o}, 0.951) 15.5%,
19
+ hsla(0, 0%, ${o}, 0.896) 22.5%,
20
+ hsla(0, 0%, ${o}, 0.825) 29%,
21
+ hsla(0, 0%, ${o}, 0.741) 35.3%,
22
+ hsla(0, 0%, ${o}, 0.648) 41.2%,
23
+ hsla(0, 0%, ${o}, 0.55) 47.1%,
24
+ hsla(0, 0%, ${o}, 0.45) 52.9%,
25
+ hsla(0, 0%, ${o}, 0.352) 58.8%,
26
+ hsla(0, 0%, ${o}, 0.259) 64.7%,
27
+ hsla(0, 0%, ${o}, 0.175) 71%,
28
+ hsla(0, 0%, ${o}, 0.104) 77.5%,
29
+ hsla(0, 0%, ${o}, 0.049) 84.5%,
30
+ hsla(0, 0%, ${o}, 0.013) 91.9%,
31
+ hsla(0, 0%, ${o}, 0) 100%
32
+ `},po=100,$n=10,Qn=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:po,height:`calc(100% + ${$n}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-$n,background:`linear-gradient(90deg, ${Br(e.palette.type)})`},fadeRight:{right:-$n,background:`linear-gradient(270deg, ${Br(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function fr(e){const[[o,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const w=p.scrollLeft,N=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([w,N])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,a]}function Tr(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),w=requestAnimationFrame(N=>{if(!e.current)return;const G=N-v,U=Math.abs(d)*G/o,de=Math.max(a,U)*Math.sign(d);e.current.scrollBy({left:de});const ve=d-de;Math.sign(d)!==Math.sign(ve)?p(0):p(ve)});return()=>cancelAnimationFrame(w)},[e,d,o,a]),p}function fo(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,w=Qn(e),N=React.useRef(),[G,U]=fr(N),fe=Tr(N,a,d),de=ve=>{!N.current||fe(ve?o:-o)};return _jsxs(Box,{...v,className:w.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:w.container,ref:N,children:p}),_jsx(Box,{className:classNames(w.fade,w.fadeLeft,{[w.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(w.fade,w.fadeRight,{[w.fadeHidden]:U===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>de(!1),className:classNames(w.button,w.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),U>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>de(!0),className:classNames(w.button,w.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const go=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Kr(e){const o=go(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const mo=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function vo(e){const{Progress:o}=(0,z.qD)().getComponents();return(0,n.jsx)(m.Suspense,{fallback:(0,n.jsx)(o,{}),children:(0,n.jsx)(mo,{...e})})}var $r=t(28865),Jn=t(60251);const ar=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),gr=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(gr,e):e,lr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(gr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},Zr={code:({inline:e,className:o,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,n.jsx)(Re,{language:v[1],text:p}):(0,n.jsx)("code",{className:o,...d,children:a})},h1:lr,h2:lr,h3:lr,h4:lr,h5:lr,h6:lr};function Yr(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:w}=e,N=ar();return(0,n.jsx)($r.D,{remarkPlugins:a==="gfm"?[Jn.Z]:[],className:`${N.markdown} ${w}`,children:o,components:Zr,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var Jr=t(23054);const Xr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Qr=({request:e,busy:o,setBusy:a})=>{const d=Xr(),[p,v]=useState(),w=async()=>{a(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{a(!1)}},N=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(N,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:w,children:"Log in"})]})};var mr=null;const yo=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function qr(e){const o=yo(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),w=()=>{v.forEach(N=>N.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:v.map(N=>_jsx(LoginRequestListItem,{request:N,busy:a,setBusy:d},N.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:w,children:"Reject All"})})]})}var xo=t(15277),bo=t.n(xo),Dr=t(29862);const So=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Co(e){const[o,a]=(0,m.useState)(!1),d=(0,Dr.t)(),p=So(),v=N=>{d()&&a(N)};var w;return(0,n.jsx)(Rt.ZP,{title:(w=e.title)!==null&&w!==void 0?w:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,n.jsx)(bo(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var _r=t(67358);function jo(e){const o=(0,_e.Z)(),[a,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const p=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(p)},[o.transitions.duration.short]),a?(0,n.jsx)(_r.Z,{...e,"data-testid":"progress"}):(0,n.jsx)(ye.Z,{display:"none"})}var Nr=t(94339),cr=t(14503),vr=t(24579),Yt=t(32552),Ln=t(15459),wo=t(27597);const eo=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Eo(e){const{link:o,title:a,onClick:d}=e,p=eo();return(0,n.jsxs)(ye.Z,{children:[(0,n.jsx)(nr.Z,{}),(0,n.jsx)(He,{to:o,onClick:d,underline:"none",children:(0,n.jsxs)(ye.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(ye.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(O.Z,{children:(0,n.jsx)("strong",{children:a})})}),(0,n.jsx)(wo.Z,{className:p.arrow})]})})]})}const Ao=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,n.jsxs)(O.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,n.jsxs)(O.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,n.jsx)(Qe,{to:o.href,variant:"contained",children:o.name})},To=class extends m.Component{componentDidCatch(o,a){console.error(`ErrorBoundary, error: ${o}, info: ${a}`),this.setState({error:o,errorInfo:a})}render(){const{slackChannel:o,children:a}=this.props,{error:d}=this.state;return d?(0,n.jsx)(Cn,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(Ao,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},Io=(0,l.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"}),Ro=(0,Ln.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(cr.Z),to={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Ir(e){const{title:o,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:w,variant:N,children:G,headerStyle:U,headerProps:fe,icon:de,action:ve,actionsClassName:we,actions:ze,cardClassName:Je,actionsTopRight:Pt,className:qt,noPadding:on,titleTypographyProps:sn}=e,kt=Io();let nn={},_t={};N&&N.split(/[\s]+/g).forEach(wr=>{nn={...nn,...to.card[wr]},_t={..._t,...to.cardContent[wr]}});const Sr=()=>!a&&!de?null:(0,n.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,n.jsx)("div",{className:kt.subheader,children:a}),de]}),Cr=w||(v?{slackChannel:v}:{});return(0,n.jsx)(Nr.Z,{style:nn,className:qt,children:(0,n.jsxs)(To,{...Cr,children:[o&&(0,n.jsx)(Yt.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:o,subheader:Sr(),action:ve,style:{...U},titleTypographyProps:sn,...fe}),Pt&&(0,n.jsx)(Ro,{children:Pt}),d&&(0,n.jsx)(nr.Z,{}),(0,n.jsx)(vr.Z,{className:ee()(Je,{[kt.noPadding]:on}),style:_t,children:G}),ze&&(0,n.jsx)(cr.Z,{className:we,children:ze}),p&&(0,n.jsx)(Eo,{...p})]})})}var Yo=t(39307);const Lo=(0,l.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"}),no={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||no.max,v=a?p-o:o;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function Jo(e){const[o,a]=useState(null),{getColor:d=Po}=e,p=Lo(e),{palette:v}=useTheme(),{value:w,fractional:N,inverse:G,unit:U,max:fe,description:de}={...no,...e},ve=N?Math.round(w*fe):w,we=fe!==100?Math.round(w):ve,[ze,Je]=useState(!1);return useEffect(()=>{const Pt=o,qt=()=>Je(!0),on=()=>Je(!1);return Pt&&de?(Pt.addEventListener("mouseenter",qt),Pt.addEventListener("mouseleave",on),()=>{Pt.removeEventListener("mouseenter",qt),Pt.removeEventListener("mouseleave",on)}):()=>{Je(!1)}},[de,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ve,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:we,inverse:G,max:fe}),className:p.circle}),de&&ze?_jsx(Box,{className:p.description,children:de}):_jsx(Box,{className:p.overlay,children:isNaN(w)?"N/A":`${we}${U}`})]})}const ko=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function As(e){const o=ko(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:w,description:N,icon:G,variant:U,getColor:fe}=e,de={inverse:v,description:N,getColor:fe,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:w,variant:U,icon:G,children:_jsx(Gauge,{...de})})})}function y(e){const{value:o,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let p=Math.round(o*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var x=t(21324),I=t(7089),Z=t(1292),J=t(42494),te=t(74603),oe=t(56939),ue=t(12231),Se=t(73698),je=t(72379);const Te=(0,l.Z)(e=>(0,k.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var De=()=>{const e=Te();return(0,n.jsx)(je.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 Ye=(0,l.Z)(e=>(0,k.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var $e=()=>{const e=Ye();return(0,n.jsx)(je.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 xt=(0,Ln.Z)(e=>(0,k.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(te.Z),Vt=(0,l.Z)(e=>(0,k.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function jn(e){const{multiple:o,items:a,label:d,placeholder:p,selected:v,onChange:w,triggerReset:N,native:G=!1,disabled:U=!1,margin:fe}=e,de=Vt(),[ve,we]=(0,m.useState)(v||(o?[]:"")),[ze,Je]=(0,m.useState)(!1);(0,m.useEffect)(()=>{we(o?[]:"")},[N,o]),(0,m.useEffect)(()=>{v!==void 0&&we(v)},[v]);const Pt=kt=>{we(kt.target.value),w(kt.target.value)},qt=kt=>{if(U){kt.preventDefault();return}Je(nn=>o&&!(kt.target instanceof HTMLElement)?!0:!nn)},on=()=>{Je(!1)},sn=kt=>()=>{const nn=ve.filter(_t=>_t!==kt);we(nn),w(nn)};return(0,n.jsx)(ye.Z,{className:de.root,children:(0,n.jsx)(Z.Z,{onClickAway:on,children:(0,n.jsxs)(J.Z,{className:de.formControl,children:[(0,n.jsx)(oe.Z,{className:de.formLabel,children:d}),(0,n.jsxs)(Se.Z,{"aria-label":d,value:ve,native:G,disabled:U,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Pt,onClick:qt,open:ze,input:(0,n.jsx)(xt,{}),label:d,tabIndex:0,renderValue:kt=>{var nn;return o&&ve.length!==0?(0,n.jsx)(ye.Z,{className:de.chips,children:kt.map(_t=>{var Sr,Cr;return(0,n.jsx)(I.Z,{label:(Sr=a.find(jr=>jr.value===_t))===null||Sr===void 0?void 0:Sr.label,clickable:!0,onDelete:sn(_t),className:de.chip},(Cr=a.find(jr=>jr.value===_t))===null||Cr===void 0?void 0:Cr.value)})}):(0,n.jsx)(O.Z,{children:ve.length===0?p||"":(nn=a.find(_t=>_t.value===kt))===null||nn===void 0?void 0:nn.label})},IconComponent:()=>ze?(0,n.jsx)($e,{}):(0,n.jsx)(De,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,n.jsx)(ue.Z,{value:[],children:p}),G?a&&a.map(kt=>(0,n.jsx)("option",{value:kt.value,children:kt.label},kt.value)):a&&a.map(kt=>(0,n.jsxs)(ue.Z,{value:kt.value,children:[o&&(0,n.jsx)(x.Z,{color:"primary",checked:ve.includes(kt.value)||!1,className:de.checkbox}),kt.label]},kt.value))]})]})})})}const hn=()=>{},rr=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:hn,stepHistory:[],setStepHistory:hn,onStepChange:hn});function Pn(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,w]=useState(p),[N,G]=useState([0]);useEffect(()=>{w(p)},[p]);const U=[];let fe;return Children.forEach(o,de=>{isValidElement(de)&&(de.props.end?fe=de:U.push(de))}),_jsxs(_Fragment,{children:[_jsx(rr.Provider,{value:{stepIndex:v,setStepIndex:w,stepHistory:N,setStepHistory:G,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:U})}),v>=Children.count(o)-1&&fe]})}const Zn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Gn=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Rr=({text:e,handleClick:o,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:o,children:e||(d?"Finish":"Next")}),yr=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Lr=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Dn=({actions:e={},children:o})=>{const a=Zn(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:w,setStepHistory:N,onStepChange:G}=useContext(VerticalStepperContext),U=(we,ze)=>{ze&&ze(),G&&G(p,we),v(we)},fe=()=>{const we=e.nextStep?e.nextStep(p,d-1):p+1;U(we,e.onNext),N([...w,we])},de=()=>{w.pop(),U(w[w.length-1],e.onBack),N([...w])},ve=()=>{U(0,e.onRestart),N([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Lr,{text:e.backText,handleClick:de,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(yr,{text:e.skipText,handleClick:fe,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Rr,{text:e.nextText,handleClick:fe,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Gn,{text:e.restartText,handleClick:ve,stepIndex:p}),o]})},Nn=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function dr(e){const{title:o,children:a,end:d,actions:p,...v}=e,w=Nn();return d?_jsxs(Box,{className:w.end,children:[_jsx(Typography,{variant:"h6",children:o}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const xr=(0,l.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 pi(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function fi(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function oa(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Fr(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function gi(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Fn(e){const o=xr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var sa=t(74600),Ts=t(15584);const mi=e=>(0,k.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Is={root:{border:"0",verticalAlign:"top"}},vi=e=>(0,k.Z)({root:{margin:e.spacing(0,0,-1,0)}}),yi=e=>(0,k.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Oo=(0,Ln.Z)(mi,{name:"BackstageMetadataTableTitleCell"})(Ts.Z),Rs=(0,Ln.Z)(Is,{name:"BackstageMetadataTableCell"})(Ts.Z),Bo=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),$o=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(Oo,{children:e}),_jsx(Rs,{colSpan:e?1:2,...a,children:o})]}),Ur=(0,Ln.Z)(vi,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(ft.Z,{disablePadding:!0,className:e.root,children:o})),xi=(0,Ln.Z)(yi,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,n.jsx)(ct.Z,{className:e.root,children:o})),Zo=(0,k.Z)({root:{margin:"0 0",listStyleType:"none"}}),Xo=e=>(0,k.Z)({root:{...Zo.root,paddingLeft:e.spacing(1)}}),Qo=(0,Ln.Z)(Zo,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,n.jsx)(Ur,{classes:e,children:o})),qo=(0,Ln.Z)(Xo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,n.jsx)(Ur,{classes:e,children:o}));function Ls(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:Do(d)},p));return o?_jsx(qo,{children:a}):_jsx(Qo,{children:a})}function Ps(e,o,a){const d=Object.keys(e).map(p=>{const v=Do(e[p],!0),w=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${w}: `}),v]},p)});return o?_jsx(qo,{children:d}):_jsx(Qo,{children:d})}function Do(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ps(e,o,a):Array.isArray(e)?Ls(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const br=({value:e,options:o})=>_jsx(Fragment,{children:Do(e,o)}),No=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(br,{value:o,options:a})});function ks(e,o){return Object.keys(e).map(a=>_jsx(No,{title:a,value:e[a],options:o},a))}function bi(e){const{metadata:o,dense:a=!0,options:d}=e,p=ks(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var _o=t(49429),Os=t(86136),es=t(79784),Bs=t(19126),ts=t.n(Bs);function Si(e){return qs.stringify(e,{strictNullHandling:!0})}function ns(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function rs(e,o){return ns(e)[o]}function $s(e,o,a){const d={...ns(e),[o]:a};return Si(d)}function Ci(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[v,w]=useState(rs(p,e));return useEffect(()=>{const N=rs(p,e);w(G=>isEqual(N,G)?G:N)},[p,w,e]),useDebouncedEffect(()=>{const N=$s(p,e,v);p!==N&&d(N,{replace:!0})},[d,v,p,e],o),[v,w]}const os={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 ro(){const o=(0,z.I_)().get(z.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return os;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var Zs=t(80079);function qn(e,o){const d=(0,z.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...o}):(0,n.jsx)(Zs.Z,{...o})}function ji(e){return qn("brokenImage",e)}function wi(e){return qn("catalog",e)}function ia(e){return qn("chat",e)}function aa(e){return qn("dashboard",e)}function Fo(e){return qn("docs",e)}function la(e){return qn("email",e)}function ca(e){return qn("github",e)}function Ei(e){return qn("group",e)}function oo(e){return qn("help",e)}function Ds(e){return qn("user",e)}function da(e){return qn("warning",e)}const Ai=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ss=({icon:e})=>{const o=(0,z.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:oo;return(0,n.jsx)(d,{})};var so;const Ns=({link:e})=>(0,n.jsx)(He,{to:e.url,children:(so=e.title)!==null&&so!==void 0?so:e.url}),Fs=({item:e})=>{var o;return(0,n.jsxs)(ct.Z,{children:[(0,n.jsx)(Os.Z,{children:(0,n.jsx)(ss,{icon:e.icon})}),(0,n.jsx)(et.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((a,d,p)=>[...a,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(Ns,{link:d},d.url)],[])})]})};function Ti(e){const{title:o,items:a,children:d}=e,{items:p}=ro(),[v,w]=(0,m.useState)(!1),[N,G]=(0,m.useState)(null),U=Ai(),fe=(0,Ee.Z)(we=>we.breakpoints.down("sm")),de=we=>{G(we.currentTarget),w(!0)},ve=()=>{w(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye.Z,{display:"flex",ml:1,children:fe?(0,n.jsx)(ut.Z,{color:"primary",size:"small",onClick:de,"data-testid":"support-button",children:(0,n.jsx)(oo,{})}):(0,n.jsx)(ne.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:de,startIcon:(0,n.jsx)(oo,{}),children:"Support"})}),(0,n.jsxs)(es.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:N,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ve,children:[(0,n.jsxs)(ft.Z,{className:U.popoverList,children:[o&&(0,n.jsx)(ct.Z,{alignItems:"flex-start",children:(0,n.jsx)(O.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(we,ze)=>(0,n.jsx)(ct.Z,{alignItems:"flex-start",children:we},`child-${ze}`)),(a!=null?a:p).map((we,ze)=>(0,n.jsx)(Fs,{item:we},`item-${ze}`))]}),(0,n.jsx)(_o.Z,{children:(0,n.jsx)(ne.Z,{color:"primary",onClick:ve,children:"Close"})})]})]})}var is=t(18671),as=t(16060);const Uo=72,ls=24,kn=18,ur={drawerWidthClosed:Uo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Uo,iconSize:Uo-ls*2,iconPadding:ls,selectedIndicatorWidth:3,userBadgePadding:kn,userBadgeDiameter:Uo-kn*2,mobileSidebarHeight:56},Us=e=>({...ur,...e,iconContainerWidth:ur.drawerWidthClosed,iconSize:ur.drawerWidthClosed-ur.iconPadding*2,userBadgeDiameter:ur.drawerWidthClosed-ur.userBadgePadding*2}),Ms={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:ur.defaultOpenDelayMs+200},Ii=e=>({...Ms,...e}),ua="@backstage/core/sidebar-intro-dismissed",or=(0,m.createContext)({sidebarConfig:ur,submenuConfig:Ms}),zs=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ri=t(50023),Li=t(4190),Pi=t(87685),ki=t(44882),Mo=t(51837);const Ws={isOpen:!1,setOpen:()=>{}},Vs=(0,m.createContext)(Ws),zo=(0,Mo.CT)("sidebar-open-state-context");function cs(e){const{children:o,value:a}=e;return(0,n.jsx)(Vs.Provider,{value:a,children:(0,n.jsx)(zo.Provider,{value:(0,Mo.EI)({1:a}),children:o})})}const Wo=()=>{const e=(0,m.useContext)(zo),o=(0,m.useContext)(Vs);if(e===void 0)return o||Ws;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var Hs=t(57998);const ds={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},us=(0,m.createContext)(ds),hs=(0,Mo.CT)("sidebar-pin-state-context");function Gs(e){const{children:o,value:a}=e;return(0,n.jsx)(us.Provider,{value:a,children:(0,n.jsx)(hs.Provider,{value:(0,Mo.EI)({1:a}),children:o})})}const Mr=()=>{const e=(0,m.useContext)(hs),o=(0,m.useContext)(us);if(e===void 0)return o||ds;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Ks=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Oi=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,m.useContext)(or),w=Ks({sidebarConfig:v}),N=(0,T.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:U}=(0,m.useContext)(gs),fe=(ve,we)=>{U(we===G?-1:we)},de=p===G&&G>=0||p!==G&&!(G>=0)&&o===N.pathname;return(0,n.jsx)(Hs.Z,{label:a,icon:d,component:He,to:o||N.pathname,onChange:fe,value:p,selected:de,classes:w})},ps=e=>{const{children:o,to:a,label:d,icon:p,value:v}=e,{isMobile:w}=Mr();return w?(0,n.jsx)(Oi,{to:a,label:d,icon:p,value:v}):(0,n.jsx)(n.Fragment,{children:o})},fs=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.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:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Bi=e=>(0,ae.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ys=m.createElement(ps).type,Js=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(or),v=fs({sidebarConfig:p});return(0,n.jsxs)(Li.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,n.jsxs)(ye.Z,{className:v.overlayHeader,children:[(0,n.jsx)(O.Z,{variant:"h3",children:o}),(0,n.jsx)(ut.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,n.jsx)(Pi.Z,{})})]}),(0,n.jsx)(ye.Z,{component:"nav",children:e})]})},gs=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Xs=e=>{const{sidebarConfig:o}=(0,m.useContext)(or),{children:a}=e,d=fs({sidebarConfig:o}),p=(0,T.TH)(),[v,w]=(0,m.useState)(-1);(0,m.useEffect)(()=>{w(-1)},[p.pathname]);let N=(0,z.vJ)(a,U=>U.getElements().filter(fe=>fe.type===Ys));if(a)N.length?N=Bi(N):N.push((0,n.jsx)(ps,{icon:(0,n.jsx)(ki.Z,{}),children:a},"default_menu"));else return null;const G=v>=0&&!N[v].props.to;return(0,n.jsx)(cs,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(gs.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:w},children:[(0,n.jsx)(Js,{label:N[v]&&N[v].props.label,open:G,onClose:()=>w(-1),children:N[v]&&N[v].props.children}),(0,n.jsx)(Ri.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:N})]})})};var io;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(io||(io={}));const ms={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(io.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(io.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Qs=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),_n=(0,m.createContext)({content:{contentRef:void 0}});function _s(e){const[o,a]=(0,m.useState)(()=>ms.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(or),p=(0,m.useRef)(null),v=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{ms.setSidebarPinState(o)},[o]);const w=(0,Ee.Z)(U=>U.breakpoints.down("xs"),{noSsr:!0}),N=()=>a(!o),G=Qs({isPinned:o,sidebarConfig:d});return(0,n.jsx)(Gs,{value:{isPinned:o,toggleSidebarPinState:N,isMobile:w},children:(0,n.jsx)(_n.Provider,{value:v,children:(0,n.jsx)(ye.Z,{className:G.root,children:e.children})})})}function vs(){const{content:e}=(0,m.useContext)(_n);return{focusContent:(0,m.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const ys=(0,l.Z)(e=>({drawer:o=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:o.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"& .MuiButtonBase-root":{textTransform:"none"}}),drawerOpen:o=>({width:o.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 Un;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Un||(Un={}));const ei=e=>{const{sidebarConfig:o}=(0,m.useContext)(or),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,w=ys({sidebarConfig:o}),N=(0,Ee.Z)(qt=>qt.breakpoints.down("md"),{noSsr:!0}),[G,U]=(0,m.useState)(Un.Closed),fe=(0,m.useRef)(),{isPinned:de,toggleSidebarPinState:ve}=Mr(),we=()=>{de||p||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Un.Open&&!N&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Un.Open)},a),U(Un.Idle)))},ze=()=>{de||p||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Un.Idle?U(Un.Closed):G===Un.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Un.Closed)},d)))},Je=G===Un.Open&&!N||de,Pt=qt=>{qt?(U(Un.Open),ve()):(U(Un.Closed),ve())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(ni,{}),(0,n.jsx)(cs,{value:{isOpen:Je,setOpen:Pt},children:(0,n.jsx)(ye.Z,{className:w.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:we,onFocus:p?()=>{}:we,onMouseLeave:p?()=>{}:ze,onBlur:p?()=>{}:ze,children:(0,n.jsx)(ye.Z,{className:ee()(w.drawer,{[w.drawerOpen]:Je}),children:v})})})]})},ti=e=>{var o;const a=Us((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=Ii((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:w,openDelayMs:N,closeDelayMs:G}=e,{isMobile:U}=Mr();return U?(0,n.jsx)(Xs,{children:v}):(0,n.jsx)(or.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,n.jsx)(ei,{openDelayMs:N,closeDelayMs:G,disableExpandOnHover:w,children:v})})};function ni(){const{sidebarConfig:e}=(0,m.useContext)(or),{focusContent:o,contentRef:a}=vs(),d=ys({sidebarConfig:e});return a!=null&&a.current?(0,n.jsx)(ne.Z,{onClick:o,variant:"contained",className:ee()(d.visuallyHidden),children:"Skip to content"}):null}function xs(e,o){const a=new URLSearchParams(o.search).toString(),d=ts().parse(a),p=new URLSearchParams(e.search).toString(),v=ts().parse(p);return(0,ae.isEqual)(o.pathname,e.pathname)&&(0,ae.isMatch)(v,d)}const $i=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Zi=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:v}=e,w=$i(),{setIsHoveredOn:N}=useContext(SidebarItemWithSubmenuContext),G=()=>{N(!1)},U=useResolvedPath(d!=null?d:""),fe=useLocation();let de=isLocationMatch(fe,U);const[ve,we]=useState(!1),ze=()=>{we(!ve)};return v!==void 0?(v.some(Je=>{const Pt=resolvePath(Je.to);return de=isLocationMatch(fe,Pt),de}),_jsxs(Box,{className:w.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:ze,onTouchStart:Je=>Je.stopPropagation(),className:classnames(w.item,de?w.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:a})]}),ve?_jsx(ArrowDropUpIcon,{className:w.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:w.dropdownArrow})]})}),v&&ve&&_jsx(Box,{className:w.dropdown,children:v.map((Je,Pt)=>_jsx(Tooltip,{title:Je.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Je.to,underline:"none",className:w.dropdownItem,onClick:G,onTouchStart:qt=>qt.stopPropagation(),children:_jsx(Typography,{className:w.textContent,children:Je.title})})},Pt))})]})):_jsx(Box,{className:w.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(w.item,de?w.selected:void 0),onClick:G,onTouchStart:Je=>Je.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:a})]})]})})})};var i;const r=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(i=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&i!==void 0?i:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),s=e=>{const{isOpen:o}=Wo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(or),p=o?a.drawerWidthOpen:a.drawerWidthClosed,v=r({left:p,submenuConfig:d}),{isHoveredOn:w}=(0,m.useContext)(zs),[N,G]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{G(w)},[w]),(0,n.jsxs)(ye.Z,{className:ee()(v.drawer,{[v.drawerOpen]:N}),children:[(0,n.jsx)(O.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var c=t(26739),g=t(76600),P=t(83543),F=t(59797),H=t(98989);const le=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ne=()=>{const e=le();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 Le=null;const rt=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),lt=()=>{const e=rt();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 Ct=null,yt,$t;const Ft=e=>(0,l.Z)(o=>{var a,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(yt=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&yt!==void 0?yt:"#404040"}},highlighted:{background:($t=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&$t!==void 0?$t:"#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:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function xn(e){return(0,m.useMemo)(()=>Ft(e),[e])()}const er=(e,o)=>(0,z.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:w})=>d=d||xs(o,(0,as.i3)(w)));return}p&&(d=xs(o,(0,as.i3)(p)))}}),d},[o.pathname]);function tr(e){return e.to===void 0}const ao=m.createElement(s).type,ri=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:v,caseSensitive:w,activeClassName:N="active","aria-current":G="page",...U},fe){let{pathname:de}=(0,T.TH)(),{pathname:ve}=(0,T.WU)(o);w||(de=de.toLocaleLowerCase("en-US"),ve=ve.toLocaleLowerCase("en-US"));let we=de===ve;!we&&!a&&(we=de.startsWith(`${ve}/`));const ze=we?G:void 0;return(0,n.jsx)(R.rU,{...U,to:o,ref:fe,"aria-current":ze,style:{...d,...we?v:void 0},className:ee()([p,we?N:void 0])})}),bs=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:w=!1,onClick:N,children:G,className:U,...fe}=e,{sidebarConfig:de}=(0,m.useContext)(or),ve=xn(de),{isOpen:we}=Wo(),ze=!we&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Je=(0,n.jsxs)(ye.Z,{style:ze,children:[(0,n.jsx)(a,{fontSize:"small"}),!we&&v?(0,n.jsx)(H.Z,{fontSize:"small"}):(0,n.jsx)(n.Fragment,{})]}),Pt=(0,n.jsx)(c.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:ee()({[ve.closedItemIcon]:!we}),children:Je}),qt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye.Z,{"data-testid":"login-button",className:ve.iconContainer,children:Pt}),d&&(0,n.jsx)(O.Z,{variant:"subtitle2",className:ve.label,children:d}),(0,n.jsx)("div",{className:ve.secondaryAction,children:G})]}),on=we?qt:Pt,sn={onClick:N,className:ee()(U,ve.root,we?ve.open:ve.closed,tr(e)&&ve.buttonItem,{[ve.highlightable]:!w})};return tr(e)?(0,n.jsx)(ne.Z,{role:"button","aria-label":d,...sn,ref:o,children:on}):(0,n.jsx)(ri,{...sn,activeClassName:ve.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...fe,children:on})}),Vo=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(or),d=xn(a),[p,v]=(0,m.useState)(!1),w=(0,T.TH)(),N=er(e,w),G=(0,Ee.Z)(ve=>ve.breakpoints.down("sm")),U=()=>{v(!0)},fe=()=>{v(!1)},de=()=>G?p?(0,n.jsx)(F.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(P.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(H.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(zs.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:p?fe:U,onMouseEnter:U,className:ee()(p&&d.highlighted),children:[(0,n.jsx)(bs,{hasSubmenu:!0,className:N?d.selected:"",...o,children:de()}),p&&e]})})},Ss=(0,m.forwardRef)((e,o)=>{const[a]=(0,z.vJ)(e.children,d=>d.getElements().filter(p=>p.type===ao));return a?(0,n.jsx)(Vo,{...e,children:a}):(0,n.jsx)(bs,{...e,ref:o})});function zr(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=xn(o),v=e.icon?e.icon:SearchIcon,w=()=>{e.onSearch(a),d("")},N=de=>{de.key==="Enter"&&(de.preventDefault(),w())},G=de=>{d(de.target.value)},U=de=>{de.preventDefault(),de.stopPropagation()},fe=de=>{w(),de.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Ss,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:U,onChange:G,onKeyDown:N,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Vl=(0,g.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Hl=(0,g.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),ha=(0,g.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),pa=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Gl=(0,g.Z)("div")(({theme:e})=>{const o=pa(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Kl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=xn(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(w=>w.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},fa=(0,l.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.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 ga(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=fa({sidebarConfig:o}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Di=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(ga,{text:o,onClose:v})})},ma=null,va="And your recently viewed plugins will pop up here!";function Yl(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:w}=d!=null?d:{},N=()=>{p(U=>({...a,...U,starredItemsDismissed:!0}))},G=()=>{p(U=>({...a,...U,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Di,{text:ma,onDismiss:N}),_jsx(SidebarDivider,{})]}),!w&&_jsx(Di,{text:va,onDismiss:G})]}):null}const ya=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ni(e){const{className:o,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:w}=vs(),N=ya();return(0,n.jsx)("article",{ref:w,tabIndex:-1,...v,className:ee()(N.root,o,{[N.stretch]:a,[N.noPadding]:d}),children:p})}var xa=t(6487),ba=t(99152);const Sa=(0,l.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 Fi(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,v]=(0,m.useState)(d!=null?d:0),w=Sa(),N=(0,m.useCallback)((G,U)=>{d===void 0&&v(U),a&&d!==U&&a(U)},[d,a]);return(0,m.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,n.jsx)(ye.Z,{className:w.tabsWrapper,children:(0,n.jsx)(ba.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:N,value:p,children:o.map((G,U)=>(0,m.createElement)(xa.Z,{...G.tabProps,"data-testid":`header-tab-${U}`,label:G.label,key:G.id,value:U,className:w.defaultTab,classes:{selected:w.selected,root:w.tabRoot}}))})})}function Ca(e){const o=(0,T.UO)(),d=e.map(({path:ve,children:we})=>({caseSensitive:!1,path:`${ve}/*`,element:we})).sort((ve,we)=>we.path.replace(/\/\*$/,"").localeCompare(ve.path.replace(/\/\*$/,"")));var p;const v=(p=(0,T.V$)(d))!==null&&p!==void 0?p:e[0].children;var w;let N=(w=o["*"])!==null&&w!==void 0?w:"";N.startsWith("/")||(N=`/${N}`);var G;const[U]=(G=(0,as.fp)(d,N))!==null&&G!==void 0?G:[],fe=U?e.findIndex(ve=>`${ve.path}/*`===U.route.path):0;var de;return{index:fe===-1?0:fe,element:v,route:(de=e[fe])!==null&&de!==void 0?de:e[0]}}function Ui(e){const{routes:o}=e,a=(0,T.s0)(),{index:d,route:p,element:v}=Ca(o),w=(0,m.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),N=G=>{let{path:U}=o[G];U=U.replace(/\/\*$/,""),U=U.replace(/^\//,""),a(U)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Fi,{tabs:w,selectedIndex:d,onChange:N}),(0,n.jsxs)(Ni,{children:[(0,n.jsx)(is.q,{title:p.title}),v]})]})}const oi=()=>null;(0,z.R5)(oi,"core.gatherMountPoints",!0);function Mi(e){const o=(0,n.jsx)(oi,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(a=>{if(!(0,m.isValidElement)(a))return[];if(a.type===m.Fragment)return Mi(a.props.children);if(a.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:w}=a.props;return[{path:d,title:p,children:v,tabProps:w}]})}function ja(e){const o=Mi(e.children);return(0,n.jsx)(Ui,{routes:o})}ja.Route=oi;const wa=(0,l.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ea(e){const{value:o,subvalue:a}=e,d=wa();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye.Z,{className:d.value,children:o}),(0,n.jsx)(ye.Z,{className:d.subvalue,children:a})]})}var Cs=t(67222),Aa=t(21070),Ta=t(90324),Ia=t(98281),Ra=t(48049),zi=t(51209),Wi=t(33375),La=t(44233),Pa=t(27604),si=t(36444),ka=t(37971),Oa=t(59709),Ba=t(17373),$a=t(3702),Za=t(93111);const Da=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height: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"}),Na=e=>{var o;const a=Da(),{onChangeFilters:d}=e,[p,v]=(0,m.useState)({...e.selectedFilters}),[w,N]=(0,m.useState)(!1),G=()=>{v({}),N(U=>!U)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)(ye.Z,{className:a.root,children:[(0,n.jsxs)(ye.Z,{className:a.header,children:[(0,n.jsx)(ye.Z,{className:a.value,children:"Filters"}),(0,n.jsx)(ne.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,n.jsx)(ye.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(U=>(0,n.jsx)(jn,{triggerReset:w,...U.element,selected:p[U.element.label],onChange:fe=>v({...p,[U.element.label]:fe})},U.element.label))})]})},Vi={Add:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Aa.Z,{...e,ref:o})),Check:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ia.Z,{...e,ref:o})),Clear:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Wi.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,n.jsx)(La.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,n.jsx)(zi.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Pa.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,n.jsx)($a.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,n.jsx)(si.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(ka.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Oa.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(zi.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ra.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Wi.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,n.jsx)(si.Z,{...e,ref:o})),SortArrow:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ta.Z,{...e,ref:o})),ThirdStateCheck:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Ba.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,n.jsx)(Za.Z,{...e,ref:o}))};function Hi(e,o){const a=o.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Fa=(0,Ln.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Cs.W$),Gi=(0,Ln.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"})(Cs.UW),Ua=(0,l.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ma=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function za(e,o){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=o.palette.textContrast,typeof p=="object")p.fontWeight=o.typography.fontWeightBold;else{const v=p;p=(w,N,G)=>({...v(w,N,G),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function Wa(e,o){return(0,ae.transform)(e,(a,d,p)=>{(0,ae.isEqual)(d,o[p])||(a[p]=d)})}const Ki={search:"",filtersOpen:!1,filters:{}};function Va(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,w=Ua(),N=(0,m.useCallback)(G=>{e.onSearchChanged(G),a(G)},[e,a]);return d?(0,n.jsxs)(ye.Z,{className:w.root,children:[(0,n.jsxs)(ye.Z,{className:w.root,children:[(0,n.jsx)(ut.Z,{onClick:v,"aria-label":"filter list",children:(0,n.jsx)(si.Z,{})}),(0,n.jsxs)(O.Z,{className:w.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Gi,{...e,ref:o,onSearchChanged:N})]}):(0,n.jsx)(Gi,{...e,ref:o,onSearchChanged:N})}function Yi(e){const{data:o,columns:a,options:d,title:p,subtitle:v,filters:w,initialState:N,emptyContent:G,onStateChange:U,components:fe,...de}=e,ve=Ma(),we=(0,_e.Z)(),ze={...Ki,...N},[Je,Pt]=(0,m.useState)(ze.filtersOpen),qt=(0,m.useCallback)(()=>Pt(Mn=>!Mn),[Pt]),[on,sn]=(0,m.useState)(0),[kt,nn]=(0,m.useState)(o),[_t,Sr]=(0,m.useState)(ze.filters),Cr=za(a,we),[jr,wr]=(0,m.useState)(ze.search);(0,m.useEffect)(()=>{if(U){const Mn=Wa({search:jr,filtersOpen:Je,filters:_t},Ki);U(Mn)}},[jr,Je,_t,U]);const di={headerStyle:{textTransform:"uppercase"}},Pr=(0,m.useCallback)(Mn=>{var hr;return(hr=a.find(Wr=>Wr.title===Mn))===null||hr===void 0?void 0:hr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!_t){nn(o);return}const Mn=Object.values(_t);if(o&&Mn.flat().length){const hr=o.filter(Wr=>!!Object.entries(_t).filter(([,Vr])=>!!Vr.length).every(([Vr,an])=>{const bn=Hi(Wr,Pr(Vr));return Array.isArray(bn)&&Array.isArray(an)?bn.some(co=>an.includes(co)):Array.isArray(bn)?bn.includes(an):Array.isArray(an)?an.includes(bn):bn===an}));nn(hr)}else nn(o);sn(Mn.flat().length)},[o,_t,Pr]);const ui=(Mn,hr)=>{const Wr=an=>{const bn=new Set,co=Hr=>{Hr!=null&&bn.add(Hr)};return hr&&hr.forEach(Hr=>{const Go=Hi(Hr,Pr(an));Array.isArray(Go)?Go.forEach(co):co(Go)}),bn},Vr=an=>({placeholder:"All results",label:an.column,multiple:an.type==="multiple-select",items:[...Wr(an.column)].sort().map(bn=>({label:bn,value:bn}))});return Mn.map(an=>({type:an.type,element:Vr(an)}))},en=!!(w!=null&&w.length),lo=(0,m.useCallback)(Mn=>(0,n.jsx)(Va,{setSearch:wr,hasFilters:en,selectedFiltersLength:on,toggleFilters:qt,...Mn}),[qt,en,on,wr]),ws=typeof o!="function"&&o.length===0,kr=a.length,hi=(0,m.useCallback)(Mn=>G&&ws?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:kr,children:G})})}):(0,n.jsx)(Cs.os,{...Mn}),[ws,G,kr]);return(0,n.jsxs)(ye.Z,{className:ve.root,children:[Je&&o&&typeof o!="function"&&(w==null?void 0:w.length)&&(0,n.jsx)(Na,{filters:ui(w,o),selectedFilters:_t,onChangeFilters:Sr}),(0,n.jsx)(Cs.ZP,{components:{Header:Fa,Toolbar:lo,Body:hi,...fe},options:{...di,...d},columns:Cr,icons:Vi,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.Z,{variant:"h5",component:"h2",children:p}),v&&(0,n.jsx)(O.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...de})]})}Yi.icons=Object.freeze(Vi);const Jl=e=>{const{children:o,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:o})})},Ha=(0,l.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:o=>o.isNext?"auto":"0",marginRight:o=>o.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Xl=e=>{const o=Ha(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:o.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},Ga=(e,o)=>o?e?"20px":"0":"40px",Ka=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>Ga(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Ql=e=>{const o=Ka(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},Ya=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),ql=e=>{const o=Ya(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},Ja=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function _l(e){const{tabs:o}=e,a=Ja(),[d,p]=useState([0,0]),[v,w]=useState(0),[N,G]=useState(0),[U,fe]=useState([[]]),de=useRef(),{width:ve}=useWindowSize(),we=(on,sn)=>{p([v,sn])},ze=()=>{w(v-1)},Je=()=>{w(v+1)},Pt=()=>v+1<U.length;useEffect(()=>{const sn=v===0?1:2,kt=de.current.offsetWidth-20-sn*30,nn=d[0]*N+d[1],_t=Math.floor(kt/170);G(_t),fe(chunkArray(o,_t)),p([Math.floor(nn/_t),nn%_t])},[ve,o]);const qt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:de,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:qt,onChange:we,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:ze,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),U[v].map((on,sn)=>_jsx(StyledTab,{value:sn,isFirstIndex:sn===0,isFirstNav:v===0,icon:on.icon||void 0,label:on.label||void 0},sn)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:Je,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),qt!==!1?U[v].map((on,sn)=>_jsx(TabPanel,{value:sn,index:qt,children:on.content},sn)):_jsx(TabPanel,{value:d[1],index:d[1],children:U[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var ec=t(44311);function Xa(e,o){const a=e[e.length-1];if(!!a)return a>=.9?o.palette.status.ok:a>=.5?o.palette.status.warning:o.palette.status.error}function tc(e){const o=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:Xa(e.data,o)})]})}const Qa=e=>(0,l.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.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:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),qa=({title:e="Unknown page",className:o})=>(0,n.jsx)(O.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function _a(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,w=Qa({textAlign:v})(),N=d||(0,n.jsx)(qa,{title:a,className:w.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(is.q,{title:a}),(0,n.jsxs)(ye.Z,{className:w.container,children:[(0,n.jsxs)(ye.Z,{className:w.leftItemsBox,children:[N,o&&(0,n.jsx)(O.Z,{className:w.description,variant:"body2",children:o})]}),(0,n.jsx)(ye.Z,{className:w.rightItemsBox,children:p})]})]})}var el=t.p+"static/mic-drop.fe3ef4d0..svg";const tl=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),nl=()=>{const e=tl();return(0,n.jsx)("img",{src:el,className:e.micDrop,alt:"Girl dropping mic from her hands"})},rl=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function ol(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=rl(),w=(0,T.s0)(),N=ro();return(0,n.jsxs)(Be.Z,{container:!0,spacing:0,className:v.container,children:[(0,n.jsxs)(Be.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(O.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",a]}),(0,n.jsx)(O.Z,{variant:"body1",className:v.subtitle,children:d}),(0,n.jsx)(O.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(O.Z,{variant:"h6",children:[(0,n.jsx)(He,{to:"#","data-testid":"go-back-link",onClick:()=>w(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(He,{to:p||N.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(nl,{})]})}var sl=t(16173);const il=(0,Ln.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(O.Z),ii=(0,Ln.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(ye.Z);function al(e){const{children:o,...a}=e,[d,p]=m.useState(null),v=m.Children.toArray(o),[w,N,...G]=v,U=G.length?G.pop():v[v.length-1],fe=v.length>3,de=ze=>{p(ze.currentTarget)},ve=()=>{p(null)},we=Boolean(d);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsxs)(sl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,n.jsx)(ii,{clone:!0,children:w}),v.length>2&&(0,n.jsx)(ii,{clone:!0,children:N}),fe&&(0,n.jsx)(il,{onClick:de,children:"..."}),(0,n.jsx)(ye.Z,{style:{fontStyle:"italic"},children:U})]}),(0,n.jsx)(es.ZP,{open:we,anchorEl:d,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(ft.Z,{children:G.map((ze,Je)=>(0,n.jsx)(ct.Z,{button:!0,children:(0,n.jsx)(ii,{clone:!0,children:ze})},Je))})})]})}const ll=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),cl=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,n.jsxs)(al,{className:a.breadcrumb,children:[(0,n.jsx)(He,{to:o,children:e}),(0,n.jsx)(O.Z,{children:d})]}):(0,n.jsx)(O.Z,{className:a.type,children:e}):null,dl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,n.jsx)(O.Z,{className:o.title,variant:"h1",children:e});return a?(0,n.jsx)(Rt.ZP,{title:a,placement:"top-start",children:d}):d},ul=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,n.jsx)(n.Fragment,{children:o}):(0,n.jsx)(O.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Ji(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:w,type:N,typeLink:G}=e,U=ll(),de=(0,z.h_)(z.Ds).getOptionalString("app.title")||"Backstage",ve=a||v,we=v||a,ze=`${ve} | %s | ${de}`,Je=`${ve} | ${de}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(is.q,{titleTemplate:ze,defaultTitle:Je}),(0,n.jsxs)("header",{style:d,className:U.header,children:[(0,n.jsxs)(ye.Z,{className:U.leftItemsBox,children:[(0,n.jsx)(cl,{classes:U,type:N,typeLink:G,pageTitle:we}),(0,n.jsx)(dl,{classes:U,pageTitle:we,tooltip:w}),(0,n.jsx)(ul,{classes:U,subtitle:p})]}),(0,n.jsx)(Be.Z,{container:!0,className:U.rightItemsBox,spacing:4,children:o})]})]})}const hl=({label:e,secondaryLabel:o,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:o})]})});function nc(e){const{actionItems:o}=e,[a,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:a,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:o.map((v,w)=>_jsx(hl,{...v},`header-action-menu-${w}`))})})]})}const pl=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),fl=({value:e,className:o})=>(0,n.jsx)(O.Z,{className:o,children:e});function gl(e){const{label:o,value:a,url:d}=e,p=pl(),v=(0,n.jsx)(fl,{className:p.value,value:a||"<Unknown>"});return(0,n.jsx)(Be.Z,{item:!0,children:(0,n.jsxs)(O.Z,{component:"span",className:p.root,children:[(0,n.jsx)(O.Z,{className:p.label,children:o}),d?(0,n.jsx)(He,{to:d,children:v}):v]})})}const ml=e=>(0,k.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),vl=(0,l.Z)(ml,{name:"BackstageItemCardHeader"});function yl(e){const{title:o,subtitle:a,children:d}=e,p=vl(e);return(0,n.jsxs)(ye.Z,{className:p.root,children:[a&&(0,n.jsx)(O.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,n.jsx)(O.Z,{variant:"h6",component:"h4",children:o}),d]})}function rc(e){const{description:o,tags:a,title:d,type:p,subtitle:v,label:w,onClick:N,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((U,fe)=>_jsx(Chip,{size:"small",label:U},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(Button,{to:"#",onClick:N,color:"primary",children:w}),G&&_jsx(Button,{to:G,color:"primary",children:w})]})]})}const xl=e=>(0,k.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),bl=(0,l.Z)(xl,{name:"BackstageItemCardGrid"});function Sl(e){const{children:o,...a}=e,d=bl(a);return(0,n.jsx)(ye.Z,{className:d.root,...a,children:o})}var Cl=t(41547);const jl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Xi(e){const{themeId:o,children:a}=e,{isMobile:d}=Mr(),p=jl({isMobile:d});return(0,n.jsx)(Cl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:o})}),children:(0,n.jsx)("main",{className:p.root,children:a})})}function wl(e){const{themeId:o,children:a,...d}=e;return(0,n.jsxs)(Xi,{themeId:o,children:[(0,n.jsx)(Ji,{...d}),a]})}var Xn=t(30195);const oc=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),Qi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function El(e){const o=new Date(Date.now()+Qi.defaultTokenExpiryMillis);if(!e)return o;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-Qi.tokenExpiryMarginMillis)}class sc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),a=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:El(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:o},a}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(o){this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const ic=e=>{const o=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},Al=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ai=({children:e})=>{const o=Al();return(0,n.jsx)(Be.Z,{component:"li",item:!0,classes:o,children:e})};class li{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 o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function Tl(e){const[o,a,d]=e.split(".");return JSON.parse(window.atob(a))}class ci{getUserId(){return this.result.userId}static fromResult(o){return new ci(o)}async getIdToken(){var o,a;return(a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Tl(o);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,a;return{token:await((a=(o=this.result).getIdToken)===null||a===void 0?void 0:a.call(o))}}async signOut(){var o,a;return(a=(o=this.result).signOut)===null||a===void 0?void 0:a.call(o)}constructor(o){this.result=o}}class Ho{static createGuest(){return new li}static fromLegacy(o){return ci.fromResult(o)}static create(o){return new Ho(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!a)throw new TypeError(`Invalid user entity reference "${o}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,a,d){this.identity=o,this.authApi=a,this.profile=d}}const Il={Component:({config:e,onSignInSuccess:o})=>{const{apiRef:a,title:d,message:p}=e,v=(0,z.h_)(a),w=(0,z.h_)(z.VE),N=async()=>{try{const G=await v.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${d} provider is not configured to support sign-in`);const U=await v.getProfile();o(Ho.create({identity:G.identity,profile:U,authApi:v}))}catch(G){w.post(new Jr.SP("Login failed",G))}};return(0,n.jsx)(ai,{children:(0,n.jsx)(Ir,{variant:"fullHeight",title:d,actions:(0,n.jsx)(ne.Z,{color:"primary",variant:"outlined",onClick:N,children:"Sign In"}),children:(0,n.jsx)(O.Z,{variant:"body1",children:p})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Ho.create({identity:d.identity,profile:p,authApi:a})}},Rl={Component:({onSignInSuccess:e})=>(0,n.jsx)(ai,{children:(0,n.jsx)(Ir,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(ne.Z,{color:"primary",variant:"outlined",onClick:()=>e(new li),children:"Enter"}),children:(0,n.jsxs)(O.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 li};var Ll=t(63955),qi=t(86619),_i=t(74828),Pl=t(45455),kl=t.n(Pl);const Ol=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Bl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),ea=e=>{const{ref:o,...a}=e;return{inputRef:o,...a}},$l={Component:({onSignInSuccess:e})=>{const o=Bl(),{register:a,handleSubmit:d,formState:p}=(0,Ll.cI)({mode:"onChange"}),{errors:v}=p,w=({userId:N,idToken:G})=>{e(Ho.fromLegacy({userId:N,getIdToken:G!==void 0?async()=>G:void 0,profile:{email:`${N}@example.com`}}))};return(0,n.jsx)(ai,{children:(0,n.jsxs)(Ir,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(O.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:o.form,onSubmit:d(w),children:[(0,n.jsxs)(J.Z,{children:[(0,n.jsx)(qi.Z,{...ea(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,n.jsx)(_i.Z,{error:!0,children:v.userId.message})]}),(0,n.jsxs)(J.Z,{children:[(0,n.jsx)(qi.Z,{...ea(a("idToken",{required:!1,validate:N=>!N||Ol.test(N)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,n.jsx)(_i.Z,{error:!0,children:v.idToken.message})]}),(0,n.jsx)(ne.Z,{type:"submit",color:"primary",variant:"outlined",className:o.button,disabled:!(p!=null&&p.isDirty)||!kl()(v),children:"Continue"})]})]})})},loader:async()=>{}},js="@backstage/core:SignInPage:provider",ta={guest:Rl,custom:$l,common:Il};function na(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function pc(e){return e.reduce((a,d)=>{if(typeof d=="string")return na(d,a),a[d]={components:ta[d],id:d},a;const{id:p}=d;return na(p,a),a[p]={components:ta.common,id:p,config:d},a},{})}const fc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),w=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var U;localStorage.removeItem(js),await((U=G.signOut)===null||U===void 0?void 0:U.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!p)return;const U=localStorage.getItem(js);if(U===null){v(!1);return}const fe=e[U];if(!fe){v(!1);return}let de=!1;return fe.components.loader(d,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(ve=>{de||(ve?w(ve):v(!1))}).catch(ve=>{de||(localStorage.removeItem(js),a.post(ve),v(!1))}),()=>{de=!0}},[p,a,o,d,e,w]);const N=useMemo(()=>Object.keys(e).map(G=>{const U=e[G],{Component:fe}=U.components,de=ve=>{localStorage.setItem(js,U.id),w(ve)};return _jsx(fe,{config:U.config,onSignInSuccess:de},U.id)}),[e,w]);return[p,N]},Zl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),w=getSignInProviders(o),[N,G]=useSignInProviders(w,e);return N?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Dl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[w,N]=useState(),[G,U]=useState(!1),fe=async({checkExisting:de,showPopup:ve})=>{try{let we;if(de&&(we=await p.getBackstageIdentity({optional:!0})),!we&&(ve||o)&&(U(!0),we=await p.getBackstageIdentity({instantPopup:!0}),!we))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!we){U(!0);return}const ze=await p.getProfile();a(UserIdentity.create({identity:we.identity,authApi:p,profile:ze}))}catch(we){N(we),U(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),w&&w.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:w.message})]})})})})]}):_jsx(Progress,{})};function gc(e){return"provider"in e?_jsx(Dl,{...e}):_jsx(Zl,{...e})}const Nl=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Fl=(0,Ln.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Yt.Z);function mc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:w,onChange:N}=e,G=Nl(),[U,fe]=useState(0),de=N||((ze,Je)=>fe(Je));let ve;w?React.Children.map(d,ze=>{if(React.isValidElement(ze)&&(ze==null?void 0:ze.props.value)===w){var Je;ve=ze==null||(Je=ze.props)===null||Je===void 0?void 0:Je.children}}):React.Children.map(d,(ze,Je)=>{React.isValidElement(ze)&&Je===U&&(ve=ze==null?void 0:ze.props.children)});const we=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...we,children:[p&&_jsx(Fl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:w||U,onChange:de,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ve}),v&&_jsx(BottomLink,{...v})]})})}const Ul=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function vc(e){const{children:o,...a}=e,d=Ul();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},25248:function(At,Oe,t){"use strict";t.d(Oe,{fC:function(){return S},CL:function(){return Qe},sM:function(){return V},$v:function(){return Ie},v_:function(){return Ke},hg:function(){return Fe},uB:function(){return X},R5:function(){return Ot},bq:function(){return C},Ds:function(){return He},ni:function(){return O},T0:function(){return D},CO:function(){return Hn},x8:function(){return En},rx:function(){return vn},YO:function(){return Sn},P4:function(){return Vn},NT:function(){return Jt},NW:function(){return We},VE:function(){return jt},W0:function(){return ye},gP:function(){return _e},IY:function(){return ht},F4:function(){return ae},ux:function(){return R},Kp:function(){return ee},$4:function(){return wt},p_:function(){return W},ZM:function(){return dt},D:function(){return T},gW:function(){return L},E6:function(){return bt},z$:function(){return Zt},h_:function(){return ie},I_:function(){return k},qD:function(){return Ee},vJ:function(){return In},yx:function(){return Re},tg:function(){return An},Oi:function(){return dn}});var h=t(52322),n=t(51837),z=t(2784);const B=(0,n.CT)("analytics-context"),m=()=>{const ge=(0,z.useContext)(B);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const re=ge.atVersion(1);if(re===void 0)throw new Error("No context found for version 1.");return re},S=ge=>{const{attributes:re,children:Ae}=ge,qe={...m(),...re},mt=(0,n.EI)({1:qe});return(0,h.jsx)(B.Provider,{value:mt,children:Ae})};function l(ge,re){const Ae=Ze=>_jsx(S,{attributes:re,children:_jsx(ge,{...Ze})});return Ae.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ae}function k(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const re=ge.atVersion(1);if(!re)throw new Error("ApiContext v1 not available");return re}function ie(ge){const Ae=k().get(ge);if(!Ae)throw new Error(`No implementation available for ${ge}`);return Ae}function _(ge){return function(Ae){const Ze=mt=>{const he=k(),$={};for(const pe in ge)if(ge.hasOwnProperty(pe)){const Ue=ge[pe],Be=he.get(Ue);if(!Be)throw new Error(`No implementation available for ${Ue}`);$[pe]=Be}return _jsx(Ae,{...mt,...$})},qe=Ae.displayName||Ae.name||"Component";return Ze.displayName=`withApis(${qe})`,Ze}}class ne{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(re){if(this.config=re,!re.id.split(".").flatMap(Ze=>Ze.split("-")).every(Ze=>Ze.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${re.id}'`)}}function D(ge){return new ne(ge)}function O(ge,re){return"id"in ge?{api:ge,deps:{},factory:()=>re}:ge}var V;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(V||(V={}));const ee=D({id:"core.auth.google"}),ae=D({id:"core.auth.github"}),T=D({id:"core.auth.okta"}),R=D({id:"core.auth.gitlab"}),W=D({id:"core.auth.microsoft"}),L=D({id:"core.auth.onelogin"}),C=D({id:"core.auth.bitbucket"}),X=D({id:"core.auth.atlassian"}),Ie=D({id:"core.alert"}),Ke=D({id:"core.analytics"}),Fe=D({id:"core.apptheme"}),He=D({id:"core.config"}),We=D({id:"core.discovery"}),jt=D({id:"core.error"});var Qe;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Qe||(Qe={}));const ye=D({id:"core.featureflags"}),_e=D({id:"core.fetch"}),wt=D({id:"core.identity"}),dt=D({id:"core.oauthrequest"}),bt=D({id:"core.storage"});class ut{setContext(re){this.context=re}captureEvent(re,Ae,{value:Ze,attributes:qe}={}){try{this.analyticsApi.captureEvent({action:re,subject:Ae,value:Ze,attributes:qe,context:this.context})}catch(mt){console.warn("Error during analytics event capture. %o",mt)}}constructor(re,Ae={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=re,this.context=Ae}}function Rt(){try{return ie(Ke)}catch{return{captureEvent:()=>{}}}}function Zt(){const ge=(0,z.useRef)(null),re=m(),Ae=Rt();function Ze(){return ge.current===null&&(ge.current=new ut(Ae)),ge.current}const qe=Ze();return qe.setContext(re),qe}const Ge="plugin-context",ce=ge=>{const{children:re,plugin:Ae}=ge,{Provider:Ze}=(0,n.CT)(Ge);return(0,h.jsx)(Ze,{value:(0,n.EI)({1:{plugin:Ae}}),children:re})};function Re(){const ge=(0,n.Vt)(Ge);if(!ge)throw new Error("Plugin Options context is not available");const re=ge.atVersion(1);if(!re)throw new Error("Plugin Options v1 is not available");return re.plugin.getPluginOptions()}const Ee=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const re=ge.atVersion(1);if(!re)throw new Error("AppContext v1 not available");return re},Xe=(0,n.uW)("component-data-store",()=>new WeakMap),St="__backstage_data";function Ot(ge,re,Ae){const Ze=ge;var qe;let mt=(qe=Ze[St])!==null&&qe!==void 0?qe:Xe.get(ge);if(mt||(mt={map:new Map},Object.defineProperty(Ze,St,{enumerable:!1,configurable:!0,writable:!1,value:mt}),Xe.set(ge,mt)),mt.map.has(re)){const he=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${re}" to component "${he}"`)}mt.map.set(re,Ae)}function ht(ge,re){if(!ge)return;const Ae=ge.type;if(!Ae)return;var Ze;const qe=(Ze=Ae[St])!==null&&Ze!==void 0?Ze:Xe.get(Ae);if(!!qe)return qe.map.get(re)}const Tt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let gt=Tt;class Dt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(re,Ae){this.id=re,this.params=Ae,this[gt]="absolute"}}function Jt(ge){var re;return new Dt(ge.id,(re=ge.params)!==null&&re!==void 0?re:[])}const Xt=/^\w+$/;let cn=null;class Ut{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(re,Ae,Ze,qe){this.id=re,this.path=Ae,this.parent=Ze,this.params=qe,this[cn]="sub"}}function fn(ge){const{id:re,path:Ae,parent:Ze}=ge,qe=Ae.split("/").filter($=>$.startsWith(":")).map($=>$.substring(1)),mt=[...Ze.params,...qe];if(Ze.params.some($=>qe.includes($)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ae.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ae}'`);if(Ae.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ae}'`);for(const $ of qe)if(!Xt.test($))throw new Error(`SubRouteRef path has invalid param, got '${$}'`);return new Ut(re,Ae,Ze,mt)}let gn=Tt;class wn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(re,Ae,Ze){this.id=re,this.params=Ae,this.optional=Ze,this[gn]="external"}}function En(ge){var re;return new wn(ge.id,(re=ge.params)!==null&&re!==void 0?re:[],Boolean(ge.optional))}var Wn=t(79635);function An(ge){const{pathname:re}=(0,Wn.TH)(),Ae=(0,n.Vt)("routing-context");if(!Ae)throw new Error("Routing context is not available");const Ze=Ae.atVersion(1),qe=(0,z.useMemo)(()=>Ze&&Ze.resolve(ge,{pathname:re}),[Ze,ge,re]);if(!Ae)throw new Error("useRouteRef used outside of routing context");if(!Ze)throw new Error("RoutingContext v1 not available");const mt="optional"in ge&&ge.optional;if(!qe&&!mt)throw new Error(`No path for ${ge}`);return qe}function dn(ge){return(0,Wn.UO)()}class rn extends z.Component{static getDerivedStateFromError(re){return{error:re}}render(){const{error:re}=this.state,{app:Ae,plugin:Ze}=this.props,{ErrorBoundaryFallback:qe}=Ae.getComponents();return re?(0,h.jsx)(qe,{error:re,resetError:this.handleErrorReset,plugin:Ze}):this.props.children}constructor(...re){super(...re),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Vn(ge){const{component:re,mountPoint:Ae,name:Ze}=ge;return Sn({component:{lazy:()=>re().then(qe=>{const mt=$=>{try{An(Ae)}catch(pe){if(typeof pe=="object"&&pe!==null){const{message:Ue}=pe;if(typeof Ue=="string"&&Ue.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ae} 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 pe}return(0,h.jsx)(qe,{...$})},he=Ze||qe.displayName||qe.name||"LazyComponent";return mt.displayName=`RoutableExtension(${he})`,mt},qe=>he=>{const $=Ee(),{BootErrorPage:pe}=$.getComponents();return(0,h.jsx)(pe,{step:"load-chunk",error:qe})})},data:{"core.mountPoint":Ae},name:Ze})}function Hn(ge){const{component:re,name:Ae}=ge;return Sn({component:re,name:Ae})}function Sn(ge){const{data:re={},name:Ae}=ge;Ae||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ze;if("lazy"in ge.component){const mt=ge.component.lazy;Ze=(0,z.lazy)(()=>mt().then(he=>({default:he})))}else Ze=ge.component.sync;const qe=Ae||Ze.displayName||Ze.name||"Component";return{expose(mt){const he=$=>{const pe=Ee(),{Progress:Ue}=pe.getComponents(),Be=re==null?void 0:re["core.mountPoint"];return(0,h.jsx)(z.Suspense,{fallback:(0,h.jsx)(Ue,{}),children:(0,h.jsx)(rn,{app:pe,plugin:mt,children:(0,h.jsx)(S,{attributes:{pluginId:mt.getId(),...Ae&&{extension:Ae},...Be&&{routeRef:Be.id}},children:(0,h.jsx)(ce,{plugin:mt,children:(0,h.jsx)(Ze,{...$})})})})})};Ot(he,"core.plugin",mt);for(const[$,pe]of Object.entries(re))Ot(he,$,pe);return he.displayName=`Extension(${qe})`,he}}}function mn(ge,re,Ae,Ze){return z.Children.toArray(ge).flatMap(qe=>{if(!(0,z.isValidElement)(qe))return[];if(qe.type===z.Fragment)return mn(qe.props.children,re,Ae,Ze);if(ht(qe,"core.featureFlagged")){const mt=qe.props;return("with"in mt?re.isActive(mt.with):!re.isActive(mt.without))?mn(qe.props.children,re,Ae,Ze):[]}if(Ae===void 0||Ae(qe))return[qe];if(Ze)throw new Error(Ze);return mn(qe.props.children,re,Ae,Ze)})}class Tn{selectByComponentData(re){const Ae=mn(this.node,this.featureFlagsApi,Ze=>ht(Ze,re.key)!==void 0,re.withStrictError);return new Tn(Ae,this.featureFlagsApi)}findComponentData(re){return mn(this.node,this.featureFlagsApi,Ze=>ht(Ze,re.key)!==void 0).map(Ze=>ht(Ze,re.key)).filter(Ze=>Ze!==void 0)}getElements(){return mn(this.node,this.featureFlagsApi)}constructor(re,Ae){this.node=re,this.featureFlagsApi=Ae}}function In(ge,re,Ae=[]){const Ze=ie(ye),qe=new Tn(ge,Ze);return(0,z.useMemo)(()=>re(qe),[ge,...Ae])}class Kn{getId(){return this.config.id}getApis(){var re;return(re=this.config.apis)!==null&&re!==void 0?re:[]}getFeatureFlags(){var re,Ae;return(Ae=(re=this.config.featureFlags)===null||re===void 0?void 0:re.slice())!==null&&Ae!==void 0?Ae:[]}get routes(){var re;return(re=this.config.routes)!==null&&re!==void 0?re:{}}get externalRoutes(){var re;return(re=this.config.externalRoutes)!==null&&re!==void 0?re:{}}provide(re){return re.expose(this)}__experimentalReconfigure(re){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(re))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var re;return(re=this.options)!==null&&re!==void 0?re:{}}toString(){return`plugin{${this.config.id}}`}constructor(re){this.config=re,this.options=void 0}}function vn(ge){return new Kn(ge)}},23054:function(At,Oe,t){"use strict";t.d(Oe,{SP:function(){return V},dR:function(){return ne},VL:function(){return ae},BD:function(){return n}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function n(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var z=t(24852);function B(T,R){const L={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete L.stack,L}function m(T){const R=(0,z.deserializeError)(T);return T.stack||(R.stack=void 0),R}function S(T){if(h(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class l extends Error{constructor(R,W){var L;let C=R;if(W!==void 0){const X=S(W);C?C+=`; caused by ${X}`:C=`caused by ${X}`}super(C),(L=Error.captureStackTrace)===null||L===void 0||L.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(W)?W:void 0}}class k extends null{}class ie extends null{}class _ extends null{}class ne extends l{}class D extends null{}class O extends null{}class V extends l{constructor(R,W){super(R,W),this.name=h(W)?W.name:"Error"}}async function ee(T){try{const W=await T.text();if(W){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const L=JSON.parse(W);if(L.error&&L.response)return L}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${W}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class ae extends Error{static async fromResponse(R){const W=await ee(R),L=W.response.statusCode||R.status,C=W.error.name||R.statusText,X=`Request failed with ${L} ${C}`,Ie=m(W.error);return new ae({message:X,response:R,data:W,cause:Ie})}constructor(R){super(R.message),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(At,Oe,t){"use strict";t.d(Oe,{nW:function(){return ae},ae:function(){return ne},q3:function(){return D}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var z=new WeakMap;class B{async getCredentials(R){const W=new URL(R.url),L=_class_private_field_get(this,z).find(C=>C.isUrlSupported(W));if(!L)throw new Error(`No auth provider available for '${R.url}', see https://backstage.io/link?scm-auth`);return L.getCredentials(R)}constructor(R){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_set(this,z,R)}}var m=new WeakMap,S=new WeakMap,l=new WeakMap,k=new WeakMap;class ie{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:R,gitlab:W,azure:L,bitbucket:C})=>ie.merge(ie.forGithub(R),ie.forGitlab(W),ie.forAzure(L),ie.forBitbucket(C))})}static forAuthApi(R,W){return new ie("generic",R,W.host,W.scopeMapping)}static forGithub(R,W){var L;const C=(L=W==null?void 0:W.host)!==null&&L!==void 0?L:"github.com";return new ie("github",R,C,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(R,W){var L;const C=(L=W==null?void 0:W.host)!==null&&L!==void 0?L:"gitlab.com";return new ie("gitlab",R,C,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(R,W){var L;const C=(L=W==null?void 0:W.host)!==null&&L!==void 0?L:"dev.azure.com";return new ie("azure",R,C,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(R,W){var L;const C=(L=W==null?void 0:W.host)!==null&&L!==void 0?L:"bitbucket.org";return new ie("bitbucket",R,C,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...R){return new B(R)}isUrlSupported(R){return R.host===_class_private_field_get(this,S)}getAdditionalScopesForProvider(R){var W;if(!(R!=null&&R.customScopes)||_class_private_field_get(this,k)==="generic")return[];var L;return(L=(W=R.customScopes)===null||W===void 0?void 0:W[_class_private_field_get(this,k)])!==null&&L!==void 0?L:[]}async getCredentials(R){const{url:W,additionalScope:L,...C}=R,X=_class_private_field_get(this,l).default.slice();L!=null&&L.repoWrite&&X.push(..._class_private_field_get(this,l).repoWrite);const Ie=this.getAdditionalScopesForProvider(L);Ie.length&&X.push(...Ie);const Ke=[...new Set(X)],Fe=await _class_private_field_get(this,m).getAccessToken(Ke,C);return{token:Fe,headers:{Authorization:`Bearer ${Fe}`}}}constructor(R,W,L,C){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,S,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,k,{writable:!0,value:void 0}),_class_private_field_set(this,m,W),_class_private_field_set(this,S,L),_class_private_field_set(this,l,C),_class_private_field_set(this,k,R)}}var _=t(79158);class ne{static fromConfig(R){return _.Lx.fromConfig(R)}}const D=(0,h.T0)({id:"integration.scmintegrations"});var O=t(52322),V=t(73250),ee=t(2784);const ae=T=>{const{type:R}=T,W=(0,h.qD)(),L=V.Z;var C;const X=R&&(C=W.getSystemIcon(R))!==null&&C!==void 0?C:L;return(0,O.jsx)(X,{})}},79158:function(At,Oe,t){"use strict";t.d(Oe,{Lx:function(){return nr},BT:function(){return Me}});var h=t(82717),n=t.n(h),z=t(76635);function B(j){const u=new URL("http://example.com");return u.host=j,u.host===j}function m(j){try{return new URL(j),!0}catch{return!1}}function S(j,u){return{list(){return j},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return j.find(Q=>u(Q)===E.host)}catch{return}},byHost(b){return j.find(E=>u(E)===b)}}}function l(j){const{url:u,base:b,lineNumber:E}=j;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:me}=n()(b);Q=new URL(b);const be=(0,z.trimEnd)(Q.pathname.substring(0,Q.pathname.length-me.length),"/");Q.pathname=`${be}${u}`}else Q=new URL(u,b);return Q.search=new URL(b).search,E&&(Q.hash=`L${E}`),Q.toString()}const k="amazonaws.com";function ie(j){const u=j.getOptionalString("endpoint");var b;const E=(b=j.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Q,me;if(u){try{const tn=new URL(u);Q=tn.host,me=tn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=k;const be=j.getOptionalString("accessKeyId"),ke=j.getOptionalString("secretAccessKey"),Ve=j.getOptionalString("roleArn"),Wt=j.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:E,accessKeyId:be,secretAccessKey:ke,roleArn:Ve,externalId:Wt}}function _(j){const u=j.map(ie);return u.some(b=>b.host===k)||u.push({host:k}),u}class ne{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}ne.factory=({config:j})=>{var u;const b=_((u=j.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new ne(E)),E=>E.config.host)};var D=t(90383),O=t(22504),V=t(69866);const ee="GB";var ae=new WeakMap,T=new WeakMap,R=new WeakMap,W=new WeakMap,L=new WeakMap,C=new WeakMap,X=new WeakMap;class Ie{static fromRepoUrl(u){const b=new URL(u);let E,Q,me;const be=b.pathname.split("/").map(Rn=>decodeURIComponent(Rn));if(be[2]==="_git"?(E=be[1],Q=me=be[3]):be[3]==="_git"?(E=be[1],Q=be[2],me=be[4]):be[4]==="_git"&&(E=`${be[1]}/${be[2]}`,Q=be[3],me=be[5]),!E||!Q||!me)throw new Error("Azure URL must point to a git repository");var ke;const Ve=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let Wt;const tn=b.searchParams.get("version");if(tn){if(tn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Wt=tn.slice(2)}return new Ie(b.origin,E,Q,me,Ve,Wt)}toRepoUrl(){let u;return(0,D.Z)(this,R)===(0,D.Z)(this,W)?u=(0,D.Z)(this,X).call(this,(0,D.Z)(this,T),"_git",(0,D.Z)(this,W)):u=(0,D.Z)(this,X).call(this,(0,D.Z)(this,T),(0,D.Z)(this,R),"_git",(0,D.Z)(this,W)),(0,D.Z)(this,L)&&u.searchParams.set("path",(0,D.Z)(this,L)),(0,D.Z)(this,C)&&u.searchParams.set("version",ee+(0,D.Z)(this,C)),u.toString()}toFileUrl(){if(!(0,D.Z)(this,L))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,D.Z)(this,X).call(this,(0,D.Z)(this,T),(0,D.Z)(this,R),"_apis","git","repositories",(0,D.Z)(this,W),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,D.Z)(this,L)),(0,D.Z)(this,C)&&u.searchParams.set("version",(0,D.Z)(this,C)),u.toString()}toArchiveUrl(){const u=(0,D.Z)(this,X).call(this,(0,D.Z)(this,T),(0,D.Z)(this,R),"_apis","git","repositories",(0,D.Z)(this,W),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,D.Z)(this,L)&&u.searchParams.set("scopePath",(0,D.Z)(this,L)),(0,D.Z)(this,C)&&u.searchParams.set("version",(0,D.Z)(this,C)),u.toString()}toCommitsUrl(){const u=(0,D.Z)(this,X).call(this,(0,D.Z)(this,T),(0,D.Z)(this,R),"_apis","git","repositories",(0,D.Z)(this,W),"commits");return u.searchParams.set("api-version","6.0"),(0,D.Z)(this,C)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,D.Z)(this,C)),u.toString()}getOwner(){return(0,D.Z)(this,T)}getProject(){return(0,D.Z)(this,R)}getRepo(){return(0,D.Z)(this,W)}getPath(){return(0,D.Z)(this,L)}getRef(){return(0,D.Z)(this,C)}constructor(u,b,E,Q,me,be){(0,O.Z)(this,ae,{writable:!0,value:void 0}),(0,O.Z)(this,T,{writable:!0,value:void 0}),(0,O.Z)(this,R,{writable:!0,value:void 0}),(0,O.Z)(this,W,{writable:!0,value:void 0}),(0,O.Z)(this,L,{writable:!0,value:void 0}),(0,O.Z)(this,C,{writable:!0,value:void 0}),(0,O.Z)(this,X,{writable:!0,value:(...ke)=>{const Ve=new URL((0,D.Z)(this,ae));return Ve.pathname=ke.map(Wt=>encodeURIComponent(Wt)).join("/"),Ve}}),(0,V.Z)(this,ae,u),(0,V.Z)(this,T,b),(0,V.Z)(this,R,E),(0,V.Z)(this,W,Q),(0,V.Z)(this,L,me),(0,V.Z)(this,C,be)}}const Ke="dev.azure.com";function Fe(j){var u;const b=(u=j.getOptionalString("host"))!==null&&u!==void 0?u:Ke,E=j.getOptionalString("token");if(!B(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:E}}function He(j){const u=j.map(Fe);return u.some(b=>b.host===Ke)||u.push({host:Ke}),u}class We{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:E}=u;if(m(b))return b;try{const me=Ie.fromRepoUrl(E),be=new URL(E);var Q;const ke=new URL(`https://a.com${(Q=me.getPath())!==null&&Q!==void 0?Q:""}`),Ve=new URL(b,ke).pathname;return be.searchParams.set("path",Ve),u.lineNumber&&(be.searchParams.set("line",String(u.lineNumber)),be.searchParams.set("lineEnd",String(u.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}We.factory=({config:j})=>{var u;const b=He((u=j.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new We(E)),E=>E.config.host)};var jt=t(48834).lW;function Qe(j){return AzureUrl.fromRepoUrl(j).toFileUrl()}function ye(j){return AzureUrl.fromRepoUrl(j).toArchiveUrl()}function _e(j){return AzureUrl.fromRepoUrl(j).toCommitsUrl()}function wt(j,u){const b=u?{...u}:{};if(j.token){const E=jt.from(`:${j.token}`,"utf8");b.Authorization=`Basic ${E.toString("base64")}`}return{headers:b}}const dt="bitbucket.org",bt="https://api.bitbucket.org/2.0";function ut(j){var u;const b=(u=j.getOptionalString("host"))!==null&&u!==void 0?u:dt;let E=j.getOptionalString("apiBaseUrl");const Q=j.getOptionalString("token"),me=j.getOptionalString("username"),be=j.getOptionalString("appPassword");if(!B(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,z.trimEnd)(E,"/"):b===dt?E=bt:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:Q,username:me,appPassword:be}}function Rt(j){const u=j.map(ut);return u.some(b=>b.host===dt)||u.push({host:dt,apiBaseUrl:bt}),u}class Zt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(!u.lineNumber)return b;const E=new URL(b);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${u.lineNumber}`:E.hash=`${u.lineNumber}`,E.toString()}resolveEditUrl(u){const b=n()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",b.ref),E.toString()}constructor(u){this.integrationConfig=u}}Zt.factory=({config:j})=>{var u,b,E;const Q=Rt((E=j.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(u=j.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(b=j.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return S(Q.map(me=>new Zt(me)),me=>me.config.host)};var Ge=t(96279),ce=t(48834).lW;async function Re(j,u){const{name:b,owner:E,resource:Q}=parseGitUrl(j),me=Q==="bitbucket.org";let be=me?`${u.apiBaseUrl}/repositories/${E}/${b}`:`${u.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ke=await fetch(be,St(u));if(ke.status===404&&!me&&(be=`${u.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ke=await fetch(be,St(u))),!ke.ok){const Wt=`Failed to retrieve default branch from ${be}, ${ke.status} ${ke.statusText}`;throw new Error(Wt)}let Ve;if(me)Ve=(await ke.json()).mainbranch.name;else{const{displayId:Wt}=await ke.json();Ve=Wt}if(!Ve)throw new Error(`Failed to read default branch from ${be}. Response ${ke.status} ${ke.json()}`);return Ve}async function Ee(j,u){const{name:b,owner:E,ref:Q,protocol:me,resource:be,filepath:ke}=parseGitUrl(j),Ve=be==="bitbucket.org";let Wt=Q;Wt||(Wt=await Re(j,u));const tn=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return Ve?`${me}://${be}/${E}/${b}/get/${Wt}.tar.gz`:`${u.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${Wt}&prefix=${E}-${b}${tn}`}function Xe(j,u){try{const{owner:b,name:E,ref:Q,filepathtype:me,filepath:be}=parseGitUrl(j);if(!b||!E||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=be.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}return`${u.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function St(j){const u={};if(j.token)u.Authorization=`Bearer ${j.token}`;else if(j.username&&j.appPassword){const b=ce.from(`${j.username}:${j.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}const Ot="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Tt(j){const u=Ot,b=ht,E=j.getString("username"),Q=j.getString("appPassword");return{host:u,apiBaseUrl:b,username:E,appPassword:Q}}function gt(j){const u=j.map(Tt);return u.length===0&&u.push({host:Ot,apiBaseUrl:ht}),u}class Dt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const E=new URL(b);return E.hash=`lines-${u.lineNumber}`,E.toString()}return b}resolveEditUrl(u){const b=n()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(u){this.integrationConfig=u}}Dt.factory=({config:j})=>{var u;const b=gt((u=j.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new Dt(E)),E=>E.config.host)};var Jt=t(48834).lW;async function Xt(j,u){const{name:b,owner:E}=parseGitUrl(j),Q=`${u.apiBaseUrl}/repositories/${E}/${b}`,me=await fetch(Q,fn(u));if(!me.ok){const Ve=`Failed to retrieve default branch from ${Q}, ${me.status} ${me.statusText}`;throw new Error(Ve)}const ke=(await me.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${me.status} ${me.json()}`);return ke}async function cn(j,u){const{name:b,owner:E,ref:Q,protocol:me,resource:be}=parseGitUrl(j);let ke=Q;return ke||(ke=await Xt(j,u)),`${me}://${be}/${E}/${b}/get/${ke}.tar.gz`}function Ut(j,u){try{const{owner:b,name:E,ref:Q,filepathtype:me,filepath:be}=parseGitUrl(j);if(!b||!E||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=be.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function fn(j){const u={};if(j.username&&j.appPassword){const b=Jt.from(`${j.username}:${j.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function gn(j){const u=j.getString("host");let b=j.getOptionalString("apiBaseUrl");const E=j.getOptionalString("token"),Q=j.getOptionalString("username"),me=j.getOptionalString("password");if(!B(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return b?b=(0,z.trimEnd)(b,"/"):b=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:b,token:E,username:Q,password:me}}function wn(j){return j.map(gn)}class En{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const E=new URL(b);return E.hash=u.lineNumber.toString(),E.toString()}return b}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}En.factory=({config:j})=>{var u;const b=wn((u=j.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new En(E)),E=>E.config.host)};var Wn=t(48834).lW;async function An(j,u){const{name:b,owner:E}=parseGitUrl(j);let Q=`${u.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,me=await fetch(Q,Vn(u));if(me.status===404&&(Q=`${u.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,me=await fetch(Q,Vn(u))),!me.ok){const Ve=`Failed to retrieve default branch from ${Q}, ${me.status} ${me.statusText}`;throw new Error(Ve)}const{displayId:be}=await me.json(),ke=be;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${me.status} ${me.json()}`);return ke}async function dn(j,u){const{name:b,owner:E,ref:Q,filepath:me}=parseGitUrl(j);let be=Q;be||(be=await An(j,u));const ke=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${u.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${be}&prefix=${E}-${b}${ke}`}function rn(j,u){try{const{owner:b,name:E,ref:Q,filepathtype:me,filepath:be}=parseGitUrl(j);if(!b||!E||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=be.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${j}, ${b}`)}}function Vn(j){const u={};if(j.token)u.Authorization=`Bearer ${j.token}`;else if(j.username&&j.password){const b=Wn.from(`${j.username}:${j.password}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function Hn(j){const u=j.getString("host");let b=j.getOptionalString("baseUrl"),E=j.getOptionalString("cloneUrl"),Q=j.getOptionalString("gitilesBaseUrl");const me=j.getOptionalString("username"),be=j.getOptionalString("password");if(B(u)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(Q&&!m(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return b?b=(0,z.trimEnd)(b,"/"):b=`https://${u}`,Q?Q=(0,z.trimEnd)(Q,"/"):Q=`https://${u}`,E?E=(0,z.trimEnd)(E,"/"):E=b,{host:u,baseUrl:b,cloneUrl:E,gitilesBaseUrl:Q,username:me,password:be}}function Sn(j){return j.map(Hn)}var mn=t(48834).lW;const Tn=")]}'";function In(j,u){const E=u.replace(j.gitilesBaseUrl,"").split("/").filter(Wt=>!!Wt),Q=E.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const me=(0,z.trimStart)(E.slice(0,Q).join("/"),"/"),be=E.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${u}`);const ke=E[be+1],Ve=E.slice(be+2).join("/");return{branch:ke,filePath:Ve===""?"/":Ve,project:me}}function Kn(j,u,b,E){return`${j.gitilesBaseUrl}/${u}/+/refs/heads/${b}/${(0,z.trimStart)(E,"/")}`}function vn(j){return j.password?"/a/":"/"}function ge(j,u){const{branch:b,project:E}=In(j,u);return`${j.baseUrl}${vn(j)}projects/${encodeURIComponent(E)}/branches/${b}`}function re(j,u){const{project:b}=In(j,u);return`${j.cloneUrl}${vn(j)}${b}`}function Ae(j,u){const{branch:b,filePath:E,project:Q}=In(j,u);return`${j.baseUrl}${vn(j)}projects/${encodeURIComponent(Q)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function Ze(j){return`${j.baseUrl}${vn(j)}projects/`}function qe(j){const u={};if(!j.password)return u;const b=mn.from(`${j.username}:${j.password}`,"utf8");return u.Authorization=`Basic ${b.toString("base64")}`,{headers:u}}async function mt(j){const u=await j.text();if(u.startsWith(Tn))try{return JSON.parse(u.slice(Tn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class he{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:E,lineNumber:Q}=u;let me;if(b.startsWith("/")){const{branch:be,project:ke}=In(this.config,E);return Kn(this.config,ke,be,b)}return b?me=new URL(b,E):me=new URL(E),Q&&(me.hash=Q.toString()),me.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}he.factory=({config:j})=>{var u;const b=Sn((u=j.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new he(E)),E=>E.config.host)};function $(j){const u=j.getString("host");let b=j.getOptionalString("baseUrl");const E=j.getOptionalString("username"),Q=j.getOptionalString("password");if(!B(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return b?b=(0,z.trimEnd)(b,"/"):b=`https://${u}`,{host:u,baseUrl:b,username:E,password:Q}}var pe=t(48834).lW;function Ue(j,u){try{var b;const E=(b=j.baseUrl)!==null&&b!==void 0?b:`https://${j.host}`,[Q,me,be,ke,Ve,Wt,...tn]=u.replace(E,"").split("/"),Rn=tn.join("/").replace(/^\//,"");return`${E}/${me}/${be}/_edit/${Wt}/${Rn}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function Be(j,u){try{var b;const E=(b=j.baseUrl)!==null&&b!==void 0?b:`https://${j.host}`,[Q,me,be,ke,Ve,Wt,...tn]=u.replace(E,"").split("/"),Rn=tn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${me}/${be}/contents/${Rn}?ref=${Wt}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function nt(j){const u={},{username:b,password:E}=j;return E?(b?u.Authorization=`basic ${pe.from(`${b}:${E}`).toString("base64")}`:u.Authorization=`token ${E}`,{headers:u}):u}class It{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return l(u)}resolveEditUrl(u){return Ue(this.config,u)}constructor(u){this.config=u}}It.factory=({config:j})=>{var u;const E=((u=j.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(Q=>$(Q));return S(E.map(Q=>new It(Q)),Q=>Q.config.host)};const Ht="github.com",Mt="https://api.github.com",Qt="https://raw.githubusercontent.com";function zt(j){var u,b;const E=(b=j.getOptionalString("host"))!==null&&b!==void 0?b:Ht;let Q=j.getOptionalString("apiBaseUrl"),me=j.getOptionalString("rawBaseUrl");const be=j.getOptionalString("token"),ke=(u=j.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Ve=>({appId:Ve.getNumber("appId"),clientId:Ve.getString("clientId"),clientSecret:Ve.getString("clientSecret"),webhookSecret:Ve.getString("webhookSecret"),privateKey:Ve.getString("privateKey"),allowedInstallationOwners:Ve.getOptionalStringArray("allowedInstallationOwners")}));if(!B(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return Q?Q=(0,z.trimEnd)(Q,"/"):E===Ht&&(Q=Mt),me?me=(0,z.trimEnd)(me,"/"):E===Ht&&(me=Qt),{host:E,apiBaseUrl:Q,rawBaseUrl:me,token:be,apps:ke}}function Y(j){const u=j.map(zt);return u.some(b=>b.host===Ht)||u.push({host:Ht,apiBaseUrl:Mt,rawBaseUrl:Qt}),u}function q(j,u,b){try{const{owner:E,name:Q,ref:me,filepathtype:be,filepath:ke}=parseGitUrl(j);if(!E||!Q||!me||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const Ve=ke.replace(/^\//,"");return A(u,b)==="api"?`${u.apiBaseUrl}/repos/${E}/${Q}/contents/${Ve}?ref=${me}`:`${u.rawBaseUrl}/${E}/${Q}/${me}/${Ve}`}catch(E){throw new Error(`Incorrect URL: ${j}, ${E}`)}}function f(j,u){const b={};return A(j,u)==="api"&&(b.Accept="application/vnd.github.v3.raw"),u.token&&(b.Authorization=`token ${u.token}`),{headers:b}}function A(j,u){return j.apiBaseUrl&&(u.token||!j.rawBaseUrl)?"api":"raw"}var M=t(42822),K=t(89393),se=t(26228);class xe{async getOrCreateToken(u,b,E){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await E(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,b))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${b}`);return{accessToken:Q.token}}appliesToRepo(u,b){return b===void 0?!0:u.repositories!==void 0?u.repositories.includes(b):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>se.ou.local()>u}}const Pe={Accept:"application/vnd.github.machine-man-preview+json"};class tt{async getInstallationCredentials(u,b){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,b,async()=>{const{installationId:Q,suspended:me}=await this.getInstallationData(u);if(me)throw new Error(`The GitHub application for ${u} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Pe});let ke;if(be.data.repository_selection==="selected"){const Wt=new K.v({baseUrl:this.baseUrl,auth:be.data.token}),tn=await Wt.paginate(Wt.apps.listReposAccessibleToInstallation);var Ve;ke=((Ve=tn.repositories)!==null&&Ve!==void 0?Ve:tn).map(Ar=>Ar.name)}return{token:be.data.token,expiresAt:se.ou.fromISO(be.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const E=(await this.getInstallations()).find(me=>{var be,ke;return((be=me.account)===null||be===void 0||(ke=be.login)===null||ke===void 0?void 0:ke.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,b){this.cache=new xe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
33
+ `)},this.appClient=new K.v({baseUrl:b,headers:Pe,authStrategy:M.i,auth:this.baseAuthConfig})}}class it{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(u,b){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(u,b).then(Ve=>({credentials:Ve,error:void 0}),Ve=>({credentials:void 0,error:Ve})))),Q=E.find(ke=>ke.credentials);if(Q)return Q.credentials.accessToken;const be=E.map(ke=>ke.error).find(ke=>ke.name!=="NotFoundError");if(be)throw be}constructor(u){var b,E;this.apps=(E=(b=u.apps)===null||b===void 0?void 0:b.map(Q=>new tt(Q,u.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class ft{async getCredentials(u){const b=n()(u.url),E=b.owner||b.name,Q=b.owner?b.name:void 0;let me="app",be=await this.githubAppCredentialsMux.getAppToken(E,Q);return be||(me="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:me}}constructor(u,b){this.githubAppCredentialsMux=u,this.token=b}}ft.create=j=>new ft(new it(j),j.token);class ct{static fromIntegrations(u){const b=new Map;return u.github.list().forEach(E=>{const Q=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,Q)}),new ct(b)}async getCredentials(u){const b=new URL(u.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return E.getCredentials(u)}constructor(u){this.providers=u}}class et{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return Me(l(u),"tree")}resolveEditUrl(u){return Me(u,"edit")}constructor(u){this.integrationConfig=u}}et.factory=({config:j})=>{var u;const b=Y((u=j.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new et(E)),E=>E.config.host)};function Me(j,u){return j.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,Q,me)=>`//${E}/${Q}/${me}/${u}/`)}const Et=null;class Lt extends et{get config(){return super.config}constructor(u){super(u)}}Lt.factory=et.factory;const Gt=null,vt=null,Nt=null,Bt="gitlab.com",pt="https://gitlab.com/api/v4";function ot(j){const u=j.getString("host");let b=j.getOptionalString("apiBaseUrl");const E=j.getOptionalString("token");let Q=j.getOptionalString("baseUrl");if(b?b=(0,z.trimEnd)(b,"/"):u===Bt&&(b=pt),Q?Q=(0,z.trimEnd)(Q,"/"):Q=`https://${u}`,B(u)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!m(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:E,apiBaseUrl:b,baseUrl:Q}}function st(j){const u=j.map(ot);return u.some(b=>b.host===Bt)||u.push({host:Bt,apiBaseUrl:pt,baseUrl:`https://${Bt}`}),u}function Kt(j){let u="";return j.host!==Bt&&(u=new URL(j.baseUrl).pathname),trimEnd(u,"/")}async function On(j,u){const b=await Yn(j,u);return yn(j,b,u).toString()}function un(j){const{token:u=""}=j;return{headers:{"PRIVATE-TOKEN":u}}}function yn(j,u,b){try{const E=new URL(j),Q=E.pathname.split("/blob/").slice(1).join("/blob/"),[me,...be]=Q.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),E.search=`?ref=${me}`,E}catch(E){throw new Error(`Incorrect url: ${j}, ${E}`)}}async function Yn(j,u){const b=new URL(j);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(u);Q&&(E=E.replace(Q,""));const me=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),be=await fetch(me.toString(),un(u)),ke=await be.json();if(!be.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${j}, ${E}`)}}class Bn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return Cn(u,"edit")}constructor(u){this.integrationConfig=u}}Bn.factory=({config:j})=>{var u;const b=st((u=j.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return S(b.map(E=>new Bn(E)),E=>E.config.host)};function Cn(j,u){return j.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class nr{static fromConfig(u){return new nr({awsS3:ne.factory({config:u}),azure:We.factory({config:u}),bitbucket:Zt.factory({config:u}),bitbucketCloud:Dt.factory({config:u}),bitbucketServer:En.factory({config:u}),gerrit:he.factory({config:u}),github:et.factory({config:u}),gitlab:Bn.factory({config:u}),gitea:It.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let b=Object.values(this.byType).map(E=>E.byUrl(u)).filter(Boolean);if(b.length>1){const E=b.filter(Q=>!(Q instanceof Zt));E.length!==0&&(b=E)}return b[0]}byHost(u){return Object.values(this.byType).map(b=>b.byHost(u)).find(Boolean)}resolveUrl(u){const b=this.byUrl(u.base);return b?b.resolveUrl(u):l(u)}resolveEditUrl(u){const b=this.byUrl(u);return b?b.resolveEditUrl(u):u}constructor(u){this.byType=u}}},49636:function(At,Oe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return C.s4}});var n=t(52322),z=t(2784),B=t(28316),m=t(79635),S=t(25248);const l=(0,S.T0)({id:"plugin.techdocs.storageservice"}),k=(0,S.T0)({id:"plugin.techdocs.service"});var ie=t(92077),_=t(95481),ne=t(7476),D=t(93225),O=t(67896),V=t(65124),ee=t(22478),ae=t(85478),T=t(68435),R=t(3482),W=t(42081),L=t(48431),C=t(89258),X=t(52943),Ie=t(61886),Ke=t(13980),Fe=t.n(Ke);class He{get(r){for(const s of this.holders){const c=s.get(r);if(c)return c}}constructor(...r){this.holders=r}}var We=t(51837);const jt=(0,We.CT)("api-context"),Qe=i=>{var r;const{apis:s,children:c}=i,g=(r=(0,z.useContext)(jt))===null||r===void 0?void 0:r.atVersion(1),P=g?new He(s,g):s;return(0,n.jsx)(jt.Provider,{value:(0,We.EI)({1:P}),children:c})};Qe.propTypes={apis:Fe().shape({get:Fe().func.isRequired}).isRequired,children:Fe().node};class ye{static validateFactories(r,s){for(const c of s){const g=[c],P=new Set;for(;g.length;){const F=g.shift(),H=r.get(F);if(!!H)for(const le of Object.values(H.deps)){if(le.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);P.has(le)||(P.add(le),g.push(le))}}}}get(r){return this.load(r)}load(r,s=[]){const c=this.apis.get(r.id);if(c)return c;const g=this.factories.get(r);if(!g)return;if(s.includes(g.api))throw new Error(`Circular dependency of api factory for ${g.api}`);const P=this.loadDeps(r,g.deps,[...s,g.api]),F=g.factory(P);return this.apis.set(r.id,F),F}loadDeps(r,s,c){const g={};for(const P in s)if(s.hasOwnProperty(P)){const F=s[P],H=this.load(F,c);if(!H)throw new Error(`No API factory available for dependency ${F} of dependent ${r}`);g[P]=H}return g}constructor(r){this.factories=r,this.apis=new Map}}var _e;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(_e||(_e={}));class wt{register(r,s){const c=_e[r],g=this.factories.get(s.api.id);return g&&g.priority>=c?!1:(this.factories.set(s.api.id,{priority:c,factory:s}),!0)}get(r){const s=this.factories.get(r.id);if(!!s)return s.factory}getAllApis(){const r=new Set;for(const{factory:s}of this.factories.values())r.add(s.api);return r}constructor(){this.factories=new Map}}function dt(i){return new Promise((r,s)=>{const c=i.width||500,g=i.height||700,P=window.screen.width/2-c/2,F=window.screen.height/2-g/2,H=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${g},top=${F},left=${P}`);let le="";if(!H||typeof H.closed=="undefined"||H.closed){const lt=new Error("Failed to open auth popup.");lt.name="PopupRejectedError",s(lt);return}const Ne=lt=>{if(lt.source!==H||lt.origin!==i.origin)return;const{data:Ct}=lt;if(Ct.type==="config_info"){le=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const yt=Ct;if("error"in yt){const $t=new Error(yt.error.message);$t.name=yt.error.name,s($t)}else r(yt.response);rt()},Le=setInterval(()=>{if(H.closed){const lt=`Login failed, ${le&&le!==window.location.origin?`Incorrect app origin, expected ${le}`:"popup was closed"}`,Ct=new Error(lt);Ct.name="PopupClosedError",s(Ct),rt()}},100);function rt(){window.removeEventListener("message",Ne),clearInterval(Le)}window.addEventListener("message",Ne)})}function bt(i){return[...i].join(" ")}class ut{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const s=await r.json();if(s.error){const c=new Error(s.error.message);throw s.error.name&&(c.name=s.error.name),c}return await this.sessionTransform(s)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!r.ok){const s=new Error(`Logout request failed, ${r.statusText}`);throw s.status=r.status,s}}async showPopup(r){const s=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:s,origin:window.location.origin}),g=await dt({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(g)}async buildUrl(r,s){const c=await this.discoveryApi.getBaseUrl("auth"),g=this.buildQueryString({...s,env:this.environment});return`${c}/${this.provider.id}${r}${g}`}buildQueryString(r){if(!r)return"";const s=Object.entries(r).map(([c,g])=>{if(typeof g=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(g)}`;if(g)return encodeURIComponent(c)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(r){const{discoveryApi:s,environment:c,provider:g,joinScopes:P=bt,oauthRequestApi:F,sessionTransform:H=le=>le}=r;this.authRequester=F.createAuthRequester({provider:g,onAuthRequest:le=>this.showPopup(le)}),this.discoveryApi=s,this.environment=c,this.provider=g,this.joinScopesFunc=P,this.sessionTransform=H}}function Rt(i,r){for(const s of r)if(!i.has(s))return!1;return!0}class Zt{sessionExistsAndHasScope(r,s){if(!r)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return Rt(c,s)}getExtendedScope(r,s){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const g=this.options.sessionScopes(r);for(const P of g)c.add(P)}if(s)for(const g of s)c.add(g);return c}constructor(r){this.options=r}}var Ge=t(82394),ce=t.n(Ge);let Re=Symbol.observable;class Ee{[Re](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(s=>s.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,s,c){const g=typeof r=="function"?{next:r,error:s,complete:c}:r;return this.observable.subscribe(g)}constructor(){this.isClosed=!1,this.observable=new(ce())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let Xe=Symbol.observable;class St{[Xe](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(s=>s.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(s=>s.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,s,c){const g=typeof r=="function"?{next:r,error:s,complete:c}:r;return this.observable.subscribe(g)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(ce())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class Ot{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?S.sM.SignedIn:S.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new St(S.sM.SignedOut),this.signedIn=!1}}class ht{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),g=this.sessionScopesFunc(this.currentSession),P=this.sessionScopesFunc(c);return Rt(P,g)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Ot;const{connector:s,defaultScopes:c=new Set,sessionScopes:g,sessionShouldRefresh:P}=r;this.connector=s,this.sessionScopesFunc=g,this.sessionShouldRefreshFunc=P,this.helper=new Zt({sessionScopes:g,defaultScopes:c})}}class Tt{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:s,defaultScopes:c=new Set,sessionScopes:g}=r;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:g,defaultScopes:c})}}const gt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Dt{static create(r){const{discoveryApi:s,environment:c="development",provider:g=gt,oauthRequestApi:P,defaultScopes:F=[],scopeTransform:H=Le=>Le}=r,le=new ut({discoveryApi:s,environment:c,provider:g,oauthRequestApi:P,sessionTransform(Le){return{...Le,providerInfo:{idToken:Le.providerInfo.idToken,accessToken:Le.providerInfo.accessToken,scopes:Dt.normalizeScopes(H,Le.providerInfo.scope),expiresAt:new Date(Date.now()+Le.providerInfo.expiresInSeconds*1e3)}}}}),Ne=new ht({connector:le,defaultScopes:new Set(F),sessionScopes:Le=>Le.providerInfo.scopes,sessionShouldRefresh:Le=>(Le.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Dt({sessionManager:Ne,scopeTransform:H})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,s){const c=Dt.normalizeScopes(this.scopeTransform,r),g=await this.sessionManager.getSession({...s,scopes:c});var P;return(P=g==null?void 0:g.providerInfo.accessToken)!==null&&P!==void 0?P:""}async getIdToken(r={}){const s=await this.sessionManager.getSession(r);var c;return(c=s==null?void 0:s.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.backstageIdentity}async getProfile(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.profile}static normalizeScopes(r,s){if(!s)return new Set;const c=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const Jt={id:"github",title:"GitHub",icon:()=>null};class Xt{static create(r){const{discoveryApi:s,environment:c="development",provider:g=Jt,oauthRequestApi:P,defaultScopes:F=["read:user"]}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c,defaultScopes:F})}}const cn={id:"gitlab",title:"GitLab",icon:()=>null};class Ut{static create(r){const{discoveryApi:s,environment:c="development",provider:g=cn,oauthRequestApi:P,defaultScopes:F=["read_user"]}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c,defaultScopes:F})}}const fn={id:"google",title:"Google",icon:()=>null},gn="https://www.googleapis.com/auth/";class wn{static create(r){const{discoveryApi:s,oauthRequestApi:c,environment:g="development",provider:P=fn,defaultScopes:F=["openid",`${gn}userinfo.email`,`${gn}userinfo.profile`]}=r;return Dt.create({discoveryApi:s,oauthRequestApi:c,provider:P,environment:g,defaultScopes:F,scopeTransform(H){return H.map(le=>le==="openid"?le:le==="profile"||le==="email"?`${gn}userinfo.${le}`:le.startsWith(gn)?le:`${gn}${le}`)}})}}const En={id:"okta",title:"Okta",icon:()=>null},Wn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),An="okta.";class dn{static create(r){const{discoveryApi:s,environment:c="development",provider:g=En,oauthRequestApi:P,defaultScopes:F=["openid","email","profile","offline_access"]}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c,defaultScopes:F,scopeTransform(H){return H.map(le=>Wn.has(le)||le.startsWith(An)?le:`${An}${le}`)}})}}var rn=t(30195);const Vn=rn.z.object({profile:rn.z.object({email:rn.z.string().optional(),displayName:rn.z.string().optional(),picture:rn.z.string().optional()}),backstageIdentity:rn.z.object({token:rn.z.string(),identity:rn.z.object({type:rn.z.literal("user"),userEntityRef:rn.z.string(),ownershipEntityRefs:rn.z.array(rn.z.string())})})}),Hn={id:"saml",title:"SAML",icon:()=>null};class Sn{static create(r){const{discoveryApi:s,environment:c="development",provider:g=Hn}=r,P=new DirectAuthConnector({discoveryApi:s,environment:c,provider:g}),F=new StaticAuthSessionManager({connector:P}),H=new AuthSessionStore({manager:F,storageKey:`${g.id}Session`,schema:samlSessionSchema});return new Sn(H)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.backstageIdentity}async getProfile(r={}){const s=await this.sessionManager.getSession(r);return s==null?void 0:s.profile}constructor(r){this.sessionManager=r}}const mn={id:"microsoft",title:"Microsoft",icon:()=>null};class Tn{static create(r){const{environment:s="development",provider:c=mn,oauthRequestApi:g,discoveryApi:P,defaultScopes:F=["openid","offline_access","profile","email","User.Read"]}=r;return Dt.create({discoveryApi:P,oauthRequestApi:g,provider:c,environment:s,defaultScopes:F})}}const In={id:"onelogin",title:"onelogin",icon:()=>null},Kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),vn="onelogin.";class ge{static create(r){const{discoveryApi:s,environment:c="development",provider:g=In,oauthRequestApi:P}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(H=>Kn.has(H)||H.startsWith(vn)?H:`${vn}${H}`)}})}}const re={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ae{static create(r){const{discoveryApi:s,environment:c="development",provider:g=re,oauthRequestApi:P,defaultScopes:F=["team"]}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c,defaultScopes:F})}}const Ze={id:"atlassian",title:"Atlassian",icon:()=>null};class qe{static create(r){const{discoveryApi:s,environment:c="development",provider:g=Ze,oauthRequestApi:P}=r;return Dt.create({discoveryApi:s,oauthRequestApi:P,provider:g,environment:c})}}class mt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Ee}}class he{captureEvent(r){}}const $="theme";class pe{static createWithStorage(r){const s=new pe(r);if(!window.localStorage)return s;var c;const g=(c=window.localStorage.getItem($))!==null&&c!==void 0?c:void 0;return s.setActiveThemeId(g),s.activeThemeId$().subscribe(P=>{P?window.localStorage.setItem($,P):window.localStorage.removeItem($)}),window.addEventListener("storage",P=>{if(P.key===$){var F;const H=(F=localStorage.getItem($))!==null&&F!==void 0?F:void 0;s.setActiveThemeId(H)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new St(void 0)}}var Ue=t(9850),Be=t.n(Ue),nt=t(12782),It=t.n(nt);const Ht=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Mt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Qt(i){if(i===null)return"null";if(Array.isArray(i))return"array";const r=typeof i;return r==="number"&&isNaN(i)?"nan":r==="string"&&i===""?"empty-string":r}const zt={type(i,r,s,c){return`Invalid type in config for key '${i}' in '${r}', got ${s}, wanted ${c}`},missing(i){return`Missing required config value at '${i}'`},convert(i,r,s){return`Unable to convert config value for key '${i}' in '${r}' to a ${s}`}};class Y{static fromConfigs(r){return r.length===0?new Y(void 0):r.reduce((s,{data:c,context:g,filteredKeys:P,deprecatedKeys:F})=>{const H=new Y(c,g,s);if(H.filteredKeys=P,F)for(const{key:le,description:Ne}of F)console.warn(`The configuration key '${le}' of ${g} is deprecated and may be removed soon. ${Ne||""}`);return H},void 0)}has(r){var s;if(this.readValue(r)!==void 0)return!0;var g;return(g=(s=this.fallback)===null||s===void 0?void 0:s.has(r))!==null&&g!==void 0?g:!1}keys(){var r;const s=this.data?Object.keys(this.data):[];var c;const g=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...s,...g])]}get(r){const s=this.getOptional(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r!=null?r:"")));return s}getOptional(r){var s;const c=Be()(this.readValue(r)),g=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(r);if(c===void 0){if(!1)var P;return g}else if(g===void 0)return c;return It()({},{value:g},{value:c},(F,H)=>!Mt(H)||!Mt(F)?H:void 0).value}getConfig(r){const s=this.getOptionalConfig(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalConfig(r){var s;const c=this.readValue(r),g=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(r);if(Mt(c))return this.copy(c,r,g);if(c!==void 0)throw new TypeError(zt.type(this.fullKey(r),this.context,Qt(c),"object"));return g}getConfigArray(r){const s=this.getOptionalConfigArray(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalConfigArray(r){const s=this.readConfigValue(r,g=>{if(!Array.isArray(g))return{expected:"object-array"};for(const[P,F]of g.entries())if(!Mt(F))return{expected:"object-array",value:F,key:`${r}[${P}]`};return!0});if(!s){if(!1)var c;return}return s.map((g,P)=>this.copy(g,`${r}[${P}]`))}getNumber(r){const s=this.getOptionalNumber(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalNumber(r){const s=this.readConfigValue(r,g=>typeof g=="number"||typeof g=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const c=Number(s);if(!Number.isFinite(c))throw new Error(zt.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const s=this.getOptionalBoolean(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalBoolean(r){const s=this.readConfigValue(r,g=>typeof g=="boolean"||typeof g=="number"||typeof g=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const c=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(c))return!0;if(/^(?:n|no|false|0|off)$/i.test(c))return!1;throw new Error(zt.convert(this.fullKey(r),this.context,"boolean"))}getString(r){const s=this.getOptionalString(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalString(r){return this.readConfigValue(r,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(r){const s=this.getOptionalStringArray(r);if(s===void 0)throw new Error(zt.missing(this.fullKey(r)));return s}getOptionalStringArray(r){return this.readConfigValue(r,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[c,g]of s.entries())if(typeof g!="string"||g==="")return{expected:"string-array",value:g,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,s,c){const g=new Y(r,this.context,c,this.fullKey(s));return g.filteredKeys=this.filteredKeys,g}readConfigValue(r,s){const c=this.readValue(r);if(c===void 0){var g;if(!1)var P;return(g=this.fallback)===null||g===void 0?void 0:g.readConfigValue(r,s)}const F=s(c);if(F!==!0){const{key:H=r,value:le=c,expected:Ne}=F;throw new TypeError(zt.type(this.fullKey(H),this.context,Qt(le),Ne))}return c}readValue(r){const s=r?r.split("."):[];for(const g of s)if(!Ht.test(g))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[g,P]of s.entries())if(Mt(c))c=c[P];else if(c!==void 0){const F=this.fullKey(s.slice(0,g).join("."));throw new TypeError(zt.type(F,this.context,Qt(c),"object"))}return c}constructor(r,s="mock-config",c,g=""){this.data=r,this.context=s,this.fallback=c,this.prefix=g,this.notifiedFilteredKeys=new Set}}const q="Invalid discovery URL pattern,";class f{static compile(r){const s=r.split(/\{\{\s*pluginId\s*\}\}/),c=s.join("pluginId");let g;try{g=new URL(c)}catch{throw new Error(`${q} URL '${c}' is invalid`)}if(g.hash)throw new Error(`${q} URL must not have a hash`);if(g.search)throw new Error(`${q} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${q} URL must not end with a slash`);return new f(s)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class A{post(r,s){return s!=null&&s.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,s)}error$(){return this.errorApi.error$()}constructor(r,s){this.alertApi=r,this.errorApi=s}}class M{post(r,s){this.subject.next({error:r,context:s})}error$(){return this.subject}constructor(){this.subject=new Ee}}class K{static forward(r,s){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,s)})}}function se(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 xe{registerFlag(r){se(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===S.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,g]of Object.entries(r.states))this.flags.set(c,g);const s=Array.from(this.flags.entries()).filter(([,c])=>c===S.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const s=JSON.parse(r);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const c=Object.entries(s).filter(([g,P])=>(se(g),P===S.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Pe(i){let r=i.baseImplementation||t.g.fetch;var s;const c=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const g of c)r=g.apply(r);return{fetch:r}}class tt{static create(r){var s,c;const g=it(r),P=((s=r.header)===null||s===void 0?void 0:s.name)||"authorization",F=((c=r.header)===null||c===void 0?void 0:c.value)||(H=>`Bearer ${H}`);return new tt(r.identityApi,g,P,F)}apply(r){return async(s,c)=>{const g=new Request(s,c),{token:P}=await this.identityApi.getCredentials();return g.headers.get(this.headerName)||typeof P!="string"||!P||!this.allowUrl(g.url)?r(s,c):(g.headers.set(this.headerName,this.headerValue(P)),r(g))}}constructor(r,s,c,g){this.identityApi=r,this.allowUrl=s,this.headerName=c,this.headerValue=g}}function it(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?ft(i.urlPrefixAllowlist):i.config?ft([i.config.getString("backend.baseUrl")]):()=>!1}function ft(i){const r=i.map(s=>s.replace(/\/$/,""));return s=>r.some(c=>s===c||s.startsWith(`${c}/`))}function ct(i,r){return!r||r==="/"?i:`${i.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class et{apply(r){return async(s,c)=>{const g=new Request(s,c),P="plugin://";if(!g.url.startsWith(P))return r(s,c);const{hostname:F,pathname:H,search:le,hash:Ne,username:Le,password:rt}=new URL(`http://${g.url.substring(P.length)}`);let lt=await this.discoveryApi.getBaseUrl(F);if(Le||rt){const yt=new URL(lt),$t=`${Le}${rt?`:${rt}`:""}@`;lt=`${yt.protocol}//${$t}${yt.host}${yt.pathname}`}const Ct=`${ct(lt,H)}${le}${Ne}`;return r(Ct,typeof s=="string"||Me(s)?c:s)}}constructor(r){this.discoveryApi=r}}function Me(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Et{static resolvePluginProtocol(r){return new et(r.discoveryApi)}static injectIdentityAuth(r){return tt.create(r)}constructor(){}}function Lt(i,r){for(const s of r)if(!i.has(s))return!1;return!0}function Gt(i,...r){const s=new Set(i);for(const c of r)for(const g of c)s.add(g);return s}class vt{request(r){return new Promise((s,c)=>{this.requests.push({scopes:r,resolve:s,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,s){this.requests=this.requests.filter(c=>Lt(r,c.scopes)?(c.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(s=>s.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,c)=>Gt(s,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:s=>{r&&this.resolve(r,s)},reject:s=>{r&&this.reject(s)}}}constructor(){this.requests=[],this.subject=new St(this.getCurrentPending())}}class Nt{createAuthRequester(r){const s=new vt,c=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:g=>{const P=this.currentRequests.slice(),F=this.makeAuthRequest(g,r);F?P[c]=F:delete P[c],this.currentRequests=P,this.subject.next(P.filter(Boolean))}}),g=>s.request(g)}makeAuthRequest(r,s){const{scopes:c}=r;if(!!c)return{provider:s.provider,trigger:async()=>{const g=await s.onAuthRequest(c);r.resolve(g)},reject:()=>{const g=new Error("Login failed, rejected by user");g.name="RejectedError",r.reject(g)}}}authRequest$(){return this.subject}constructor(){this.subject=new St([]),this.currentRequests=[],this.handlerCount=0}}const Bt=new Map;class pt{static create(r){var s;return new pt((s=r.namespace)!==null&&s!==void 0?s:"",r.errorApi)}static addStorageEventListener(){window.addEventListener("storage",r=>{for(const[c,g]of Bt.entries()){var s;!((s=r.key)===null||s===void 0)&&s.startsWith(c)&&g.handleStorageChange(r.key)}})}get(r){return this.snapshot(r).value}snapshot(r){let s,c="absent";try{const g=localStorage.getItem(this.getKeyName(r));g&&(s=JSON.parse(g,(P,F)=>(typeof F=="object"&&F!==null&&Object.freeze(F),F)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:s,presence:c}}forBucket(r){const s=`${this.namespace}/${r}`;return Bt.has(s)||Bt.set(s,new pt(s,this.errorApi)),Bt.get(s)}async set(r,s){localStorage.setItem(this.getKeyName(r),JSON.stringify(s)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return pt.hasSubscribed||(pt.addStorageEventListener(),pt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===r)}handleStorageChange(r){if(!(r!=null&&r.startsWith(this.namespace)))return;const s=r==null?void 0:r.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const s=this.snapshot(r);for(const c of this.subscribers)c.next(s)}constructor(r,s){this.namespace=r,this.errorApi=s,this.subscribers=new Set,this.observable=new(ce())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}pt.hasSubscribed=!1;const ot=(0,z.createContext)(void 0);function st(){const[i]=(0,m.is)((0,n.jsx)(m.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!i.index}var Kt=t(16060);const On=(i,r)=>{try{var s,c;const g=(0,Kt.fp)(r,{pathname:i}),P=(s=g==null?void 0:g.filter(H=>{var le;return((le=H==null?void 0:H.route.routeRefs)===null||le===void 0?void 0:le.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!P)return{};let F;return P.routeRefs.size===1&&(F=P.routeRefs.values().next().value),{extension:"App",pluginId:((c=P.plugin)===null||c===void 0?void 0:c.getId())||"root",...F?{routeRef:F.id}:{}}}catch{return{}}},un=({pathname:i,search:r,hash:s})=>{const c=(0,S.z$)();return(0,z.useEffect)(()=>{c.captureEvent("navigate",`${i}${r}${s}`)},[c,i,r,s]),null},yn=({routeObjects:i})=>{const{pathname:r,search:s,hash:c}=(0,m.TH)();return(0,n.jsx)(S.fC,{attributes:On(r,i),children:(0,n.jsx)(un,{pathname:r,search:s,hash:c})})};function Yn(i){return st()?Bn(i):""}function Bn(i){var r;let{pathname:s}=new URL((r=i.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function Cn({component:i,appIdentityProxy:r,children:s}){const[c,g]=(0,z.useState)(),P=(0,S.h_)(S.Ds),F=Yn(P);return c?(r.setTarget(c,{signOutTargetUrl:F||"/"}),(0,n.jsx)(n.Fragment,{children:s})):(0,n.jsx)(i,{onSignInSuccess:g})}function nr(i){const{Router:r,SignInPage:s}=(0,S.qD)().getComponents(),c=(0,S.h_)(S.Ds),g=Bn(c),P=`${g}/*`,F=(0,z.useContext)(ot);if(!F)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:H,appIdentityProxy:le}=F;return s?st()?(0,n.jsxs)(r,{children:[(0,n.jsx)(yn,{routeObjects:H}),(0,n.jsx)(Cn,{component:s,appIdentityProxy:le,children:(0,n.jsx)(m.Z5,{children:(0,n.jsx)(m.AW,{path:P,element:(0,n.jsx)(n.Fragment,{children:i.children})})})})]}):(0,n.jsxs)(r,{basename:g,children:[(0,n.jsx)(yn,{routeObjects:H}),(0,n.jsx)(Cn,{component:s,appIdentityProxy:le,children:i.children})]}):(le.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:g||"/"}),st()?(0,n.jsxs)(r,{children:[(0,n.jsx)(yn,{routeObjects:H}),(0,n.jsx)(m.Z5,{children:(0,n.jsx)(m.AW,{path:P,element:(0,n.jsx)(n.Fragment,{children:i.children})})})]}):(0,n.jsxs)(r,{basename:g,children:[(0,n.jsx)(yn,{routeObjects:H}),i.children]}))}var j=t(90383),u=t(22504),b=t(69866),E=t(64279);function Q(i){const r={};for(const c in i.collectors)i.collectors.hasOwnProperty(c)&&(r[c]=i.collectors[c]());const s=[{node:z.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:c,parent:g,contexts:P}=s.shift();z.Children.forEach(c,F=>{if(!(0,z.isValidElement)(F))return;const H={};for(const le in r)if(r.hasOwnProperty(le)){const Ne=r[le];H[le]=Ne.visit(Ne.accumulator,F,g,P[le])}for(const le of i.discoverers){const Ne=le(F);Ne&&s.push({node:Ne,parent:F,contexts:H})}})}return Object.fromEntries(Object.entries(r).map(([c,g])=>[c,g.accumulator]))}function me(i,r){return()=>({accumulator:i(),visit:r})}function be(i){var r;return(r=i.props)===null||r===void 0?void 0:r.children}function ke(i){var r,s;if(((r=i.props)===null||r===void 0?void 0:r.path)&&((s=i.props)===null||s===void 0?void 0:s.element)){var c;return(c=i.props)===null||c===void 0?void 0:c.element}}const Ve=me(()=>new Set,(i,r)=>{const s=(0,S.IY)(r,"core.plugin");s&&i.add(s)}),Wt=i=>{const{children:r}=i,s=(0,S.h_)(S.W0),c="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,S.R5)(Wt,"core.featureFlagged",!0);const tn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Rn(i){const r=i;if(r!=null&&r.type){var s,c;return(c=(s=r.type.displayName)!==null&&s!==void 0?s:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function Ar(i,r=new Array){return z.Children.forEach(i,s=>{if(!(0,z.isValidElement)(s))return;const c=(0,S.IY)(s,"core.mountPoint");if(c){const g=(0,S.IY)(s,"core.plugin");r.push({routeRef:c,plugin:g})}Ar(s.props.children,r)}),r}const uo=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,r,s,c)=>{var g,P;if(c!=null&&c.isElementAncestor)return c;if((s==null?void 0:s.props.element)===r)return{...c,isElementAncestor:!0};const F=(g=r.props)===null||g===void 0?void 0:g.path,H=(0,S.IY)(r,"core.mountPoint");if(H&&F)throw new Error(`Path property may not be set directly on a routable extension "${Rn(r)}"`);var le;const Ne=(le=c==null||(P=c.obj)===null||P===void 0?void 0:P.children)!==null&&le!==void 0?le:i.objects;if(F!==void 0){if(typeof F!="string")throw new Error(`Element path must be a string at "${Rn(r)}"`);const Ct=F.startsWith("/")?F.slice(1):F,yt=r.props.element;if((0,S.IY)(r,"core.gatherMountPoints")){var Le;if(yt)throw new Error(`Mount point gatherers may not have an element prop "${Rn(r)}"`);const $t={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Le=r.props)===null||Le===void 0?void 0:Le.caseSensitive),children:[tn],plugin:void 0};return Ne.push($t),{obj:$t,gatherPath:Ct,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(yt){var rt;const[$t,...Ft]=Ar(yt);if(Ft.length>0)throw new Error(`Route element with path "${F}" may not contain multiple routable extensions`);if(!$t)return c;const{routeRef:xn,plugin:er}=$t,tr={path:Ct,element:"mounted",routeRefs:new Set([xn]),caseSensitive:Boolean((rt=r.props)===null||rt===void 0?void 0:rt.caseSensitive),children:[tn],plugin:er};return Ne.push(tr),i.paths.set(xn,Ct),i.parents.set(xn,c==null?void 0:c.routeRef),{obj:tr,routeRef:xn!=null?xn:c==null?void 0:c.routeRef,gatherPath:Ct,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(H){var lt;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${Rn(r)}" with mount point "${H}" must be assigned a path`);return c==null||(lt=c.obj)===null||lt===void 0||lt.routeRefs.add(H),i.paths.set(H,c.gatherPath),i.parents.set(H,c==null?void 0:c.gatherRouteRef),{...c,routeRef:H}}return c}),ho=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,r,s,c)=>{var g,P,F;if((s==null?void 0:s.props.element)===r)return c;let H=c==null?void 0:c.obj,le=c==null?void 0:c.routeRef,Ne=c==null?void 0:c.sticky;const Le=(g=r.props)===null||g===void 0?void 0:g.path;var rt;const lt=(rt=H==null?void 0:H.children)!==null&&rt!==void 0?rt:i.objects,Ct=Boolean((P=r.props)===null||P===void 0?void 0:P.caseSensitive);let yt=c==null?void 0:c.path;if((0,S.IY)(r,"core.gatherMountPoints")){if(!Le)throw new Error("Mount point gatherer must have a path");yt=Le}const $t=(F=r.props)===null||F===void 0?void 0:F.element;let Ft=(0,S.IY)(r,"core.mountPoint");if(!Ft&&(0,z.isValidElement)($t)&&(Ft=(0,S.IY)($t,"core.mountPoint")),Ft){let tr=Le;if(yt&&(tr?yt=void 0:tr=yt),!tr)throw new Error("Mounted routable extension must have a path");i.paths.set(Ft,tr),le&&Ne?(i.parents.set(Ft,le),Le&&(le=Ft,Ne=!1)):(i.parents.set(Ft,le),le=Ft),Le?(H={caseSensitive:Ct,path:Le,element:"mounted",routeRefs:new Set([Ft]),children:[tn],plugin:(0,S.IY)(r.props.element,"core.plugin")},lt.push(H)):H==null||H.routeRefs.add(Ft)}if((0,S.IY)(r,"core.gatherMountPoints")&&(Ne=!0),(0,S.IY)(r,"core.gatherMountPoints")){if(!Le)throw new Error("Mount point gatherer must have a path");if(!Ft){var er;H={caseSensitive:Ct,path:Le,element:"gathered",routeRefs:new Set,children:[tn],plugin:c==null||(er=c.obj)===null||er===void 0?void 0:er.plugin},lt.push(H)}}return{obj:H,path:yt,routeRef:le,sticky:Ne}}),Or=me(()=>new Set,(i,r)=>{if(r.type===Wt){const s=r.props;i.add("with"in s?s.with:s.without)}}),pr=(0,We.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Gr(i){return i[pr]==="absolute"}function Br(i){return i[pr]==="sub"}function po(i){return i[pr]==="external"}function $n(...i){const r=i.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function Qn(i,r,s){let c,g="";if(Gr(i))c=i;else if(Br(i))c=i.parent,g=i.path;else if(po(i)){const H=s.get(i);if(!H)return[void 0,""];if(Gr(H))c=H;else if(Br(H))c=H.parent,g=H.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${H}`)}else throw i[pr]?new Error(`Unknown or invalid route ref type, ${i[pr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!c)return[void 0,""];const P=r.get(c);if(P===void 0)return[void 0,""];const F=$n(P,g);return[c,F]}function fr(i,r,s,c,g){var P;const F=(P=(0,Kt.fp)(g,r))!==null&&P!==void 0?P:[],H=Array();let le=-1;for(let rt=i;rt&&(le=F.findIndex(lt=>lt.route.routeRefs.has(rt)),le===-1);rt=c.get(rt))H.unshift(rt);H.length===0&&(le-=1);const Ne=le===-1?"":F[le].pathname,Le=H.slice(0,-1).map(rt=>{const lt=s.get(rt);if(lt===void 0)throw new Error(`No path for ${rt}`);if(lt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${rt} as it has parameters`);return lt});return`${$n(Ne,...Le)}/`}class Tr{resolve(r,s){const[c,g]=Qn(r,this.routePaths,this.routeBindings);if(!c)return;let P;typeof s=="string"?P=this.trimPath(s):s.pathname?P={...s,pathname:this.trimPath(s.pathname)}:P=s;const F=this.appBasePath+fr(c,P,this.routePaths,this.routeParents,this.routeObjects);return(...[le])=>$n(F,(0,Kt.Gn)(g,le))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,s,c,g,P){this.routePaths=r,this.routeParents=s,this.routeObjects=c,this.routeBindings=g,this.appBasePath=P}}const fo=(0,We.CT)("routing-context"),go=({routePaths:i,routeParents:r,routeObjects:s,routeBindings:c,basePath:g="",children:P})=>{const F=new Tr(i,r,s,c,g),H=(0,We.EI)({1:F});return(0,n.jsx)(fo.Provider,{value:H,children:P})};function Kr(i,r){const s=new Set(r.values());s.delete(void 0);for(const c of r.keys()){if(s.has(c))continue;let g=c,P="";for(;g;){const H=i.get(g);if(H===void 0)throw new Error(`No path for ${g}`);P=$n(H,P),g=r.get(g)}const F=P.match(/:(\w+)/g);if(F){for(let H=0;H<F.length;H++)for(let le=H+1;le<F.length;le++)if(F[le]===F[H])throw new Error(`Parameter ${F[le]} is duplicated in path ${P}`)}}}function mo(i,r){for(const s of r)if(!!s.externalRoutes){for(const[c,g]of Object.entries(s.externalRoutes))if(!g.optional&&!i.has(g))throw new Error(`External route '${c}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const vo=(0,We.CT)("app-context"),$r=({appContext:i,children:r})=>{const s=(0,We.EI)({1:i});return(0,n.jsx)(vo.Provider,{value:s,children:r})};function Jn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function ar(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class gr{setTarget(r,s){this.target=r,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw Jn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ar("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Jn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ar("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(s=>s.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ar("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var lr=t(72164);function Zr(i,r,s){if(i!==void 0){const g=s.find(P=>P.id===i);if(g)return g}if(r){const g=s.find(P=>P.variant==="dark");if(g)return g}const c=s.find(g=>g.variant==="light");return c||s[0]}const Yr=()=>{const i=(0,z.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,s]=(0,z.useState)(i.matches);return(0,z.useEffect)(()=>{const c=g=>{s(g.matches)};return i.addListener(c),()=>{i.removeListener(c)}},[i]),r};function Jr({children:i}){const r=(0,S.h_)(S.hg),s=(0,lr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Yr():!1,g=Zr(s,c,r.getInstalledThemes());if(!g)throw new Error("App has no themes");return(0,n.jsx)(g.Provider,{children:i})}const Xr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const s=r.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const g=JSON.parse(i);Array.isArray(g)?s.push(...g):s.push({data:g,context:"env"})}catch(g){throw new Error(`Failed to load runtime configuration, ${g}`)}const c=window.__APP_CONFIG__;return c&&s.push({context:"window",data:c}),s};class Qr{add(r,s){return this.apis.push([r.id,s]),s}build(){return new mr(new Map(this.apis))}constructor(){this.apis=[]}}class mr{static builder(){return new Qr}static from(r){return new mr(new Map(r.map(([s,c])=>[s.id,c])))}static with(r,s){return new mr(new Map([[r.id,s]]))}with(r,s){return new mr(new Map([...this.apis,[r.id,s]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function yo(i){const r=new Map;return i&&i({bind:(c,g)=>{for(const[P,F]of Object.entries(g)){const H=c[P];if(!H)throw new Error(`Key ${P} is not an existing external route`);if(!F&&!H.optional)throw new Error(`External route ${P} is required but was undefined`);F&&r.set(H,F)}}}),r}function qr(i){const r=new URL(i);return r.protocol=document.location.protocol,r.hostname=document.location.hostname,r.port=document.location.port,r.toString().replace(/\/$/,"")}function xo(i,r,s){var c;const g=Boolean(i),P=(0,E.default)(i||(()=>Promise.resolve([])));let F;if(g&&P.loading){const{Progress:Ne}=r;F=(0,n.jsx)(Ne,{})}else if(P.error){const{BootErrorPage:Ne}=r;F=(0,n.jsx)(Ne,{step:"load-config",error:P.error})}const{ThemeProvider:H=Jr}=r;if(F)return{node:(0,n.jsx)(Qe,{apis:mr.with(S.hg,s),children:(0,n.jsx)(H,{children:F})})};let le;if(!((c=P.value)===null||c===void 0)&&c.length){const Ne=Y.fromConfigs(P.value),Le=Ne.getOptionalString("app.baseUrl"),rt=Ne.getOptionalString("backend.baseUrl");let lt=P.value;const Ct={data:{},context:"relative-resolver"};if(Le&&rt){const yt=new URL(Le).origin,$t=new URL(rt).origin;if(yt===$t){const Ft=qr(rt);rt!==Ft&&(Ct.data.backend={baseUrl:Ft})}}if(Le){const yt=qr(Le);Le!==yt&&(Ct.data.app={baseUrl:yt})}Object.keys(Ct.data).length&&(lt=lt.concat([Ct])),le=Y.fromConfigs(lt)}else le=Y.fromConfigs([]);return{api:le}}class bo{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}var Dr=new WeakMap;class So{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(r){const s=this.getProvider();return()=>(0,n.jsx)(s,{children:r})}getProvider(){if((0,j.Z)(this,Dr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,b.Z)(this,Dr,!0);const r=new bo(this);let s=!1;return({children:g})=>{const P=(0,z.useRef)(!0),F=(0,z.useMemo)(()=>pe.createWithStorage(this.themes),[]),{routing:H,featureFlags:le,routeBindings:Ne}=(0,z.useMemo)(()=>{const Ct=Q({root:g,discoverers:[be,ke],collectors:{routing:st()?ho:uo,collectedPlugins:Ve,featureFlags:Or}});return Ct.collectedPlugins.forEach(yt=>this.plugins.add(yt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ct,routeBindings:yo(this.bindRoutes)}},[g]);s||(s=!0,Kr(H.paths,H.parents),mo(Ne,this.plugins));const Le=xo(this.configLoader,this.components,F),rt="api"in Le;if(rt){const{api:Ct}=Le;this.configApi=Ct}if("node"in Le)return Le.node;if(rt&&P.current){P.current=!1;const Ct=this.getApiHolder().get(S.W0);if(Ct){for(const Ft of this.featureFlags)Ct.registerFlag({...Ft,pluginId:""});for(const Ft of this.plugins.values())if("getFeatureFlags"in Ft)for(const xn of Ft.getFeatureFlags())Ct.registerFlag({name:xn.name,pluginId:Ft.getId()});else for(const xn of Ft.output())xn.type==="feature-flag"&&Ct.registerFlag({name:xn.name,pluginId:Ft.getId()});const yt=Ct.getRegisteredFlags(),$t=new Set(yt.map(Ft=>Ft.name));for(const Ft of le)$t.has(Ft)||Ct.registerFlag({name:Ft,pluginId:""})}}const{ThemeProvider:lt=Jr}=this.components;return(0,n.jsx)(Qe,{apis:this.getApiHolder(),children:(0,n.jsx)($r,{appContext:r,children:(0,n.jsx)(lt,{children:(0,n.jsx)(go,{routePaths:H.paths,routeParents:H.parents,routeObjects:H.objects,routeBindings:Ne,basePath:Yn(Le.api),children:(0,n.jsx)(ot.Provider,{value:{routeObjects:H.objects,appIdentityProxy:this.appIdentityProxy},children:g})})})})})}}getRouter(){return nr}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const s of r.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return ye.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:S.hg,deps:{},factory:()=>pe.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:S.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:S.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:S.W0,deps:{},factory:()=>new xe});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const s of r.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return ye.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new ye(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const s=new Set;for(const c of r){const g=c.getId();if(s.has(g))throw new Error(`Duplicate plugin found '${g}'`);s.add(g)}}constructor(r){this.appIdentityProxy=new gr,(0,u.Z)(this,Dr,{writable:!0,value:!1});var s;this.apis=(s=r.apis)!==null&&s!==void 0?s:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]);var g;this.featureFlags=(g=r.featureFlags)!==null&&g!==void 0?g:[],this.components=r.components,this.themes=r.themes;var P;this.configLoader=(P=r.configLoader)!==null&&P!==void 0?P:Xr;var F;this.defaultApis=(F=r.defaultApis)!==null&&F!==void 0?F:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new wt}}function Co(i){return new So(i)}let _r=!1;const jo=i=>{const r=(0,S.qD)(),{NotFoundErrorPage:s}=r.getComponents(),c=(0,z.useMemo)(()=>st(),[]),P=[...(0,S.vJ)(i.children,F=>F.getElements().flatMap(H=>{let le=H.props.path;if(le==="")return[];var Ne;le=(Ne=le==null?void 0:le.replace(/\/\*$/,""))!==null&&Ne!==void 0?Ne:"/";let Le=c?H:H.props.element;return!c&&!Le&&(Le=H,_r||(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] />} />."),_r=!0)),[{path:le,element:Le,children:H.props.children?[{path:le==="/"?"/":"*",element:H.props.children}]:void 0}]}).sort((H,le)=>le.path.localeCompare(H.path)).map(H=>({...H,path:H.path==="/"?"/":`${H.path}/*`}))),{path:"*",element:(0,n.jsx)(s,{})}];return(0,m.V$)(P)};var Nr=t(25488);const cr=[(0,S.ni)({api:S.NW,deps:{configApi:S.Ds},factory:({configApi:i})=>f.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,S.ni)({api:S.$v,deps:{},factory:()=>new mt}),(0,S.ni)({api:S.v_,deps:{},factory:()=>new he}),(0,S.ni)({api:S.VE,deps:{alertApi:S.$v},factory:({alertApi:i})=>{const r=new A(i,new M);return K.forward(r,{hidden:!1}),r}}),(0,S.ni)({api:S.E6,deps:{errorApi:S.VE},factory:({errorApi:i})=>pt.create({errorApi:i})}),(0,S.ni)({api:S.gP,deps:{configApi:S.Ds,identityApi:S.$4,discoveryApi:S.NW},factory:({configApi:i,identityApi:r,discoveryApi:s})=>Pe({middleware:[Et.resolvePluginProtocol({discoveryApi:s}),Et.injectIdentityAuth({identityApi:r,config:i})]})}),(0,S.ni)({api:S.ZM,deps:{},factory:()=>new Nt}),(0,S.ni)({api:S.Kp,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>wn.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.p_,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Tn.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.F4,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Xt.create({discoveryApi:i,oauthRequestApi:r,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.D,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>dn.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.ux,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Ut.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.gW,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>ge.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.bq,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>Ae.create({discoveryApi:i,oauthRequestApi:r,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.uB,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:i,oauthRequestApi:r,configApi:s})=>qe.create({discoveryApi:i,oauthRequestApi:r,environment:s.getOptionalString("auth.environment")})}),(0,S.ni)({api:Nr.RV,deps:{discovery:S.NW,identity:S.$4,config:S.Ds},factory:({config:i,discovery:r,identity:s})=>Nr.iM.create({config:i,discovery:r,identity:s})})];var vr=t(77277),Yt=t(23196),Ln=t(39857);function wo({children:i}){return(0,m.GV)()?(0,n.jsx)(n.Fragment,{children:i}):(0,n.jsx)(m.VA,{children:i})}const eo=()=>(0,n.jsx)(Yt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Eo=({step:i,error:r})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${r.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(wo,{children:(0,n.jsx)(Yt.mf,{status:"501",statusMessage:s})})},Ao=({error:i,resetError:r,plugin:s})=>(0,n.jsx)(Yt.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,n.jsx)(vr.Z,{variant:"outlined",onClick:r,children:"Retry"})}),To={Progress:Yt.Ex,Router:Ln.VK,NotFoundErrorPage:eo,BootErrorPage:Eo,ErrorBoundaryFallback:Ao};var Io=t(43642),Ro=t(80079),to=t(90941),Ir=t(32915),Yo=t(40562),Lo=t(21853),no=t(60744),Po=t(66569),Jo=t(30254),ko=t(13384),As=t(15933),y=t(58838),x=t(86737),I=t(4989),Z=t(44407),J=t(18628),te=t(84219),oe=t(98685),ue=t(39781);const Se={brokenImage:Ro.Z,catalog:J.Z,scaffolder:Ir.Z,techdocs:Yo.Z,search:Lo.Z,chat:no.Z,dashboard:Po.Z,docs:Jo.Z,email:ko.Z,github:y.Z,group:te.Z,help:x.Z,"kind:api":As.Z,"kind:component":Z.Z,"kind:domain":Io.Z,"kind:group":te.Z,"kind:location":I.Z,"kind:system":to.Z,"kind:user":oe.Z,user:oe.Z,warning:ue.Z};var je=t(73689),Te=t(48032);const Ce={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")`},De={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 Ye(i){const{colors:r,shape:s,options:c}=i,P=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,F=`${s}, ${P}`;var H;const le=(H=c==null?void 0:c.fontColor)!==null&&H!==void 0?H:"#FFFFFF";return{colors:r,shape:s,backgroundImage:F,fontColor:le}}const at={home:Ye({colors:De.teal,shape:Ce.wave}),documentation:Ye({colors:De.pinkSea,shape:Ce.wave2}),tool:Ye({colors:De.purpleSky,shape:Ce.round}),service:Ye({colors:De.marineBlue,shape:Ce.wave}),website:Ye({colors:De.veryBlue,shape:Ce.wave}),library:Ye({colors:De.rubyRed,shape:Ce.wave}),other:Ye({colors:De.darkGrey,shape:Ce.wave}),app:Ye({colors:De.toastyOrange,shape:Ce.wave}),apis:Ye({colors:De.teal,shape:Ce.wave2}),card:Ye({colors:De.greens,shape:Ce.wave})},$e=16,xt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Vt(i){const{palette:r,htmlFontSize:s=$e,fontFamily:c=xt,defaultPageTheme:g,pageTheme:P=at}=i;if(!P[g])throw new Error(`${g} is not defined in pageTheme.`);var F;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:P[g],getPageTheme:({themeId:H})=>(F=P[H])!==null&&F!==void 0?F:P[g]}}function jn(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Te.darken)(i.palette.link,.3),background:(0,Te.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function hn(i){const r=Vt(i),s=(0,je.Z)(r),c=jn(s);return{...s,overrides:c}}var rr=t(34505);const Pn=hn({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:rr.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:at}),Zn=hn({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:rr.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:at});var Gn=t(98192),Rr=t(15222),yr=t(41547),Lr=t(87561);const Dn=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(Rr.Z,{}),Provider:({children:i})=>(0,n.jsx)(yr.Z,{theme:Pn,children:(0,n.jsx)(Lr.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(Gn.Z,{}),Provider:({children:i})=>(0,n.jsx)(yr.Z,{theme:Zn,children:(0,n.jsx)(Lr.ZP,{children:i})})}];function Nn(i){var r,s,c,g;return Co({...i,apis:(r=i==null?void 0:i.apis)!==null&&r!==void 0?r:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...To,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:cr,icons:{...Se,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(c=i==null?void 0:i.featureFlags)!==null&&c!==void 0?c:[],themes:(g=i==null?void 0:i.themes)!==null&&g!==void 0?g:Dn})}var dr=t(25271),xr=t(76635);async function pi({storageApi:i}){const r=i.forBucket("settings"),s=i.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,xr.isArray)(c))return;var g;const P=new Set((g=s.snapshot("entityRefs").value)!==null&&g!==void 0?g:[]);c.filter(xr.isString).map(F=>F.split(":")).filter(F=>F.length===4&&F[0]==="entity").map(([F,H,le,Ne])=>(0,dr.eE)({kind:H,namespace:le,name:Ne})).forEach(F=>P.add(F)),await s.set("entityRefs",Array.from(P)),await r.remove("starredEntities")}class fi{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(ce())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),pi(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var g;this.starredEntities=new Set((g=c.value)!==null&&g!==void 0?g:[]),this.notifyChanges()}})}}var oa=t(33414),Fr=t(79692),gi=t(12420),Fn=t(56941),sa=t(19928);function Ts(){const i=useApi(catalogApiRef),{error:r,loading:s,value:c}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(P=>{var F;return((F=P.facets.kind)===null||F===void 0?void 0:F.map(H=>H.value).sort())||[]}),[i]);return{loading:s,error:r,allKinds:c!=null?c:[]}}function mi(i,r,s){let c=i;return r&&(c=c.filter(P=>r.some(F=>F.toLocaleLowerCase("en-US")===P.toLocaleLowerCase("en-US")))),s&&!i.some(P=>P.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(c=c.concat([s])),c.sort().reduce((P,F)=>(P[F.toLocaleLowerCase("en-US")]=F,P),{})}const Is=(0,Fr.Z)(i=>(0,gi.Z)({root:{...i.typography.h4}}));function vi(i){var r;const{initialFilter:s="component",allowedKinds:c}=i,g=Is(),{allKinds:P}=useAllKinds(),{filters:F,updateFilters:H,queryParameters:{kind:le}}=useEntityList(),Ne=useMemo(()=>[le].flat()[0],[le]);var Le;const[rt,lt]=useState((Le=Ne!=null?Ne:(r=F.kind)===null||r===void 0?void 0:r.value)!==null&&Le!==void 0?Le:s);useEffect(()=>{Ne&&lt(Ne)},[Ne]),useEffect(()=>{var yt;if(!((yt=F.kind)===null||yt===void 0)&&yt.value){var $t;lt(($t=F.kind)===null||$t===void 0?void 0:$t.value)}},[F.kind]),useEffect(()=>{H({kind:rt?new EntityKindFilter(rt):void 0})},[rt,H]);const Ct=filterKinds(P,c,rt);return _jsx(Select,{input:_jsx(InputBase,{}),value:rt.toLocaleLowerCase("en-US"),onChange:yt=>lt(yt.target.value),classes:g,children:Object.keys(Ct).map(yt=>_jsx(MenuItem,{value:yt,children:`${pluralize(Ct[yt])}`},yt))})}var yi=t(86359),Oo=t(95544),Rs=t(99688),Bo=t(12231),$o=t(86136),Ur=t(49378),xi=t(85256),Zo=t(80030),Xo=t(61837),Qo=t(79784),qo=t(50758),Ls=t(31654),Ps=t(43054),Do=t(65759),br=t(51666);const No="catalog-entity",ks=(0,br.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:No}),bi=(0,br.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),_o=(0,br.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:No}),Os=(0,br.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:No}),es=(0,br.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Bs=(0,br.J$)({name:"catalog.location.create",attributes:{action:"create"}}),ts=(0,br.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Si=[ks,bi,_o,Os,es,Bs,ts];var ns=t(49166);function rs(i){const{unregisterEntityOptions:r,isUnregisterAllowed:s,onUnregisterEntity:c,onClose:g}=i,P=typeof(r==null?void 0:r.disableUnregister)=="boolean";var F;const H=(F=!s||(P?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&F!==void 0?F:!1;let le=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(le=(0,n.jsxs)(Bo.Z,{onClick:()=>{g(),c()},disabled:H,children:[(0,n.jsx)($o.Z,{children:(0,n.jsx)(ns.Z,{fontSize:"small"})}),(0,n.jsx)(Ur.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:le})}const $s=(0,Fr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ci(i){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:c,onInspectEntity:g}=i,[P,F]=(0,z.useState)(),H=$s(),Ne=(0,Fn.N$)(_o).allowed,Le=$t=>{F($t.currentTarget)},rt=()=>{F(void 0)},lt=(0,S.h_)(S.$v),Ct=(0,z.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>lt.post({message:"Copied!",severity:"info"}))},[lt]),yt=r&&[...r.map($t=>(0,n.jsxs)(Bo.Z,{onClick:()=>{rt(),$t.onClick()},children:[(0,n.jsx)($o.Z,{children:(0,n.jsx)($t.Icon,{fontSize:"small"})}),(0,n.jsx)(Ur.Z,{primary:$t.title})]},$t.title)),(0,n.jsx)(xi.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Zo.ZP,{title:"More",arrow:!0,children:(0,n.jsx)(Xo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!P,role:"button",onClick:Le,"data-testid":"menu-button",className:H.button,id:"long-menu",children:(0,n.jsx)(Ps.Z,{})})}),(0,n.jsx)(Qo.ZP,{open:Boolean(P),onClose:rt,anchorEl:P,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(qo.Z,{children:[yt,(0,n.jsx)(rs,{unregisterEntityOptions:s,isUnregisterAllowed:Ne,onUnregisterEntity:c,onClose:rt}),(0,n.jsxs)(Bo.Z,{onClick:()=>{rt(),g()},children:[(0,n.jsx)($o.Z,{children:(0,n.jsx)(Ls.Z,{fontSize:"small"})}),(0,n.jsx)(Ur.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(Bo.Z,{onClick:()=>{rt(),Ct()},children:[(0,n.jsx)($o.Z,{children:(0,n.jsx)(Do.Z,{fontSize:"small"})}),(0,n.jsx)(Ur.Z,{primary:"Copy entity URL"})]})]})})]})}const os="plugin.catalog.entityLayoutRoute",ro=()=>null;(0,S.R5)(ro,os,!0),(0,S.R5)(ro,"core.gatherMountPoints",!0);function Zs(i){const{entity:r,title:s}=i;return(0,n.jsxs)(Oo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(Oo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),r&&(0,n.jsx)(Fn.LH,{entity:r})]})}function qn(i,r,s,c){var g;const P=(g=i!=null?i:c==null?void 0:c.kind)!==null&&g!==void 0?g:"";var F;const H=(F=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&F!==void 0?F:"";var le,Ne,Le;return{headerTitle:`${(Le=(Ne=(le=c==null?void 0:c.metadata.title)!==null&&le!==void 0?le:s)!==null&&Ne!==void 0?Ne:c==null?void 0:c.metadata.name)!==null&&Le!==void 0?Le:""}${H&&H!==dr.zG?` in ${H}`:""}`,headerType:(()=>{let lt=P.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(lt+=" \u2014 ",lt+=c.spec.type.toLocaleLowerCase("en-US")),lt})()}}function ji(i){var r;const{entity:s}=i,c=(0,Fn.hF)(s,dr.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Yt.i9,{label:"Owner",value:(0,n.jsx)(Fn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=s.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Yt.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const wi=i=>{var r,s;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:g,children:P,NotFoundComponent:F}=i,{kind:H,namespace:le,name:Ne}=(0,S.Oi)(Fn.wi),{entity:Le,loading:rt,error:lt}=(0,Fn.ce)(),Ct=(0,m.TH)(),yt=(0,S.vJ)(P,Ss=>Ss.selectByComponentData({key:os,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:zr})=>{if(Le){if(zr.if&&!zr.if(Le))return[]}else return[];return[{path:zr.path,title:zr.title,children:zr.children,tabProps:zr.tabProps}]}),[Le]),{headerTitle:$t,headerType:Ft}=qn(H,le,Ne,Le),[xn,er]=(0,z.useState)(!1),[tr,ao]=(0,z.useState)(!1),ri=(0,m.s0)(),bs=async()=>{er(!1),ao(!1),ri("/")};(0,z.useEffect)(()=>{er(!1),ao(!1)},[Ct.pathname]);var Vo;return(0,n.jsxs)(Yt.T3,{themeId:(Vo=Le==null||(r=Le.spec)===null||r===void 0||(s=r.type)===null||s===void 0?void 0:s.toString())!==null&&Vo!==void 0?Vo:"home",children:[(0,n.jsx)(Yt.h4,{title:(0,n.jsx)(Zs,{title:$t,entity:Le}),pageTitleOverride:$t,type:Ft,children:Le&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ji,{entity:Le}),(0,n.jsx)(Ci,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:g,onUnregisterEntity:()=>er(!0),onInspectEntity:()=>ao(!0)})]})}),rt&&(0,n.jsx)(Yt.Ex,{}),Le&&(0,n.jsx)(Yt.tn,{routes:yt}),lt&&(0,n.jsx)(Yt.VY,{children:(0,n.jsx)(Rs.Z,{severity:"error",children:lt.toString()})}),!rt&&!lt&&!Le&&(0,n.jsx)(Yt.VY,{children:F||(0,n.jsxs)(Yt.GB,{title:"Entity not found",children:["There is no ",H," with the requested"," ",(0,n.jsx)(Yt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(Fn.pp,{open:xn,entity:Le,onConfirm:bs,onClose:()=>er(!1)}),(0,n.jsx)(Fn.U_,{open:tr,entity:Le,onClose:()=>ao(!1)})]})};wi.Route=ro;var ia=t(23054);function aa(i){const{open:r,onClose:s,onConfirm:c,entity:g}=i,[P,F]=useState(!1),H=useApi(catalogApiRef),le=useApi(alertApiRef),Ne=async()=>{F(!0);try{const Le=g.metadata.uid;await H.removeEntityByUid(Le),c()}catch(Le){assertError(Le),le.post({message:Le.message})}finally{F(!1)}};return _jsxs(Dialog,{open:r,onClose:s,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:P,onClick:Ne,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Fo=t(19625);function la(i){var r,s;return(i==null||(r=i.metadata)===null||r===void 0||(s=r.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function ca(){const i=useNavigate(),r=useRouteRef(rootRouteRef),[s,c]=useState(!1),{entity:g}=useEntity(),P=async()=>{c(!1),i(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:g,onConfirm:P,onClose:()=>c(!1)})]})}var Ei=t(29644);const oo=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Ds(i,r){return{items:(await r.getEntityAncestors({entityRef:i})).items.map(g=>{var P,F;return{errors:((F=(P=g.entity.status)===null||P===void 0?void 0:P.items)!==null&&F!==void 0?F:[]).filter(oo).map(Ne=>Ne.error).filter(Ne=>Boolean(Ne)),entity:g.entity}}).filter(g=>g.errors.length>0)}}async function da(i,r){const s=r.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ds(stringifyEntityRef(i),s)).items.length>0}function Ai(){const{entity:i}=useEntity(),r=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:c,error:g,value:P}=useAsync(async()=>Ds(r,s),[r,s]);return g?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:g})}):c||!P?null:_jsx(_Fragment,{children:P.items.map((F,H)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(F.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:F.entity})]}),F.errors.map((le,Ne)=>_jsx(ResponseErrorPanel,{error:le},Ne))]},H))})}const ss="core.backstage.entitySwitch",so=i=>null;(0,S.R5)(so,ss,!0);const Ns=i=>{var r;const{entity:s,loading:c}=(0,Fn.ce)(),g=(0,S.I_)(),P=(0,S.vJ)(i.children,le=>le.selectByComponentData({key:ss,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ne=>{if(c)return[];const{if:Le,children:rt}=Ne.props;if(!s)return[{if:Le===void 0,children:rt}];var lt;return[{if:(lt=Le==null?void 0:Le(s,{apis:g}))!==null&&lt!==void 0?lt:!0,children:rt}]}),[g,s,c]);if(P.some(le=>typeof le.if=="object"&&"then"in le.if))return(0,n.jsx)(Fs,{results:P});var H;return(H=(r=P.find(le=>le.if))===null||r===void 0?void 0:r.children)!==null&&H!==void 0?H:null};function Fs({results:i}){const{loading:r,value:s}=(0,E.default)(async()=>{const c=i.map(async({if:P,children:F})=>{try{if(await P)return F}catch{}return null});var g;return(g=(await Promise.all(c)).find(Boolean))!==null&&g!==void 0?g:null},[i]);return r||!s?null:s}Ns.Case=so;const Ti=null,is=Fn._i.Filters,as=Fn._i.Content;var Uo=t(85877),ls=t(15096);const kn=(0,S.rx)({id:"catalog",apis:[(0,S.ni)({api:Fn.Ah,deps:{discoveryApi:S.NW,fetchApi:S.gP},factory:({discoveryApi:i,fetchApi:r})=>new Ei.MS({discoveryApi:i,fetchApi:r})}),(0,S.ni)({api:Fn.p3,deps:{storageApi:S.E6},factory:({storageApi:i})=>new fi({storageApi:i})})],routes:{catalogIndex:Fo._Z,catalogEntity:Fn.wi},externalRoutes:{createComponent:Fo.yw,viewTechDoc:Fo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ur=kn.provide((0,S.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(i=>i.CatalogPage),mountPoint:Fo._Z})),Us=kn.provide((0,S.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:Fn.wi})),Ms=kn.provide((0,S.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),Ii=kn.provide((0,S.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),ua=kn.provide((0,S.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),or=kn.provide((0,S.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),zs=kn.provide((0,S.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),Ri=kn.provide((0,S.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),Li=kn.provide((0,S.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),Pi=kn.provide((0,S.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),ki=kn.provide((0,S.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),Mo=kn.provide((0,S.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),Ws=kn.provide((0,S.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}})),Vs=kn.provide((0,ls.E5)({name:"CatalogSearchResultListItem",component:()=>t.e(7670).then(t.bind(t,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var zo=t(32838);class cs{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,s){const g=`${await this.getApiOrigin()}/${s}`,P=await fetch(`${g.endsWith("/")?g:`${g}/`}index.html`);if(P.status===404)throw new Error("Page not found");return P.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,s,c){const g=await this.getApiOrigin();return new URL(r,`${g}/${c}`).toString()}constructor({configApi:r,discoveryApi:s,identityApi:c}){this.configApi=r,this.discoveryApi=s,this.identityApi=c}}class Wo{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:s,identityApi:c}){this.configApi=r,this.discoveryApi=s,this.identityApi=c}}const Hs=[(0,S.ni)({api:Ie.Dl,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:i,discoveryApi:r,identityApi:s})=>new cs({configApi:i,discoveryApi:r,identityApi:s})}),(0,S.ni)({api:Ie.gT,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:i,discoveryApi:r,identityApi:s})=>new Wo({configApi:i,discoveryApi:r,identityApi:s})}),(0,S.ni)({api:zo.q3,deps:{configApi:S.Ds},factory:({configApi:i})=>zo.ae.fromConfig(i)})],ds={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},us={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function hs(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Gs(){const i=await Xr(),r=await hs();return[...i,{context:"detected",data:r?ds:us}]}var Mr=t(58845);const Ks=(0,Fr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ps=()=>{const i=Ks();return(0,n.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.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 fs=(0,Fr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ys=()=>{const i=fs();return(0,n.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.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 Js=(0,Fr.Z)({root:{width:Yt.po.drawerWidthClosed,height:3*Yt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Yt.po.drawerWidthClosed,marginLeft:24}}),gs=()=>{const i=Js(),{isOpen:r}=(0,Yt.mZ)();return(0,n.jsx)("div",{className:i.root,children:(0,n.jsx)(Yt.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:r?(0,n.jsx)(ps,{}):(0,n.jsx)(Ys,{})})})},Xs=({children:i})=>(0,n.jsxs)(Yt.tR,{children:[(0,n.jsxs)(Yt.YE,{children:[(0,n.jsx)(gs,{}),(0,n.jsx)(Yt.v7,{}),(0,n.jsx)(Yt.R6,{icon:Mr.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var io=t(32388),ms=t(4142);const Qs=(0,Fr.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 _n;(function(i){i.LIGHT="light",i.DARK="dark"})(_n||(_n={}));const _s=()=>{const i=(0,S.h_)(S.hg),r=Qs(),[s,c]=(0,z.useState)(i.getActiveThemeId()===_n.DARK?_n.DARK:_n.LIGHT),g={[_n.LIGHT]:{icon:ms.Z,title:"Dark theme"},[_n.DARK]:{icon:io.Z,title:"Light theme"}},{title:P,icon:F}=g[s],H=()=>{c(le=>{const Ne=le===_n.LIGHT?_n.DARK:_n.LIGHT;return i.setActiveThemeId(Ne),Ne})};return(0,n.jsx)(Oo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(Zo.ZP,{title:P,arrow:!0,children:(0,n.jsx)(Xo.Z,{size:"small",onClick:H,children:(0,n.jsx)(F,{className:r.headerIcon})})})})},vs=()=>(0,n.jsxs)(C.I6,{children:[(0,n.jsx)(D.S,{}),(0,n.jsx)(O.F,{withSearch:!1})]}),ys=(0,n.jsx)(vs,{}),Un=Nn({apis:Hs,configLoader:Gs,plugins:Object.values(h)}),ei=Un.getProvider(),ti=Un.getRouter(),ni=C.s4.provide((0,Ie.KY)({name:"ThemeToggleAddon",component:_s,location:Ie.oZ.Header})),xs=(0,n.jsxs)(jo,{children:[(0,n.jsx)(m.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(m.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Us,{})}),(0,n.jsx)(m.AW,{path:"/docs",element:(0,n.jsx)(C.Jl,{}),children:(0,n.jsx)(R.u,{})}),(0,n.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(C.I6,{}),children:[ys,(0,n.jsx)(Ie.DR,{children:(0,n.jsx)(ni,{})})]})]});var Zi=()=>(0,n.jsx)(ei,{children:(0,n.jsx)(ti,{children:(0,n.jsx)(Xs,{children:xs})})});B.render((0,n.jsx)(Zi,{}),document.getElementById("root"))},51837:function(At,Oe,t){"use strict";t.d(Oe,{CT:function(){return S},EI:function(){return ie},uW:function(){return B},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),z=_=>`__@backstage/${_}__`;function B(_,ne){const D=z(_);let O=n[D];return O||(O=ne(),n[D]=O,O)}var m=t(2784);function S(_){return B(_,()=>(0,m.createContext)(void 0))}function l(_){return(0,m.useContext)(S(_))}function k(_){return{set(ne){globalThis[`__@backstage/${_}__`]=createContext(createVersionedValueMap(ne))},reset(){delete globalThis[`__@backstage/${_}__`]}}}function ie(_){Object.freeze(_);const ne={atVersion(D){return _[D]}};return Object.defineProperty(ne,"$map",{configurable:!0,enumerable:!0,get(){return _}}),ne}},56941:function(At,Oe,t){"use strict";t.d(Oe,{h$:function(){return Tt},n3:function(){return h.n3},_i:function(){return W},tW:function(){return Ue},df:function(){return M},UO:function(){return An},dq:function(){return Pe},nl:function(){return ko},dx:function(){return We},rI:function(){return ye},u3:function(){return ot},xE:function(){return un},sL:function(){return yn},LH:function(){return u},U_:function(){return Yt},pp:function(){return To},EW:function(){return Lo},Ah:function(){return z},wi:function(){return Ie},hF:function(){return dt},CV:function(){return bt},$3:function(){return Fe},p3:function(){return B},ce:function(){return Jt},X2:function(){return Dt},wp:function(){return dn},ZW:function(){return Ze},N$:function(){return mt},eK:function(){return In},CR:function(){return ge}});var h=t(29644),n=t(25248);const z=(0,n.T0)({id:"plugin.catalog.service"}),B=(0,n.T0)({id:"catalog-react.starred-entities"});var m=t(82394);class S{async toggleStarred(x){this.starredEntities.delete(x)||this.starredEntities.add(x);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(x=>(x.next(new Set(this.starredEntities)),this.subscribers.add(x),()=>{this.subscribers.delete(x)}))}}var l=t(52322),k=t(2784),ie=t(41156),_=t(60364),ne=t(77277),D=t(4190),O=t(95544),V=t(90436),ee=t(60905),ae=t(36444);const T=y=>{const x=(0,ie.Z)(te=>te.breakpoints.down("md")),I=(0,_.Z)(),[Z,J]=(0,k.useState)(!1);return x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ne.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>J(!0),startIcon:(0,l.jsx)(ae.Z,{}),children:"Filters"}),(0,l.jsx)(D.ZP,{open:Z,onClose:()=>J(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(O.Z,{m:2,children:[(0,l.jsx)(V.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),y.children]})})]}):(0,l.jsx)(ee.Z,{item:!0,lg:2,children:y.children})},R=y=>(0,l.jsx)(ee.Z,{item:!0,xs:12,lg:10,children:y.children}),W=y=>(0,l.jsx)(ee.Z,{container:!0,style:{position:"relative"},children:y.children});W.Filters=T,W.Content=R;var L=t(23196),C=t(25271),X=t(51837);const Ie=(0,X.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ke(y){var x,I;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(I=(x=y.metadata.namespace)===null||x===void 0?void 0:x.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:y.metadata.name}}function Fe(y,x){const I=x==null?void 0:x.defaultKind;let Z,J,te;return"metadata"in y?(Z=y.kind,J=y.metadata.namespace,te=y.metadata.name):(Z=y.kind,J=y.namespace,te=y.name),(J===void 0||J==="")&&(J=C.zG),(x==null?void 0:x.defaultNamespace)!==void 0?(x==null?void 0:x.defaultNamespace)===J&&(J=void 0):J===C.zG&&(J=void 0),Z=Z.toLocaleLowerCase("en-US"),Z=I&&I.toLocaleLowerCase("en-US")===Z?void 0:Z,`${Z?`${Z}:`:""}${J?`${J}/`:""}${te}`}var He=t(80030);const We=(0,k.forwardRef)((y,x)=>{const{entityRef:I,defaultKind:Z,title:J,children:te,...oe}=y,ue=(0,n.tg)(Ie);let Se,je,Te;if(typeof I=="string"){const $e=(0,C.of)(I);Se=$e.kind,je=$e.namespace,Te=$e.name}else"metadata"in I?(Se=I.kind,je=I.metadata.namespace,Te=I.metadata.name):(Se=I.kind,je=I.namespace,Te=I.name);Se=Se.toLocaleLowerCase("en-US");var Ce;je=(Ce=je==null?void 0:je.toLocaleLowerCase("en-US"))!==null&&Ce!==void 0?Ce:C.zG;const De={kind:Se,namespace:je,name:Te},Ye=Fe({kind:Se,namespace:je,name:Te},{defaultKind:Z}),at=(0,l.jsxs)(L.rU,{...oe,ref:x,to:ue(De),children:[te,!te&&(J!=null?J:Ye)]});return J?(0,l.jsx)(He.ZP,{title:Ye,children:at}):at});var jt=t(64279);function Qe(y){const{entityRefs:x,defaultKind:I,getTitle:Z,...J}=y,te=(0,n.h_)(z),{value:oe=new Array,loading:ue,error:Se}=(0,jt.default)(async()=>{const je=x.reduce((Ce,De)=>"metadata"in De?Ce:[...Ce,(0,C.of)(De)],new Array),Te=x.filter(Ce=>"metadata"in Ce);return je.length>0?[...(await te.getEntities({filter:je.map(Ce=>({kind:Ce.kind,"metadata.namespace":Ce.namespace,"metadata.name":Ce.name}))})).items,...Te]:Te},[x]);return ue?(0,l.jsx)(L.Ex,{}):Se?(0,l.jsx)(L.yu,{error:Se}):(0,l.jsx)(l.Fragment,{children:oe.map((je,Te)=>(0,l.jsxs)(k.Fragment,{children:[Te>0&&", ",(0,l.jsx)(We,{...J,defaultKind:I,entityRef:je,title:Z(je)})]},Te))})}function ye(y){const{entityRefs:x,defaultKind:I,fetchEntities:Z,getTitle:J,...te}=y;return Z?(0,l.jsx)(Qe,{...te,defaultKind:I,entityRefs:x,getTitle:J}):(0,l.jsx)(l.Fragment,{children:x.map((oe,ue)=>(0,l.jsxs)(k.Fragment,{children:[ue>0&&", ",(0,l.jsx)(We,{...te,defaultKind:I,entityRef:oe,title:J?J(oe):void 0})]},ue))})}function _e(y){return y.reduce((x,I)=>({...x,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function wt(y){return x=>y.every(I=>!I.filterEntity||I.filterEntity(x))}function dt(y,x,I){var Z;let J=(y==null||(Z=y.relations)===null||Z===void 0?void 0:Z.filter(te=>te.type===x).map(te=>(0,C.of)(te.targetRef)))||[];return I!=null&&I.kind&&(J=J.filter(te=>te.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),J}function bt(y,x){var I;const Z=(I=y.metadata.annotations)===null||I===void 0?void 0:I[C.M6];if(!!Z)try{const J=(0,C.Ou)(Z),te=x.byUrl(J.target);return{locationTargetUrl:J.target,integrationType:te==null?void 0:te.type}}catch{return}}function ut(y,x){const I=new Set([...getEntityRelations(y,RELATION_MEMBER_OF,{kind:"group"}),...y?[getCompoundEntityRef(y)]:[]].map(stringifyEntityRef)),Z=getEntityRelations(x,RELATION_OWNED_BY).map(stringifyEntityRef);for(const J of Z)if(I.has(J))return!0;return!1}class Rt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(x){this.value=x}}class Zt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(x){this.value=x}}class Ge{filterEntity(x){var I;return this.values.every(Z=>((I=x.metadata.tags)!==null&&I!==void 0?I:[]).includes(Z))}toQueryValue(){return this.values}constructor(x){this.values=x}}class ce{filterEntity(x){const I=this.toUpperArray(this.value.split(/\s/)),Z=this.toUpperArray([x.metadata.tags]),J=this.toUpperArray([x.metadata.name,x.metadata.title]);for(const te of I)if(Z.every(oe=>oe!==te)&&J.every(oe=>!oe.includes(te)))return!1;return!0}toUpperArray(x){return x.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(x){this.value=x}}class Re{filterEntity(x){return this.values.some(I=>dt(x,C.S4).some(Z=>Fe(Z,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(x){this.values=x}}class Ee{filterEntity(x){return this.values.some(I=>{var Z;return((Z=x.spec)===null||Z===void 0?void 0:Z.lifecycle)===I})}toQueryValue(){return this.values}constructor(x){this.values=x}}class Xe{filterEntity(x){switch(this.value){case"owned":return this.isOwnedEntity(x);case"starred":return this.isStarredEntity(x);default:return!0}}toQueryValue(){return this.value}constructor(x,I,Z){this.value=x,this.isOwnedEntity=I,this.isStarredEntity=Z}}class St{filterEntity(x){var I;const Z=(I=x.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return Z!==void 0&&this.value.toString()===Z}constructor(x){this.value=x}}class Ot{filterEntity(x){var I,Z;const J=(x==null||(I=x.status)===null||I===void 0||(Z=I.items)===null||Z===void 0?void 0:Z.length)>0;return J!==void 0&&this.value===J}constructor(x){this.value=x}}const ht=(0,X.CT)("entity-context"),Tt=({children:y,entity:x,loading:I,error:Z,refresh:J})=>{const te={entity:x,loading:I,error:Z,refresh:J};return(0,l.jsx)(ht.Provider,{value:(0,X.EI)({1:te}),children:(0,l.jsx)(n.fC,{attributes:{...x?{entityRef:(0,C.eE)(x)}:void 0},children:y})})},gt=y=>_jsx(Tt,{entity:y.entity,loading:!Boolean(y.entity),error:void 0,refresh:void 0,children:y.children});function Dt(){const y=(0,X.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const x=y.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");if(!x.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:x.entity}}function Jt(){const y=(0,X.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const x=y.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");const{entity:I,loading:Z,error:J,refresh:te}=x;return{entity:I,loading:Z,error:J,refresh:te}}var Xt=t(76635),cn=t(19126),Ut=t.n(cn),fn=t(79635),gn=t(69294),wn=t(48760),En=t(90736);const Wn=(0,k.createContext)(void 0),An=({children:y})=>{const x=(0,En.default)(),I=(0,n.h_)(z),[Z,J]=(0,k.useState)({}),te=(0,fn.TH)();var oe;const ue=(0,k.useMemo)(()=>(oe=Ut().parse(te.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[te]),[Se,je]=(0,k.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Te,error:Ce},De]=(0,gn.default)(async()=>{const $e=(0,Xt.compact)(Object.values(Z)),xt=wt($e),Vt=_e($e),jn=_e((0,Xt.compact)(Object.values(Se.appliedFilters))),hn=Object.keys(Z).reduce((Pn,Zn)=>{const Gn=Z[Zn];return Gn!=null&&Gn.toQueryValue&&(Pn[Zn]=Gn.toQueryValue()),Pn},{});if((0,Xt.isEqual)(jn,Vt))je({appliedFilters:Z,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(xt)});else{const Pn=await I.getEntities({filter:Vt});je({appliedFilters:Z,backendEntities:Pn.items,entities:Pn.items.filter(xt)})}if(x()){var rr;const Pn=Ut().parse(te.search,{ignoreQueryPrefix:!0}),Zn=Ut().stringify({...Pn,filters:hn},{addQueryPrefix:!0,arrayFormat:"repeat"}),Gn=`${window.location.pathname}${Zn}`;(rr=window.history)===null||rr===void 0||rr.replaceState(null,document.title,Gn)}},[I,ue,Z,Se],{loading:!0});(0,wn.Z)(De,10,[Z]);const Ye=(0,k.useCallback)($e=>{J(xt=>{const Vt=typeof $e=="function"?$e(xt):$e;return{...xt,...Vt}})},[]),at=(0,k.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:Ye,queryParameters:ue,loading:Te,error:Ce}),[Se,Ye,ue,Te,Ce]);return(0,l.jsx)(Wn.Provider,{value:at,children:y})};function dn(){const y=(0,k.useContext)(Wn);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var rn=t(18149),Vn=t.n(rn),Hn=t(829),Sn=t.n(Hn);function mn(){const y=(0,n.h_)(z),{filters:{kind:x,type:I},queryParameters:{type:Z},updateFilters:J}=dn(),te=(0,k.useMemo)(()=>[Z].flat().filter(Boolean),[Z]);var oe;const[ue,Se]=(0,k.useState)(te.length?te:(oe=I==null?void 0:I.getTypes())!==null&&oe!==void 0?oe:[]);(0,k.useEffect)(()=>{te.length&&Se(te)},[te]);const[je,Te]=(0,k.useState)([]),Ce=(0,k.useMemo)(()=>x==null?void 0:x.value,[x]),{error:De,loading:Ye,value:at}=(0,jt.default)(async()=>Ce?await y.getEntityFacets({filter:{kind:Ce},facets:["spec.type"]}).then(Vt=>Vt.facets["spec.type"]||[]):[],[Ce,y]),$e=(0,k.useRef)(at);return(0,k.useEffect)(()=>{const xt=$e.current;if($e.current=at,Ye||!Ce||xt===at||!at)return;const Vt=[...new Set(Sn()(at,hn=>-hn.count).map(hn=>hn.value.toLocaleLowerCase("en-US")))];Te(Vt);const jn=ue.filter(hn=>Vt.includes(hn));Vn()(ue,jn)||Se(jn)},[Ye,Ce,ue,Se,at]),(0,k.useEffect)(()=>{J({type:ue.length?new Zt(ue):void 0})},[ue,J]),{loading:Ye,error:De,availableTypes:je,selectedTypes:ue,setSelectedTypes:Se}}const Tn=20;function In(y,x){var I,Z;const J=x==null||(I=x.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),te=x==null||(Z=x.kind)===null||Z===void 0?void 0:Z.toLocaleLowerCase("en-US"),oe=(0,n.h_)(z),{loading:ue,value:Se,error:je}=(0,jt.default)(async()=>{var Te;const Ce=(Te=y.relations)===null||Te===void 0?void 0:Te.map($e=>({type:$e.type,target:(0,C.of)($e.targetRef)})).filter($e=>(!J||$e.type.toLocaleLowerCase("en-US")===J)&&(!te||$e.target.kind===te));if(!Ce)return[];const De=Object.values((0,Xt.groupBy)(Ce,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),Ye=[];for(const $e of De)Ye.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,Xt.chunk)($e.map(xt=>xt.target.name),Tn)});return(await Promise.all(Ye.flatMap($e=>$e.nameBatches.map(xt=>oe.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":xt}}))))).flatMap($e=>$e.items)},[y,J,te]);return{entities:Se,loading:ue,error:je}}var Kn=t(72164);function vn(y){return typeof y=="string"?y:(0,C.eE)(y)}function ge(){const y=(0,n.h_)(B),x=(0,Kn.Z)(y.starredEntitie$(),new Set),I=(0,k.useCallback)(J=>x.has(vn(J)),[x]),Z=(0,k.useCallback)(J=>y.toggleStarred(vn(J)).then(),[y]);return{starredEntities:x,toggleStarredEntity:Z,isStarredEntity:I}}function re(y){return typeof y=="string"?y:(0,C.eE)(y)}function Ae(y){const x=(0,n.h_)(B),[I,Z]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{const te=x.starredEntitie$().subscribe({next(oe){Z(oe.has(re(y)))}});return()=>{te.unsubscribe()}},[y,x]),{toggleStarredEntity:(0,k.useCallback)(()=>x.toggleStarred(re(y)).then(),[y,x]),isStarredEntity:I}}function Ze(){const y=(0,n.h_)(n.$4),{loading:x,value:I}=(0,jt.default)(async()=>{const{ownershipEntityRefs:J}=await y.getBackstageIdentity();return J},[]),Z=(0,k.useMemo)(()=>{const J=new Set(I!=null?I:[]);return te=>{const oe=dt(te,C.S4).map(C.eE);for(const ue of oe)if(J.has(ue))return!0;return!1}},[I]);return(0,k.useMemo)(()=>({loading:x,isOwnedEntity:Z}),[x,Z])}var qe=t(25488);function mt(y){const{entity:x,loading:I,error:Z}=Jt(),{allowed:J,loading:te,error:oe}=(0,qe.gI)({permission:y,resourceRef:x?(0,C.eE)(x):void 0});return I||te?{loading:!0,allowed:!1}:Z?{loading:!1,allowed:!1,error:Z}:{loading:!1,allowed:J,error:oe}}function he(){const y=(0,n.h_)(z),{error:x,loading:I,value:Z}=(0,jt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(te=>{var oe;return((oe=te.facets.kind)===null||oe===void 0?void 0:oe.map(ue=>ue.value).sort())||[]}),[y]);return{loading:I,error:x,allKinds:Z!=null?Z:[]}}function $(y,x,I){let Z=y;return x&&(Z=Z.filter(te=>x.some(oe=>oe.toLocaleLowerCase("en-US")===te.toLocaleLowerCase("en-US")))),I&&!y.some(te=>te.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(Z=Z.concat([I])),Z.sort().reduce((te,oe)=>(te[oe.toLocaleLowerCase("en-US")]=oe,te),{})}function pe(y){var x;const{filters:I,queryParameters:{kind:Z},updateFilters:J}=dn(),te=(0,k.useMemo)(()=>[Z].flat()[0],[Z]);var oe;const[ue,Se]=(0,k.useState)((oe=te!=null?te:(x=I.kind)===null||x===void 0?void 0:x.value)!==null&&oe!==void 0?oe:y.initialFilter);(0,k.useEffect)(()=>{te&&Se(te)},[te]),(0,k.useEffect)(()=>{var De;if(!((De=I.kind)===null||De===void 0)&&De.value){var Ye;Se((Ye=I.kind)===null||Ye===void 0?void 0:Ye.value)}},[I.kind]),(0,k.useEffect)(()=>{J({kind:ue?new Rt(ue):void 0})},[ue,J]);const{allKinds:je,loading:Te,error:Ce}=he();return{loading:Te,error:Ce,allKinds:je!=null?je:[],selectedKind:ue,setSelectedKind:Se}}const Ue=y=>{const{allowedKinds:x,hidden:I,initialFilter:Z="component"}=y,J=(0,n.h_)(n.$v),{error:te,allKinds:oe,selectedKind:ue,setSelectedKind:Se}=pe({initialFilter:Z});if((0,k.useEffect)(()=>{te&&J.post({message:"Failed to load entity kinds",severity:"error"})},[te,J]),te)return null;const je=$(oe,x,ue),Te=Object.keys(je).map(Ce=>({value:Ce,label:je[Ce]}));return I?null:(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsx)(L.Ph,{label:"Kind",items:Te,selected:ue.toLocaleLowerCase("en-US"),onChange:Ce=>Se(String(Ce))})})};var Be=t(79692),nt=t(5806),It=t(21324),Ht=t(86619),Mt=t(19996),Qt=t(25505),zt=t(38016),Y=t(88013);const q=(0,Be.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),f=(0,l.jsx)(Qt.Z,{fontSize:"small"}),A=(0,l.jsx)(Mt.Z,{fontSize:"small"}),M=y=>{var x;const{initialFilter:I=[]}=y,Z=q(),{updateFilters:J,backendEntities:te,filters:oe,queryParameters:{lifecycles:ue}}=dn(),Se=(0,k.useMemo)(()=>[ue].flat().filter(Boolean),[ue]);var je;const[Te,Ce]=(0,k.useState)(Se.length?Se:(je=(x=oe.lifecycles)===null||x===void 0?void 0:x.values)!==null&&je!==void 0?je:I);(0,k.useEffect)(()=>{Se.length&&Ce(Se)},[Se]);const De=(0,k.useMemo)(()=>[...new Set(te.map(Ye=>{var at;return(at=Ye.spec)===null||at===void 0?void 0:at.lifecycle}).filter(Boolean))].sort(),[te]);return(0,k.useEffect)(()=>{J({lifecycles:Te.length&&De.length?new Ee(Te):void 0})},[Te,J,De]),De.length?(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsxs)(V.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(Y.ZP,{multiple:!0,options:De,value:Te,onChange:(Ye,at)=>Ce(at),renderOption:(Ye,{selected:at})=>(0,l.jsx)(nt.Z,{control:(0,l.jsx)(It.Z,{icon:f,checkedIcon:A,checked:at}),label:Ye}),size:"small",popupIcon:(0,l.jsx)(zt.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Ye=>(0,l.jsx)(Ht.Z,{...Ye,className:Z.input,variant:"outlined"})})]})}):null},K=(0,Be.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),se=(0,l.jsx)(Qt.Z,{fontSize:"small"}),xe=(0,l.jsx)(Mt.Z,{fontSize:"small"}),Pe=()=>{var y;const x=K(),{updateFilters:I,backendEntities:Z,filters:J,queryParameters:{owners:te}}=dn(),oe=(0,k.useMemo)(()=>[te].flat().filter(Boolean),[te]);var ue;const[Se,je]=(0,k.useState)(oe.length?oe:(ue=(y=J.owners)===null||y===void 0?void 0:y.values)!==null&&ue!==void 0?ue:[]);(0,k.useEffect)(()=>{oe.length&&je(oe)},[oe]);const Te=(0,k.useMemo)(()=>[...new Set(Z.flatMap(Ce=>dt(Ce,C.S4).map(De=>Fe(De,{defaultKind:"group"}))).filter(Boolean))].sort(),[Z]);return(0,k.useEffect)(()=>{I({owners:Se.length&&Te.length?new Re(Se):void 0})},[Se,I,Te]),Te.length?(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsxs)(V.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(Y.ZP,{multiple:!0,options:Te,value:Se,onChange:(Ce,De)=>je(De),renderOption:(Ce,{selected:De})=>(0,l.jsx)(nt.Z,{control:(0,l.jsx)(It.Z,{icon:se,checkedIcon:xe,checked:De}),label:Ce}),size:"small",popupIcon:(0,l.jsx)(zt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ce=>(0,l.jsx)(Ht.Z,{...Ce,className:x.input,variant:"outlined"})})]})}):null},tt=y=>{const x=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:x(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},it=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),ft=y=>{var x;const I=(x=y.entity.spec.profile)===null||x===void 0?void 0:x.email;return I?_jsx(EmailCardAction,{email:I}):null},ct=y=>{var x;const I=(x=y.entity.spec.profile)===null||x===void 0?void 0:x.email;return I?_jsx(EmailCardAction,{email:I}):null},et=(0,Be.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Me=4,Et=y=>{var x,I,Z;const{entityRef:J,children:te,delayTime:oe=500}=y,ue=et(),Se=useApiHolder(),je=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Te,Ce]=useState(!1),De=useMemo(()=>debounce(()=>Ce(!0),oe),[oe]),[{loading:Ye,error:at,value:$e},xt]=useAsyncFn(async()=>{const jn=Se.get(catalogApiRef);if(jn){const hn=await jn.getEntityByRef(J);if(!hn)throw new Error(`${J} not found`);return hn}},[Se,J]),Vt=()=>{Ce(!1),De.cancel()};return useEffect(()=>{je.isOpen&&!$e&&!at&&!Ye&&xt()},[je.isOpen,xt,$e,at,Ye]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:De,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(je),children:te})}),Te&&_jsx(HoverPopover,{PaperProps:{className:ue.popoverPaper},...bindPopover(je),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Vt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[at&&_jsx(ResponseErrorPanel,{error:at}),Ye&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:ue.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(x=$e.spec)===null||x===void 0?void 0:x.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,Me).map(jn=>_jsx(Chip,{size:"small",label:jn},jn)),((I=$e.metadata.tags)===null||I===void 0?void 0:I.length)&&((Z=$e.metadata.tags)===null||Z===void 0?void 0:Z.length)>Me&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!at&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},Lt=(0,Be.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Gt=()=>{var y;const x=Lt(),{filters:I,updateFilters:Z}=useEntityList();var J;const[te,oe]=useState((J=(y=I.text)===null||y===void 0?void 0:y.value)!==null&&J!==void 0?J:"");return useDebounce(()=>{Z({text:te.length?new EntityTextFilter(te):void 0})},250,[te,Z]),_jsx(Toolbar,{className:x.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:x.input,placeholder:"Search",autoComplete:"off",onChange:ue=>oe(ue.target.value),value:te,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:te.length===0,children:_jsx(Clear,{})})})})})})},vt=Object.freeze({createEntityRefColumn(y){const{defaultKind:x}=y;function I(Z){var J;return((J=Z.metadata)===null||J===void 0?void 0:J.title)||Fe(Z,{defaultKind:x})}return{title:"Name",highlight:!0,customFilterAndSearch(Z,J){return I(J).includes(Z)},customSort(Z,J){return I(Z).localeCompare(I(J))},render:Z=>{var J;return(0,l.jsx)(We,{entityRef:Z,defaultKind:x,title:(J=Z.metadata)===null||J===void 0?void 0:J.title})}}},createEntityRelationColumn(y){const{title:x,relation:I,defaultKind:Z,filter:J}=y;function te(ue){return dt(ue,I,J)}function oe(ue){return te(ue).map(Se=>Fe(Se,{defaultKind:Z})).join(", ")}return{title:x,customFilterAndSearch(ue,Se){return oe(Se).includes(ue)},customSort(ue,Se){return oe(ue).localeCompare(oe(Se))},render:ue=>(0,l.jsx)(ye,{entityRefs:te(ue),defaultKind:Z})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:C.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:C.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:C.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,l.jsx)(L.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Nt=[vt.createEntityRefColumn({defaultKind:"system"}),vt.createDomainColumn(),vt.createOwnerColumn(),vt.createMetadataDescriptionColumn()],Bt=[vt.createEntityRefColumn({defaultKind:"component"}),vt.createSystemColumn(),vt.createOwnerColumn(),vt.createSpecTypeColumn(),vt.createSpecLifecycleColumn(),vt.createMetadataDescriptionColumn()],pt=(0,Be.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),ot=y=>{const{entities:x,title:I,emptyContent:Z,variant:J="gridItem",columns:te}=y,oe=pt(),ue={minWidth:"0",width:"100%"};return J==="gridItem"&&(ue.height="calc(100% - 10px)"),(0,l.jsx)(L.iA,{columns:te,title:I,style:ue,emptyContent:Z&&(0,l.jsx)("div",{className:oe.empty,children:Z}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:x})};ot.columns=vt,ot.systemEntityColumns=Nt,ot.componentEntityColumns=Bt;const st=(0,Be.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Kt=(0,l.jsx)(Qt.Z,{fontSize:"small"}),On=(0,l.jsx)(Mt.Z,{fontSize:"small"}),un=y=>{var x;const I=st(),{updateFilters:Z,filters:J,queryParameters:{tags:te}}=dn(),oe=(0,n.h_)(z),{value:ue}=(0,jt.default)(async()=>{var De;const Ye="metadata.tags",{facets:at}=await oe.getEntityFacets({facets:[Ye],filter:(De=J.kind)===null||De===void 0?void 0:De.getCatalogFilters()});return Object.fromEntries(at[Ye].map(({value:$e,count:xt})=>[$e,xt]))},[J.kind]),Se=(0,k.useMemo)(()=>[te].flat().filter(Boolean),[te]);var je;const[Te,Ce]=(0,k.useState)(Se.length?Se:(je=(x=J.tags)===null||x===void 0?void 0:x.values)!==null&&je!==void 0?je:[]);return(0,k.useEffect)(()=>{Se.length&&Ce(Se)},[Se]),(0,k.useEffect)(()=>{const De=Object.keys(ue!=null?ue:{});Z({tags:Te.length&&De.length?new Ge(Te):void 0})},[Te,Z,ue]),Object.keys(ue!=null?ue:{}).length?(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsxs)(V.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(Y.ZP,{multiple:!0,options:Object.keys(ue!=null?ue:{}),value:Te,onChange:(De,Ye)=>Ce(Ye),renderOption:(De,{selected:Ye})=>(0,l.jsx)(nt.Z,{control:(0,l.jsx)(It.Z,{icon:Kt,checkedIcon:On,checked:Ye}),label:y.showCounts?`${De} (${ue==null?void 0:ue[De]})`:De}),size:"small",popupIcon:(0,l.jsx)(zt.Z,{"data-testid":"tag-picker-expand"}),renderInput:De=>(0,l.jsx)(Ht.Z,{...De,className:I.input,variant:"outlined"})})]})}):null},yn=y=>{const{hidden:x,initialFilter:I}=y,Z=(0,n.h_)(n.$v),{error:J,availableTypes:te,selectedTypes:oe,setSelectedTypes:ue}=mn();if((0,k.useEffect)(()=>{J&&Z.post({message:"Failed to load entity types",severity:"error"}),I&&ue([I])},[J,Z,I,ue]),te.length===0||J)return null;const Se=[{value:"all",label:"all"},...te.map(Te=>({value:Te,label:Te}))];var je;return x?null:(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsx)(L.Ph,{label:"Type",items:Se,selected:(je=Se.length>1?oe[0]:void 0)!==null&&je!==void 0?je:"all",onChange:Te=>ue(Te==="all"?[]:[String(Te)])})})};var Yn=t(15459),Bn=t(61837),Cn=t(11640),nr=t(28347);const j=(0,Yn.Z)({root:{color:"#f3ba37"}})(Cn.Z),u=y=>{const{toggleStarredEntity:x,isStarredEntity:I}=Ae(y.entity);return(0,l.jsx)(Bn.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>x(),children:(0,l.jsx)(He.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,l.jsx)(j,{}):(0,l.jsx)(nr.Z,{})})})};var b=t(8629),E=t(79249),Q=t(38724),me=t(99152),be=t(6487),ke=t(49429),Ve=t(55999),Wt=t(72779),tn=t.n(Wt),Rn=t(39412);const Ar=Rn.Z;function uo(y,x){if(y)return y.toLocaleLowerCase("en-US");if(x)try{return(0,C.of)(x).kind.toLocaleLowerCase("en-US")}catch{return}}function ho(y,x){const I=(0,n.qD)(),Z=uo(y,x);return Z&&I.getSystemIcon(`kind:${Z}`)||Ar}function Or(y){const{kind:x,entityRef:I,...Z}=y,J=ho(x,I);return(0,l.jsx)(J,{...Z})}const pr=(0,Be.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Gr(y){const x=(0,n.h_)(z),I=(0,C.eE)(y),{loading:Z,error:J,value:te}=(0,jt.default)(async()=>{const oe=await x.getEntityAncestors({entityRef:I}),ue=new Array,Se=new Array;for(const je of oe.items){const Te=(0,C.eE)(je.entity),Ce=Te===oe.rootEntityRef;ue.push({id:Te,root:Ce,...je.entity});for(const De of je.parentEntityRefs)Se.push({from:Te,to:De})}return{nodes:ue,edges:Se}},[I]);return{loading:Z,error:J,nodes:(te==null?void 0:te.nodes)||[],edges:(te==null?void 0:te.edges)||[]}}function Br({node:y}){const x=pr(),I=(0,fn.s0)(),Z=(0,n.tg)(Ie),[J,te]=(0,k.useState)(0),[oe,ue]=(0,k.useState)(0),Se=(0,k.useRef)(null);(0,k.useLayoutEffect)(()=>{if(Se.current){let{height:xt,width:Vt}=Se.current.getBBox();xt=Math.round(xt),Vt=Math.round(Vt),(xt!==oe||Vt!==J)&&(te(Vt),ue(xt))}},[J,oe]);const je=10,Te=oe,Ce=Te+je,De=Ce+J+je*2,Ye=oe+je*2,at=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?Fe({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),$e=()=>{I(Z({kind:y.kind,namespace:y.metadata.namespace||C.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:$e,className:x.clickable,children:[(0,l.jsx)("rect",{className:tn()(x.node,y.root?"secondary":"primary"),width:De,height:Ye,rx:10}),(0,l.jsx)(Or,{kind:y.kind,y:je,x:je,width:Te,height:Te,className:tn()(x.text,y.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:Se,className:tn()(x.text,y.root?"secondary":"primary"),y:Ye/2,x:Ce+(J+je*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:at})]})}function po(y){const{loading:x,error:I,nodes:Z,edges:J}=Gr(y.entity);return x?(0,l.jsx)(L.Ex,{}):I?(0,l.jsx)(L.Gk,{error:I}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Ve.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(L.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(O.Z,{mt:4,children:(0,l.jsx)(L.mn,{nodes:Z,edges:J,renderNode:Br,direction:L.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var $n=t(11776),Qn=t(38402),fr=t(86136),Tr=t(99688),fo=t(49378),go=t(54506),Kr=t(94339),mo=t(24579),vo=t(27685);const $r=(0,Be.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Jn(y){const x=$r();return(0,l.jsx)(fo.Z,{...y,primaryTypographyProps:{className:x.monospace},secondaryTypographyProps:{className:x.monospace}})}function ar(y){const x=$r();return(0,l.jsx)(go.Z,{className:x.monospace,children:y.children})}function gr(y){return(0,l.jsx)(O.Z,{mt:2,children:(0,l.jsx)(Kr.Z,{variant:"outlined",children:(0,l.jsxs)(mo.Z,{children:[(0,l.jsxs)(V.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(Yr,{to:y.helpLink})]}),y.children]})})})}function lr(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function Zr(y){const[x,I]=y.entry,Z=lr(I);return(0,l.jsxs)(Qn.Z,{children:[y.indent&&(0,l.jsx)(fr.Z,{}),(0,l.jsx)(Jn,{primary:x,secondary:Z?(0,l.jsx)(L.rU,{to:Z,children:I}):I})]})}function Yr(y){const x=$r();return(0,l.jsx)(L.rU,{to:y.to,className:x.helpIcon,children:(0,l.jsx)(vo.Z,{fontSize:"inherit"})})}const Jr=(0,Be.Z)({root:{display:"flex",flexDirection:"column"}});function Xr(y){var x,I;const Z=(0,n.h_)(z),J=(0,C.eE)(y),te=(x=y.metadata.annotations)===null||x===void 0?void 0:x[C.P1],oe=(I=y.metadata.annotations)===null||I===void 0?void 0:I[C.q1],{loading:ue,error:Se,value:je}=(0,jt.default)(async()=>!te&&!oe?[]:(await Z.getEntities({filter:[...te?[{[`metadata.annotations.${C.P1}`]:te}]:[],...oe?[{[`metadata.annotations.${C.q1}`]:oe}]:[]]})).items,[te,oe]);return{loading:ue,error:Se,location:te,originLocation:oe,colocatedEntities:je==null?void 0:je.filter(Te=>(0,C.eE)(Te)!==J)}}function Qr(y){return(0,l.jsxs)($n.Z,{dense:!0,children:[y.header&&(0,l.jsx)(Zr,{entry:y.header},"header"),y.entities.map(x=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(fr.Z,{children:(0,l.jsx)(Or,{kind:x.kind})}),(0,l.jsx)(Jn,{primary:(0,l.jsx)(We,{entityRef:x})})]},(0,C.eE)(x)))]})}function mr(y){const{entity:x}=y,{loading:I,error:Z,location:J,originLocation:te,colocatedEntities:oe}=Xr(x);if(I)return(0,l.jsx)(L.Ex,{});if(Z)return(0,l.jsx)(L.Gk,{error:Z});if(!J&&!te)return(0,l.jsx)(Tr.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,l.jsx)(Tr.Z,{severity:"info",children:"There were no other entities on this location."});if(J===te)return(0,l.jsx)(Qr,{entities:oe});const ue=oe.filter(je=>{var Te;return((Te=je.metadata.annotations)===null||Te===void 0?void 0:Te[C.P1])===J}),Se=oe.filter(je=>{var Te;return((Te=je.metadata.annotations)===null||Te===void 0?void 0:Te[C.q1])===te});return(0,l.jsxs)(l.Fragment,{children:[ue.length>0&&(0,l.jsx)(Qr,{entities:ue,header:["At the same location",J]}),Se.length>0&&(0,l.jsx)(Qr,{entities:Se,header:["At the same origin",te]})]})}function yo(y){const x=Jr();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Ve.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:x.root,children:(0,l.jsx)(mr,{entity:y.entity})})]})}function qr(y){return Object.fromEntries([...Object.entries(y)].sort((x,I)=>x[0]<I[0]?-1:1))}function xo(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Ve.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Ve.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(L.Oi,{text:JSON.stringify(qr(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var bo=t(3440),Dr=t.n(bo);const So=(0,Be.Z)({root:{display:"flex",flexDirection:"column"}});function Co(y){var x,I;const Z=So(),{apiVersion:J,kind:te,metadata:oe,spec:ue,relations:Se=[],status:je={}}=y.entity,Te=Dr()(Sn()(Se,Ce=>Ce.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:Z.root,children:[(0,l.jsx)(gr,{title:"Identity",children:(0,l.jsxs)($n.Z,{dense:!0,children:[(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(Jn,{primary:"apiVersion",secondary:J})}),(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(Jn,{primary:"kind",secondary:te})}),(ue==null?void 0:ue.type)&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(Jn,{primary:"spec.type",secondary:ue.type})}),oe.uid&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(Jn,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,l.jsx)(Qn.Z,{children:(0,l.jsx)(Jn,{primary:"etag",secondary:oe.etag})})]})}),(0,l.jsxs)(gr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,l.jsx)($n.Z,{dense:!0,subheader:(0,l.jsxs)(ar,{children:["Annotations",(0,l.jsx)(Yr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(Ce=>(0,l.jsx)(Zr,{indent:!0,entry:Ce},Ce[0]))}),!!Object.keys(oe.labels||{}).length&&(0,l.jsx)($n.Z,{dense:!0,subheader:(0,l.jsx)(ar,{children:"Labels"}),children:Object.entries(oe.labels).map(Ce=>(0,l.jsx)(Zr,{indent:!0,entry:Ce},Ce[0]))}),!!(!((x=oe.tags)===null||x===void 0)&&x.length)&&(0,l.jsx)($n.Z,{dense:!0,subheader:(0,l.jsx)(ar,{children:"Tags"}),children:oe.tags.map((Ce,De)=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(fr.Z,{}),(0,l.jsx)(Jn,{primary:Ce})]},`${Ce}-${De}`))})]}),!!Se.length&&(0,l.jsx)(gr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Te).map(([Ce,De],Ye)=>(0,l.jsx)("div",{children:(0,l.jsx)($n.Z,{dense:!0,subheader:(0,l.jsx)(ar,{children:Ce}),children:De.map(at=>(0,l.jsxs)(Qn.Z,{children:[(0,l.jsx)(fr.Z,{children:(0,l.jsx)(Or,{entityRef:at.targetRef})}),(0,l.jsx)(Jn,{primary:(0,l.jsx)(We,{entityRef:at.targetRef})})]},at.targetRef))})},Ye))}),!!(!((I=je.items)===null||I===void 0)&&I.length)&&(0,l.jsx)(gr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:je.items.map((Ce,De)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(V.Z,{children:[Ce.level,": ",Ce.type]}),(0,l.jsx)(O.Z,{ml:2,children:Ce.message})]},De))})]})]})}var _r=t(72847);function jo(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Ve.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Ve.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(L.Oi,{text:_r.ZP.stringify(qr(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Nr=(0,Be.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function cr(y){const{children:x,value:I,index:Z,...J}=y,te=Nr();return(0,l.jsx)("div",{role:"tabpanel",hidden:I!==Z,id:`vertical-tabpanel-${Z}`,"aria-labelledby":`vertical-tab-${Z}`,className:te.tabContents,...J,children:I===Z&&(0,l.jsx)(O.Z,{pl:3,pr:3,children:x})})}function vr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function Yt(y){const x=Nr(),[I,Z]=k.useState(0);return(0,k.useEffect)(()=>{Z(0)},[y.open]),y.entity?(0,l.jsxs)(b.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:x.fullHeightDialog},children:[(0,l.jsx)(E.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(Q.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:x.root,children:[(0,l.jsxs)(me.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(J,te)=>Z(te),"aria-label":"Inspector options",className:x.tabs,children:[(0,l.jsx)(be.Z,{label:"Overview",...vr(0)}),(0,l.jsx)(be.Z,{label:"Ancestry",...vr(1)}),(0,l.jsx)(be.Z,{label:"Colocated",...vr(2)}),(0,l.jsx)(be.Z,{label:"Raw JSON",...vr(3)}),(0,l.jsx)(be.Z,{label:"Raw YAML",...vr(4)})]}),(0,l.jsx)(cr,{value:I,index:0,children:(0,l.jsx)(Co,{entity:y.entity})}),(0,l.jsx)(cr,{value:I,index:1,children:(0,l.jsx)(po,{entity:y.entity})}),(0,l.jsx)(cr,{value:I,index:2,children:(0,l.jsx)(yo,{entity:y.entity})}),(0,l.jsx)(cr,{value:I,index:3,children:(0,l.jsx)(xo,{entity:y.entity})}),(0,l.jsx)(cr,{value:I,index:4,children:(0,l.jsx)(jo,{entity:y.entity})})]})}),(0,l.jsx)(ke.Z,{children:(0,l.jsx)(ne.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Ln=t(85256);function wo(y){var x;const I=(0,n.h_)(z),Z=(x=y.metadata.annotations)===null||x===void 0?void 0:x[C.q1],J=y.metadata.uid,te=Z==="bootstrap:bootstrap",oe=(0,jt.default)(async()=>{const at=I.getLocationByRef(Z);let $e;if(!Z)$e=Promise.resolve([]);else{const xt=`metadata.annotations.${C.q1}`;$e=I.getEntities({filter:{[xt]:Z},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Vt=>Vt.items)}return Promise.all([at,$e]).then(([xt,Vt])=>({location:xt,colocatedEntities:Vt}))},[I,y]),ue=(0,k.useCallback)(async function(){const{location:$e}=oe.value;await I.removeLocationById($e.id)},[I,oe]),Se=(0,k.useCallback)(async function(){await I.removeEntityByUid(J)},[I,J]);if(te)return{type:"bootstrap",location:Z,deleteEntity:Se};const{loading:je,error:Te,value:Ce}=oe;if(je)return{type:"loading"};if(Te)return{type:"error",error:Te};const{location:De,colocatedEntities:Ye}=Ce;return De?{type:"unregister",location:Z,colocatedEntities:Ye.map(C.iB),unregisterLocation:ue,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var eo=t(23054);const Eo=(0,Be.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Ao=({entity:y,onConfirm:x,onClose:I})=>{const Z=(0,n.h_)(n.$v),J=(0,n.h_)(n.Ds),te=Eo(),oe=wo(y),[ue,Se]=(0,k.useState)(!1),[je,Te]=(0,k.useState)(!1);var Ce;const De=(Ce=J.getOptionalString("app.title"))!==null&&Ce!==void 0?Ce:"Backstage",Ye=(0,k.useCallback)(async function(){if("unregisterLocation"in oe){Te(!0);try{await oe.unregisterLocation(),x()}catch(Vt){(0,eo.BD)(Vt),Z.post({message:Vt.message})}finally{Te(!1)}}},[Z,x,oe]),at=(0,k.useCallback)(async function(){if("deleteEntity"in oe){Te(!0);try{await oe.deleteEntity(),x()}catch(Vt){(0,eo.BD)(Vt),Z.post({message:Vt.message})}finally{Te(!1)}}},[Z,x,oe]),$e=()=>(0,l.jsx)(ke.Z,{className:te.dialogActions,children:(0,l.jsx)(ne.Z,{onClick:I,color:"primary",children:"Cancel"})});return oe.type==="loading"?(0,l.jsx)(L.Ex,{}):oe.type==="error"?(0,l.jsx)(L.Gk,{error:oe.error}):oe.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Tr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',oe.location,'"). If you believe this is in error, please contact the ',De," ","integrator."]}),(0,l.jsxs)(O.Z,{marginTop:2,children:[!ue&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ne.Z,{variant:"text",size:"small",color:"primary",className:te.advancedButton,onClick:()=>Se(!0),children:"Advanced Options"}),(0,l.jsx)($e,{})]}),ue&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(ne.Z,{variant:"contained",color:"secondary",disabled:je,onClick:at,children:"Delete Entity"}),(0,l.jsx)($e,{})]})]})]}):oe.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(ne.Z,{variant:"contained",color:"secondary",disabled:je,onClick:at,children:"Delete Entity"}),(0,l.jsx)($e,{})]}):oe.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ve.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Ve.Z,{component:"ul",children:oe.colocatedEntities.map(xt=>(0,l.jsx)("li",{children:(0,l.jsx)(We,{entityRef:xt})},`${xt.kind}:${xt.namespace}/${xt.name}`))}),(0,l.jsx)(Ve.Z,{children:"Located at the following location:"}),(0,l.jsx)(Ve.Z,{component:"ul",children:(0,l.jsx)("li",{children:oe.location})}),(0,l.jsxs)(Ve.Z,{children:["To undo, just re-register the entity in ",De,"."]}),(0,l.jsxs)(O.Z,{marginTop:2,children:[(0,l.jsx)(ne.Z,{variant:"contained",color:"secondary",disabled:je,onClick:Ye,children:"Unregister Location"}),!ue&&(0,l.jsx)(O.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(ne.Z,{variant:"text",size:"small",color:"primary",className:te.advancedButton,onClick:()=>Se(!0),children:"Advanced Options"})})]}),ue&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(Ln.Z,{})}),(0,l.jsx)(Ve.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(ne.Z,{variant:"contained",color:"secondary",disabled:je,onClick:at,children:"Delete Entity"})]})]}):(0,l.jsx)(Tr.Z,{severity:"error",children:"Internal error: Unknown state"})},To=y=>{const{open:x,onConfirm:I,onClose:Z,entity:J}=y;return(0,l.jsxs)(b.Z,{open:x,onClose:Z,children:[(0,l.jsx)(E.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(Q.Z,{children:(0,l.jsx)(Ao,{entity:J,onConfirm:I,onClose:Z})})]})};var Io=t(12231),Ro=t(9520),to=t(47603);const Ir=(0,Be.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Yo(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:to.Z},{id:"starred",label:"Starred",icon:Cn.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Lo=y=>{const{initialFilter:x,availableFilters:I}=y,Z=Ir(),J=(0,n.h_)(n.Ds);var te;const oe=(te=J.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Company",{filters:ue,updateFilters:Se,backendEntities:je,queryParameters:{kind:Te,user:Ce},loading:De}=dn(),Ye=["starred","all"],at=Yo(oe).map(Dn=>({...Dn,items:Dn.items.filter(({id:Nn})=>["group","user"].some(dr=>dr===Te)?Ye.includes(Nn):!I||I.includes(Nn))})).filter(({items:Dn})=>!!Dn.length),{isStarredEntity:$e}=ge(),{isOwnedEntity:xt,loading:Vt}=Ze(),jn=De||Vt,hn=(0,k.useMemo)(()=>new Xe("owned",xt,$e),[xt,$e]),rr=(0,k.useMemo)(()=>new Xe("starred",xt,$e),[xt,$e]),Pn=(0,k.useMemo)(()=>[Ce].flat()[0],[Ce]),[Zn,Gn]=(0,k.useState)(Pn!=null?Pn:x),Rr=(0,k.useMemo)(()=>je.filter(wt((0,Xt.compact)(Object.values({...ue,user:void 0})))),[ue,je]),yr=(0,k.useMemo)(()=>({all:Rr.length,starred:Rr.filter(Dn=>rr.filterEntity(Dn)).length,owned:Rr.filter(Dn=>hn.filterEntity(Dn)).length}),[Rr,rr,hn]);(0,k.useEffect)(()=>{Pn&&Gn(Pn)},[Pn]),(0,k.useEffect)(()=>{!jn&&!!Zn&&Zn!=="all"&&yr[Zn]===0&&Gn("all")},[jn,yr,Zn,Gn]),(0,k.useEffect)(()=>{Se({user:Zn?new Xe(Zn,xt,$e):void 0})},[Zn,xt,$e,Se]);var Lr;return(0,l.jsx)(Kr.Z,{className:Z.root,children:at.map(Dn=>(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(V.Z,{variant:"subtitle2",component:"span",className:Z.title,children:Dn.name}),(0,l.jsx)(Kr.Z,{className:Z.groupWrapper,children:(0,l.jsx)($n.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Dn.name,children:Dn.items.map(Nn=>{var dr;return(0,l.jsxs)(Io.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Gn(Nn.id),selected:Nn.id===((dr=ue.user)===null||dr===void 0?void 0:dr.value),className:Z.menuItem,disabled:yr[Nn.id]===0,"data-testid":`user-picker-${Nn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Nn.icon&&(0,l.jsx)(fr.Z,{className:Z.listIcon,children:(0,l.jsx)(Nn.icon,{fontSize:"small"})}),(0,l.jsx)(fo.Z,{children:(0,l.jsxs)(V.Z,{variant:"body1",children:[Nn.label," "]})}),(0,l.jsx)(Ro.Z,{children:(Lr=yr[Nn.id])!==null&&Lr!==void 0?Lr:"-"})]},Nn.id)})})})]},Dn.name))})},no=(0,Be.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Po=(0,l.jsx)(Qt.Z,{fontSize:"small"}),Jo=(0,l.jsx)(Mt.Z,{fontSize:"small"}),ko=()=>{const y=no(),{updateFilters:x}=dn(),[I,Z]=(0,k.useState)([]);function J(ue){x({orphan:ue?new St(ue):void 0})}function te(ue){x({error:ue?new Ot(ue):void 0})}const oe=["Is Orphan","Has Error"];return(0,l.jsx)(O.Z,{pb:1,pt:1,children:(0,l.jsxs)(V.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(Y.ZP,{multiple:!0,options:oe,value:I,onChange:(ue,Se)=>{Z(Se),J(Se.includes("Is Orphan")),te(Se.includes("Has Error"))},renderOption:(ue,{selected:Se})=>(0,l.jsx)(nt.Z,{control:(0,l.jsx)(It.Z,{icon:Po,checkedIcon:Jo,checked:Se}),label:ue}),size:"small",popupIcon:(0,l.jsx)(zt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ue=>(0,l.jsx)(Ht.Z,{...ue,className:y.input,variant:"outlined"})})]})})},As=({children:y,value:x})=>{var I;const[Z,J]=useState((I=x==null?void 0:x.filters)!==null&&I!==void 0?I:{}),te=useCallback(Ye=>{J(at=>{const $e=typeof Ye=="function"?Ye(at):Ye;return{...at,...$e}})},[]),oe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var ue,Se,je,Te,Ce;const De=useMemo(()=>({entities:(ue=x==null?void 0:x.entities)!==null&&ue!==void 0?ue:oe.entities,backendEntities:(Se=x==null?void 0:x.backendEntities)!==null&&Se!==void 0?Se:oe.backendEntities,updateFilters:(je=x==null?void 0:x.updateFilters)!==null&&je!==void 0?je:te,filters:Z,loading:(Te=x==null?void 0:x.loading)!==null&&Te!==void 0?Te:!1,queryParameters:(Ce=x==null?void 0:x.queryParameters)!==null&&Ce!==void 0?Ce:oe.queryParameters,error:x==null?void 0:x.error}),[x,oe,Z,te]);return _jsx(EntityListContext.Provider,{value:De,children:y})}},33414:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{AboutCard:function(){return jt},AboutContent:function(){return He},AboutField:function(){return X}});var h=t(52322),n=t(25271),z=t(23196),B=t(25248),m=t(32838),S=t(56941),l=t(79692),k=t(94339),ie=t(32552),_=t(61837),ne=t(85256),D=t(24579),O=t(52866),V=t(30254),ee=t(27604),ae=t(2784),T=t(19625),R=t(60905),W=t(7089),L=t(90436);const C=(0,l.Z)(Qe=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Qe.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function X(Qe){const{label:ye,value:_e,gridSizes:wt,children:dt}=Qe,bt=C(),ut=(0,B.vJ)(dt,Zt=>Zt.getElements()),Rt=ut.length>0?ut:(0,h.jsx)(L.Z,{variant:"body2",className:bt.value,children:_e||"unknown"});return(0,h.jsxs)(R.Z,{item:!0,...wt,children:[(0,h.jsx)(L.Z,{variant:"h2",className:bt.label,children:ye}),Rt]})}var Ie=t(24851);const Ke=(0,l.Z)({description:{wordBreak:"break-word"}});function Fe(Qe,ye,_e){if(ye==="url"||Qe.includes("://"))return Qe;const wt=_e.type==="file"?`file://${_e.target}`:_e.target;return ye==="file"||_e.type==="file"?new URL(Qe,wt).href:wt}function He(Qe){var ye,_e,wt,dt,bt,ut,Rt,Zt;const{entity:Ge}=Qe,ce=Ke(),Re=Ge.kind.toLocaleLowerCase("en-US")==="system",Ee=Ge.kind.toLocaleLowerCase("en-US")==="resource",Xe=Ge.kind.toLocaleLowerCase("en-US")==="component",St=Ge.kind.toLocaleLowerCase("en-US")==="api",Ot=Ge.kind.toLocaleLowerCase("en-US")==="template",ht=Ge.kind.toLocaleLowerCase("en-US")==="location",Tt=Ge.kind.toLocaleLowerCase("en-US")==="group",gt=(0,S.hF)(Ge,n.cz,{kind:"system"}),Dt=(0,S.hF)(Ge,n.cz,{kind:"component"}),Jt=(0,S.hF)(Ge,n.cz,{kind:"domain"}),Xt=(0,S.hF)(Ge,n.S4);let cn;try{cn=(0,n.CV)(Ge)}catch{cn=void 0}return(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(X,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(z.SA,{className:ce.description,content:(Ge==null||(ye=Ge.metadata)===null||ye===void 0?void 0:ye.description)||"No description"})}),(0,h.jsx)(X,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Xt.length>0&&(0,h.jsx)(S.rI,{entityRefs:Xt,defaultKind:"group"})}),(Re||Jt.length>0)&&(0,h.jsx)(X,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,h.jsx)(S.rI,{entityRefs:Jt,defaultKind:"domain"})}),(St||Xe||Ee||gt.length>0)&&(0,h.jsx)(X,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:gt.length>0&&(0,h.jsx)(S.rI,{entityRefs:gt,defaultKind:"system"})}),Xe&&Dt.length>0&&(0,h.jsx)(X,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(S.rI,{entityRefs:Dt,defaultKind:"component"})}),(St||Xe||Ee||Ot||Tt||ht||typeof(Ge==null||(_e=Ge.spec)===null||_e===void 0?void 0:_e.type)=="string")&&(0,h.jsx)(X,{label:"Type",value:Ge==null||(wt=Ge.spec)===null||wt===void 0?void 0:wt.type,gridSizes:{xs:12,sm:6,lg:4}}),(St||Xe||typeof(Ge==null||(dt=Ge.spec)===null||dt===void 0?void 0:dt.lifecycle)=="string")&&(0,h.jsx)(X,{label:"Lifecycle",value:Ge==null||(bt=Ge.spec)===null||bt===void 0?void 0:bt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(X,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ge==null||(ut=Ge.metadata)===null||ut===void 0?void 0:ut.tags)||[]).map(Ut=>(0,h.jsx)(W.Z,{size:"small",label:Ut},Ut))}),ht&&((Ge==null||(Rt=Ge.spec)===null||Rt===void 0?void 0:Rt.targets)||(Ge==null||(Zt=Ge.spec)===null||Zt===void 0?void 0:Zt.target))&&(0,h.jsx)(X,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Ie.s,{cols:1,items:(Ge.spec.targets||[Ge.spec.target]).map(Ut=>Ut).map(Ut=>{var fn;return{text:Ut,href:Fe(Ut,(Ge==null||(fn=Ge.spec)===null||fn===void 0?void 0:fn.type)||"unknown",cn)}})})})]})}const We=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function jt(Qe){var ye,_e,wt;const{variant:dt}=Qe,bt=We(),{entity:ut}=(0,S.X2)(),Rt=(0,B.h_)(m.q3),Zt=(0,B.h_)(S.Ah),Ge=(0,B.h_)(B.$v),ce=(0,B.h_)(B.VE),Re=(0,B.tg)(T.jU),Ee=(0,S.CV)(ut,Rt),Xe=(ye=ut.metadata.annotations)===null||ye===void 0?void 0:ye[n.Tf],St={label:"View Source",disabled:!Ee,icon:(0,h.jsx)(m.nW,{type:Ee==null?void 0:Ee.integrationType}),href:Ee==null?void 0:Ee.locationTargetUrl},Ot={label:"View TechDocs",disabled:!(!((_e=ut.metadata.annotations)===null||_e===void 0)&&_e["backstage.io/techdocs-ref"])||!Re,icon:(0,h.jsx)(V.Z,{}),href:Re&&Re({namespace:ut.metadata.namespace||n.zG,kind:ut.kind,name:ut.metadata.name})};let ht="";dt==="gridItem"?ht=bt.gridItemCard:dt==="fullHeight"&&(ht=bt.fullHeightCard);let Tt="";dt==="gridItem"?Tt=bt.gridItemCardContent:dt==="fullHeight"&&(Tt=bt.fullHeightCardContent);const gt=(wt=ut.metadata.annotations)===null||wt===void 0?void 0:wt[n.P1],Dt=(gt==null?void 0:gt.startsWith("url:"))||(gt==null?void 0:gt.startsWith("file:")),Jt=(0,ae.useCallback)(async()=>{try{await Zt.refreshEntity((0,n.eE)(ut)),Ge.post({message:"Refresh scheduled",severity:"info"})}catch(Xt){ce.post(Xt)}},[Zt,Ge,ce,ut]);return(0,h.jsxs)(k.Z,{className:ht,children:[(0,h.jsx)(ie.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Dt&&(0,h.jsx)(_.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Jt,children:(0,h.jsx)(O.Z,{})}),(0,h.jsx)(_.Z,{component:z.rU,"aria-label":"Edit",disabled:!Xe,title:"Edit Metadata",to:Xe!=null?Xe:"#",children:(0,h.jsx)(ee.Z,{})})]}),subheader:(0,h.jsx)(z.M6,{links:[St,Ot]})}),(0,h.jsx)(ne.Z,{}),(0,h.jsx)(D.Z,{className:Tt,children:(0,h.jsx)(He,{entity:ut})})]})}},86359:function(At,Oe,t){"use strict";t.d(Oe,{E:function(){return ae}});var h=t(52322),n=t(25271),z=t(23196),B=t(56941),m=t(90436),S=t(15459),l=t(27604),k=t(2997),ie=t(11640),_=t(28347),ne=t(76635),D=t(2784),O=t(7089);const V=Object.freeze({createNameColumn(T){function R(W){var L;return((L=W.metadata)===null||L===void 0?void 0:L.title)||(0,B.$3)(W,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:W},{entity:L}){return R(W).localeCompare(R(L))},render:({entity:W})=>{var L;return(0,h.jsx)(B.dx,{entityRef:W,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(L=W.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,W;return(0,h.jsx)(h.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(W=T.spec)===null||W===void 0?void 0:W.target))&&(0,h.jsx)(z.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,h.jsx)(z.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,h.jsx)(h.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,h.jsx)(O.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:W})=>{var L;const C=(L=W.metadata)===null||L===void 0?void 0:L.labels,X=C&&C[T]||(R==null?void 0:R.defaultValue);return(0,h.jsx)(h.Fragment,{children:X&&(0,h.jsx)(O.Z,{label:X,size:"small",variant:"outlined"},X)})},width:"auto"}}}),ee=(0,S.Z)({root:{color:"#f3ba37"}})(ie.Z),ae=T=>{var R,W;const{columns:L,actions:C,tableOptions:X,subtitle:Ie,emptyContent:Ke}=T,{isStarredEntity:Fe,toggleStarredEntity:He}=(0,B.CR)(),{loading:We,error:jt,entities:Qe,filters:ye}=(0,B.wp)(),_e=(0,D.useMemo)(()=>{var ce;return[V.createTitleColumn({hidden:!0}),V.createNameColumn({defaultKind:(ce=ye.kind)===null||ce===void 0?void 0:ce.value}),...Re(),V.createMetadataDescriptionColumn(),V.createTagsColumn()];function Re(){var Ee;switch((Ee=ye.kind)===null||Ee===void 0?void 0:Ee.value){case"user":return[];case"domain":case"system":return[V.createOwnerColumn()];case"group":case"template":return[V.createSpecTypeColumn()];case"location":return[V.createSpecTypeColumn(),V.createSpecTargetsColumn()];default:return[V.createSystemColumn(),V.createOwnerColumn(),V.createSpecTypeColumn(),V.createSpecLifecycleColumn()]}}},[(R=ye.kind)===null||R===void 0?void 0:R.value]),wt=ye.type===void 0;var dt;const bt=(0,ne.capitalize)((dt=(W=ye.user)===null||W===void 0?void 0:W.value)!==null&&dt!==void 0?dt:"all");if(jt)return(0,h.jsx)("div",{children:(0,h.jsx)(z.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(z.Oi,{language:"text",text:jt.toString()})})});const ut=[({entity:ce})=>{var Re;const Ee=(Re=ce.metadata.annotations)===null||Re===void 0?void 0:Re[n.l2],Xe="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Xe}),(0,h.jsx)(k.Z,{fontSize:"small"})]}),tooltip:Xe,disabled:!Ee,onClick:()=>{!Ee||window.open(Ee,"_blank")}}},({entity:ce})=>{var Re;const Ee=(Re=ce.metadata.annotations)===null||Re===void 0?void 0:Re[n.Tf],Xe="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Xe}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Xe,disabled:!Ee,onClick:()=>{!Ee||window.open(Ee,"_blank")}}},({entity:ce})=>{const Re=Fe(ce),Ee=Re?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Ee}),Re?(0,h.jsx)(ee,{}):(0,h.jsx)(_.Z,{})]}),tooltip:Ee,onClick:()=>He(ce)}}],Rt=Qe.map(ce=>{const Re=(0,B.hF)(ce,n.cz,{kind:"system"}),Ee=(0,B.hF)(ce,n.S4);return{entity:ce,resolved:{name:(0,B.$3)(ce,{defaultKind:"Component"}),ownedByRelationsTitle:Ee.map(Xe=>(0,B.$3)(Xe,{defaultKind:"group"})).join(", "),ownedByRelations:Ee,partOfSystemRelationTitle:Re.map(Xe=>(0,B.$3)(Xe,{defaultKind:"system"})).join(", "),partOfSystemRelations:Re}}}),Zt=(L||_e).find(ce=>ce.title==="Type");Zt&&(Zt.hidden=!wt);const Ge=Rt.length>20;return(0,h.jsx)(z.iA,{isLoading:We,columns:L||_e,options:{paging:Ge,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!We,padding:"dense",pageSizeOptions:[20,50,100],...X},title:`${bt} (${Qe.length})`,data:Rt,actions:C||ut,subtitle:Ie,emptyContent:Ke})};ae.columns=V},85877:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{EntityLabelsCard:function(){return D},hasLabels:function(){return O}});var h=t(52322),n=t(56941),z=t(2784),B=t(23196),m=t(79692),S=t(90436),l=t(77277);const k=`metadata:
34
+ name: example
35
+ labels:
36
+ javaVersion: 1.2.3`,ie=(0,m.Z)(V=>({code:{borderRadius:6,margin:`${V.spacing(2)}px 0px`,background:V.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLabelsEmptyState"});function _(){const V=ie();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.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,h.jsx)("div",{className:V.code,children:(0,h.jsx)(B.Oi,{text:k,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(l.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const ne=(0,m.Z)(V=>({key:{fontWeight:"bold"}})),D=V=>{var ee;const{variant:ae,title:T}=V,{entity:R}=(0,n.X2)(),W=ne(),L=[{render:X=>(0,h.jsx)(S.Z,{className:W.key,variant:"body2",children:X.key})},{field:"value"}],C=R==null||(ee=R.metadata)===null||ee===void 0?void 0:ee.labels;return(0,h.jsx)(B.rJ,{title:T||"Labels",variant:ae,children:!C||Object.keys(C).length===0?(0,h.jsx)(_,{}):(0,h.jsx)(B.iA,{columns:L,data:Object.keys(C).map(X=>({key:X,value:C[X]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(C).length>5}})})};function O(V){var ee,ae;return!(V==null||(ee=V.metadata)===null||ee===void 0)&&ee.labels?Object.keys(V==null||(ae=V.metadata)===null||ae===void 0?void 0:ae.labels).some(Boolean):!1}},24851:function(At,Oe,t){"use strict";t.d(Oe,{s:function(){return ee}});var h=t(52322),n=t(90348),z=t(11861),B=t(2784),m=t(79692),S=t(95544),l=t(90436),k=t(52160),ie=t(23196);const _=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function ne(ae){const{href:T,text:R,Icon:W}=ae,L=_();return(0,h.jsxs)(S.Z,{display:"flex",children:[(0,h.jsx)(S.Z,{mr:1,className:L.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:W?(0,h.jsx)(W,{}):(0,h.jsx)(k.Z,{})})}),(0,h.jsx)(S.Z,{flexGrow:"1",children:(0,h.jsx)(ie.rU,{to:T,target:"_blank",rel:"noopener",children:R||T})})]})}var D=t(41156);const O={xs:1,sm:1,md:1,lg:2,xl:3};function V(ae){const T=[(0,D.Z)(C=>C.breakpoints.up("xl"))?"xl":null,(0,D.Z)(C=>C.breakpoints.up("lg"))?"lg":null,(0,D.Z)(C=>C.breakpoints.up("md"))?"md":null,(0,D.Z)(C=>C.breakpoints.up("sm"))?"sm":null,(0,D.Z)(C=>C.breakpoints.up("xs"))?"xs":null];let R=1;if(typeof ae=="number")R=ae;else{var W;const C=(W=T.find(X=>X!==null))!==null&&W!==void 0?W:"xs";var L;R=(L=ae==null?void 0:ae[C])!==null&&L!==void 0?L:O[C]}return R}function ee(ae){const{items:T,cols:R=void 0}=ae,W=V(R);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:W,children:T.map(({text:L,href:C,Icon:X},Ie)=>(0,h.jsx)(z.Z,{children:(0,h.jsx)(ne,{href:C,text:L!=null?L:C,Icon:X})},Ie))})}},19625:function(At,Oe,t){"use strict";t.d(Oe,{_Z:function(){return B},jU:function(){return z},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),z=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),B=(0,h.NT)({id:"catalog"})},51666:function(At,Oe,t){"use strict";t.d(Oe,{rG:function(){return h},Y2:function(){return W},J$:function(){return ie},g2:function(){return z}});var h;(function(L){L.DENY="DENY",L.ALLOW="ALLOW",L.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(L,C){return L.name===C.name}function z(L,C){return"resourceType"in L?!C||L.resourceType===C:!1}function B(L){return L.attributes.action==="create"}function m(L){return L.attributes.action==="read"}function S(L){return L.attributes.action==="update"}function l(L){return L.attributes.action==="delete"}function k(L){return{authorize:async(C,X)=>await L.authorize(C,X),authorizeConditional(C,X){const Ie=C;return L.authorize(Ie,X)}}}function ie({name:L,attributes:C,resourceType:X}){return X?{type:"resource",name:L,attributes:C,resourceType:X}:{type:"basic",name:L,attributes:C}}var _=t(23054),ne=t(96279),D=t.n(ne),O=t(9571),V=t(30195);const ee=V.z.lazy(()=>V.z.object({rule:V.z.string(),resourceType:V.z.string(),params:V.z.record(V.z.any()).optional()}).or(V.z.object({anyOf:V.z.array(ee).nonempty()})).or(V.z.object({allOf:V.z.array(ee).nonempty()})).or(V.z.object({not:ee}))),ae=V.z.object({result:V.z.literal(h.ALLOW).or(V.z.literal(h.DENY))}),T=V.z.union([V.z.object({result:V.z.literal(h.ALLOW).or(V.z.literal(h.DENY))}),V.z.object({result:V.z.literal(h.CONDITIONAL),pluginId:V.z.string(),resourceType:V.z.string(),conditions:ee})]),R=(L,C)=>V.z.object({items:V.z.array(V.z.intersection(V.z.object({id:V.z.string()}),L)).refine(X=>X.length===C.size&&X.every(({id:Ie})=>C.has(Ie)),{message:"Items in response do not match request"})});class W{async authorize(C,X){return this.makeRequest(C,ae,X)}async authorizeConditional(C,X){return this.makeRequest(C,T,X)}async makeRequest(C,X,Ie){if(!this.enabled)return C.map(ye=>({result:h.ALLOW}));const Ke={items:C.map(ye=>({id:O.Z(),...ye}))},Fe=await this.discovery.getBaseUrl("permission"),He=await D()(`${Fe}/authorize`,{method:"POST",body:JSON.stringify(Ke),headers:{...this.getAuthorizationHeader(Ie==null?void 0:Ie.token),"content-type":"application/json"}});if(!He.ok)throw await _.VL.fromResponse(He);const We=await He.json(),Qe=R(X,new Set(Ke.items.map(({id:ye})=>ye))).parse(We).items.reduce((ye,_e)=>(ye[_e.id]=_e,ye),{});return Ke.items.map(ye=>Qe[ye.id])}getAuthorizationHeader(C){return C?{Authorization:`Bearer ${C}`}:{}}constructor(C){this.discovery=C.discovery;var X;this.enabled=(X=C.config.getOptionalBoolean("permission.enabled"))!==null&&X!==void 0?X:!1}}},25488:function(At,Oe,t){"use strict";t.d(Oe,{iM:function(){return S},RV:function(){return B},gI:function(){return k}});var h=t(52322),n=t(2784),z=t(25248);const B=(0,z.T0)({id:"plugin.permission.api"});var m=t(51666);class S{static create(D){const{config:O,discovery:V,identity:ee}=D,ae=new m.Y2({discovery:V,config:O});return new S(ae,ee)}async authorize(D){return(await this.permissionClient.authorize([D],await this.identityApi.getCredentials()))[0]}constructor(D,O){this.permissionClient=D,this.identityApi=O}}var l=t(69984);function k(ne){const D=(0,z.h_)(B),{data:O,error:V}=(0,l.ZP)(ne,async ee=>{if((0,m.g2)(ee.permission)&&!ee.resourceRef)return m.rG.DENY;const{result:ae}=await D.authorize(ee);return ae});return V?{error:V,loading:!1,allowed:!1}:O===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:O===m.rG.ALLOW}}const ie=ne=>{const{permission:D,resourceRef:O,errorComponent:V,...ee}=ne,ae=usePermission(isResourcePermission(D)?{permission:D,resourceRef:O}:{permission:D}),T=useApp(),{NotFoundErrorPage:R}=T.getComponents();let W=V===void 0?_jsx(R,{}):V;return ae.loading?W=null:ae.allowed&&(W=ne.element),_jsx(Route,{...ee,element:W})};function _(ne){const{permission:D,resourceRef:O}=ne,V=usePermission(isResourcePermission(D)?{permission:D,resourceRef:O}:{permission:D}),ee=useApp();if(V.loading)return null;if(V.allowed)return _jsx(_Fragment,{children:ne.children});if(ne.errorPage)return _jsx(_Fragment,{children:ne.errorPage});const{NotFoundErrorPage:ae}=ee.getComponents();return _jsx(ae,{})}},15096:function(At,Oe,t){"use strict";t.d(Oe,{FA:function(){return ie},qO:function(){return bt},Nd:function(){return He},E5:function(){return Mt},Rx:function(){return C}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class z{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(q){this.mockedResults=q}}var B=t(52322),m=t(2784),S=t(95544),l=t(79692);const k=(0,l.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ie=({text:Y,preTag:q,postTag:f})=>{const A=k(),M=(0,m.useMemo)(()=>Y.split(new RegExp(`(${q}.+?${f})`)),[f,q,Y]);return(0,B.jsx)(B.Fragment,{children:M.map((K,se)=>K.includes(q)?(0,B.jsx)("mark",{className:A.highlight,children:K.replace(new RegExp(`${q}|${f}`,"g"),"")},se):K)})};var _=t(48760),ne=t(50581),D=t(61837),O=t(74603),V=t(21853),ee=t(33375),ae=t(76635),T=t(64279),R=t(1849),W=t(51837);const L=(0,W.CT)("search-context"),C=()=>{const Y=(0,m.useContext)(L);if(!Y)throw new Error("useSearch must be used within a SearchContextProvider");const q=Y.atVersion(1);if(!q)throw new Error("No SearchContext v1 found");return q},X=()=>(0,m.useContext)(L)!==void 0,Ie={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Ke=(Y=Ie)=>{var q,f,A,M;const K=(0,h.h_)(n),[se,xe]=(0,m.useState)(Y.term),[Pe,tt]=(0,m.useState)(Y.types),[it,ft]=(0,m.useState)(Y.filters),[ct,et]=(0,m.useState)(Y.pageLimit),[Me,Et]=(0,m.useState)(Y.pageCursor),Lt=(0,R.Z)(se),Gt=(0,R.Z)(it),vt=(0,T.default)(()=>K.query({term:se,types:Pe,filters:it,pageLimit:ct,pageCursor:Me}),[se,Pe,it,ct,Me]),Nt=!vt.loading&&!vt.error&&((q=vt.value)===null||q===void 0?void 0:q.nextPageCursor),Bt=!vt.loading&&!vt.error&&((f=vt.value)===null||f===void 0?void 0:f.previousPageCursor),pt=(0,m.useCallback)(()=>{var Kt;Et((Kt=vt.value)===null||Kt===void 0?void 0:Kt.nextPageCursor)},[(A=vt.value)===null||A===void 0?void 0:A.nextPageCursor]),ot=(0,m.useCallback)(()=>{var Kt;Et((Kt=vt.value)===null||Kt===void 0?void 0:Kt.previousPageCursor)},[(M=vt.value)===null||M===void 0?void 0:M.previousPageCursor]);return(0,m.useEffect)(()=>{Lt!==void 0&&se!==Lt&&Et(void 0)},[se,Lt,Et]),(0,m.useEffect)(()=>{Gt!==void 0&&!(0,ae.isEqual)(it,Gt)&&Et(void 0)},[it,Gt,Et]),{result:vt,term:se,setTerm:xe,types:Pe,setTypes:tt,filters:it,setFilters:ft,pageLimit:ct,setPageLimit:et,pageCursor:Me,setPageCursor:Et,fetchNextPage:Nt?pt:void 0,fetchPreviousPage:Bt?ot:void 0}},Fe=Y=>{const{initialState:q,children:f}=Y,A=Ke(q);return(0,B.jsx)(h.fC,{attributes:{searchTypes:A.types.sort().join(",")},children:(0,B.jsx)(L.Provider,{value:(0,W.EI)({1:A}),children:f})})},He=Y=>{const{initialState:q,inheritParentContextIfAvailable:f,children:A}=Y;return X()&&f?(0,B.jsx)(B.Fragment,{children:A}):(0,B.jsx)(Fe,{initialState:q,children:A})},We=({children:Y})=>{var q;const f=it=>(0,R.Z)(it)!==it,A=(0,h.z$)(),{term:M,result:K}=C();var se;const xe=(se=(q=K.value)===null||q===void 0?void 0:q.numberOfResults)!==null&&se!==void 0?se:void 0,tt=f(K.loading)&&!K.loading;return(0,m.useEffect)(()=>{M&&tt&&A.captureEvent("search",M,{value:xe})},[A,M,xe,tt]),(0,B.jsx)(B.Fragment,{children:Y})};function jt(Y){return(0,m.forwardRef)((q,f)=>(0,B.jsx)(He,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(Y,{...q,ref:f})}))}const Qe=jt((0,m.forwardRef)((Y,q)=>{const{onChange:f,onKeyDown:A=()=>{},onClear:M=()=>{},onSubmit:K=()=>{},debounceTime:se=200,clearButton:xe=!0,fullWidth:Pe=!0,value:tt,placeholder:it,inputProps:ft={},endAdornment:ct,...et}=Y,Me=(0,h.h_)(h.Ds),[Et,Lt]=(0,m.useState)("");(0,m.useEffect)(()=>{Lt(st=>st!==tt?String(tt):st)},[tt]),(0,_.Z)(()=>f(Et),se,[Et]);const Gt=(0,m.useCallback)(st=>{Lt(st.target.value)},[Lt]),vt=(0,m.useCallback)(st=>{A&&A(st),K&&st.key==="Enter"&&K()},[A,K]),Nt=(0,m.useCallback)(()=>{f(""),M&&M()},[f,M]),Bt=it!=null?it:`Search in ${Me.getOptionalString("app.title")||"Backstage"}`,pt=(0,B.jsx)(ne.Z,{position:"start",children:(0,B.jsx)(D.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,B.jsx)(V.Z,{})})}),ot=(0,B.jsx)(ne.Z,{position:"end",children:(0,B.jsx)(D.Z,{"aria-label":"Clear",size:"small",onClick:Nt,children:(0,B.jsx)(ee.Z,{})})});return(0,B.jsx)(We,{children:(0,B.jsx)(O.Z,{"data-testid":"search-bar-next",ref:q,value:Et,placeholder:Bt,startAdornment:pt,endAdornment:xe?ot:ct,inputProps:{"aria-label":"Search",...ft},fullWidth:Pe,onChange:Gt,onKeyDown:vt,...et})})})),ye=jt((0,m.forwardRef)((Y,q)=>{const{value:f="",onChange:A,...M}=Y,{term:K,setTerm:se}=C();(0,m.useEffect)(()=>{f&&se(String(f))},[f,se]);const xe=(0,m.useCallback)(Pe=>{A?A(Pe):se(Pe)},[A,se]);return(0,B.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,B.jsx)(Qe,{...M,ref:q,value:K,onChange:xe})})}));var _e=t(4614),wt=t(88013);const bt=(Y=>q=>(0,B.jsx)(He,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(Y,{...q})}))(function(q){const{loading:f,value:A,onChange:M=()=>{},options:K=[],getOptionLabel:se=Nt=>String(Nt),inputPlaceholder:xe,inputDebounceTime:Pe,freeSolo:tt=!0,fullWidth:it=!0,clearOnBlur:ft=!1,"data-testid":ct="search-autocomplete",...et}=q,{setTerm:Me}=C(),Et=(0,m.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:se(Nt):"",[se]),Lt=(0,m.useMemo)(()=>Et(A),[A,Et]),Gt=(0,m.useCallback)((Nt,Bt,pt,ot)=>{Me(Et(Bt)),M(Nt,Bt,pt,ot)},[Et,Me,M]),vt=(0,m.useCallback)(({InputProps:{ref:Nt,endAdornment:Bt},InputLabelProps:pt,...ot})=>(0,B.jsx)(ye,{...ot,ref:Nt,clearButton:!1,value:Lt,placeholder:xe,debounceTime:Pe,endAdornment:f?(0,B.jsx)(_e.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Bt}),[f,Lt,xe,Pe]);return(0,B.jsx)(wt.ZP,{...et,"data-testid":ct,value:A,onChange:Gt,options:K,getOptionLabel:se,renderInput:vt,freeSolo:tt,fullWidth:it,clearOnBlur:ft})}),ut=({icon:Y,primaryText:q,primaryTextTypographyProps:f,secondaryText:A,secondaryTextTypographyProps:M,disableTextTypography:K})=>_jsxs(_Fragment,{children:[Y?_jsx(ListItemIcon,{children:Y}):null,_jsx(ListItemText,{primary:q,primaryTypographyProps:f,secondary:A,secondaryTypographyProps:M,disableTypography:K})]});var Rt=t(42494),Zt=t(84899),Ge=t(5806),ce=t(21324),Re=t(56939),Ee=t(73698),Xe=t(12231),St=t(86619),Ot=t(7089),ht=t(69294);const Tt=(Y,q,f=[],A=250)=>{const M=(0,m.useRef)({}),K=Y||(()=>Promise.resolve([])),[se,xe]=(0,ht.default)(K,[q],{loading:!0});if((0,_.Z)(()=>{M.current[q]===void 0&&(M.current[q]=xe(q).then(tt=>(M.current[q]=tt,tt)))},A,[xe,q]),f.length)return{loading:!1,value:f};const Pe=M.current[q];return Array.isArray(Pe)?{loading:!1,value:Pe}:se},gt=(Y,q)=>{const{setFilters:f}=C();(0,m.useEffect)(()=>{q&&[q].flat().length>0&&f(A=>({...A,[Y]:q}))},[])},Dt=Y=>{const{className:q,defaultValue:f,name:A,values:M,valuesDebounceMs:K,label:se,filterSelectedOptions:xe,limitTags:Pe,multiple:tt}=Y,[it,ft]=(0,m.useState)("");gt(A,f);const ct=typeof M=="function"?M:void 0,et=typeof M=="function"?void 0:M,{value:Me,loading:Et}=Tt(ct,it,et,K),{filters:Lt,setFilters:Gt}=C(),vt=Lt[A]||(tt?[]:null),Nt=(ot,st)=>{Gt(Kt=>{const{[A]:On,...un}=Kt;return st?{...un,[A]:st}:{...un}})},Bt=ot=>(0,B.jsx)(St.Z,{...ot,name:"search",variant:"outlined",label:se,fullWidth:!0}),pt=(ot,st)=>ot.map((Kt,On)=>(0,B.jsx)(Ot.Z,{label:Kt,color:"primary",...st({index:On})}));return(0,B.jsx)(wt.ZP,{filterSelectedOptions:xe,limitTags:Pe,multiple:tt,className:q,id:`${tt?"multi-":""}select-filter-${A}--select`,options:Me||[],loading:Et,value:vt,onChange:Nt,onInputChange:(ot,st)=>ft(st),renderInput:Bt,renderTags:pt})},Jt=(0,l.Z)({label:{textTransform:"capitalize"}}),Xt=Y=>{const{className:q,defaultValue:f,label:A,name:M,values:K=[],valuesDebounceMs:se}=Y,xe=Jt(),{filters:Pe,setFilters:tt}=C();gt(M,f);const it=typeof K=="function"?K:void 0,ft=typeof K=="function"?void 0:K,{value:ct=[],loading:et}=Tt(it,"",ft,se),Me=Lt=>{const{target:{value:Gt,checked:vt}}=Lt;tt(Nt=>{const{[M]:Bt,...pt}=Nt,ot=(Bt||[]).filter(Kt=>Kt!==Gt),st=vt?[...ot,Gt]:ot;return st.length?{...pt,[M]:st}:pt})};var Et;return(0,B.jsxs)(Rt.Z,{className:q,disabled:et,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[A?(0,B.jsx)(Zt.Z,{className:xe.label,children:A}):null,ct.map(Lt=>(0,B.jsx)(Ge.Z,{control:(0,B.jsx)(ce.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Lt},value:Lt,name:Lt,onChange:Me,checked:((Et=Pe[M])!==null&&Et!==void 0?Et:[]).includes(Lt)}),label:Lt},Lt))]})},cn=Y=>{const{className:q,defaultValue:f,label:A,name:M,values:K,valuesDebounceMs:se}=Y,xe=Jt();gt(M,f);const Pe=typeof K=="function"?K:void 0,tt=typeof K=="function"?void 0:K,{value:it=[],loading:ft}=Tt(Pe,"",tt,se),{filters:ct,setFilters:et}=C(),Me=Et=>{const{target:{value:Lt}}=Et;et(Gt=>{const{[M]:vt,...Nt}=Gt;return Lt?{...Nt,[M]:Lt}:Nt})};return(0,B.jsxs)(Rt.Z,{disabled:ft,className:q,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[A?(0,B.jsx)(Re.Z,{className:xe.label,margin:"dense",children:A}):null,(0,B.jsxs)(Ee.Z,{variant:"outlined",value:ct[M]||"",onChange:Me,children:[(0,B.jsx)(Xe.Z,{value:"",children:(0,B.jsx)("em",{children:"All"})}),it.map(Et=>(0,B.jsx)(Xe.Z,{value:Et,children:Et},Et))]})]})},Ut=({component:Y,...q})=>(0,B.jsx)(Y,{...q});Ut.Checkbox=Y=>(0,B.jsx)(Ut,{...Y,component:Xt}),Ut.Select=Y=>(0,B.jsx)(Ut,{...Y,component:cn}),Ut.Autocomplete=Y=>(0,B.jsx)(Ut,{...Y,component:Dt});var fn=t(48834).lW;const gn=Y=>fn.from(Y.toString(),"utf-8").toString("base64"),wn=Y=>Y?Number(fn.from(Y,"base64").toString("utf-8")):0,En=Y=>{const{total:q=-1,cursor:f,onCursorChange:A,limit:M=25,limitLabel:K="Results per page:",limitText:se=({from:et,to:Me})=>q>0?`of ${q}`:`${et}-${Me}`,limitOptions:xe,onLimitChange:Pe,...tt}=Y,it=useMemo(()=>wn(f),[f]),ft=useCallback((et,Me)=>{A==null||A(gn(Me))},[A]),ct=useCallback(et=>{const Me=et.target.value;Pe==null||Pe(parseInt(Me,10))},[Pe]);return _jsx(TablePagination,{...tt,component:"div",count:q,page:it,onPageChange:ft,rowsPerPage:M,labelRowsPerPage:K,labelDisplayedRows:se,rowsPerPageOptions:xe,onRowsPerPageChange:ct})},Wn=Y=>{const{pageLimit:q,setPageLimit:f,pageCursor:A,setPageCursor:M}=useSearch();return _jsx(En,{...Y,limit:q,onLimitChange:f,cursor:A,onCursorChange:M})};var An=t(23196);const dn=Y=>{const{children:q}=Y,f=useSearch(),{result:A,...M}=f;return q(A,M)},rn=Y=>{const{query:q,children:f}=Y,A=useApi(searchApiRef),M=useAsync(()=>{const{term:K="",types:se=[],filters:xe={},...Pe}=q;return A.query({...Pe,term:K,types:se,filters:xe})},[q]);return f(M,q)},Vn=Y=>{const{query:q,children:f}=Y;return q?_jsx(rn,{query:q,children:f}):_jsx(dn,{children:f})},Hn=Y=>{const{query:q,children:f,noResultsComponent:A=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...M}=Y;return _jsx(Vn,{query:q,children:({loading:K,error:se,value:xe})=>K?_jsx(Progress,{}):se?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:se}):xe!=null&&xe.results.length?isFunction(f)?f(xe):_jsx(SearchResultListItemExtensions,{...M,results:xe.results,children:f}):A})},Sn=Y=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Hn,{...Y})}),mn=({result:Y,highlight:q,icon:f,secondaryAction:A,lineClamp:M=5})=>Y?_jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[f&&_jsx(ListItemIcon,{children:f}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:Y.location,children:q!=null&&q.fields.title?_jsx(HighlightedSearchResultText,{text:(q==null?void 0:q.fields.title)||"",preTag:(q==null?void 0:q.preTag)||"",postTag:(q==null?void 0:q.postTag)||""}):Y.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:M,overflow:"hidden"},children:q!=null&&q.fields.text?_jsx(HighlightedSearchResultText,{text:q.fields.text,preTag:q.preTag,postTag:q.postTag}):Y.text})}),A&&_jsx(Box,{alignItems:"flex-end",children:A})]}),_jsx(Divider,{})]}):null,Tn=Y=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(mn,{...Y})}),In=Y=>{const{error:q,loading:f,resultItems:A,renderResultItem:M=Pe=>_jsx(DefaultResultListItem,{result:Pe.document},Pe.document.location),disableRenderingWithNoResults:K,noResultsComponent:se=K?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...xe}=Y;return f?_jsx(Progress,{}):q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:q}):A!=null&&A.length?_jsx(List,{...xe,children:A.map(M)}):_jsx(_Fragment,{children:se})},Kn=Y=>{const{query:q,renderResultItem:f,children:A,...M}=Y,K=useSearchResultListItemExtensions(A);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:q,children:({loading:se,error:xe,value:Pe})=>_jsx(In,{...M,error:xe,loading:se,resultItems:Pe==null?void 0:Pe.results,renderResultItem:f!=null?f:K})})})};var vn=t(19126);const ge=(0,l.Z)(Y=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:Y.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:Y.palette.text.secondary,margin:Y.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:Y.palette.text.secondary,margin:Y.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:Y.spacing(.5)}})),re=Y=>{const q=ge(),{label:f,children:A,...M}=Y;return _jsx(Chip,{...M,className:q.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[f,": ",A]})})},Ae=()=>null,Ze=(0,l.Z)(Y=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:Y.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:Y.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),qe=Y=>{const q=Ze(),{label:f,value:A="None",onChange:M,onDelete:K}=Y,se=useCallback(xe=>{M(xe.target.value)},[M]);return _jsx(re,{label:f,onDelete:K,children:_jsx(Typography,{role:"textbox",component:"span",className:q.root,onChange:se,contentEditable:!0,suppressContentEditableWarning:!0,children:A})})},mt=(0,l.Z)(Y=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:Y.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),he=Y=>{const q=mt(),{label:f,value:A="none",onChange:M,onDelete:K,children:se}=Y,xe=useCallback(Pe=>{M(Pe.target.value)},[M]);return _jsx(re,{label:f,onDelete:K,children:_jsxs(Select,{className:q.root,value:A,onChange:xe,input:_jsx(InputBase,{}),IconComponent:Ae,children:[_jsx(MenuItem,{value:"none",children:"None"}),se]})})};function $(Y){const q=ge(),[f,A]=useState(null),{error:M,loading:K,icon:se,title:xe,titleProps:Pe={},link:tt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:q.listSubheaderLinkIcon})]}),linkProps:it={},filterOptions:ft,renderFilterOption:ct=st=>_jsx(MenuItem,{value:String(st),children:st},String(st)),filterFields:et,renderFilterField:Me,resultItems:Et,renderResultItem:Lt=st=>_jsx(DefaultResultListItem,{result:st.document},st.document.location),disableRenderingWithNoResults:Gt,noResultsComponent:vt=Gt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Nt}=Y,Bt=useCallback(st=>{A(st.currentTarget)},[]),pt=useCallback(()=>{A(null)},[]);if(K)return _jsx(Progress,{});if(M)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:M});if(!(Et!=null&&Et.length))return _jsx(_Fragment,{children:vt});var ot;return _jsxs(List,{...Nt,children:[_jsxs(ListSubheader,{className:q.listSubheader,children:[se,_jsx(Typography,{className:q.listSubheaderName,component:"strong",...Pe,children:xe}),ft?_jsx(Chip,{className:q.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Bt}):null,ft?_jsx(Menu,{id:"filters-menu",anchorEl:f,open:Boolean(f),onClose:pt,onClick:pt,keepMounted:!0,children:ft.map(ct)}):null,et==null?void 0:et.map(st=>(ot=Me==null?void 0:Me(st))!==null&&ot!==void 0?ot:null),_jsx(Link,{className:q.listSubheaderLink,to:"/search",...it,children:tt})]}),Et.map(Lt)]})}function pe(Y){const{query:q,children:f,renderResultItem:A,linkProps:M={},...K}=Y,se=useSearchResultListItemExtensions(f);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:q,children:({loading:xe,error:Pe,value:tt},{term:it,types:ft,pageCursor:ct,filters:et={}})=>{const Me=`/search?${qs.stringify({term:it,types:ft,filters:et,pageCursor:ct,query:it},{arrayFormat:"brackets"})}`;return _jsx($,{...K,error:Pe,loading:xe,linkProps:{to:Me,...M},filterFields:Object.keys(et),resultItems:tt==null?void 0:tt.results,renderResultItem:A!=null?A:se})}})})}const Ue=(0,l.Z)(Y=>({root:{display:"flex",justifyContent:"space-between",gap:Y.spacing(2),margin:Y.spacing(2,0)}})),Be=()=>{const{fetchNextPage:Y,fetchPreviousPage:q}=useSearch(),f=Ue();return!Y&&!q?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:f.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!q,onClick:q,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!Y,onClick:Y,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},nt="search.results.list.items.extensions.v1",It=(Y,q)=>{for(const f of Y){if(!isValidElement(f))continue;const A=getComponentData(f,nt);if(!!(A!=null&&A(q)))return cloneElement(f,{rank:q.rank,highlight:q.highlight,result:q.document,...f.props})}return null},Ht=({rank:Y,result:q,noTrack:f,children:A})=>{const M=(0,h.z$)(),K=(0,m.useCallback)(()=>{f||!q||M.captureEvent("discover",q.title,{attributes:{to:q.location},value:Y})},[Y,q,f,M]);return(0,B.jsx)(S.Z,{role:"button",tabIndex:0,onClickCapture:K,children:A})},Mt=Y=>{const{name:q,component:f,predicate:A=()=>!0}=Y;return(0,h.YO)({name:q,component:{lazy:()=>f().then(M=>K=>(0,B.jsx)(Ht,{rank:K.rank,result:K.result,noTrack:K.noTrack,children:(0,m.createElement)(M,K)}))},data:{[nt]:A}})},Qt=Y=>{const q=useElementFilter(Y,f=>f.selectByComponentData({key:nt}).getElements(),[Y]);return useCallback((f,A)=>{const M=It(q,f);return _jsx(Fragment,{children:M!=null?M:_jsx(Ht,{rank:f.rank,result:f.document,children:_jsx(DefaultResultListItem,{rank:f.rank,highlight:f.highlight,result:f.document})})},A)},[q])},zt=Y=>{const{results:q,children:f,...A}=Y,M=Qt(f);return _jsx(List,{...A,children:q.map(M)})}},61886:function(At,Oe,t){"use strict";t.d(Oe,{Ox:function(){return ye},jM:function(){return m},Zz:function(){return S},oZ:function(){return Fe},DR:function(){return l},ZS:function(){return Ie},VA:function(){return dt},KY:function(){return ie},gT:function(){return V},Dl:function(){return ee},ux:function(){return wt},$L:function(){return O},x1:function(){return Ke}});var h=t(52322),n=t(2784),z=t(79635),B=t(25248);const m="techdocs.addons.addon.v1",S="techdocs.addons.wrapper.v1",l=()=>null;(0,B.R5)(l,S,!0);const k=ce=>`${m}.${ce.toLocaleLowerCase("en-US")}`;function ie(ce){const{name:Re,component:Ee}=ce;return(0,B.YO)({name:Re,component:{sync:Xe=>(0,h.jsx)(Ee,{...Xe})},data:{[m]:ce,[k(Re)]:!0}})}const _=(ce,Re)=>ce.selectByComponentData({key:Re}).getElements()[0],ne=ce=>ce.selectByComponentData({key:S}).selectByComponentData({key:m}),D=ce=>ce.selectByComponentData({key:S}).findComponentData({key:m}),O=()=>{const ce=(0,z.pC)(),Re=(0,B.vJ)(ce,ne),Ee=(0,B.vJ)(ce,D),Xe=(0,n.useCallback)(ht=>{if(!Re||!ht)return null;const Tt=k(ht.name);var gt;return(gt=_(Re,Tt))!==null&&gt!==void 0?gt:null},[Re]),St=(0,n.useCallback)(ht=>{const Tt=Ee.find(gt=>gt.name===ht);return Tt?Xe(Tt):null},[Ee,Xe]),Ot=(0,n.useCallback)(ht=>{const Tt=Ee.filter(gt=>gt.location===ht);return Tt.length?Tt.map(Xe):null},[Ee,Xe]);return{renderComponentByName:St,renderComponentsByLocation:Ot}},V=(0,B.T0)({id:"plugin.techdocs.service"}),ee=(0,B.T0)({id:"plugin.techdocs.storageservice"});var ae=t(64279),T=t(25271),R=t(51837);function W(ce,Re){return Re.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ce.kind=ce.kind.toLocaleLowerCase(),ce.name=ce.name.toLocaleLowerCase(),ce.namespace=ce.namespace.toLocaleLowerCase()),ce}const L=(ce,Re)=>(0,T.eE)(ce)===(0,T.eE)(Re),C={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},X=(0,R.CT)("techdocs-reader-page-context"),Ie=(0,n.memo)(({entityRef:ce,children:Re})=>{const Ee=(0,B.h_)(V),Xe=(0,B.h_)(B.Ds),St=(0,ae.default)(async()=>Ee.getTechDocsMetadata(ce),[ce]),Ot=(0,ae.default)(async()=>Ee.getEntityMetadata(ce),[ce]),[ht,Tt]=(0,n.useState)(C.title),[gt,Dt]=(0,n.useState)(C.subtitle),[Jt,Xt]=(0,n.useState)(C.shadowRoot),cn={metadata:St,entityRef:W(ce,Xe),entityMetadata:Ot,shadowRoot:Jt,setShadowRoot:Xt,title:ht,setTitle:Tt,subtitle:gt,setSubtitle:Dt},Ut=(0,R.EI)({1:cn});return(0,h.jsx)(B.fC,{attributes:{entityRef:(0,T.eE)(ce)},children:(0,h.jsx)(X.Provider,{value:Ut,children:Re instanceof Function?Re(cn):Re})})},(ce,Re)=>L(ce.entityRef,Re.entityRef)),Ke=()=>{const ce=(0,n.useContext)(X);if(ce===void 0)return C;const Re=ce.atVersion(1);if(Re===void 0)throw new Error("No context found for version 1.");return Re},Fe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var He=t(70882),We=t(50236),jt=t(19219),Qe=t(23196);const ye="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",_e=ce=>{(0,n.useEffect)(()=>{if(!ce)return()=>{};const Re=ce.querySelectorAll('head > link[rel="stylesheet"]');var Ee;let Xe=(Ee=Re==null?void 0:Re.length)!==null&&Ee!==void 0?Ee:0;const St=new CustomEvent(ye);if(!Xe)return ce.dispatchEvent(St),()=>{};const Ot=()=>{--Xe===0&&ce.dispatchEvent(St)};return Re==null||Re.forEach(ht=>{ht.addEventListener("load",Ot)}),()=>{Re==null||Re.forEach(ht=>{ht.removeEventListener("load",Ot)})}},[ce])},wt=ce=>{const[Re,Ee]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!ce)return()=>{};Ee(!0);const Xe=ce.style;Xe.setProperty("opacity","0");const St=()=>{Ee(!1),Xe.setProperty("opacity","1")};return ce.addEventListener(ye,St),()=>{ce.removeEventListener(ye,St)}},[ce]),Re},dt=({element:ce,onAppend:Re,children:Ee})=>{const[Xe,St]=(0,n.useState)((0,He.Ue)({...(0,We.Z)(),insertionPoint:void 0}));_e(ce);const Ot=wt(ce),ht=(0,n.useCallback)(Tt=>{if(!ce||!Tt)return;St((0,He.Ue)({...(0,We.Z)(),insertionPoint:ce.querySelector("head")||void 0}));let gt=Tt.shadowRoot;gt||(gt=Tt.attachShadow({mode:"open"})),gt.replaceChildren(ce),typeof Re=="function"&&Re(gt)},[ce,Re]);return(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(Qe.Ex,{}),(0,h.jsxs)(jt.ZP,{jss:Xe,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ht,"data-testid":"techdocs-native-shadowroot"}),Ee]})]})};var bt=t(54073);const ut=()=>{const{shadowRoot:ce}=useTechDocsReaderPage();return ce},Rt=ce=>{const Re=ut();return Re?ce.map(Ee=>Re==null?void 0:Re.querySelectorAll(Ee)).filter(Ee=>Ee.length).map(Ee=>Array.from(Ee)).flat():[]},Zt=ce=>ce.toString()&&ce.rangeCount&&ce.getRangeAt(0).getBoundingClientRect().top,Ge=(ce=0)=>{const Re=ut(),[Ee,Xe]=useState(null),St=useMemo(()=>debounce(()=>{const Ot=Re,ht=Ot.getSelection?Ot.getSelection():document.getSelection();ht&&Zt(ht)?Xe(ht):Xe(null)},ce),[Re,Xe,ce]);return useEffect(()=>(window.document.addEventListener("selectionchange",St),()=>window.document.removeEventListener("selectionchange",St)),[St]),Ee}},52943:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{EmbeddedDocsRouter:function(){return ae},Router:function(){return ee},isTechDocsAvailable:function(){return V}});var h=t(52322),n=t(2784),z=t(79635),B=t(56941),m=t(23196),S=t(25271),l=t(89258),k=t(65124),ie=t(67896);const _=({entity:T})=>{const R=(0,S.iB)(T);return(0,h.jsxs)(l.I6,{entityRef:R,children:[(0,h.jsx)(k.b,{}),(0,h.jsx)(ie.F,{withSearch:!1})]})};var ne=t(18662),D=t(7476);const O="backstage.io/techdocs-ref",V=T=>{var R,W;return Boolean(T==null||(R=T.metadata)===null||R===void 0||(W=R.annotations)===null||W===void 0?void 0:W[O])},ee=()=>(0,h.jsxs)(z.Z5,{children:[(0,h.jsx)(z.AW,{path:"/",element:(0,h.jsx)(ne.TechDocsIndexPage,{})}),(0,h.jsx)(z.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(D.TechDocsReaderPage,{})})]}),ae=T=>{var R;const{children:W}=T,{entity:L}=(0,B.X2)(),C=(0,z.V$)([{path:"/*",element:(0,h.jsx)(_,{entity:L}),children:[{path:"*",element:W}]}]);return((R=L.metadata.annotations)===null||R===void 0?void 0:R[O])?C:(0,h.jsx)(m.sk,{annotation:O})}},92077:function(At,Oe,t){"use strict";t.d(Oe,{k:function(){return m},p:function(){return B}});var h=t(23054),n=t(76372),z=t.n(n);class B{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:k,namespace:ie,name:_}=l,D=`${await this.getApiOrigin()}/metadata/techdocs/${ie}/${k}/${_}`,O=await this.fetchApi.fetch(`${D}`);if(!O.ok)throw await h.VL.fromResponse(O);return await O.json()}async getEntityMetadata(l){const{kind:k,namespace:ie,name:_}=l,D=`${await this.getApiOrigin()}/metadata/entity/${ie}/${k}/${_}`,O=await this.fetchApi.fetch(`${D}`);if(!O.ok)throw await h.VL.fromResponse(O);return await O.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,k){const{kind:ie,namespace:_,name:ne}=l,O=`${await this.getStorageUrl()}/${_}/${ie}/${ne}/${k}`,V=await this.fetchApi.fetch(`${O.endsWith("/")?O:`${O}/`}index.html`);let ee="";switch(V.status){case 404:throw ee="Page not found. ",k||(ee+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ee);case 500:throw ee="Could not generate documentation or an error in the TechDocs backend. ",new Error(ee);default:break}return V.text()}async syncEntityDocs(l,k=()=>{}){const{kind:ie,namespace:_,name:ne}=l,O=`${await this.getApiOrigin()}/sync/${_}/${ie}/${ne}`,{token:V}=await this.identityApi.getCredentials();return new Promise((ee,ae)=>{const T=new n.EventSourcePolyfill(O,{withCredentials:!0,headers:V?{Authorization:`Bearer ${V}`}:{}});T.addEventListener("log",R=>{R.data&&k(JSON.parse(R.data))}),T.addEventListener("finish",R=>{let W=!1;R.data&&({updated:W}=JSON.parse(R.data)),ee(W?"updated":"cached")}),T.onerror=R=>{switch(T.close(),R.status){case 404:ae(new h.dR(R.message));return;default:ae(new Error(R.data));return}}})}async getBaseUrl(l,k,ie){const{kind:_,namespace:ne,name:D}=k,V=`${await this.getApiOrigin()}/static/docs/${ne}/${_}/${D}/${ie}`;return new URL(l,V.endsWith("/")?V:`${V}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(At,Oe,t){"use strict";t.d(Oe,{D:function(){return h}});function h(n,z){return z.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(At,Oe,t){"use strict";t.d(Oe,{u:function(){return k}});var h=t(52322),n=t(2784),z=t(23196),B=t(56941),m=t(42081),S=t(48431),l=t(68435);const k=ie=>{const{initialFilter:_="owned",columns:ne,actions:D}=ie;return(0,h.jsx)(m.j,{children:(0,h.jsxs)(z.VY,{children:[(0,h.jsx)(z.yW,{title:"",children:(0,h.jsx)(z.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(B.UO,{children:(0,h.jsxs)(B._i,{children:[(0,h.jsxs)(B._i.Filters,{children:[(0,h.jsx)(S.f,{}),(0,h.jsx)(B.EW,{initialFilter:_}),(0,h.jsx)(B.dq,{}),(0,h.jsx)(B.xE,{})]}),(0,h.jsx)(B._i.Content,{children:(0,h.jsx)(l.n,{actions:D,columns:ne})})]})})]})})}},85478:function(At,Oe,t){"use strict";t.d(Oe,{f:function(){return ne}});var h=t(52322),n=t(95573),z=t(51953),B=t(25248),m=t(23196),S=t(94339),l=t(16111),k=t(24579),ie=t(14503),_=t(2784);const ne=ae=>{const{entities:T}=ae,R=(0,B.tg)(n.Fw),W=(0,B.h_)(B.Ds);if(!T)return null;var L,C;return(0,h.jsx)(m.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((X,Ie)=>(0,h.jsxs)(S.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(m.hu,{title:(L=X.metadata.title)!==null&&L!==void 0?L:X.metadata.name})}),(0,h.jsx)(k.Z,{children:X.metadata.description}),(0,h.jsx)(ie.Z,{children:(0,h.jsx)(m.zx,{to:R({namespace:(0,z.D)((C=X.metadata.namespace)!==null&&C!==void 0?C:"default",W),kind:(0,z.D)(X.kind,W),name:(0,z.D)(X.metadata.name,W)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Ie)):null})};var D=t(56941);const O={title:"All Documentation",filterPredicate:()=>!0},V=({entities:ae,group:T})=>{const{loading:R,isOwnedEntity:W}=useEntityOwnership(),L=ae.filter(X=>T.filterPredicate==="ownedByUser"?R?!1:W(X):typeof T.filterPredicate=="function"&&T.filterPredicate(X)),C=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return L.length===0?null:_jsxs(Content,{children:[C,_jsx(DocsCardGrid,{entities:L})]})},ee=({groups:ae})=>{const{loading:T,error:R,entities:W}=useEntityList();if(R)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:R.toString()})});if(T)return _jsx(Progress,{});if(W.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 L,C;return W.sort((X,Ie)=>((L=X.metadata.title)!==null&&L!==void 0?L:X.metadata.name).localeCompare((C=Ie.metadata.title)!==null&&C!==void 0?C:Ie.metadata.name)),_jsx(Content,{children:(ae||[O]).map((X,Ie)=>_jsx(V,{entities:W,group:X},`${X.title}-${Ie}`))})}},68435:function(At,Oe,t){"use strict";t.d(Oe,{H:function(){return W},n:function(){return L}});var h=t(52322),n=t(2784),z=t(95074),B=t(76635),m=t(23196),S=t(56941),l=t(25248),k=t(25271),ie=t(95573),_=t(39981),ne=t(2337),D=t(11640),O=t(28347);const V=(0,ne.Z)({root:{color:"#f3ba37"}})(D.Z),ee={createCopyDocsUrlAction(C){return X=>({icon:()=>(0,h.jsx)(_.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>C(`${window.location.origin}${X.resolved.docsUrl}`)})},createStarEntityAction(C,X){return({entity:Ie})=>{const Ke=C(Ie);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ke?(0,h.jsx)(V,{}):(0,h.jsx)(O.Z,{}),tooltip:Ke?"Remove from favorites":"Add to favorites",onClick:()=>X(Ie)}}}};function ae(C){return C.metadata.title||C.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:C=>(0,h.jsx)(m.uw,{value:(0,h.jsx)(m.rU,{to:C.resolved.docsUrl,children:ae(C.entity)}),subvalue:C.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:C})=>(0,h.jsx)(S.rI,{entityRefs:C.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var R=t(51953);const W=C=>{const{entities:X,title:Ie,loading:Ke,columns:Fe,actions:He,options:We}=C,[,jt]=(0,z.Z)(),Qe=(0,l.tg)(ie.Fw),ye=(0,l.h_)(l.Ds);if(!X)return null;const _e=X.map(bt=>{const ut=(0,S.hF)(bt,k.S4);var Rt;return{entity:bt,resolved:{docsUrl:Qe({namespace:(0,R.D)((Rt=bt.metadata.namespace)!==null&&Rt!==void 0?Rt:"default",ye),kind:(0,R.D)(bt.kind,ye),name:(0,R.D)(bt.metadata.name,ye)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(Zt=>(0,S.$3)(Zt,{defaultKind:"group"})).join(", ")}}}),wt=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],dt=[ee.createCopyDocsUrlAction(jt)];return(0,h.jsx)(h.Fragment,{children:Ke||_e&&_e.length>0?(0,h.jsx)(m.iA,{isLoading:Ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...We},data:_e,columns:Fe||wt,actions:He||dt,title:Ie?`${Ie} (${_e.length})`:`All (${_e.length})`}):(0,h.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(m.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};W.columns=T,W.actions=ee;const L=C=>{var X;const{columns:Ie,actions:Ke,options:Fe}=C,{loading:He,error:We,entities:jt,filters:Qe}=(0,S.wp)(),{isStarredEntity:ye,toggleStarredEntity:_e}=(0,S.CR)(),[,wt]=(0,z.Z)();var dt;const bt=(0,B.capitalize)((dt=(X=Qe.user)===null||X===void 0?void 0:X.value)!==null&&dt!==void 0?dt:"all"),ut=[ee.createCopyDocsUrlAction(wt),ee.createStarEntityAction(ye,_e)];return We?(0,h.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(m.Oi,{language:"text",text:We.toString()})}):(0,h.jsx)(W,{title:bt,entities:jt,loading:He,actions:Ke||ut,columns:Ie,options:Fe})};L.columns=T,L.actions=ee},18662:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsIndexPage:function(){return m}});var h=t(52322),n=t(2784),z=t(79635),B=t(3482);const m=S=>(0,z.pC)()||(0,h.jsx)(B.u,{...S})},42081:function(At,Oe,t){"use strict";t.d(Oe,{j:function(){return m}});var h=t(52322),n=t(2784),z=t(23196),B=t(25248);const m=S=>{const{children:l}=S,k=(0,B.h_)(B.Ds);var ie;const _=`Documentation available in ${(ie=k.getOptionalString("organization.name"))!==null&&ie!==void 0?ie:"Backstage"}`;return(0,h.jsx)(z.g9,{title:"Documentation",subtitle:_,themeId:"documentation",children:l})}},48431:function(At,Oe,t){"use strict";t.d(Oe,{f:function(){return B}});var h=t(2784),n=t(56941);class z{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const B=()=>{const{updateFilters:m}=(0,n.wp)();return(0,h.useEffect)(()=>{m({techdocs:new z})},[m]),null}},89258:function(At,Oe,t){"use strict";t.d(Oe,{I6:function(){return ne},Jl:function(){return _},s4:function(){return S}});var h=t(61886),n=t(92077),z=t(95573),B=t(25248),m=t(15096);const S=(0,B.rx)({id:"techdocs",apis:[(0,B.ni)({api:h.Dl,deps:{configApi:B.Ds,discoveryApi:B.NW,identityApi:B.$4,fetchApi:B.gP},factory:({configApi:O,discoveryApi:V,identityApi:ee,fetchApi:ae})=>new n.k({configApi:O,discoveryApi:V,identityApi:ee,fetchApi:ae})}),(0,B.ni)({api:h.gT,deps:{configApi:B.Ds,discoveryApi:B.NW,fetchApi:B.gP},factory:({configApi:O,discoveryApi:V,fetchApi:ee})=>new n.p({configApi:O,discoveryApi:V,fetchApi:ee})})],routes:{root:z._Z,docRoot:z.Fw,entityContent:z.pd}}),l=S.provide((0,B.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(O=>O.Router),mountPoint:z._Z})),k=S.provide((0,B.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(O=>O.EmbeddedDocsRouter),mountPoint:z.pd})),ie=S.provide((0,B.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(O=>O.TechDocsCustomHome),mountPoint:z._Z})),_=S.provide((0,B.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(O=>O.TechDocsIndexPage),mountPoint:z._Z})),ne=S.provide((0,B.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(O=>O.TechDocsReaderPage),mountPoint:z.Fw})),D=S.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(t.bind(t,55511)).then(O=>O.TechDocsSearchResultListItem),predicate:O=>O.type==="techdocs"}))},7476:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsReaderLayout:function(){return ne},TechDocsReaderPage:function(){return D}});var h=t(52322),n=t(2784),z=t(79635),B=t(23196),m=t(61886),S=t(67896),l=t(93225),k=t(65124),ie=t(95573),_=t(25248);const ne=({withSearch:O,withHeader:V=!0})=>(0,h.jsxs)(B.T3,{themeId:"documentation",children:[V&&(0,h.jsx)(l.S,{}),(0,h.jsx)(k.b,{}),(0,h.jsx)(S.F,{withSearch:O})]}),D=O=>{const{kind:V,name:ee,namespace:ae}=(0,_.Oi)(ie.Fw),{children:T,entityRef:R={kind:V,name:ee,namespace:ae}}=O,W=(0,z.pC)();if(!T){const C=W?n.Children.toArray(W.props.children):[];var L;const Ie=C.flatMap(Ke=>{var Fe;return(L=Ke==null||(Fe=Ke.props)===null||Fe===void 0?void 0:Fe.children)!==null&&L!==void 0?L:[]}).find(Ke=>!(0,_.IY)(Ke,m.Zz)&&!(0,_.IY)(Ke,m.jM));return(0,h.jsx)(m.ZS,{entityRef:R,children:Ie||(0,h.jsx)(ne,{})})}return(0,h.jsx)(m.ZS,{entityRef:R,children:({metadata:C,entityMetadata:X,onReady:Ie})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(B.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:R,techdocsMetadataValue:C.value,entityMetadataValue:X.value,onReady:Ie}):T})})})}},67896:function(At,Oe,t){"use strict";t.d(Oe,{F:function(){return Y}});var h=t(52322),n=t(2784),z=t(79692),B=t(60905),m=t(61886),S=t(23196),l=t(22478),k=t(4614),ie=t(77277),_=t(99688),ne=t(12420),D=t(90436),O=t(61837),V=t(4190),ee=t(87685);const ae=(0,z.Z)(f=>(0,ne.Z)({paper:{width:"100%",[f.breakpoints.up("sm")]:{width:"75%"},[f.breakpoints.up("md")]:{width:"50%"},padding:f.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:f.palette.background.default}})),T=({buildLog:f,onClose:A})=>{const M=ae(),K=f.length===0?"Waiting for logs...":f.join(`
37
+ `);return(0,h.jsxs)(B.Z,{container:!0,direction:"column",className:M.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(B.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(D.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(O.Z,{title:"Close the drawer",onClick:A,color:"inherit",children:(0,h.jsx)(ee.Z,{})},"dismiss")]}),(0,h.jsx)(B.Z,{item:!0,xs:!0,children:(0,h.jsx)(S.nU,{text:K,classes:{root:M.logs}})})]})},R=({buildLog:f})=>{const A=ae(),[M,K]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ie.Z,{color:"inherit",onClick:()=>K(!0),children:"Show Build Logs"}),(0,h.jsx)(V.ZP,{classes:{paper:A.paper},anchor:"right",open:M,onClose:()=>K(!1),children:(0,h.jsx)(T,{buildLog:f,onClose:()=>K(!1)})})]})};var W=t(25248);const L=({errorMessage:f})=>{const A=(0,W.h_)(W.Ds).getOptionalString("techdocs.builder");let M="";return A!=="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,h.jsx)(S.mf,{status:"404",statusMessage:f||"Documentation not found",additionalInfo:M})};var C=t(95481);const X=(0,z.Z)(f=>({root:{marginBottom:f.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Ie=()=>{let f=null;const A=X(),{state:M,contentReload:K,contentErrorMessage:se,syncErrorMessage:xe,buildLog:Pe}=(0,C.DK)();return M==="INITIAL_BUILD"&&(f=(0,h.jsx)(_.Z,{classes:{root:A.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(k.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Pe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),M==="CONTENT_STALE_REFRESHING"&&(f=(0,h.jsx)(_.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(k.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Pe}),classes:{root:A.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(f=(0,h.jsx)(_.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ie.Z,{color:"inherit",onClick:()=>K(),children:"Refresh"}),classes:{root:A.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(f=(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Pe}),classes:{root:A.root,message:A.message},children:["Building a newer version of this documentation failed."," ",xe]})),M==="CONTENT_NOT_FOUND"&&(f=(0,h.jsxs)(h.Fragment,{children:[xe&&(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Pe}),classes:{root:A.root,message:A.message},children:["Building a newer version of this documentation failed."," ",xe]}),(0,h.jsx)(L,{errorMessage:se})]})),f};var Ke=t(79635),Fe=t(60364),He=t(41156),We=t(32838),jt=t(35368),Qe=t.n(jt);const ye=/main\.[A-Fa-f0-9]{8}\.min\.css$/,_e=/^https:\/\/fonts\.googleapis\.com/,wt=/^https:\/\/fonts\.gstatic\.com/,dt=f=>f.nodeName==="LINK",bt=f=>{const A=(f==null?void 0:f.getAttribute("href"))||"",M=A.match(ye),K=A.match(_e),se=A.match(wt);return M||K||se},ut=f=>(dt(f)&&!bt(f)&&f.remove(),f),Rt=f=>f.nodeName==="IFRAME",Zt=(f,A)=>{const M=f.getAttribute("src")||"";try{const{host:K}=new URL(M);return A.includes(K)}catch{return!1}},Ge=f=>A=>(Rt(A)&&!Zt(A,f)&&A.remove(),A),ce=()=>{const f=(0,W.h_)(W.Ds);return(0,n.useMemo)(()=>f.getOptionalConfig("techdocs.sanitizer"),[f])},Re=()=>{const f=ce();return(0,n.useCallback)(async A=>{const M=f==null?void 0:f.getOptionalStringArray("allowedIframeHosts");Qe().addHook("beforeSanitizeElements",ut);const K=["link"];return M&&(K.push("iframe"),Qe().addHook("beforeSanitizeElements",Ge(M))),Qe().sanitize(A.innerHTML,{ADD_TAGS:K,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[f])};var Ee=t(41128),Xe=({theme:f})=>`
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: ${f.palette.text.primary};
47
+ --md-default-fg-color--light: ${f.palette.text.secondary};
48
+ --md-default-fg-color--lighter: ${(0,Ee.$n)(f.palette.text.secondary,.7)};
49
+ --md-default-fg-color--lightest: ${(0,Ee.$n)(f.palette.text.secondary,.3)};
50
+
51
+ /* BACKGROUND */
52
+ --md-default-bg-color:${f.palette.background.default};
53
+ --md-default-bg-color--light: ${f.palette.background.paper};
54
+ --md-default-bg-color--lighter: ${(0,Ee.$n)(f.palette.background.paper,.7)};
55
+ --md-default-bg-color--lightest: ${(0,Ee.$n)(f.palette.background.paper,.3)};
56
+
57
+ /* PRIMARY */
58
+ --md-primary-fg-color: ${f.palette.primary.main};
59
+ --md-primary-fg-color--light: ${f.palette.primary.light};
60
+ --md-primary-fg-color--dark: ${f.palette.primary.dark};
61
+ --md-primary-bg-color: ${f.palette.primary.contrastText};
62
+ --md-primary-bg-color--light: ${(0,Ee.$n)(f.palette.primary.contrastText,.7)};
63
+
64
+ /* ACCENT */
65
+ --md-accent-fg-color: var(--md-primary-fg-color);
66
+
67
+ /* SHADOW */
68
+ --md-shadow-z1: ${f.shadows[1]};
69
+ --md-shadow-z2: ${f.shadows[2]};
70
+ --md-shadow-z3: ${f.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: ${f.palette.text.primary};
107
+ --md-code-bg-color: ${f.palette.background.paper};
108
+ --md-code-hl-color: ${(0,Ee.Fq)(f.palette.warning.main,.5)};
109
+ --md-code-hl-keyword-color: ${f.palette.type==="dark"?f.palette.primary.light:f.palette.primary.dark};
110
+ --md-code-hl-function-color: ${f.palette.type==="dark"?f.palette.secondary.light:f.palette.secondary.dark};
111
+ --md-code-hl-string-color: ${f.palette.type==="dark"?f.palette.success.light:f.palette.success.dark};
112
+ --md-code-hl-number-color: ${f.palette.type==="dark"?f.palette.error.light:f.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: var(--md-accent-fg-color);
126
+ --md-typeset-table-color: ${f.palette.text.primary};
127
+ --md-typeset-del-color: ${f.palette.type==="dark"?(0,Ee.Fq)(f.palette.error.dark,.5):(0,Ee.Fq)(f.palette.error.light,.5)};
128
+ --md-typeset-ins-color: ${f.palette.type==="dark"?(0,Ee.Fq)(f.palette.success.dark,.5):(0,Ee.Fq)(f.palette.success.light,.5)};
129
+ --md-typeset-mark-color: ${f.palette.type==="dark"?(0,Ee.Fq)(f.palette.warning.dark,.5):(0,Ee.Fq)(f.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
+ `,St=({theme:f})=>`
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: ${f.typography.fontFamily};
152
+ font-family: var(--md-text-font-family);
153
+ background-color: unset;
154
+ }
155
+ `;const Ot="224px";var ht=({theme:f,sidebar:A})=>`
156
+ /*================== Layout ==================*/
157
+
158
+ .md-grid {
159
+ max-width: 100%;
160
+ margin: 0;
161
+ }
162
+
163
+ .md-nav {
164
+ font-size: calc(var(--md-typeset-font-size) * 0.9);
165
+ }
166
+ .md-nav__link {
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: space-between;
170
+ }
171
+ .md-nav__icon {
172
+ height: 20px !important;
173
+ width: 20px !important;
174
+ margin-left:${f.spacing(1)}px;
175
+ }
176
+ .md-nav__icon svg {
177
+ margin: 0;
178
+ width: 20px !important;
179
+ height: 20px !important;
180
+ }
181
+ .md-nav__icon:after {
182
+ width: 20px !important;
183
+ height: 20px !important;
184
+ }
185
+
186
+ .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
187
+ text-decoration: underline;
188
+ color: var(--md-typeset-a-color);
189
+ }
190
+
191
+ .md-main__inner {
192
+ margin-top: 0;
193
+ }
194
+
195
+ .md-sidebar {
196
+ bottom: 75px;
197
+ position: fixed;
198
+ width: 16rem;
199
+ overflow-y: auto;
200
+ overflow-x: hidden;
201
+ scrollbar-color: rgb(193, 193, 193) #eee;
202
+ scrollbar-width: thin;
203
+ }
204
+ .md-sidebar .md-sidebar__scrollwrap {
205
+ width: calc(12.1rem);
206
+ }
207
+ .md-sidebar--secondary {
208
+ right: ${f.spacing(3)}px;
209
+ }
210
+ .md-sidebar::-webkit-scrollbar {
211
+ width: 5px;
212
+ }
213
+ .md-sidebar::-webkit-scrollbar-button {
214
+ width: 5px;
215
+ height: 5px;
216
+ }
217
+ .md-sidebar::-webkit-scrollbar-track {
218
+ background: #eee;
219
+ border: 1 px solid rgb(250, 250, 250);
220
+ box-shadow: 0px 0px 3px #dfdfdf inset;
221
+ border-radius: 3px;
222
+ }
223
+ .md-sidebar::-webkit-scrollbar-thumb {
224
+ width: 5px;
225
+ background: rgb(193, 193, 193);
226
+ border: transparent;
227
+ border-radius: 3px;
228
+ }
229
+ .md-sidebar::-webkit-scrollbar-thumb:hover {
230
+ background: rgb(125, 125, 125);
231
+ }
232
+
233
+ .md-content {
234
+ max-width: calc(100% - 16rem * 2);
235
+ margin-left: 16rem;
236
+ margin-bottom: 50px;
237
+ }
238
+
239
+ .md-footer {
240
+ position: fixed;
241
+ bottom: 0px;
242
+ pointer-events: none;
243
+ }
244
+
245
+ .md-footer-nav__link {
246
+ pointer-events: all;
247
+ }
248
+
249
+ .md-footer__title {
250
+ background-color: unset;
251
+ }
252
+ .md-footer-nav__link {
253
+ width: 16rem;
254
+ }
255
+
256
+ .md-dialog {
257
+ background-color: unset;
258
+ }
259
+
260
+ @media screen and (min-width: 76.25em) {
261
+ .md-sidebar {
262
+ height: auto;
263
+ }
264
+ }
265
+
266
+ @media screen and (max-width: 76.1875em) {
267
+ .md-nav {
268
+ transition: none !important;
269
+ background-color: var(--md-default-bg-color)
270
+ }
271
+ .md-nav--primary .md-nav__title {
272
+ cursor: auto;
273
+ color: var(--md-default-fg-color);
274
+ font-weight: 700;
275
+ white-space: normal;
276
+ line-height: 1rem;
277
+ height: auto;
278
+ display: flex;
279
+ flex-flow: column;
280
+ row-gap: 1.6rem;
281
+ padding: 1.2rem .8rem .8rem;
282
+ background-color: var(--md-default-bg-color);
283
+ }
284
+ .md-nav--primary .md-nav__title~.md-nav__list {
285
+ box-shadow: none;
286
+ }
287
+ .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
288
+ border-top: none;
289
+ }
290
+ .md-nav--primary .md-nav__title .md-nav__button {
291
+ display: none;
292
+ }
293
+ .md-nav--primary .md-nav__title .md-nav__icon {
294
+ color: var(--md-default-fg-color);
295
+ position: static;
296
+ height: auto;
297
+ margin: 0 0 0 -0.2rem;
298
+ }
299
+ .md-nav--primary > .md-nav__title [for="none"] {
300
+ padding-top: 0;
301
+ }
302
+ .md-nav--primary .md-nav__item {
303
+ border-top: none;
304
+ }
305
+ .md-nav--primary :is(.md-nav__title,.md-nav__item) {
306
+ font-size : var(--md-typeset-font-size);
307
+ }
308
+ .md-nav .md-source {
309
+ display: none;
310
+ }
311
+
312
+ .md-sidebar {
313
+ height: 100%;
314
+ }
315
+ .md-sidebar--primary {
316
+ width: 12.1rem !important;
317
+ z-index: 200;
318
+ left: ${A.isPinned?`calc(-12.1rem + ${Ot})`:"calc(-12.1rem + 72px)"} !important;
319
+ }
320
+ .md-sidebar--secondary:not([hidden]) {
321
+ display: none;
322
+ }
323
+
324
+ .md-content {
325
+ max-width: 100%;
326
+ margin-left: 0;
327
+ }
328
+
329
+ .md-header__button {
330
+ margin: 0.4rem 0;
331
+ margin-left: 0.4rem;
332
+ padding: 0;
333
+ }
334
+
335
+ .md-overlay {
336
+ left: 0;
337
+ }
338
+
339
+ .md-footer {
340
+ position: static;
341
+ padding-left: 0;
342
+ }
343
+ .md-footer-nav__link {
344
+ /* footer links begin to overlap at small sizes without setting width */
345
+ width: 50%;
346
+ }
347
+ }
348
+
349
+ @media screen and (max-width: 600px) {
350
+ .md-sidebar--primary {
351
+ left: -12.1rem !important;
352
+ width: 12.1rem;
353
+ }
354
+ }
355
+ `;const Tt=["h1","h2","h3","h4","h5","h6"];var gt=({theme:f})=>`
356
+ /*================== Typeset ==================*/
357
+
358
+ .md-typeset {
359
+ font-size: var(--md-typeset-font-size);
360
+ }
361
+
362
+ ${Tt.reduce((A,M)=>{var K;const se=(K=f.typography.htmlFontSize)!==null&&K!==void 0?K:16,xe=f.typography[M],{lineHeight:Pe,fontFamily:tt,fontWeight:it,fontSize:ft}=xe,ct=et=>{let Me=1;return typeof et=="number"&&(Me=et/se*.6),typeof et=="string"&&(Me=et.replace("rem","")),`calc(${Me} * var(--md-typeset-font-size))`};return A.concat(`
363
+ .md-typeset ${M} {
364
+ color: var(--md-default-fg-color);
365
+ line-height: ${Pe};
366
+ font-family: ${tt};
367
+ font-weight: ${it};
368
+ font-size: ${ct(ft)};
369
+ }
370
+ `)},"")}
371
+
372
+ .md-typeset .md-content__button {
373
+ color: var(--md-default-fg-color);
374
+ }
375
+
376
+ .md-typeset hr {
377
+ border-bottom: 0.05rem dotted ${f.palette.divider};
378
+ }
379
+
380
+ .md-typeset details {
381
+ font-size: var(--md-typeset-font-size) !important;
382
+ }
383
+ .md-typeset details summary {
384
+ padding-left: 2.5rem !important;
385
+ }
386
+ .md-typeset details summary:before,
387
+ .md-typeset details summary:after {
388
+ top: 50% !important;
389
+ width: 20px !important;
390
+ height: 20px !important;
391
+ transform: rotate(0deg) translateY(-50%) !important;
392
+ }
393
+ .md-typeset details[open] > summary:after {
394
+ transform: rotate(90deg) translateX(-50%) !important;
395
+ }
396
+
397
+ .md-typeset blockquote {
398
+ color: var(--md-default-fg-color--light);
399
+ border-left: 0.2rem solid var(--md-default-fg-color--light);
400
+ }
401
+
402
+ .md-typeset table:not([class]) {
403
+ font-size: var(--md-typeset-font-size);
404
+ border: 1px solid var(--md-default-fg-color);
405
+ border-bottom: none;
406
+ border-collapse: collapse;
407
+ }
408
+ .md-typeset table:not([class]) th {
409
+ font-weight: bold;
410
+ }
411
+ .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
412
+ border-bottom: 1px solid var(--md-default-fg-color);
413
+ }
414
+
415
+ .md-typeset pre > code::-webkit-scrollbar-thumb {
416
+ background-color: hsla(0, 0%, 0%, 0.32);
417
+ }
418
+ .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
419
+ background-color: hsla(0, 0%, 0%, 0.87);
420
+ }
421
+ `,Dt=()=>`
422
+ /*================== Animations ==================*/
423
+ /*
424
+ Disable CSS animations on link colors as they lead to issues in dark mode.
425
+ The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
426
+ */
427
+ .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
428
+ transition: none;
429
+ }
430
+ `,Jt=({theme:f})=>`
431
+ /*================== Extensions ==================*/
432
+
433
+ /* HIGHLIGHT */
434
+ .highlight .md-clipboard:after {
435
+ content: unset;
436
+ }
437
+
438
+ .highlight .nx {
439
+ color: ${f.palette.type==="dark"?"#ff53a3":"#ec407a"};
440
+ }
441
+
442
+ /* CODE HILITE */
443
+ .codehilite .gd {
444
+ background-color: ${f.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
445
+ }
446
+
447
+ .codehilite .gi {
448
+ background-color: ${f.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
449
+ }
450
+
451
+ /* TABBED */
452
+ .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
453
+ .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
454
+ .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
455
+ .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
456
+ .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
457
+ .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
458
+ .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
459
+ .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
460
+ .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
461
+ .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
462
+ .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
463
+ .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
464
+ .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
465
+ .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
466
+ .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
467
+ .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
468
+ .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
469
+ .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
470
+ .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
471
+ .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
472
+ color: var(--md-accent-fg-color);
473
+ border-color: var(--md-accent-fg-color);
474
+ }
475
+
476
+ /* TASK-LIST */
477
+ .task-list-control .task-list-indicator::before {
478
+ background-color: ${f.palette.action.disabledBackground};
479
+ }
480
+ .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
481
+ background-color: ${f.palette.success.main};
482
+ }
483
+
484
+ /* ADMONITION */
485
+ .admonition {
486
+ font-size: var(--md-typeset-font-size) !important;
487
+ }
488
+ .admonition .admonition-title {
489
+ padding-left: 2.5rem !important;
490
+ }
491
+
492
+ .admonition .admonition-title:before {
493
+ top: 50% !important;
494
+ width: 20px !important;
495
+ height: 20px !important;
496
+ transform: translateY(-50%) !important;
497
+ }
498
+ `;const Xt=[Xe,St,ht,gt,Dt,Jt],cn=()=>(0,S.Pf)(),Ut=()=>{const f=cn(),A=(0,Fe.Z)();return(0,n.useMemo)(()=>{const M={theme:A,sidebar:f};return Xt.reduce((K,se)=>K+se(M),"")},[A,f])},fn=()=>{const f=Ut();return(0,n.useCallback)(A=>(A.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${f}</style>`),A),[f])},gn=(f,A,M)=>{const K=f==="src"&&A.endsWith(".svg"),se=!A.match(/^([a-z]*:)?\/\//i),xe=A.startsWith(M);return K&&(se||xe)},wn=({techdocsStorageApi:f,entityId:A,path:M})=>async K=>{const se=await f.getApiOrigin(),xe=async(Pe,tt)=>{for(const it of Pe)if(it.hasAttribute(tt)){const ft=it.getAttribute(tt);if(!ft)return;const ct=await f.getBaseUrl(ft,A,M);if(gn(tt,ft,se))try{const Me=await(await fetch(ct,{credentials:"include"})).text();it.setAttribute(tt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Me)))}`)}catch{it.setAttribute("alt",`Error: ${ft}`)}else it.setAttribute(tt,ct)}};return await Promise.all([xe(K.querySelectorAll("img"),"src"),xe(K.querySelectorAll("script"),"src"),xe(K.querySelectorAll("source"),"src"),xe(K.querySelectorAll("link"),"href"),xe(K.querySelectorAll("a[download]"),"href")]),K};var En=t(79158),Wn=t(67097),An=t(28316),dn=t(82717),rn=t.n(dn);const Vn=f=>A=>{var M;const K=A.querySelector('[title="Edit this page"]');if(!K||!K.href)return A;const se=new URL(K.href),xe=f.byUrl(se);if((xe==null?void 0:xe.type)!=="github"&&(xe==null?void 0:xe.type)!=="gitlab")return A;const Pe=((M=A.querySelector("article>h1"))===null||M===void 0?void 0:M.childNodes[0].textContent)||"",tt=encodeURIComponent(`Documentation Feedback: ${Pe}`),it=encodeURIComponent(`Page source:
499
+ ${K.href}
500
+
501
+ Feedback:`),ft=(xe==null?void 0:xe.type)==="github"?(0,En.BT)(se.href,"blob"):se.href,ct=rn()(ft),et=`/${ct.organization}/${ct.name}`,Me=K.cloneNode();switch(xe==null?void 0:xe.type){case"gitlab":Me.href=`${se.origin}${et}/issues/new?issue[title]=${tt}&issue[description]=${it}`;break;case"github":Me.href=`${se.origin}${et}/issues/new?title=${tt}&body=${it}`;break;default:return A}return An.render(n.createElement(Wn.Z),Me),Me.style.paddingLeft="5px",Me.title="Leave feedback for this page",Me.id="git-feedback-link",K==null||K.insertAdjacentElement("beforebegin",Me),A};var Hn=t(44882);const Sn=()=>f=>{const A=f.querySelector('.md-header label[for="__drawer"]'),M=f.querySelector("article");if(!A||!M)return f;const K=A.cloneNode();return An.render(n.createElement(Hn.Z),K),K.id="toggle-sidebar",K.title="Toggle Sidebar",K.classList.add("md-content__button"),K.style.setProperty("padding","0 0 0 5px"),K.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),M==null||M.prepend(K),f},mn=()=>f=>(((M,K)=>{Array.from(M).filter(se=>se.hasAttribute(K)).forEach(se=>{const xe=se.getAttribute(K);if(xe){xe.match(/^https?:\/\//i)&&se.setAttribute("target","_blank");try{const Pe=Tn(window.location.href);se.setAttribute(K,new URL(xe,Pe).toString())}catch{se.replaceWith(se.textContent||xe)}}})})(Array.from(f.getElementsByTagName("a")),"href"),f);function Tn(f){const A=new URL(f);return!A.pathname.endsWith("/")&&!A.pathname.endsWith(".html")&&(A.pathname+="/"),A.toString()}const In=({baseUrl:f,onClick:A})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(K=>{K.addEventListener("click",se=>{const Pe=K.getAttribute("href");!Pe||Pe.startsWith(f)&&!K.hasAttribute("download")&&(se.preventDefault(),A(se,Pe))})}),M);var Kn=t(15459),vn=t(80030),ge=t(72379),re=t(41547);const Ae=(0,Kn.Z)(f=>({tooltip:{fontSize:"inherit",color:f.palette.text.primary,margin:0,padding:f.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(vn.ZP),Ze=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),qe=({text:f})=>{const[A,M]=(0,n.useState)(!1),K=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(f),M(!0)},[f]),se=(0,n.useCallback)(()=>{M(!1)},[M]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:A,onClose:se,leaveDelay:1e3,children:(0,h.jsx)(ie.Z,{className:"md-clipboard md-icon",onClick:K,children:(0,h.jsx)(Ze,{})})})},mt=f=>A=>{const M=A.querySelectorAll("pre > code");for(const se of M){var K;const xe=se.textContent||"",Pe=document.createElement("div");se==null||(K=se.parentElement)===null||K===void 0||K.prepend(Pe),An.render((0,h.jsx)(re.Z,{theme:f,children:(0,h.jsx)(qe,{text:xe})}),Pe)}return A},he=()=>f=>{var A;return(A=f.querySelector(".md-header"))===null||A===void 0||A.remove(),f},$=()=>f=>{var A,M;return(A=f.querySelector(".md-footer .md-copyright"))===null||A===void 0||A.remove(),(M=f.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),f},pe=({onLoading:f,onLoaded:A})=>M=>(f(),M.addEventListener(m.Ox,function K(){A(),M.removeEventListener(m.Ox,K)}),M),Ue=()=>f=>(f.addEventListener(m.Ox,function A(){if(window.location.hash){var M;const K=window.location.hash.slice(1);(M=f==null?void 0:f.querySelector(`[id="${K}"]`))===null||M===void 0||M.scrollIntoView()}f.removeEventListener(m.Ox,A)}),f),Be=()=>f=>(setTimeout(()=>{const A=f==null?void 0:f.querySelectorAll("li.md-nav__item--active");A.length!==0&&(A.forEach(K=>{const se=K==null?void 0:K.querySelector("input");se!=null&&se.checked||se==null||se.click()}),A[A.length-1].scrollIntoView())},200),f),nt=async(f,A)=>{let M;if(typeof f=="string")M=new DOMParser().parseFromString(f,"text/html").documentElement;else if(f instanceof Element)M=f;else throw new Error("dom is not a recognized type");for(const K of A)M=await K(M);return M},It="screen and (max-width: 76.1875em)",Ht=f=>{const A=(0,Ke.s0)(),M=(0,Fe.Z)(),K=(0,He.Z)(It),se=Re(),xe=fn(),Pe=(0,W.z$)(),tt=(0,W.h_)(m.Dl),it=(0,W.h_)(We.q3),{state:ft,path:ct,content:et}=(0,C.DK)(),[Me,Et]=(0,n.useState)(null),Lt=(0,m.ux)(Me),Gt=(0,n.useCallback)(()=>{if(!Me)return;Me.querySelectorAll(".md-sidebar").forEach(ot=>{if(K)ot.style.top="0px";else{const un=document==null?void 0:document.querySelector(".techdocs-reader-page");var st;const yn=(st=un==null?void 0:un.getBoundingClientRect().top)!==null&&st!==void 0?st:0;var Kt;let Yn=(Kt=Me.getBoundingClientRect().top)!==null&&Kt!==void 0?Kt:0;const Bn=Me.querySelector(".md-container > .md-tabs");var On;const Cn=(On=Bn==null?void 0:Bn.getBoundingClientRect().height)!==null&&On!==void 0?On:0;Yn<yn&&(Yn=yn),ot.style.top=`${Math.max(Yn,0)+Cn}px`}ot.style.setProperty("opacity","1")})},[Me,K]);(0,n.useEffect)(()=>(window.addEventListener("resize",Gt),window.addEventListener("scroll",Gt,!0),()=>{window.removeEventListener("resize",Gt),window.removeEventListener("scroll",Gt,!0)}),[Me,Gt]);const vt=(0,n.useCallback)(()=>{if(!Me)return;const pt=Me.querySelector(".md-footer");pt&&(pt.style.width=`${Me.getBoundingClientRect().width}px`)},[Me]);(0,n.useEffect)(()=>(window.addEventListener("resize",vt),()=>{window.removeEventListener("resize",vt)}),[Me,vt]),(0,n.useEffect)(()=>{Lt||(vt(),Gt())},[ft,Lt,vt,Gt]);const Nt=(0,n.useCallback)((pt,ot)=>nt(pt,[se,wn({techdocsStorageApi:tt,entityId:f,path:ot}),mn(),Sn(),he(),$(),Vn(it),xe]),[f,it,tt,se,xe]),Bt=(0,n.useCallback)(async pt=>nt(pt,[Ue(),Be(),mt(M),In({baseUrl:window.location.origin,onClick:(ot,st)=>{var Kt;const On=ot.ctrlKey||ot.metaKey,un=new URL(st),yn=`${un.pathname}${un.search}${un.hash}`,Yn=((Kt=ot.target)===null||Kt===void 0?void 0:Kt.innerText)||st,Bn=st.replace(window.location.origin,"");if(Pe.captureEvent("click",Yn,{attributes:{to:Bn}}),un.hash)if(On)window.open(yn,"_blank");else{var Cn;A(yn),(Cn=pt==null?void 0:pt.querySelector(`[id="${un.hash.slice(1)}"]`))===null||Cn===void 0||Cn.scrollIntoView()}else On?window.open(yn,"_blank"):A(yn)}}),pe({onLoading:()=>{},onLoaded:()=>{var ot;(ot=pt.querySelector(".md-nav__title"))===null||ot===void 0||ot.removeAttribute("for")}}),pe({onLoading:()=>{Array.from(pt.querySelectorAll(".md-sidebar")).forEach(st=>{st.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,A,Pe]);return(0,n.useEffect)(()=>{if(!et)return()=>{};let pt=!0;return Nt(et,ct).then(async ot=>{if(!(ot!=null&&ot.innerHTML)||!pt)return;window.scroll({top:0});const st=await Bt(ot);Et(st)}),()=>{pt=!1}},[et,ct,Nt,Bt]),Me};var Mt=t(8560);const Qt=()=>{const f=(0,m.$L)(),{shadowRoot:A}=(0,m.x1)(),M=A==null?void 0:A.querySelector('[data-md-component="content"]'),K=A==null?void 0:A.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let se=K==null?void 0:K.querySelector('[data-techdocs-addons-location="primary sidebar"]');se||(se=document.createElement("div"),se.setAttribute("data-techdocs-addons-location","primary sidebar"),K==null||K.prepend(se));const xe=A==null?void 0:A.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Pe=xe==null?void 0:xe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Pe||(Pe=document.createElement("div"),Pe.setAttribute("data-techdocs-addons-location","secondary sidebar"),xe==null||xe.prepend(Pe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Mt.Z,{container:se,children:f.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,h.jsx)(Mt.Z,{container:M,children:f.renderComponentsByLocation(m.oZ.Content)}),(0,h.jsx)(Mt.Z,{container:Pe,children:f.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},zt=(0,z.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Y=(0,C.m1)(f=>{var A;const{withSearch:M=!0,onReady:K}=f,se=zt(),{entityMetadata:{value:xe,loading:Pe},entityRef:tt,setShadowRoot:it}=(0,m.x1)(),ft=Ht(tt),ct=(0,n.useCallback)(et=>{it(et),K instanceof Function&&K()},[it,K]);return Pe===!1&&!xe?(0,h.jsx)(S.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ft?(0,h.jsx)(S.VY,{children:(0,h.jsxs)(B.Z,{container:!0,children:[(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})}),M&&(0,h.jsx)(B.Z,{className:se.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:tt,entityTitle:xe==null||(A=xe.metadata)===null||A===void 0?void 0:A.title})}),(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(m.VA,{element:ft,onAppend:ct,children:(0,h.jsx)(Qt,{})})})]})}):(0,h.jsx)(S.VY,{children:(0,h.jsx)(B.Z,{container:!0,children:(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})})})})}),q=null},93225:function(At,Oe,t){"use strict";t.d(Oe,{S:function(){return ee}});var h=t(52322),n=t(2784),z=t(18671),B=t(60905),m=t(98069),S=t(73250),l=t(61886),k=t(56941),ie=t(25271),_=t(23196),ne=t(25248),D=t(76635),O=t(95573);const V=(0,h.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),ee=ae=>{const{children:T}=ae,R=(0,l.$L)(),W=(0,ne.h_)(ne.Ds),{title:L,setTitle:C,subtitle:X,setSubtitle:Ie,entityRef:Ke,metadata:{value:Fe,loading:He},entityMetadata:{value:We,loading:jt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Fe||(C(Fe.site_name),Ie(()=>{let{site_description:ce}=Fe;return(!ce||ce==="None")&&(ce=""),ce}))},[Fe,C,Ie]);const Qe=W.getOptional("app.title")||"Backstage",ye=[L,X,Qe].filter(Boolean).join(" | "),{locationMetadata:_e,spec:wt}=We||{},dt=wt==null?void 0:wt.lifecycle,bt=We?(0,k.hF)(We,ie.S4):[],ut=(0,ne.tg)(O._Z)(),Rt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_.i9,{label:(0,D.capitalize)((We==null?void 0:We.kind)||"entity"),value:(0,h.jsx)(k.dx,{color:"inherit",entityRef:Ke,title:We==null?void 0:We.metadata.title,defaultKind:"Component"})}),bt.length>0&&(0,h.jsx)(_.i9,{label:"Owner",value:(0,h.jsx)(k.rI,{color:"inherit",entityRefs:bt,defaultKind:"group"})}),dt?(0,h.jsx)(_.i9,{label:"Lifecycle",value:dt}):null,_e&&_e.type!=="dir"&&_e.type!=="file"?(0,h.jsx)(_.i9,{label:"",value:(0,h.jsxs)(B.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(S.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:_e.target}):null]});return!jt&&We===void 0||!He&&Fe===void 0?null:(0,h.jsxs)(_.h4,{type:"Documentation",typeLink:ut,title:L||V,subtitle:X===""?void 0:X||V,children:[(0,h.jsx)(z.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:ye})}),Rt,T,R.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(At,Oe,t){"use strict";t.d(Oe,{b:function(){return D}});var h=t(52322),n=t(2784),z=t(79692),B=t(15223),m=t(95544),S=t(80030),l=t(61837),k=t(48348),ie=t(47603),_=t(61886);const ne=(0,z.Z)(O=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:O.spacing(3,3,0)}})),D=O=>{const V=ne(),[ee,ae]=(0,n.useState)(null),T=(0,n.useCallback)(Ke=>{ae(Ke.currentTarget)},[]),R=(0,n.useCallback)(()=>{ae(null)},[]),{entityMetadata:{value:W,loading:L}}=(0,_.x1)(),C=(0,_.$L)(),X=C.renderComponentsByLocation(_.oZ.Subheader),Ie=C.renderComponentsByLocation(_.oZ.Settings);return!X&&!Ie||L===!1&&!W?null:(0,h.jsx)(B.Z,{classes:V,...O.toolbarProps,children:(0,h.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[X,Ie?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:T,children:(0,h.jsx)(ie.Z,{})})}),(0,h.jsx)(k.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ee,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ee),onClose:R,keepMounted:!0,children:Ie})]}):null]})})}},95481:function(At,Oe,t){"use strict";t.d(Oe,{DK:function(){return D},m1:function(){return V}});var h=t(52322),n=t(2784),z=t(79635),B=t(61886),m=t(25248),S=t(64279),l=t(77446);function k({contentLoading:ee,content:ae,activeSyncState:T}){return ee||T==="BUILD_READY_RELOAD"||!ae&&T==="CHECKING"?"CHECKING":!ae&&T==="BUILDING"?"INITIAL_BUILD":ae?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ie(ee,ae){const T={...ee};switch(ae.type){case"sync":ae.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=ae.state,T.syncError=ae.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof ae.path=="string"&&(T.path=ae.path),T.contentLoading=!1,T.content=ae.content,T.contentError=ae.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(ae.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(ae.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function _(ee,ae,T,R){var W,L;const[C,X]=(0,n.useReducer)(ie,{activeSyncState:"CHECKING",path:R,contentLoading:!0,buildLog:[]}),Ie=(0,m.h_)(B.Dl),{retry:Ke}=(0,l.Z)(async()=>{X({type:"contentLoading"});try{const We=await Ie.getEntityDocs({kind:ee,namespace:ae,name:T},R);return X({type:"content",content:We,path:R}),We}catch(We){X({type:"content",contentError:We,path:R})}},[Ie,ee,ae,T,R]),Fe=(0,n.useRef)({content:void 0,reload:()=>{}});return Fe.current={content:C.content,reload:Ke},(0,S.default)(async()=>{X({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{X({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ie.syncEntityDocs({kind:ee,namespace:ae,name:T},Qe=>{X({type:"buildLog",log:Qe})})){case"updated":Fe.current.content?X({type:"sync",state:"BUILD_READY"}):(Fe.current.reload(),X({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":X({type:"sync",state:"UP_TO_DATE"});break;default:X({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(jt){X({type:"sync",state:"ERROR",syncError:jt})}finally{clearTimeout(We)}},[ee,T,ae,Ie,X,Fe]),{state:(0,n.useMemo)(()=>k({activeSyncState:C.activeSyncState,contentLoading:C.contentLoading,content:C.content}),[C.activeSyncState,C.content,C.contentLoading]),contentReload:Ke,path:C.path,content:C.content,contentErrorMessage:(W=C.contentError)===null||W===void 0?void 0:W.toString(),syncErrorMessage:(L=C.syncError)===null||L===void 0?void 0:L.toString(),buildLog:C.buildLog}}const ne=(0,n.createContext)({}),D=()=>(0,n.useContext)(ne),O=({children:ee})=>{const{"*":ae=""}=(0,z.UO)(),{entityRef:T}=(0,B.x1)(),{kind:R,namespace:W,name:L}=T,C=_(R,W,L,ae);return(0,h.jsx)(ne.Provider,{value:C,children:ee instanceof Function?ee(C):ee})},V=ee=>ae=>(0,h.jsx)(O,{children:(0,h.jsx)(ee,{...ae})})},95573:function(At,Oe,t){"use strict";t.d(Oe,{Fw:function(){return z},_Z:function(){return n},pd:function(){return B}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),z=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),B=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(At,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsSearchResultListItem:function(){return D}});var h=t(52322),n=t(2784),z=t(79692),B=t(49378),m=t(38402),S=t(86136),l=t(85256),k=t(90436),ie=t(23196),_=t(15096);const ne=(0,z.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),D=O=>{const{result:V,highlight:ee,lineClamp:ae=5,asListItem:T=!0,asLink:R=!0,title:W,icon:L}=O,C=ne(),X=({children:Fe})=>R?(0,h.jsx)(ie.rU,{noTrack:!0,to:V.location,children:Fe}):(0,h.jsx)(h.Fragment,{children:Fe}),Ie=()=>{const Fe=ee!=null&&ee.fields.title?(0,h.jsx)(_.FA,{text:ee.fields.title,preTag:ee.preTag,postTag:ee.postTag}):V.title,He=ee!=null&&ee.fields.entityTitle?(0,h.jsx)(_.FA,{text:ee.fields.entityTitle,preTag:ee.preTag,postTag:ee.postTag}):V.entityTitle,We=ee!=null&&ee.fields.name?(0,h.jsx)(_.FA,{text:ee.fields.name,preTag:ee.preTag,postTag:ee.postTag}):V.name;return V?(0,h.jsx)(B.Z,{className:C.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(X,{children:W||(0,h.jsxs)(h.Fragment,{children:[Fe," | ",He!=null?He:We," docs"]})}),secondary:(0,h.jsx)(k.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ae,overflow:"hidden"},children:ee!=null&&ee.fields.text?(0,h.jsx)(_.FA,{text:ee.fields.text,preTag:ee.preTag,postTag:ee.postTag}):V.text})}):null},Ke=({children:Fe})=>T?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(m.Z,{alignItems:"flex-start",children:[L&&(0,h.jsx)(S.Z,{children:L}),(0,h.jsx)("div",{className:C.flexContainer,children:Fe})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:Fe});return(0,h.jsx)(Ke,{children:(0,h.jsx)(Ie,{})})}},22478:function(At,Oe,t){"use strict";t.d(Oe,{S:function(){return ne}});var h=t(52322),n=t(15096),z=t(79692),B=t(27556),m=t(2784),S=t(79635),l=t(55511);const k=(0,z.Z)(D=>({root:{width:"100%"},bar:{padding:D.spacing(1)}})),ie=D=>D==null?void 0:D.document,_=D=>{const{entityId:O,entityTitle:V,debounceTime:ee=150}=D,[ae,T]=(0,m.useState)(!1),R=(0,S.s0)(),{setFilters:W,result:{loading:L,value:C}}=(0,n.Rx)(),X=k(),[Ie,Ke]=(0,m.useState)([]);(0,m.useEffect)(()=>{let Qe=!0;if(Qe&&C){const ye=C.results.slice(0,10);Ke(ye)}return()=>{Qe=!1}},[L,C]);const{kind:Fe,name:He,namespace:We}=O;(0,m.useEffect)(()=>{W(Qe=>({...Qe,kind:Fe,namespace:We,name:He}))},[Fe,We,He,W]);const jt=(Qe,ye)=>{if(ie(ye)){const{location:_e}=ye.document;R(_e)}};return(0,h.jsx)(B.Z,{className:X.bar,variant:"outlined",children:(0,h.jsx)(n.qO,{classes:{root:X.root},"data-testid":"techdocs-search-bar",size:"small",open:ae,getOptionLabel:()=>"",filterOptions:Qe=>Qe,onClose:()=>{T(!1)},onFocus:()=>{T(!0)},onChange:jt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ie,renderOption:({document:Qe,highlight:ye})=>(0,h.jsx)(l.TechDocsSearchResultListItem,{result:Qe,lineClamp:3,asListItem:!1,asLink:!1,title:Qe.title,highlight:ye}),loading:L,inputDebounceTime:ee,inputPlaceholder:`Search ${V||O.name} docs`,freeSolo:!1})})},ne=D=>{const O={term:"",types:["techdocs"],pageCursor:"",filters:D.entityId};return(0,h.jsx)(n.Nd,{initialState:O,children:(0,h.jsx)(_,{...D})})}},53260:function(){}},function(At){var Oe=function(h){return At(At.s=h)};At.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Oe(49636)});var t=At.O()}]);})();
502
+
503
+ //# sourceMappingURL=main.dd3e123f.js.map