@techdocs/cli 1.4.1-next.0 → 1.4.1-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 (56) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/{index/PublisherConfig-9dfc07ee.cjs.js → PublisherConfig-a2649fb7.cjs.js} +1 -1
  3. package/dist/cjs/PublisherConfig-a2649fb7.cjs.js.map +1 -0
  4. package/dist/cjs/{index/generate-8722d4c2.cjs.js → generate-d9c4c0d9.cjs.js} +2 -2
  5. package/dist/cjs/generate-d9c4c0d9.cjs.js.map +1 -0
  6. package/dist/cjs/{index/migrate-5312e76c.cjs.js → migrate-0697fdb4.cjs.js} +3 -3
  7. package/dist/cjs/migrate-0697fdb4.cjs.js.map +1 -0
  8. package/dist/cjs/{index/mkdocs-b897f254.cjs.js → mkdocs-582c42fd.cjs.js} +3 -3
  9. package/dist/cjs/mkdocs-582c42fd.cjs.js.map +1 -0
  10. package/dist/cjs/{index/mkdocsServer-db7109fb.cjs.js → mkdocsServer-99ec8af2.cjs.js} +1 -1
  11. package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +1 -0
  12. package/dist/cjs/{index/publish-f0f203ef.cjs.js → publish-ac098b56.cjs.js} +3 -3
  13. package/dist/cjs/publish-ac098b56.cjs.js.map +1 -0
  14. package/dist/cjs/{index/serve-8c722cc8.cjs.js → serve-461aaf60.cjs.js} +3 -3
  15. package/dist/cjs/serve-461aaf60.cjs.js.map +1 -0
  16. package/dist/cjs/{index/utility-2edd5bff.cjs.js → utility-3c0df5a9.cjs.js} +1 -1
  17. package/dist/cjs/utility-3c0df5a9.cjs.js.map +1 -0
  18. package/dist/embedded-app/index.html +1 -1
  19. package/dist/embedded-app/static/{6051.18a39235.chunk.js → 6051.002ec2c4.chunk.js} +2 -2
  20. package/dist/embedded-app/static/{6051.18a39235.chunk.js.map → 6051.002ec2c4.chunk.js.map} +1 -1
  21. package/dist/embedded-app/static/{8951.4ffeac5f.chunk.js → 8951.dd51135b.chunk.js} +2 -2
  22. package/dist/embedded-app/static/{8951.4ffeac5f.chunk.js.map → 8951.dd51135b.chunk.js.map} +1 -1
  23. package/dist/embedded-app/static/{9323.a4a386cd.chunk.js → 9323.6577088c.chunk.js} +2 -2
  24. package/dist/embedded-app/static/{9323.a4a386cd.chunk.js.map → 9323.6577088c.chunk.js.map} +1 -1
  25. package/dist/embedded-app/static/main.3a433f5b.js +508 -0
  26. package/dist/embedded-app/static/main.3a433f5b.js.map +1 -0
  27. package/dist/embedded-app/static/module-react-router-dom.87e15add.js +21 -0
  28. package/dist/embedded-app/static/module-react-router-dom.87e15add.js.map +1 -0
  29. package/dist/embedded-app/static/module-react-router.3fa3d41e.js +21 -0
  30. package/dist/embedded-app/static/module-react-router.3fa3d41e.js.map +1 -0
  31. package/dist/embedded-app/static/module-zod.49079951.js +3 -0
  32. package/dist/embedded-app/static/module-zod.49079951.js.map +1 -0
  33. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js → react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js} +2 -2
  34. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js.map → react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js.map} +1 -1
  35. package/dist/embedded-app/static/{runtime.d717207e.js → runtime.3a433f5b.js} +2 -2
  36. package/dist/embedded-app/static/{runtime.d717207e.js.map → runtime.3a433f5b.js.map} +1 -1
  37. package/dist/embedded-app/static/{vendor.d717207e.js → vendor.3a433f5b.js} +83 -83
  38. package/dist/embedded-app/static/vendor.3a433f5b.js.map +1 -0
  39. package/dist/index.cjs.js +6 -6
  40. package/dist/index.cjs.js.map +1 -1
  41. package/package.json +4 -4
  42. package/dist/cjs/index/PublisherConfig-9dfc07ee.cjs.js.map +0 -1
  43. package/dist/cjs/index/generate-8722d4c2.cjs.js.map +0 -1
  44. package/dist/cjs/index/migrate-5312e76c.cjs.js.map +0 -1
  45. package/dist/cjs/index/mkdocs-b897f254.cjs.js.map +0 -1
  46. package/dist/cjs/index/mkdocsServer-db7109fb.cjs.js.map +0 -1
  47. package/dist/cjs/index/publish-f0f203ef.cjs.js.map +0 -1
  48. package/dist/cjs/index/serve-8c722cc8.cjs.js.map +0 -1
  49. package/dist/cjs/index/utility-2edd5bff.cjs.js.map +0 -1
  50. package/dist/embedded-app/static/main.d717207e.js +0 -503
  51. package/dist/embedded-app/static/main.d717207e.js.map +0 -1
  52. package/dist/embedded-app/static/module-react-router-dom.34e67991.js +0 -30
  53. package/dist/embedded-app/static/module-react-router-dom.34e67991.js.map +0 -1
  54. package/dist/embedded-app/static/module-zod.cdb212b6.js +0 -3
  55. package/dist/embedded-app/static/module-zod.cdb212b6.js.map +0 -1
  56. package/dist/embedded-app/static/vendor.d717207e.js.map +0 -1
@@ -1,503 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(bt,$e,t){"use strict";t.d($e,{n3:function(){return y},MS:function(){return we}});var u=t(47842),r=t(25271),z=t(23054),P=t(96279),m=t.n(P);const y=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function c(ue){return!ue.cursor}function $(ue){return!c(ue)}class we{async getEntityAncestors(G,Z){const{kind:S,namespace:V,name:re}=(0,r.of)(G.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(V)}/${encodeURIComponent(re)}/ancestry`,Z)}async getLocationById(G,Z){return await this.requestOptional("GET",`/locations/${encodeURIComponent(G)}`,Z)}async getEntities(G,Z){const{filter:S=[],fields:V=[],order:re,offset:q,limit:_,after:B}=G!=null?G:{},R=this.getParams(S);if(V.length&&R.push(`fields=${V.map(encodeURIComponent).join(",")}`),re)for(const Ce of[re].flat())Ce&&R.push(`order=${encodeURIComponent(Ce.order)}:${encodeURIComponent(Ce.field)}`);q!==void 0&&R.push(`offset=${q}`),_!==void 0&&R.push(`limit=${_}`),B!==void 0&&R.push(`after=${encodeURIComponent(B)}`);const k=R.length?`?${R.join("&")}`:"",L=await this.requestRequired("GET",`/entities${k}`,Z),W=(Ce,Ve)=>{var et,K;if(((et=Ce.metadata)===null||et===void 0?void 0:et.name)===void 0||Ce.kind===void 0||((K=Ve.metadata)===null||K===void 0?void 0:K.name)===void 0||Ve.kind===void 0)return 0;const tt=(0,r.eE)(Ce),dt=(0,r.eE)(Ve);return tt<dt?-1:tt>dt?1:0};return{items:L.sort(W)}}async getEntitiesByRefs(G,Z){var S;const V={entityRefs:G.entityRefs};!((S=G.fields)===null||S===void 0)&&S.length&&(V.fields=G.fields);const q=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,_=await this.fetchApi.fetch(q,{headers:{"Content-Type":"application/json",...(Z==null?void 0:Z.token)&&{Authorization:`Bearer ${Z==null?void 0:Z.token}`}},method:"POST",body:JSON.stringify(V)});if(!_.ok)throw await z.VL.fromResponse(_);const{items:B}=await _.json();return{items:B.map(R=>R!=null?R:void 0)}}async queryEntities(G={},Z){const S=[];if(c(G)){var V,re;const{fields:_=[],filter:B,limit:R,orderFields:k,fullTextFilter:L}=G;S.push(...this.getParams(B)),R!==void 0&&S.push(`limit=${R}`),k!==void 0&&(Array.isArray(k)?k:[k]).forEach(({field:Ce,order:Ve})=>S.push(`sortField=${Ce},${Ve}`)),_.length&&S.push(`fields=${_.map(encodeURIComponent).join(",")}`);const W=L==null||(V=L.term)===null||V===void 0?void 0:V.trim();W&&S.push(`fullTextFilterTerm=${W}`),!(L==null||(re=L.fields)===null||re===void 0)&&re.length&&S.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:_=[],limit:B,cursor:R}=G;S.push(`cursor=${R}`),B!==void 0&&S.push(`limit=${B}`),_.length&&S.push(`fields=${_.map(encodeURIComponent).join(",")}`)}const q=S.length?`?${S.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${q}`,Z)}async getEntityByRef(G,Z){const{kind:S,namespace:V,name:re}=(0,r.of)(G);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(V)}/${encodeURIComponent(re)}`,Z)}async getEntityByName(G,Z){const{kind:S,namespace:V="default",name:re}=G;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(V)}/${encodeURIComponent(re)}`,Z)}async refreshEntity(G,Z){const S=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(Z==null?void 0:Z.token)&&{Authorization:`Bearer ${Z==null?void 0:Z.token}`}},method:"POST",body:JSON.stringify({entityRef:G})});if(S.status!==200)throw new Error(await S.text())}async getEntityFacets(G,Z){const{filter:S=[],facets:V}=G,re=this.getParams(S);for(const _ of V)re.push(`facet=${encodeURIComponent(_)}`);const q=re.length?`?${re.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${q}`,Z)}async addLocation(G,Z){const{type:S="url",target:V,dryRun:re}=G,q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${re?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(Z==null?void 0:Z.token)&&{Authorization:`Bearer ${Z==null?void 0:Z.token}`}},method:"POST",body:JSON.stringify({type:S,target:V})});if(q.status!==201)throw new Error(await q.text());const{location:_,entities:B,exists:R}=await q.json();if(!_)throw new Error(`Location wasn't added: ${V}`);return{location:_,entities:B,exists:R}}async getLocationByRef(G,Z){return(await this.requestRequired("GET","/locations",Z)).map(V=>V.data).find(V=>G===(0,r.NZ)(V))}async removeLocationById(G,Z){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(G)}`,Z)}async removeEntityByUid(G,Z){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(G)}`,Z)}async validateEntity(G,Z,S){const V=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(S==null?void 0:S.token)&&{Authorization:`Bearer ${S==null?void 0:S.token}`}},method:"POST",body:JSON.stringify({entity:G,location:Z})});if(V.ok)return{valid:!0};if(V.status!==400)throw await z.VL.fromResponse(V);const{errors:re=[]}=await V.json();return{valid:!1,errors:re}}async requestIgnored(G,Z,S){const V=`${await this.discoveryApi.getBaseUrl("catalog")}${Z}`,re=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},q=await this.fetchApi.fetch(V,{method:G,headers:re});if(!q.ok)throw await z.VL.fromResponse(q)}async requestRequired(G,Z,S){const V=`${await this.discoveryApi.getBaseUrl("catalog")}${Z}`,re=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},q=await this.fetchApi.fetch(V,{method:G,headers:re});if(!q.ok)throw await z.VL.fromResponse(q);return q.json()}async requestOptional(G,Z,S){const V=`${await this.discoveryApi.getBaseUrl("catalog")}${Z}`,re=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},q=await this.fetchApi.fetch(V,{method:G,headers:re});if(!q.ok){if(q.status===404)return;throw await z.VL.fromResponse(q)}return await q.json()}getParams(G=[]){const Z=[];for(const S of[G].flat()){const V=[];for(const[re,q]of Object.entries(S))for(const _ of[q].flat())_===y?V.push(encodeURIComponent(re)):typeof _=="string"&&V.push(`${encodeURIComponent(re)}=${encodeURIComponent(_)}`);V.length&&Z.push(`filter=${V.join(",")}`)}return Z}constructor(G){(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.discoveryApi=G.discoveryApi,this.fetchApi=G.fetchApi||{fetch:m()}}}},25271:function(bt,$e,t){"use strict";t.d($e,{Tf:function(){return z},P1:function(){return jn},q1:function(){return Vn},M6:function(){return fe},l2:function(){return r},zG:function(){return u},w$:function(){return wn},nP:function(){return ln},aS:function(){return zn},S4:function(){return Bt},cz:function(){return nt},iB:function(){return lt},CV:function(){return Ke},of:function(){return Et},Ou:function(){return ke},eE:function(){return pt},NZ:function(){return Fe}});const u="default",r="backstage.io/view-url",z="backstage.io/edit-url",P="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",y="kubernetes.io/auth-provider";var c=t(76635),$=t.n(c);class we{async enforce(D){return D.metadata.namespace?D:lodash.merge({metadata:{namespace:this.namespace}},D)}constructor(D=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=D}}class ue{static isValidPrefixAndOrSuffix(D,pe,Ae,Qe){if(typeof D!="string")return!1;const Xe=D.split(pe);return Xe.length===1?Qe(Xe[0]):Xe.length===2?Ae(Xe[0])&&Qe(Xe[1]):!1}static isJsonSafe(D){try{return $().isEqual(D,JSON.parse(JSON.stringify(D)))}catch{return!1}}static isValidDnsSubdomain(D){return typeof D=="string"&&D.length>=1&&D.length<=253&&D.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(D)}static isValidTag(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(D)}static isValidUrl(D){if(typeof D!="string")return!1;try{return new URL(D),!0}catch{return!1}}static isValidString(D){var pe;return typeof D=="string"&&((pe=D==null?void 0:D.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString(D){var pe;return typeof D=="string"&&((pe=D==null?void 0:D.trim())===null||pe===void 0?void 0:pe.length)>=1}}var G=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),Z=t(27991),S=t.n(Z),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"}}}`),re=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),q=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 _=new Map,B=[G,V,re,q];function R(te){if(!(te!=null&&te.length))throw new TypeError("Unknown error");const D=te[0];throw new TypeError(`${D.instancePath||"<root>"} ${D.message}${D.params?` - ${Object.entries(D.params).map(([pe,Ae])=>`${pe}: ${Ae}`).join(", ")}`:""}`)}function k(te,D={}){var pe;const Ae=(pe=D==null?void 0:D.disableCache)!==null&&pe!==void 0?pe:!1,Qe=Ae?"":JSON.stringify(te);if(!Ae){const an=_.get(Qe);if(an)return an}const Xe=L(te),Tt=new(S())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Xe.length&&Tt.addSchema(Xe,void 0,void 0,!0);const Gt=Tt.compile(te);return Ae||_.set(Qe,Gt),Gt}function L(te){if(typeof te!="object")return[];const D=new Set;te.$id&&D.add(te.$id);const pe=new Array,Ae=[te];for(;Ae.length;){const Qe=Ae.pop();for(const Xe of W(Qe))if(!D.has(Xe)){D.add(Xe);const Tt=B.find(Gt=>Gt.$id===Xe);Tt&&(pe.push(Tt),Ae.push(Tt))}}return pe}function*W(te){const D=[te];for(;D.length;){const pe=D.pop();if(typeof pe=="object"&&pe)for(const[Ae,Qe]of Object.entries(pe))Ae==="$ref"&&typeof Qe=="string"?yield Qe.split("#")[0]:D.push(Qe)}}function Ce(te){const D=compileAjvSchema(te||entityEnvelopeSchema);return pe=>{if(D(pe)===!0)return pe;throw throwAjvError(D.errors)}}function Ve(te){const D=k(te);return pe=>{var Ae;if(D(pe)===!0)return pe;const Xe=(Ae=D.errors)===null||Ae===void 0?void 0:Ae.filter(Tt=>["/kind","/apiVersion"].includes(Tt.instancePath));if(Xe!=null&&Xe.length&&Xe.every(Tt=>Tt.keyword==="enum"))return!1;throw R(D.errors)}}function et(te){const D=compileAjvSchema(te||entitySchema);return pe=>{if(D(pe)===!0)return pe;throw throwAjvError(D.errors)}}class K{static isValidApiVersion(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(D)}static isValidObjectName(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(D)}static isValidNamespace(D){return ue.isValidDnsLabel(D)}static isValidLabelKey(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,K.isValidObjectName)}static isValidLabelValue(D){return D===""||K.isValidObjectName(D)}static isValidAnnotationKey(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,K.isValidObjectName)}static isValidAnnotationValue(D){return typeof D=="string"}}const tt={isValidApiVersion:K.isValidApiVersion,isValidKind:K.isValidKind,isValidEntityName:K.isValidObjectName,isValidNamespace:K.isValidNamespace,isValidLabelKey:K.isValidLabelKey,isValidLabelValue:K.isValidLabelValue,isValidAnnotationKey:K.isValidAnnotationKey,isValidAnnotationValue:K.isValidAnnotationValue,isValidTag:te=>typeof te=="string"&&te.length>=1&&te.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(te)};function dt(te={}){return{...tt,...te}}class Me{async enforce(D){function pe(j,J,Y){if(J==null)throw new Error(`${j} must have a value`);let ge;try{ge=Y(J)}catch(me){throw new Error(`${j} could not be validated, ${me}`)}if(!ge){let me;switch(Y.name){case"isValidLabelValue":case"isValidObjectName":me="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":me="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":me="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":me="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":me="a string";break;case"isValidKind":me="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":me="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":me="a non empty string";break;default:me=void 0;break}const Ue=me?` expected ${me} but found "${J}".`:"";throw new Error(`"${j}" is not valid;${Ue} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ae(j,J,Y){return J===void 0||pe(j,J,Y)}pe("apiVersion",D.apiVersion,this.validators.isValidApiVersion),pe("kind",D.kind,this.validators.isValidKind),pe("metadata.name",D.metadata.name,this.validators.isValidEntityName),Ae("metadata.namespace",D.metadata.namespace,this.validators.isValidNamespace);var Qe;for(const[j,J]of Object.entries((Qe=D.metadata.labels)!==null&&Qe!==void 0?Qe:[]))pe(`labels.${j}`,j,this.validators.isValidLabelKey),pe(`labels.${j}`,J,this.validators.isValidLabelValue);var Xe;for(const[j,J]of Object.entries((Xe=D.metadata.annotations)!==null&&Xe!==void 0?Xe:[]))pe(`annotations.${j}`,j,this.validators.isValidAnnotationKey),pe(`annotations.${j}`,J,this.validators.isValidAnnotationValue);var Tt;const Gt=(Tt=D.metadata.tags)!==null&&Tt!==void 0?Tt:[];for(let j=0;j<Gt.length;++j)pe(`tags.${j}`,Gt[j],this.validators.isValidTag);var an;const ne=(an=D.metadata.links)!==null&&an!==void 0?an:[];for(let j=0;j<ne.length;++j){var Q,se,g;pe(`links.${j}.url`,(Q=ne[j])===null||Q===void 0?void 0:Q.url,CommonValidatorFunctions.isValidUrl),Ae(`links.${j}.title`,(se=ne[j])===null||se===void 0?void 0:se.title,CommonValidatorFunctions.isNonEmptyString),Ae(`links.${j}.icon`,(g=ne[j])===null||g===void 0?void 0:g.icon,KubernetesValidatorFunctions.isValidObjectName)}return D}constructor(D=makeValidator()){_define_property(this,"validators",void 0),this.validators=D}}class ft{async enforce(D){if(!this.validate){const Qe=new Ajv({allowUnionTypes:!0});this.validate=Qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(D)===!0)return D;const[Ae]=this.validate.errors||[];throw Ae?new Error(`Malformed envelope, ${Ae.instancePath||"<root>"} ${Ae.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Ie(te){let D=te.indexOf(":");const pe=te.indexOf("/");pe!==-1&&pe<D&&(D=-1);const Ae=D===-1?void 0:te.slice(0,D),Qe=pe===-1?void 0:te.slice(D+1,pe),Xe=te.slice(Math.max(D+1,pe+1));if(Ae===""||Qe===""||Xe==="")throw new TypeError(`Entity reference "${te}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ae,namespace:Qe,name:Xe}}function lt(te){return{kind:te.kind,namespace:te.metadata.namespace||u,name:te.metadata.name}}function Et(te,D){if(!te)throw new Error("Entity reference must not be empty");const pe=D==null?void 0:D.defaultKind,Ae=(D==null?void 0:D.defaultNamespace)||u;let Qe,Xe,Tt;if(typeof te=="string"){const se=Ie(te);var Gt;Qe=(Gt=se.kind)!==null&&Gt!==void 0?Gt:pe;var an;Xe=(an=se.namespace)!==null&&an!==void 0?an:Ae,Tt=se.name}else{var ne;Qe=(ne=te.kind)!==null&&ne!==void 0?ne:pe;var Q;Xe=(Q=te.namespace)!==null&&Q!==void 0?Q:Ae,Tt=te.name}if(Qe)if(Xe){if(!Tt){const se=JSON.stringify(te);throw new Error(`Entity reference ${se} had missing or empty name`)}}else{const se=JSON.stringify(te);throw new Error(`Entity reference ${se} had missing or empty namespace`)}else{const se=JSON.stringify(te);throw new Error(`Entity reference ${se} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Qe,namespace:Xe,name:Tt}}function pt(te){let D,pe,Ae;if("metadata"in te){D=te.kind;var Qe;pe=(Qe=te.metadata.namespace)!==null&&Qe!==void 0?Qe:u,Ae=te.metadata.name}else{D=te.kind;var Xe;pe=(Xe=te.namespace)!==null&&Xe!==void 0?Xe:u,Ae=te.name}return`${D.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Ae.toLocaleLowerCase("en-US")}`}var mt=t(47842);class At{async enforce(D){let pe=D;for(const Ae of this.policies){const Qe=await Ae.enforce(pe);if(!Qe)throw new Error(`Policy ${Ae.constructor.name} did not return a result`);pe=Qe}return pe}constructor(D){(0,mt.Z)(this,"policies",void 0),this.policies=D}}class Nt{async enforce(D){for(const pe of this.policies){const Ae=await pe.enforce(D);if(Ae)return Ae}throw new Error("The entity did not match any known policy")}constructor(D){(0,mt.Z)(this,"policies",void 0),this.policies=D}}const ze={allOf(te){return new At(te)},oneOf(te){return new Nt(te)}};var qt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ve(te){let D;return{async check(pe){return D||(D=Ve(te)),D(pe)===pe}}}const he=ve(qt);var Ne=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 Je=ve(Ne);var wt=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 jt=ve(wt);var ot=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 St=ve(ot);var kt=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 zt=ve(kt),Bt="ownedBy",on="ownerOf",Wt="consumesApi",Vt="apiConsumedBy",Nn="providesApi",In="apiProvidedBy",ln="dependsOn",wn="dependencyOf",Fn="parentOf",Un="childOf",Mn="memberOf",Jn="hasMember",nt="partOf",zn="hasPart";var Pn=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 Wn=ve(Pn);var Sn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const sn=ve(Sn);var Ln=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 gn=ve(Ln),jn="backstage.io/managed-by-location",Vn="backstage.io/managed-by-origin-location",fe="backstage.io/source-location",oe=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function ke(te){if(typeof te!="string")throw new TypeError(`Unable to parse location ref '${te}', unexpected argument ${typeof te}`);const D=te.indexOf(":");if(D<0)throw new TypeError(`Unable to parse location ref '${te}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=te.substring(0,D).trim(),Ae=te.substring(D+1).trim();if(!pe||!Ae)throw new TypeError(`Unable to parse location ref '${te}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${te}', please prefix it with 'url:', e.g. 'url:${te}'`);if(oe.test(Ae))throw new TypeError(`Invalid location ref '${te}', target is a javascript: URL`);return{type:pe,target:Ae}}function Fe(te){const{type:D,target:pe}=te;if(D){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(oe.test(pe))throw new TypeError(`Invalid location ref '${D}:${pe}', target is a javascript: URL`);return`${D}:${pe}`}function Ke(te){var D,pe,Ae,Qe,Xe;const Tt=(Xe=(D=te.metadata)===null||D===void 0||(pe=D.annotations)===null||pe===void 0?void 0:pe[fe])!==null&&Xe!==void 0?Xe:(Ae=te.metadata)===null||Ae===void 0||(Qe=Ae.annotations)===null||Qe===void 0?void 0:Qe[jn];if(!Tt)throw new Error(`Entity '${pt(te)}' is missing location`);return ke(Tt)}},23196:function(bt,$e,t){"use strict";t.d($e,{Oi:function(){return he},VY:function(){return ht},yW:function(){return al},XF:function(){return wt},mn:function(){return Ke},NX:function(){return u},ub:function(){return se},mf:function(){return hl},yu:function(){return mn},h4:function(){return ja},M6:function(){return ar},i9:function(){return wl},aR:function(){return Ft},rJ:function(){return Or},Oh:function(){return Il},hu:function(){return Al},rU:function(){return tt},Qj:function(){return Me},nU:function(){return Pr},SA:function(){return zr},sk:function(){return rt},Or:function(){return oo},T3:function(){return Ea},g9:function(){return kl},Ex:function(){return br},Gk:function(){return h},tn:function(){return tr},Ph:function(){return yn},YE:function(){return js},v7:function(){return n},R6:function(){return Ps},tR:function(){return aa},uw:function(){return Yo},qt:function(){return oi},iA:function(){return wa},GB:function(){return Cn},po:function(){return pr},mZ:function(){return vo},Pf:function(){return Wo}});var u={};t.r(u),t.d(u,{Nm:function(){return jt},ht:function(){return kt},LJ:function(){return St}});var r=t(52322),z=t(60871),P=t(19928),m=t(2784);function y(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,C=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(de=>a(le=>le.concat(de)));return()=>{N.unsubscribe()}},[d]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const N=setTimeout(()=>{a(de=>{const le=de.filter(Se=>Se!==U);return le.length===de.length?de:le})},C);return()=>clearTimeout(N)}},[U,C]),o.length===0)return null;const H=()=>{a(N=>N.filter(de=>de!==U))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:H,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:U.severity,children:_jsxs(Typography,{component:"span",children:[String(U.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var c=t(79692);const $=(0,c.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function we(e){const{displayName:o,picture:a,customStyles:d}=e,p=$();let v={...d};const C={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:C,children:extractInitials(o)})})}var ue=t(77277),G=t(86689),Z=t(90436),S=t(72779),V=t.n(S),re=t(76635),q=t(79635),_=t(39857);function B(){const[e]=(0,q.is)((0,r.jsx)(q.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const R=(0,c.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),k=e=>/^([a-z+.-]+):/.test(e),L=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,W=window.open;if(W&&!W.__backstage){const e=function(...a){const d=String(a[0]);if(L.test(d))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return W.apply(this,a)};e.__backstage=!0,window.open=e}const Ce=()=>{try{return(0,z.h_)(z.Ds).getOptionalString("app.baseUrl")}catch{return}},Ve=()=>{const e="http://sample.dev";var o;const a=(o=Ce())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,re.trimEnd)(d,"/")},et=e=>{let o=String(e);const a=Ve(),d=k(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},K=e=>{if(e instanceof Array)return e.map(K).join(" ").trim();if(typeof e=="object"&&e){var o;return K(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},tt=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=R(),v=(0,z.z$)(),C=B()?et(a.to):a.to,U=K(a.children)||C,H=k(C),N=H&&!!/^https?:/.exec(C);if(L.test(C))throw new Error("Link component rejected javascript: URL as a security precaution");const de=le=>{e==null||e(le),o||v.captureEvent("click",U,{attributes:{to:C}})};return H?(0,r.jsxs)(G.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:C,onClick:de,className:V()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(Z.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(G.Z,{...a,ref:d,component:_.rU,to:C,onClick:de})}),dt=m.forwardRef((e,o)=>(0,r.jsx)(tt,{ref:o,...e,color:"initial"})),Me=m.forwardRef((e,o)=>(0,r.jsx)(ue.Z,{ref:o,component:dt,...e})),ft=null;var Ie=t(95544),lt=t(60364),Et=t(83229),pt=t(26639),mt=t(39595),At=t(61837),Nt=t(80030),ze=t(19353),qt=t(95074);function ve(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),[C,U]=(0,m.useState)(!1),[{error:H},N]=(0,qt.Z)();(0,m.useEffect)(()=>{H&&v.post(H)},[H,v]);const de=le=>{le.stopPropagation(),U(!0),N(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Nt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>U(!1),open:C,children:(0,r.jsx)(At.Z,{onClick:de,"aria-label":p,children:(0,r.jsx)(ze.Z,{})})})})}function he(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:C=!1}=e,U=(0,lt.Z)(),H=U.palette.type==="dark"?pt.Z:mt.Z,N=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Ie.Z,{position:"relative",children:[(0,r.jsx)(Et.Z,{customStyle:v,language:a,style:H,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:de=>p!=null&&p.includes(de)?{style:{backgroundColor:N}}:{},children:o}),C&&(0,r.jsx)(Ie.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(ve,{text:o})})]})}var Ne=t(41156),Je=t(88188);function wt(e){const{title:o,to:a}=e,d=(0,Ne.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(At.Z,{component:_.rU,color:"primary",title:o,size:"small",to:a,children:(0,r.jsx)(Je.Z,{})}):(0,r.jsx)(ue.Z,{component:_.rU,variant:"contained",color:"primary",to:a,children:o}):null}var jt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(jt||(jt={}));var ot;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ot||(ot={}));var St;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(St||(St={}));var kt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(kt||(kt={}));var zt=t(27397),Bt=t(11105),on=t(97963),Wt=t(46506),Vt=t.n(Wt),Nn=t(54073),In=t.n(Nn),ln=t(10368);const wn=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Fn({node:{id:e}}){const o=wn(),[a,d]=m.useState(0),[p,v]=m.useState(0),C=m.useRef(null);m.useLayoutEffect(()=>{if(C.current){let{height:de,width:le}=C.current.getBBox();de=Math.round(de),le=Math.round(le),(de!==p||le!==a)&&(d(le),v(de))}},[a,p]);const U=10,H=a+U*2,N=p+U*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:H,height:N,rx:10}),(0,r.jsx)("text",{ref:C,className:o.text,y:N/2,x:H/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",Mn="node",Jn="edge",nt="label",zn=(0,ln.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Pn=e=>(0,r.jsx)(Fn,{...e});function Wn({render:e=Pn,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:C=0}=a,U=a,H=zn(),N=m.useRef(null);return m.useLayoutEffect(()=>{if(N.current){let{height:de,width:le}=N.current.getBBox();de=Math.round(de),le=Math.round(le),(de!==p||le!==d)&&o(a.id,{...a,height:de,width:le})}},[a,d,p,o]),(0,r.jsx)("g",{ref:N,"data-testid":Mn,className:H.node,transform:`translate(${v-d/2},${C-p/2})`,children:e({node:U})})}var Sn=t(76985),sn=t(39829),Ln=t(19574),gn=t.n(Ln);const jn=(0,ln.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Vn({edge:{label:e}}){const o=jn();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const fe=(0,ln.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"}),oe=e=>(0,r.jsx)(Vn,{...e});function ke({render:e=oe,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:C=0,width:U,height:H,points:N}=d,de=d,le=fe(),Se=m.useRef(null);m.useLayoutEffect(()=>{if(Se.current){let{height:Ye,width:Pt}=Se.current.getBBox();Ye=Math.round(Ye),Pt=Math.round(Pt),(Ye!==H||Pt!==U)&&o(a,{...d,height:Ye,width:Pt})}},[d,H,U,o,a]);let Pe="";const We=m.useMemo(()=>Sn.Z().x(Ye=>Ye.x).y(Ye=>Ye.y).curve(sn[p]),[p]);if(N){const Ye=N.filter(Pt=>gn()(Pt.x)&&gn()(Pt.y));Pe=We(Ye)||""}return(0,r.jsxs)(r.Fragment,{children:[Pe&&(0,r.jsx)("path",{"data-testid":Jn,className:le.path,d:Pe}),de.label?(0,r.jsx)("g",{ref:Se,"data-testid":nt,className:le.label,transform:`translate(${v},${C})`,children:e({edge:de})}):null]})}const Fe="workspace";function Ke(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:C=jt.TOP_BOTTOM,align:U,nodeMargin:H=50,edgeMargin:N=10,rankMargin:de=50,paddingX:le=0,paddingY:Se=0,acyclicer:Pe,ranker:We=St.NETWORK_SIMPLEX,labelPosition:Ye=kt.RIGHT,labelOffset:Pt=10,edgeRanks:Jt=1,edgeWeight:nn=1,renderLabel:rn,defs:Lt,zoom:_t="enabled",curve:Qt="curveMonotoneX",fit:wr="grow",...jr}=e,Er=(0,on.Z)(),[Ar,Li]=m.useState(100),[$r,ki]=m.useState(100),Xt=m.useRef(new(Vt()).graphlib.Graph),[Co,Ls]=m.useState(((o=Xt.current.graph())===null||o===void 0?void 0:o.width)||0),[Dr,Oi]=m.useState(((a=Xt.current.graph())===null||a===void 0?void 0:a.height)||0),[$n,yr]=m.useState([]),[Xr,qr]=m.useState([]),dn=Math.max(Co,Ar),bn=Math.max(Dr,$r),wo=Math.min(Dr,$r),_r=wr==="grow"?bn:wo,Xo=m.useMemo(()=>In()(fn=>{if(!fn)return;const Dn=Bt.Z(fn),un=Bt.Z(fn.getElementById(Fe));function fr(){Dn.call(zt.sP().scaleExtent([1,10]).on("zoom",Tr=>{Tr.transform.x=Math.min(0,Math.max(Tr.transform.x,dn-dn*Tr.transform.k)),Tr.transform.y=Math.min(0,Math.max(Tr.transform.y,bn-bn*Tr.transform.k)),un.attr("transform",Tr.transform)}))}_t==="enabled"?fr():_t==="enable-on-click"&&Dn.on("click",()=>fr());const{width:gr,height:ks}=fn.getBoundingClientRect();Ar!==gr&&Li(gr),$r!==ks&&ki(ks)},100),[$r,Ar,dn,bn,_t]),ka=m.useCallback(()=>{const fn=Xt.current.nodes(),Dn=Xt.current.edges();fn.forEach(un=>{p.some(gr=>gr.id===un)||Xt.current.removeNode(un)}),Dn.forEach(un=>{d.some(gr=>gr.from===un.v&&gr.to===un.w)||Xt.current.removeEdge(un.v,un.w)}),p.forEach(un=>{const fr=Xt.current.nodes().find(gr=>un.id===gr);if(fr&&Xt.current.node(fr)){const{width:gr,height:ks,x:Tr,y:Xl}=Xt.current.node(fr);Xt.current.setNode(fr,{...un,width:gr,height:ks,x:Tr,y:Xl})}else Xt.current.setNode(un.id,{...un,width:0,height:0})}),d.forEach(un=>{Xt.current.setEdge(un.from,un.to,{...un,label:un.label,width:0,height:0,labelpos:Ye,labeloffset:Pt,weight:nn,minlen:Jt})})},[d,p,Ye,Pt,nn,Jt]),qo=m.useMemo(()=>In()(()=>{Vt().layout(Xt.current);const{height:fn,width:Dn}=Xt.current.graph(),un=Math.max(0,fn||0),fr=Math.max(0,Dn||0);Ls(fr),Oi(un),yr(Xt.current.nodes()),qr(Xt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Xt.current.setGraph({rankdir:C,align:U,nodesep:H,edgesep:N,ranksep:de,marginx:le,marginy:Se,acyclicer:Pe,ranker:We}),ka(),qo(),qo.cancel),[Pe,U,C,N,le,Se,H,de,We,ka,qo]);function Jl(fn,Dn){return Xt.current.setNode(fn,Dn),qo(),Xt.current}function Ql(fn,Dn){return Xt.current.setEdge(fn,Dn),qo(),Xt.current}return(0,r.jsxs)("svg",{ref:Xo,...jr,width:"100%",height:_r,viewBox:`0 0 ${dn} ${bn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Un,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:Er.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Lt]}),(0,r.jsx)("g",{id:Fe,children:(0,r.jsxs)("svg",{width:Co,height:Dr,y:bn/2-Dr/2,x:dn/2-Co/2,viewBox:`0 0 ${Co} ${Dr}`,children:[Xr.map(fn=>{const Dn=Xt.current.edge(fn);return Dn?(0,r.jsx)(ke,{id:fn,setEdge:Ql,render:rn,edge:Dn,curve:Qt},`${fn.v}-${fn.w}`):null}),$n.map(fn=>{const Dn=Xt.current.node(fn);return Dn?(0,r.jsx)(Wn,{setNode:Jl,render:v,node:Dn},fn):null})]})})]})}var te;const D=(0,c.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(te=e.palette.banner.warning)!==null&&te!==void 0?te:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),pe=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=D(),U=useApi(storageApiRef).forBucket("notifications");var H;const N=(H=U.snapshot("dismissedBanners").value)!==null&&H!==void 0?H:[],[de,le]=useState(new Set(N)),Se=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(Se!=null&&Se.value){var We;const Ye=(We=Se==null?void 0:Se.value)!==null&&We!==void 0?We:[];le(new Set(Ye))}},[Se==null?void 0:Se.value]);const Pe=()=>{U.set("dismissedBanners",[...de,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!de.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:Pe,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Ae=t(60905),Qe=t.p+"static/missingAnnotation.67f79e98..svg",Xe=t.p+"static/noInformation.4b426325..svg",Tt=t.p+"static/createComponent.975d1e1e..svg",Gt=t.p+"static/noBuild.1715fa71..svg";const an=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),ne=({missing:e})=>{const o=an();switch(e){case"field":return(0,r.jsx)("img",{src:Qe,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:Xe,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:Tt,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Gt,alt:"no Build",className:o.generalImg});default:return null}},Q=(0,c.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function se(e){const{title:o,description:a,missing:d,action:p}=e,v=Q();return(0,r.jsxs)(Ae.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Ae.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Ae.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Ae.Z,{item:!0,xs:!0,children:(0,r.jsx)(Z.Z,{variant:"h5",children:o})}),(0,r.jsx)(Ae.Z,{item:!0,xs:!0,children:(0,r.jsx)(Z.Z,{variant:"body1",children:a})}),(0,r.jsx)(Ae.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Ae.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)(ne,{missing:d}):d.customImage})]})}const g=`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`,j=/^.*ANNOTATION.*$/m,J=g.match(j)[0],Y=g.split(`
12
- `).findIndex(e=>j.test(e)),ge=(0,c.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function me(e){return Array.from(Array(e+1).keys(),o=>o+Y)}function Ue(e){const o=e.map(a=>J.replace("ANNOTATION",a)).join(`
13
- `);return g.replace(J,o)}function it(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(a=>(0,r.jsx)("code",{children:a})).reduce((a,d)=>(0,r.jsxs)(r.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 rt(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=ge();return(0,r.jsx)(se,{missing:"field",title:"Missing Annotation",description:it(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(Ie.Z,{className:v.code,children:(0,r.jsx)(he,{text:Ue(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:me(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ue.Z,{color:"primary",component:tt,to:p,children:"Read more"})]})})}var yt=t(11776),at=t(38402),qe=t(49378),Ze=t(41128),$t=t(27616),Ht=t(8284),Rt=t(70660),It=t(91750),en=t(38016);const Dt=(e,o)=>(o.palette.type==="light"?Ze._j:Ze.$n)(o.palette[e].light,.6),vt=(e,o)=>(o.palette.type==="light"?Ze.$n:Ze._j)(o.palette[e].light,.9),_e=(0,c.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Dt(o,e)}})),Ot=({severity:e})=>{const o=_e({severity:e});return(0,r.jsx)(It.Z,{classes:o})},tn=({severity:e})=>{const o=_e({severity:e});return(0,r.jsx)(en.Z,{classes:o})},En=(0,c.Z)(e=>({panel:{backgroundColor:({severity:o})=>vt(o,e),color:({severity:o})=>Dt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Dt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Dt(o,e),backgroundColor:({severity:o})=>vt(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"}),cn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Cn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:v}=e,C=En({severity:o}),U=cn(o)+(a?`: ${a}`:"");return(0,r.jsxs)($t.Z,{defaultExpanded:v!=null?v:!1,className:C.panel,role:"alert",children:[(0,r.jsxs)(Ht.Z,{expandIcon:(0,r.jsx)(tn,{severity:o}),className:C.summary,children:[(0,r.jsx)(Ot,{severity:o}),(0,r.jsx)(Z.Z,{className:C.summaryText,variant:"subtitle1",children:U})]}),(d||p)&&(0,r.jsx)(Rt.Z,{children:(0,r.jsxs)(Ae.Z,{container:!0,children:[d&&(0,r.jsx)(Ae.Z,{item:!0,xs:12,children:(0,r.jsx)(Z.Z,{className:C.message,variant:"body1",children:d})}),p&&(0,r.jsx)(Ae.Z,{item:!0,xs:12,className:C.details,children:p})]})})]})}const Qn=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),kn=({error:e,message:o,stack:a,children:d})=>{const p=Qn();return(0,r.jsxs)(yt.Z,{dense:!0,children:[(0,r.jsxs)(at.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(ve,{text:e})]}),(0,r.jsxs)(at.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,r.jsx)(ve,{text:o})]}),a&&(0,r.jsxs)(at.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(ve,{text:a})]}),d]})};function mn(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(Cn,{severity:"error",title:o!=null?o:a.message,defaultExpanded:d,children:(0,r.jsx)(kn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var rr=t(85256);const w=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function h(e){var o;const{title:a,error:d,defaultExpanded:p}=e,v=w();if(d.name!=="ResponseError")return(0,r.jsx)(mn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:C,cause:U}=d,{request:H,response:N}=C,de=`${N.statusCode}: ${U.name}`,le=H&&`${H.method} ${H.url}`,Se=U.message.replace(/\\n/g,`
14
- `),Pe=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
15
- `),We=JSON.stringify(C,void 0,2);return(0,r.jsxs)(mn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:de,message:Se,stack:Pe},children:[le&&(0,r.jsxs)(at.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qe.Z,{classes:{secondary:v.text},primary:"Request",secondary:H?`${le}`:void 0}),(0,r.jsx)(ve,{text:le})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rr.Z,{component:"li",className:v.divider}),(0,r.jsx)(at.Z,{alignItems:"flex-start",children:(0,r.jsx)(qe.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(he,{language:"json",text:We,showCopyCodeButton:!0})]})]})}var x=t(28316);function E(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function X(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function be(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||E(e);return p||X(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 je=null;const Ee="core.calloutSeen";function ut(){const[e,o]=useState(()=>{const d=localStorage.getItem(Ee);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(Ee),U={...v?JSON.parse(v):{},[d]:p};o(U),localStorage.setItem(Ee,JSON.stringify(U))},[]);return{states:e,setState:a}}function Mt(e){const{states:o,setState:a}=ut(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function hn(e){const{seen:o,markSeen:a}=Mt(e);return{show:o===!1,hide:a}}const Hn=(0,c.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function xr(e){const{featureId:o,title:a,description:d,children:p}=e,{show:v,hide:C}=useShowCallout(o),U=usePortal("core.callout"),H=useRef(null),[N,de]=useState(),le=Hn(),Se=useCallback(()=>{if(H.current){const Pe=H.current.getBoundingClientRect(),We=Math.max(Pe.width,Pe.height),Ye=800,Pt=Pe.x-(We-Pe.width)/2-Ye,Jt=Pe.y-(We-Pe.height)/2-Ye,nn=We+2*Ye,rn=450,Lt=Pe.x+Pe.width/2-rn,_t=Pe.y-(We-Pe.height)/2+We+20;de({dotLeft:Pt,dotTop:Jt,dotSize:nn,borderWidth:Ye,textTop:_t,textLeft:Lt,textWidth:rn})}},[]);return useEffect(()=>(window.addEventListener("resize",Se),window.addEventListener("scroll",Se),()=>{window.removeEventListener("resize",Se),window.removeEventListener("scroll",Se)}),[Se]),useLayoutEffect(Se,[H.current,Se]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:le.featureWrapper,ref:H,children:p}),createPortal(_jsx(Box,{className:le.backdrop,children:_jsx(ClickAwayListener,{onClickAway:C,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:le.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:C,onKeyDown:C,role:"button",tabIndex:0,children:_jsx(Box,{className:le.pulseCircle})}),_jsxs(Box,{className:le.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),U)]}):_jsx(_Fragment,{children:p})}var Rr=t(35292);const Ir=(0,c.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function eo({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,r.jsx)(Rr.Z,{}),label:p,onClick:v,title:C}){const U=Ir();return o?(0,r.jsxs)(Ie.Z,{title:C,className:V()(U.link,U.disabled),children:[d,(0,r.jsx)(Z.Z,{variant:"caption",component:"span",className:U.label,children:p})]}):(0,r.jsxs)(tt,{title:C,className:V()(U.link,U[e]),to:a,onClick:v,children:[d,(0,r.jsx)(Z.Z,{variant:"caption",component:"span",className:U.label,children:p})]})}const jo=(0,c.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ar(e){const{links:o}=e,a=jo();return(0,r.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,r.jsx)(eo,{...d},p+1))})}const Gn=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
- `},Xn=100,lr=10,Nr=(0,c.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Xn,height:`calc(100% + ${lr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-lr,background:`linear-gradient(90deg, ${Gn(e.palette.type)})`},fadeRight:{right:-lr,background:`linear-gradient(270deg, ${Gn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Eo(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 C=p.scrollLeft,U=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([C,U])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,a]}function mr(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),C=requestAnimationFrame(U=>{if(!e.current)return;const H=U-v,N=Math.abs(d)*H/o,le=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:le});const Se=d-le;Math.sign(d)!==Math.sign(Se)?p(0):p(Se)});return()=>cancelAnimationFrame(C)},[e,d,o,a]),p}function _o(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,C=Nr(e),U=React.useRef(),[H,N]=Eo(U),de=mr(U,a,d),le=Se=>{U.current&&de(Se?o:-o)};return _jsxs(Box,{...v,className:C.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:C.container,ref:U,children:p}),_jsx(Box,{className:classNames(C.fade,C.fadeLeft,{[C.fadeHidden]:H===0})}),_jsx(Box,{className:classNames(C.fade,C.fadeRight,{[C.fadeHidden]:N===0})}),H>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>le(!1),className:classNames(C.button,C.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>le(!0),className:classNames(C.button,C.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ao=(0,c.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function to(e){const o=Ao(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 qn=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Pr(e){const{Progress:o}=(0,z.qD)().getComponents();return(0,r.jsx)(m.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(qn,{...e})})}var Lr=t(28865),To=t(60251);const Fr=(0,c.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Ur=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(Ur,e):e,cr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(Ur,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},Mr={code:({inline:e,className:o,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,r.jsx)(he,{language:v[1],text:p}):(0,r.jsx)("code",{className:o,...d,children:a})},h1:cr,h2:cr,h3:cr,h4:cr,h5:cr,h6:cr};function zr(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:C}=e,U=Fr();return(0,r.jsx)(Lr.D,{remarkPlugins:a==="gfm"?[To.Z]:[],className:`${U.markdown} ${C}`,children:o,components:Mr,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var Ro=t(23054);const Io=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Po=({request:e,busy:o,setBusy:a})=>{const d=Io(),[p,v]=useState(),C=async()=>{a(!0);try{await e.trigger()}catch(H){v(isError(H)?H.message:"An unspecified error occurred")}finally{a(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:C,children:"Log in"})]})};var Lo=null;const no=(0,c.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function es(e){const o=no(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useApi(configApiRef);var C;const U=(C=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&C!==void 0?C:!1,H=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),N=()=>{H.forEach(de=>de.reject())};return _jsxs(Dialog,{open:Boolean(H.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),U?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:H.map(de=>_jsx(LoginRequestListItem,{request:de,busy:a,setBusy:d},de.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:N,children:"Reject All"})})]})}var vr=t(15277),ko=t.n(vr),ro=t(29862);const Oo=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function oo(e){const[o,a]=(0,m.useState)(!1),d=(0,ro.t)(),p=Oo(),v=U=>{d()&&a(U)};var C;return(0,r.jsx)(Nt.ZP,{title:(C=e.title)!==null&&C!==void 0?C:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(ko(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var dr=t(67358);function br(e){const o=(0,lt.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,r.jsx)(dr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Ie.Z,{display:"none"})}var Zo=t(94339),Wr=t(14503),Bo=t(24579),kr=t(32552),Kt=t(15459),ts=t(27597);const $o=(0,c.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function ns(e){const{link:o,title:a,onClick:d}=e,p=$o();return(0,r.jsxs)(Ie.Z,{children:[(0,r.jsx)(rr.Z,{}),(0,r.jsx)(tt,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(Ie.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(Ie.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Z.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(ts.Z,{className:p.arrow})]})})]})}const rs=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(Z.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(Z.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(Me,{to:o.href,variant:"contained",children:o.name})},os=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,r.jsx)(mn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(rs,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ss=(0,c.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),is=(0,Kt.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Wr.Z),or={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 Or(e){const{title:o,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:C,variant:U,children:H,headerStyle:N,headerProps:de,icon:le,action:Se,actionsClassName:Pe,actions:We,cardClassName:Ye,actionsTopRight:Pt,className:Jt,noPadding:nn,titleTypographyProps:rn}=e,Lt=ss();let _t={},Qt={};U&&U.split(/[\s]+/g).forEach(Ar=>{_t={..._t,...or.card[Ar]},Qt={...Qt,...or.cardContent[Ar]}});const wr=()=>!a&&!le?null:(0,r.jsxs)("div",{className:Lt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:Lt.subheader,children:a}),le]}),jr=C||(v?{slackChannel:v}:{});return(0,r.jsx)(Zo.Z,{style:_t,className:Jt,children:(0,r.jsxs)(os,{...jr,children:[o&&(0,r.jsx)(kr.Z,{classes:{root:Lt.header,title:Lt.headerTitle,subheader:Lt.headerSubheader,avatar:Lt.headerAvatar,action:Lt.headerAction,content:Lt.headerContent},title:o,subheader:wr(),action:Se,style:{...N},titleTypographyProps:rn,...de}),Pt&&(0,r.jsx)(is,{children:Pt}),d&&(0,r.jsx)(rr.Z,{}),(0,r.jsx)(Bo.Z,{className:V()(Ye,{[Lt.noPadding]:nn}),style:Qt,children:H}),We&&(0,r.jsx)(Wr.Z,{className:Pe,children:We}),p&&(0,r.jsx)(ns,{...p})]})})}var as=t(39307);const Do=(0,c.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),so={fractional:!0,inverse:!1,unit:"%",max:100},Vr=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||so.max,v=a?p-o:o;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function b(e){const[o,a]=useState(null),{getColor:d=Vr}=e,p=Do(e),{palette:v}=useTheme(),{value:C,fractional:U,inverse:H,unit:N,max:de,description:le}={...so,...e},Se=U?Math.round(C*de):C,Pe=de!==100?Math.round(C):Se,[We,Ye]=useState(!1);return useEffect(()=>{const Pt=o,Jt=()=>Ye(!0),nn=()=>Ye(!1);return Pt&&le?(Pt.addEventListener("mouseenter",Jt),Pt.addEventListener("mouseleave",nn),()=>{Pt.removeEventListener("mouseenter",Jt),Pt.removeEventListener("mouseleave",nn)}):()=>{Ye(!1)}},[le,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Se,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Pe,inverse:H,max:de}),className:p.circle}),le&&We?_jsx(Box,{className:p.description,children:le}):_jsx(Box,{className:p.overlay,children:isNaN(C)?"N/A":`${Pe}${N}`})]})}const A=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function I(e){const o=A(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:C,description:U,icon:H,variant:N,getColor:de}=e,le={inverse:v,description:U,getColor:de,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:C,variant:N,icon:H,children:_jsx(Gauge,{...le})})})}function F(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 ee=t(21324),ce=t(7089),ie=t(1292),ye=t(42494),Re=t(74603),Le=t(56939),Be=t(12231),xe=t(73698),He=t(12420),ct=t(72379);const st=(0,c.Z)(e=>(0,He.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var gt=()=>{const e=st();return(0,r.jsx)(ct.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Zt=(0,c.Z)(e=>(0,He.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Yt=()=>{const e=Zt();return(0,r.jsx)(ct.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const An=(0,Kt.Z)(e=>(0,He.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"})(Re.Z),pn=(0,c.Z)(e=>(0,He.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 yn(e){const{multiple:o,items:a,label:d,placeholder:p,selected:v,onChange:C,triggerReset:U,native:H=!1,disabled:N=!1,margin:de}=e,le=pn(),[Se,Pe]=(0,m.useState)(v||(o?[]:"")),[We,Ye]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Pe(o?[]:"")},[U,o]),(0,m.useEffect)(()=>{v!==void 0&&Pe(v)},[v]);const Pt=Lt=>{Pe(Lt.target.value),C(Lt.target.value)},Jt=Lt=>{if(N){Lt.preventDefault();return}Ye(_t=>o&&!(Lt.target instanceof HTMLElement)?!0:!_t)},nn=()=>{Ye(!1)},rn=Lt=>()=>{const _t=Se.filter(Qt=>Qt!==Lt);Pe(_t),C(_t)};return(0,r.jsx)(Ie.Z,{className:le.root,children:(0,r.jsx)(ie.Z,{onClickAway:nn,children:(0,r.jsxs)(ye.Z,{className:le.formControl,children:[(0,r.jsx)(Le.Z,{className:le.formLabel,children:d}),(0,r.jsxs)(xe.Z,{"aria-label":d,value:Se,native:H,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:o,margin:de,onChange:Pt,onClick:Jt,open:We,input:(0,r.jsx)(An,{}),label:d,tabIndex:0,renderValue:Lt=>{var _t;return o&&Se.length!==0?(0,r.jsx)(Ie.Z,{className:le.chips,children:Lt.map(Qt=>{var wr,jr;return(0,r.jsx)(ce.Z,{label:(wr=a.find(Er=>Er.value===Qt))===null||wr===void 0?void 0:wr.label,clickable:!0,onDelete:rn(Qt),className:le.chip},(jr=a.find(Er=>Er.value===Qt))===null||jr===void 0?void 0:jr.value)})}):(0,r.jsx)(Z.Z,{children:Se.length===0?p||"":(_t=a.find(Qt=>Qt.value===Lt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>We?(0,r.jsx)(Yt,{}):(0,r.jsx)(gt,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,r.jsx)(Be.Z,{value:[],children:p}),H?a&&a.map(Lt=>(0,r.jsx)("option",{value:Lt.value,children:Lt.label},Lt.value)):a&&a.map(Lt=>(0,r.jsxs)(Be.Z,{value:Lt.value,children:[o&&(0,r.jsx)(ee.Z,{color:"primary",checked:Se.includes(Lt.value)||!1,className:le.checkbox}),Lt.label]},Lt.value))]})]})})})}const xn=()=>{},Zr=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:xn,stepHistory:[],setStepHistory:xn,onStepChange:xn});function Hr(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,C]=useState(p),[U,H]=useState([0]);useEffect(()=>{C(p)},[p]);const N=[];let de;return Children.forEach(o,le=>{isValidElement(le)&&(le.props.end?de=le:N.push(le))}),_jsxs(_Fragment,{children:[_jsx(Zr.Provider,{value:{stepIndex:v,setStepIndex:C,stepHistory:U,setStepHistory:H,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:N})}),v>=Children.count(o)-1&&de]})}const Gr=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Tn=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),On=({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")}),Sr=({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"}),Os=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Zi=({actions:e={},children:o})=>{const a=Gr(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:C,setStepHistory:U,onStepChange:H}=useContext(VerticalStepperContext),N=(Pe,We)=>{We&&We(),H&&H(p,Pe),v(Pe)},de=()=>{const Pe=e.nextStep?e.nextStep(p,d-1):p+1;N(Pe,e.onNext),U([...C,Pe])},le=()=>{C.pop(),N(C[C.length-1],e.onBack),U([...C])},Se=()=>{N(0,e.onRestart),U([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Os,{text:e.backText,handleClick:le,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Sr,{text:e.skipText,handleClick:de,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(On,{text:e.nextText,handleClick:de,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Tn,{text:e.restartText,handleClick:Se,stepIndex:p}),o]})},Zs=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Bi(e){const{title:o,children:a,end:d,actions:p,...v}=e,C=Zs();return d?_jsxs(Box,{className:C.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 Cr=(0,c.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Bs(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function $i(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Di(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ni(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function $s(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function ur(e){const o=Cr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var hr=t(74600),_n=t(15584);const No=e=>(0,He.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ds={root:{border:"0",verticalAlign:"top"}},Ns=e=>(0,He.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Fs=e=>(0,He.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Us=(0,Kt.Z)(No,{name:"BackstageMetadataTableTitleCell"})(_n.Z),ls=(0,Kt.Z)(Ds,{name:"BackstageMetadataTableCell"})(_n.Z),Ms=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Fi=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(Us,{children:e}),_jsx(ls,{colSpan:e?1:2,...a,children:o})]}),cs=(0,Kt.Z)(Ns,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(yt.Z,{disablePadding:!0,className:e.root,children:o})),Ui=(0,Kt.Z)(Fs,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(at.Z,{className:e.root,children:o})),ds=(0,He.Z)({root:{margin:"0 0",listStyleType:"none"}}),us=e=>(0,He.Z)({root:{...ds.root,paddingLeft:e.spacing(1)}}),Fo=(0,Kt.Z)(ds,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(cs,{classes:e,children:o})),hs=(0,Kt.Z)(us,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(cs,{classes:e,children:o}));function zs(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:ao(d)},p));return o?_jsx(hs,{children:a}):_jsx(Fo,{children:a})}function io(e,o,a){const d=Object.keys(e).map(p=>{const v=ao(e[p],!0),C=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${C}: `}),v]},p)});return o?_jsx(hs,{children:d}):_jsx(Fo,{children:d})}function ao(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?io(e,o,a):Array.isArray(e)?zs(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ws=({value:e,options:o})=>_jsx(Fragment,{children:ao(e,o)}),Vs=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ws,{value:o,options:a})});function Mi(e,o){return Object.keys(e).map(a=>_jsx(Vs,{title:a,value:e[a],options:o},a))}function Kr(e){const{metadata:o,dense:a=!0,options:d}=e,p=Mi(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Hs=t(49429),Zn=t(86136),Gs=t(79784),zi=t(19126),Ks=t.n(zi);function Ys(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,o){return Js(e)[o]}function Uo(e,o,a){const d={...Js(e),[o]:a};return Ys(d)}function Wi(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[v,C]=useState(Qs(p,e));return useEffect(()=>{const U=Qs(p,e);C(H=>isEqual(U,H)?H:U)},[p,C,e]),useDebouncedEffect(()=>{const U=Uo(p,e,v);p!==U&&d(U,{replace:!0})},[d,v,p,e],o),[v,C]}const lo={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 Yr(){const o=(0,z.I_)().get(z.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return lo;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 co=t(80079);function er(e,o){const d=(0,z.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(co.Z,{...o})}function Xs(e){return er("brokenImage",e)}function _s(e){return er("catalog",e)}function Vi(e){return er("chat",e)}function Hi(e){return er("dashboard",e)}function Gi(e){return er("docs",e)}function Ki(e){return er("email",e)}function Yi(e){return er("github",e)}function Oa(e){return er("group",e)}function uo(e){return er("help",e)}function Ji(e){return er("user",e)}function ps(e){return er("warning",e)}const ei=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ti=({icon:e})=>{const o=(0,z.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:uo;return(0,r.jsx)(d,{})};var ho;const ni=({link:e})=>(0,r.jsx)(tt,{to:e.url,children:(ho=e.title)!==null&&ho!==void 0?ho:e.url}),ri=({item:e})=>{var o;return(0,r.jsxs)(at.Z,{children:[(0,r.jsx)(Zn.Z,{children:(0,r.jsx)(ti,{icon:e.icon})}),(0,r.jsx)(qe.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(ni,{link:d},d.url)],[])})]})};function oi(e){const{title:o,items:a,children:d}=e,{items:p}=Yr(),[v,C]=(0,m.useState)(!1),[U,H]=(0,m.useState)(null),N=ei(),de=(0,Ne.Z)(Pe=>Pe.breakpoints.down("sm")),le=Pe=>{H(Pe.currentTarget),C(!0)},Se=()=>{C(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ie.Z,{display:"flex",ml:1,children:de?(0,r.jsx)(At.Z,{color:"primary",size:"small",onClick:le,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(uo,{})}):(0,r.jsx)(ue.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:le,startIcon:(0,r.jsx)(uo,{}),children:"Support"})}),(0,r.jsxs)(Gs.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Se,children:[(0,r.jsxs)(yt.Z,{className:N.popoverList,children:[o&&(0,r.jsx)(at.Z,{alignItems:"flex-start",children:(0,r.jsx)(Z.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(Pe,We)=>(0,r.jsx)(at.Z,{alignItems:"flex-start",children:Pe},`child-${We}`)),(a!=null?a:p).map((Pe,We)=>(0,r.jsx)(ri,{item:Pe},`item-${We}`))]}),(0,r.jsx)(Hs.Z,{children:(0,r.jsx)(ue.Z,{color:"primary",onClick:Se,"aria-label":"Close",children:"Close"})})]})]})}var Mo=t(18671),fs=t(27381);const po=72,gs=24,ms=18,pr={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-gs*2,iconPadding:gs,selectedIndicatorWidth:3,userBadgePadding:ms,userBadgeDiameter:po-ms*2,mobileSidebarHeight:56},vs=e=>({...pr,...e,iconContainerWidth:pr.drawerWidthClosed,iconSize:pr.drawerWidthClosed-pr.iconPadding*2,userBadgeDiameter:pr.drawerWidthClosed-pr.userBadgePadding*2}),fo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:pr.defaultOpenDelayMs+200},si=e=>({...fo,...e}),Qi="@backstage/core/sidebar-intro-dismissed",sr=(0,m.createContext)({sidebarConfig:pr,submenuConfig:fo}),ys=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Xi=t(50023),go=t(4190),qi=t(87685),_i=t(44882),mo=t(51837);const xs={isOpen:!1,setOpen:()=>{}},zo=(0,m.createContext)(xs),ii=(0,mo.CT)("sidebar-open-state-context");function ai(e){const{children:o,value:a}=e;return(0,r.jsx)(zo.Provider,{value:a,children:(0,r.jsx)(ii.Provider,{value:(0,mo.EI)({1:a}),children:o})})}const vo=()=>{const e=(0,m.useContext)(ii),o=(0,m.useContext)(zo);if(e===void 0)return o||xs;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var bs=t(57998);const Ss={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Cs=(0,m.createContext)(Ss),Jr=(0,mo.CT)("sidebar-pin-state-context");function ea(e){const{children:o,value:a}=e;return(0,r.jsx)(Cs.Provider,{value:a,children:(0,r.jsx)(Jr.Provider,{value:(0,mo.EI)({1:a}),children:o})})}const Wo=()=>{const e=(0,m.useContext)(Jr),o=(0,m.useContext)(Cs);if(e===void 0)return o||Ss;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},ta=(0,c.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"}})),na=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,m.useContext)(sr),C=ta({sidebarConfig:v}),U=(0,q.TH)(),{selectedMenuItemIndex:H,setSelectedMenuItemIndex:N}=(0,m.useContext)(ci),de=(Se,Pe)=>{N(Pe===H?-1:Pe)},le=p===H&&H>=0||p!==H&&!(H>=0)&&o===U.pathname;return(0,r.jsx)(bs.Z,{"aria-label":a,label:a,icon:d,component:tt,to:o||U.pathname,onChange:de,value:p,selected:le,classes:C})},ws=e=>{const{children:o,to:a,label:d,icon:p,value:v}=e,{isMobile:C}=Wo();return C?(0,r.jsx)(na,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:o})},Rn=(0,c.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay: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`})})),ra=e=>(0,re.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),li=m.createElement(ws).type,oa=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(sr),v=Rn({sidebarConfig:p});return(0,r.jsxs)(go.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(Ie.Z,{className:v.overlayHeader,children:[(0,r.jsx)(Z.Z,{variant:"h3",children:o}),(0,r.jsx)(At.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(qi.Z,{})})]}),(0,r.jsx)(Ie.Z,{component:"nav",children:e})]})},ci=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),sa=e=>{const{sidebarConfig:o}=(0,m.useContext)(sr),{children:a}=e,d=Rn({sidebarConfig:o}),p=(0,q.TH)(),[v,C]=(0,m.useState)(-1);(0,m.useEffect)(()=>{C(-1)},[p.pathname]);let U=(0,z.vJ)(a,N=>N.getElements().filter(de=>de.type===li));if(a)U.length?U=ra(U):U.push((0,r.jsx)(ws,{icon:(0,r.jsx)(_i.Z,{}),children:a},"default_menu"));else return null;const H=v>=0&&!U[v].props.to;return(0,r.jsx)(ai,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ci.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:C},children:[(0,r.jsx)(oa,{label:U[v]&&U[v].props.label,open:H,onClose:()=>C(-1),children:U[v]&&U[v].props.children}),(0,r.jsx)(Xi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var Vo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Vo||(Vo={}));const di={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Vo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Vo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ia=(0,c.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"}),ui=(0,m.createContext)({content:{contentRef:void 0}});function aa(e){const[o,a]=(0,m.useState)(()=>di.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(sr),p=(0,m.useRef)(null),v=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{di.setSidebarPinState(o)},[o]);const C=(0,Ne.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),U=()=>a(!o),H=ia({isPinned:o,sidebarConfig:d});return(0,r.jsx)(ea,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:C},children:(0,r.jsx)(ui.Provider,{value:v,children:(0,r.jsx)(Ie.Z,{className:H.root,children:e.children})})})}function hi(){const{content:e}=(0,m.useContext)(ui);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 pi=(0,c.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"}}),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 Kn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Kn||(Kn={}));const la=e=>{const{sidebarConfig:o}=(0,m.useContext)(sr),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,C=pi({sidebarConfig:o}),U=(0,Ne.Z)(Jt=>Jt.breakpoints.down("md"),{noSsr:!0}),[H,N]=(0,m.useState)(Kn.Closed),de=(0,m.useRef)(),{isPinned:le,toggleSidebarPinState:Se}=Wo(),Pe=()=>{le||p||(de.current&&(clearTimeout(de.current),de.current=void 0),H!==Kn.Open&&!U&&(de.current=window.setTimeout(()=>{de.current=void 0,N(Kn.Open)},a),N(Kn.Idle)))},We=()=>{le||p||(de.current&&(clearTimeout(de.current),de.current=void 0),H===Kn.Idle?N(Kn.Closed):H===Kn.Open&&(de.current=window.setTimeout(()=>{de.current=void 0,N(Kn.Closed)},d)))},Ye=H===Kn.Open&&!U||le,Pt=Jt=>{Jt?(N(Kn.Open),Se()):(N(Kn.Closed),Se())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(fi,{}),(0,r.jsx)(ai,{value:{isOpen:Ye,setOpen:Pt},children:(0,r.jsx)(Ie.Z,{className:C.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Pe,onFocus:p?()=>{}:Pe,onMouseLeave:p?()=>{}:We,onBlur:p?()=>{}:We,children:(0,r.jsx)(Ie.Z,{className:V()(C.drawer,{[C.drawerOpen]:Ye}),children:v})})})]})},js=e=>{var o;const a=vs((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=si((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:C,openDelayMs:U,closeDelayMs:H}=e,{isMobile:N}=Wo();return N?(0,r.jsx)(sa,{children:v}):(0,r.jsx)(sr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(la,{openDelayMs:U,closeDelayMs:H,disableExpandOnHover:C,children:v})})};function fi(){const{sidebarConfig:e}=(0,m.useContext)(sr),{focusContent:o,contentRef:a}=hi(),d=pi({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(ue.Z,{onClick:o,variant:"contained",className:V()(d.visuallyHidden),children:"Skip to content"}):null}function Es(e,o){const a=new URLSearchParams(o.search).toString(),d=Ks().parse(a),p=new URLSearchParams(e.search).toString(),v=Ks().parse(p);return(0,re.isEqual)(o.pathname,e.pathname)&&(0,re.isMatch)(v,d)}const gi=(0,c.Z)(e=>{var o,a;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((a=e.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),ca=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:v}=e,C=gi(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),H=()=>{U(!1)},N=useResolvedPath(d!=null?d:""),de=useLocation();let le=isLocationMatch(de,N);const[Se,Pe]=useState(!1),We=()=>{Pe(!Se)};return v!==void 0?(v.some(Ye=>{const Pt=resolvePath(Ye.to);return le=isLocationMatch(de,Pt),le}),_jsxs(Box,{className:C.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:We,onTouchStart:Ye=>Ye.stopPropagation(),className:classnames(C.item,le?C.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:a})]}),Se?_jsx(ArrowDropUpIcon,{className:C.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:C.dropdownArrow})]})}),v&&Se&&_jsx(Box,{className:C.dropdown,children:v.map((Ye,Pt)=>_jsx(Tooltip,{title:Ye.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Ye.to,underline:"none",className:C.dropdownItem,onClick:H,onTouchStart:Jt=>Jt.stopPropagation(),children:_jsx(Typography,{className:C.textContent,children:Ye.title})})},Pt))})]})):_jsx(Box,{className:C.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(C.item,le?C.selected:void 0),onClick:H,onTouchStart:Ye=>Ye.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:a})]})]})})})};var Ho;const mi=(0,c.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:(Ho=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Ho!==void 0?Ho:"#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:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),vi=e=>{const{isOpen:o}=vo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(sr),p=o?a.drawerWidthOpen:a.drawerWidthClosed,v=mi({left:p,submenuConfig:d}),{isHoveredOn:C}=(0,m.useContext)(ys),[U,H]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{H(C)},[C]),(0,r.jsxs)(Ie.Z,{className:V()(v.drawer,{[v.drawerOpen]:U}),children:[(0,r.jsx)(Z.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var yi=t(26739),yo=t(76600),da=t(83543),xi=t(59797),As=t(98989);const ua=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ha=()=>{const e=ua();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 pa=null;const bi=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),fa=()=>{const e=bi();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 ga=null,Go,Ko;const ir=e=>(0,c.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",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Go=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&Go!==void 0?Go:"#404040"}},highlighted:{background:(Ko=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Ko!==void 0?Ko:"#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 xo(e){return(0,m.useMemo)(()=>ir(e),[e])()}const Si=(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:C})=>d=d||Es(o,(0,fs.i3)(C)));return}p&&(d=Es(o,(0,fs.i3)(p)))}}),d},[o.pathname]);function Ts(e){return e.to===void 0}const Rs=m.createElement(vi).type,Ci=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:v,caseSensitive:C,activeClassName:U="active","aria-current":H="page",...N},de){let{pathname:le}=(0,q.TH)(),{pathname:Se}=(0,q.WU)(o);C||(le=le.toLocaleLowerCase("en-US"),Se=Se.toLocaleLowerCase("en-US"));let Pe=le===Se;!Pe&&!a&&(Pe=le.startsWith(`${Se}/`));const We=Pe?H:void 0;return(0,r.jsx)(_.rU,{...N,to:o,ref:de,"aria-current":We,style:{...d,...Pe?v:void 0},className:V()([p,Pe?U:void 0])})}),Is=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:C=!1,onClick:U,children:H,className:N,...de}=e,{sidebarConfig:le}=(0,m.useContext)(sr),Se=xo(le),{isOpen:Pe}=vo(),We=!Pe&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Ye=(0,r.jsxs)(Ie.Z,{style:We,children:[(0,r.jsx)(a,{fontSize:"small"}),!Pe&&v?(0,r.jsx)(As.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(yi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:V()({[Se.closedItemIcon]:!Pe}),children:Ye}),Jt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ie.Z,{"data-testid":"login-button",className:Se.iconContainer,children:Pt}),d&&(0,r.jsx)(Z.Z,{variant:"subtitle2",className:Se.label,children:d}),(0,r.jsx)("div",{className:Se.secondaryAction,children:H})]}),nn=Pe?Jt:Pt,rn={onClick:U,className:V()(N,Se.root,Pe?Se.open:Se.closed,Ts(e)&&Se.buttonItem,{[Se.highlightable]:!C})};return Ts(e)?(0,r.jsx)(ue.Z,{role:"button","aria-label":d,...rn,ref:o,children:nn}):(0,r.jsx)(Ci,{...rn,activeClassName:Se.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...de,children:nn})}),wi=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(sr),d=xo(a),[p,v]=(0,m.useState)(!1),C=(0,q.TH)(),U=Si(e,C),H=(0,Ne.Z)(Se=>Se.breakpoints.down("sm")),N=()=>{v(!0)},de=()=>{v(!1)},le=()=>H?p?(0,r.jsx)(xi.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(da.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(As.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(ys.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:de,onTouchStart:p?de:N,onMouseEnter:N,className:V()(p&&d.highlighted),children:[(0,r.jsx)(Is,{hasSubmenu:!0,className:U?d.selected:"",...o,children:le()}),p&&e]})})},Ps=(0,m.forwardRef)((e,o)=>{const[a]=(0,z.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Rs));return a?(0,r.jsx)(wi,{...e,children:a}):(0,r.jsx)(Is,{...e,ref:o})});function Za(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=xo(o),v=e.icon?e.icon:SearchIcon,C=()=>{e.onSearch(a),d("")},U=le=>{le.key==="Enter"&&(le.preventDefault(),C())},H=le=>{d(le.target.value)},N=le=>{le.preventDefault(),le.stopPropagation()},de=le=>{C(),le.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Ps,{icon:v,to:e.to,onClick:de,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:H,onKeyDown:U,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const ma=(0,yo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),i=(0,yo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),n=(0,yo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),s=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),l=(0,yo.Z)("div")(({theme:e})=>{const o=s(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),f=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=xo(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(C=>C.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,{})})})},T=(0,c.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 O(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=T({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 M=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(O,{text:o,onClose:v})})},ae=null,Te="And your recently viewed plugins will pop up here!";function Oe(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:C}=d!=null?d:{},U=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},H=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(M,{text:ae,onDismiss:U}),_jsx(SidebarDivider,{})]}),!C&&_jsx(M,{text:Te,onDismiss:H})]}):null}const Ge=(0,c.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function ht(e){const{className:o,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:C}=hi(),U=Ge();return(0,r.jsx)("article",{ref:C,tabIndex:-1,...v,className:V()(U.root,o,{[U.stretch]:a,[U.noPadding]:d}),children:p})}var xt=t(6487),Ct=t(99152);const Ut=(0,c.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Ft(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,v]=(0,m.useState)(d!=null?d:0),C=Ut(),U=(0,m.useCallback)((H,N)=>{d===void 0&&v(N),a&&d!==N&&a(N)},[d,a]);return(0,m.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(Ie.Z,{className:C.tabsWrapper,children:(0,r.jsx)(Ct.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:U,value:p,children:o.map((H,N)=>(0,m.createElement)(xt.Z,{...H.tabProps,"data-testid":`header-tab-${N}`,label:H.label,key:H.id,value:N,className:C.defaultTab,classes:{selected:C.selected,root:C.tabRoot}}))})})}function Bn(e){const o=(0,q.UO)(),d=e.map(({path:Se,children:Pe})=>({caseSensitive:!1,path:`${Se}/*`,element:Pe})).sort((Se,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(Se.path.replace(/\/\*$/,"")));var p;const v=(p=(0,q.V$)(d))!==null&&p!==void 0?p:e[0].children;var C;let U=(C=o["*"])!==null&&C!==void 0?C:"";U.startsWith("/")||(U=`/${U}`);var H;const[N]=(H=(0,fs.fp)(d,U))!==null&&H!==void 0?H:[],de=N?e.findIndex(Se=>`${Se.path}/*`===N.route.path):0;var le;return{index:de===-1?0:de,element:v,route:(le=e[de])!==null&&le!==void 0?le:e[0]}}function tr(e){const{routes:o}=e,a=(0,q.s0)(),{index:d,route:p,element:v}=Bn(o),C=(0,m.useMemo)(()=>o.map(H=>({id:H.path,label:H.title,tabProps:H.tabProps})),[o]),U=H=>{let{path:N}=o[H];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ft,{tabs:C,selectedIndex:d,onChange:U}),(0,r.jsxs)(ht,{children:[(0,r.jsx)(Mo.q,{title:p.title}),v]})]})}const nr=()=>null;(0,z.R5)(nr,"core.gatherMountPoints",!0);function Qr(e){const o=(0,r.jsx)(nr,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(a=>{if(!(0,m.isValidElement)(a))return[];if(a.type===m.Fragment)return Qr(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:C}=a.props;return[{path:d,title:p,children:v,tabProps:C}]})}function ji(e){const o=Qr(e.children);return(0,r.jsx)(tr,{routes:o})}ji.Route=nr;const Ei=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Yo(e){const{value:o,subvalue:a}=e,d=Ei();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ie.Z,{className:d.value,children:o}),(0,r.jsx)(Ie.Z,{className:d.subvalue,children:a})]})}var bo=t(67222),Br=t(21070),Ba=t(90324),$a=t(98281),Da=t(48049),va=t(51209),ya=t(33375),Na=t(44233),Fa=t(27604),Ai=t(36444),Ua=t(37971),Ma=t(59709),za=t(17373),Wa=t(3702),Va=t(93111);const Ha=(0,c.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ga=e=>{var o;const a=Ha(),{onChangeFilters:d}=e,[p,v]=(0,m.useState)({...e.selectedFilters}),[C,U]=(0,m.useState)(!1),H=()=>{v({}),U(N=>!N)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(Ie.Z,{className:a.root,children:[(0,r.jsxs)(Ie.Z,{className:a.header,children:[(0,r.jsx)(Ie.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(ue.Z,{color:"primary",onClick:H,children:"Clear all"})]}),(0,r.jsx)(Ie.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(N=>(0,r.jsx)(yn,{triggerReset:C,...N.element,selected:p[N.element.label],onChange:de=>v({...p,[N.element.label]:de})},N.element.label))})]})},xa={Add:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Br.Z,{...e,ref:o})),Check:(0,m.forwardRef)((e,o)=>(0,r.jsx)($a.Z,{...e,ref:o})),Clear:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Na.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Fa.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Wa.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ai.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ua.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ma.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Da.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ai.Z,{...e,ref:o})),SortArrow:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ba.Z,{...e,ref:o})),ThirdStateCheck:(0,m.forwardRef)((e,o)=>(0,r.jsx)(za.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Va.Z,{...e,ref:o}))};function ba(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 Ka=(0,Kt.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(bo.W$),Sa=(0,Kt.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(bo.UW),Ya=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ja=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Qa(e,o){return e.map(a=>{var d;const p=(d=a.headerStyle)!==null&&d!==void 0?d:{};let v=a.cellStyle||{};if(a.highlight)if(p.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const C=v;v=(U,H,N)=>({...C(U,H,N),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:p,cellStyle:v}})}function Xa(e,o){return(0,re.transform)(e,(a,d,p)=>{(0,re.isEqual)(d,o[p])||(a[p]=d)})}const Ca={search:"",filtersOpen:!1,filters:{}};function qa(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,C=Ya(),U=(0,m.useCallback)(H=>{e.onSearchChanged(H),a(H)},[e,a]);return d?(0,r.jsxs)(Ie.Z,{className:C.root,children:[(0,r.jsxs)(Ie.Z,{className:C.root,children:[(0,r.jsx)(At.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(Ai.Z,{})}),(0,r.jsxs)(Z.Z,{className:C.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:U})]}):(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:U})}function wa(e){const{data:o,columns:a,options:d,title:p,subtitle:v,filters:C,initialState:U,emptyContent:H,onStateChange:N,components:de,...le}=e,Se=Ja(),Pe=(0,lt.Z)(),We={...Ca,...U},[Ye,Pt]=(0,m.useState)(We.filtersOpen),Jt=(0,m.useCallback)(()=>Pt($n=>!$n),[Pt]),[nn,rn]=(0,m.useState)(0),[Lt,_t]=(0,m.useState)(o),[Qt,wr]=(0,m.useState)(We.filters),jr=Qa(a,Pe),[Er,Ar]=(0,m.useState)(We.search);(0,m.useEffect)(()=>{if(N){const $n=Xa({search:Er,filtersOpen:Ye,filters:Qt},Ca);N($n)}},[Er,Ye,Qt,N]);const Li={headerStyle:{textTransform:"uppercase"}},$r=(0,m.useCallback)($n=>{var yr;return(yr=a.find(Xr=>Xr.title===$n))===null||yr===void 0?void 0:yr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!Qt){_t(o);return}const $n=Object.values(Qt);if(o&&$n.flat().length){const yr=o.filter(Xr=>!!Object.entries(Qt).filter(([,qr])=>!!qr.length).every(([qr,dn])=>{const bn=ba(Xr,$r(qr));return Array.isArray(bn)&&Array.isArray(dn)?bn.some(wo=>dn.includes(wo)):Array.isArray(bn)?bn.includes(dn):Array.isArray(dn)?dn.includes(bn):bn===dn}));_t(yr)}else _t(o);rn($n.flat().length)},[o,Qt,$r]);const ki=($n,yr)=>{const Xr=dn=>{const bn=new Set,wo=_r=>{_r!=null&&bn.add(_r)};return yr&&yr.forEach(_r=>{const Xo=ba(_r,$r(dn));Array.isArray(Xo)?Xo.forEach(wo):wo(Xo)}),bn},qr=dn=>({placeholder:"All results",label:dn.column,multiple:dn.type==="multiple-select",items:[...Xr(dn.column)].sort().map(bn=>({label:bn,value:bn}))});return $n.map(dn=>({type:dn.type,element:qr(dn)}))},Xt=!!(C!=null&&C.length),Co=(0,m.useCallback)($n=>(0,r.jsx)(qa,{setSearch:Ar,hasFilters:Xt,selectedFiltersLength:nn,toggleFilters:Jt,...$n}),[Jt,Xt,nn,Ar]),Ls=typeof o!="function"&&o.length===0,Dr=a.length,Oi=(0,m.useCallback)($n=>H&&Ls?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Dr,children:H})})}):(0,r.jsx)(bo.os,{...$n}),[Ls,H,Dr]);return(0,r.jsxs)(Ie.Z,{className:Se.root,children:[Ye&&o&&typeof o!="function"&&(C==null?void 0:C.length)&&(0,r.jsx)(Ga,{filters:ki(C,o),selectedFilters:Qt,onChangeFilters:wr}),(0,r.jsx)(bo.ZP,{components:{Header:Ka,Toolbar:Co,Body:Oi,...de},options:{...Li,...d},columns:jr,icons:xa,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(Z.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Lt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...le})]})}wa.icons=Object.freeze(xa);const ql=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})})},_a=(0,c.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"}),_l=e=>{const o=_a(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})},el=(e,o)=>o?e?"20px":"0":"40px",tl=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>el(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),ec=e=>{const o=tl(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},nl=(0,c.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),tc=e=>{const o=nl(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},rl=(0,c.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function nc(e){const{tabs:o}=e,a=rl(),[d,p]=useState([0,0]),[v,C]=useState(0),[U,H]=useState(0),[N,de]=useState([[]]),le=useRef(),{width:Se}=useWindowSize(),Pe=(nn,rn)=>{p([v,rn])},We=()=>{C(v-1)},Ye=()=>{C(v+1)},Pt=()=>v+1<N.length;useEffect(()=>{const rn=v===0?1:2,Lt=le.current.offsetWidth-20-rn*30,_t=d[0]*U+d[1],Qt=Math.floor(Lt/170);H(Qt),de(chunkArray(o,Qt)),p([Math.floor(_t/Qt),_t%Qt])},[Se,o]);const Jt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:le,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Jt,onChange:Pe,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:We,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((nn,rn)=>_jsx(StyledTab,{value:rn,isFirstIndex:rn===0,isFirstNav:v===0,icon:nn.icon||void 0,label:nn.label||void 0},rn)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:Ye,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Jt!==!1?N[v].map((nn,rn)=>_jsx(TabPanel,{value:rn,index:Jt,children:nn.content},rn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var rc=t(44311);function ol(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 oc(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:ol(e.data,o)})]})}const sl=e=>(0,c.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"}),il=({title:e="Unknown page",className:o})=>(0,r.jsx)(Z.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function al(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,C=sl({textAlign:v})(),U=d||(0,r.jsx)(il,{title:a,className:C.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Mo.q,{title:a}),(0,r.jsxs)(Ie.Z,{className:C.container,children:[(0,r.jsxs)(Ie.Z,{className:C.leftItemsBox,children:[U,o&&(0,r.jsx)(Z.Z,{className:C.description,variant:"body2",children:o})]}),(0,r.jsx)(Ie.Z,{className:C.rightItemsBox,children:p})]})]})}var ll=t.p+"static/mic-drop.fe3ef4d0..svg";const cl=(0,c.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),dl=()=>{const e=cl();return(0,r.jsx)("img",{src:ll,className:e.micDrop,alt:"Girl dropping mic from her hands"})},ul=(0,c.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function hl(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=ul(),C=(0,q.s0)(),U=Yr();return(0,r.jsxs)(Ae.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Ae.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Z.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",a]}),(0,r.jsx)(Z.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(Z.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Z.Z,{variant:"h6",children:[(0,r.jsx)(tt,{to:"#","data-testid":"go-back-link",onClick:()=>C(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(tt,{to:p||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(dl,{})]})}var pl=t(16173);const fl=(0,Kt.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Z.Z),Ti=(0,Kt.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Ie.Z);function gl(e){const{children:o,...a}=e,[d,p]=m.useState(null),v=m.Children.toArray(o),[C,U,...H]=v,N=H.length?H.pop():v[v.length-1],de=v.length>3,le=We=>{p(We.currentTarget)},Se=()=>{p(null)},Pe=Boolean(d);return(0,r.jsxs)(m.Fragment,{children:[(0,r.jsxs)(pl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(Ti,{clone:!0,children:C}),v.length>2&&(0,r.jsx)(Ti,{clone:!0,children:U}),de&&(0,r.jsx)(fl,{onClick:le,children:"..."}),(0,r.jsx)(Ie.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(Gs.ZP,{open:Pe,anchorEl:d,onClose:Se,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(yt.Z,{children:H.map((We,Ye)=>(0,r.jsx)(at.Z,{button:!0,children:(0,r.jsx)(Ti,{clone:!0,children:We})},Ye))})})]})}const ml=(0,c.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),vl=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,r.jsxs)(gl,{className:a.breadcrumb,children:[(0,r.jsx)(tt,{to:o,children:e}),(0,r.jsx)(Z.Z,{children:d})]}):(0,r.jsx)(Z.Z,{className:a.type,children:e}):null,yl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,r.jsx)(Z.Z,{className:o.title,variant:"h1",children:e});return a?(0,r.jsx)(Nt.ZP,{title:a,placement:"top-start",children:d}):d},xl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(Z.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function ja(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:C,type:U,typeLink:H}=e,N=ml(),le=(0,z.h_)(z.Ds).getOptionalString("app.title")||"Backstage",Se=a||v,Pe=v||a,We=`${Se} | %s | ${le}`,Ye=`${Se} | ${le}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Mo.q,{titleTemplate:We,defaultTitle:Ye}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(Ie.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(vl,{classes:N,type:U,typeLink:H,pageTitle:Pe}),(0,r.jsx)(yl,{classes:N,pageTitle:Pe,tooltip:C}),(0,r.jsx)(xl,{classes:N,subtitle:p})]}),(0,r.jsx)(Ae.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:o})]})]})}const bl=({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 sc(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:a}=e,[d,p]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>p(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>p(!1),children:_jsx(List,{children:a.map((C,U)=>_jsx(bl,{...C},`header-action-menu-${U}`))})})]})}const Sl=(0,c.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Ze.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Cl=({value:e,className:o})=>(0,r.jsx)(Z.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function wl(e){const{label:o,value:a,url:d}=e,p=Sl(),v=(0,r.jsx)(Cl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Ae.Z,{item:!0,children:(0,r.jsxs)(Z.Z,{component:"span",className:p.root,children:[(0,r.jsx)(Z.Z,{className:p.label,children:o}),d?(0,r.jsx)(tt,{to:d,children:v}):v]})})}const jl=e=>(0,He.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),El=(0,c.Z)(jl,{name:"BackstageItemCardHeader"});function Al(e){const{title:o,subtitle:a,children:d}=e,p=El(e);return(0,r.jsxs)(Ie.Z,{className:p.root,children:[a&&(0,r.jsx)(Z.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,r.jsx)(Z.Z,{variant:"h6",component:"h4",children:o}),d]})}function ic(e){const{description:o,tags:a,title:d,type:p,subtitle:v,label:C,onClick:U,href:H}=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((N,de)=>_jsx(Chip,{size:"small",label:N},de))}):null,o]}),_jsxs(CardActions,{children:[!H&&_jsx(LinkButton,{to:"#",onClick:U,color:"primary",children:C}),H&&_jsx(LinkButton,{to:H,color:"primary",children:C})]})]})}const Tl=e=>(0,He.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),Rl=(0,c.Z)(Tl,{name:"BackstageItemCardGrid"});function Il(e){const{children:o,...a}=e,d=Rl(a);return(0,r.jsx)(Ie.Z,{className:d.root,...a,children:o})}var Pl=t(41547);const Ll=(0,c.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function Ea(e){const{themeId:o,children:a}=e,d=Ll();return(0,r.jsx)(Pl.Z,{theme:p=>({...p,page:p.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:a})})}function kl(e){const{themeId:o,children:a,...d}=e;return(0,r.jsxs)(Ea,{themeId:o,children:[(0,r.jsx)(ja,{...d}),a]})}var Yn=t(30195);const ac=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),Aa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Ol(e){const o=new Date(Date.now()+Aa.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-Aa.tokenExpiryMarginMillis)}class lc{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:Ol(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){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const cc=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},Zl=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ri=({children:e})=>{const o=Zl();return(0,r.jsx)(Ae.Z,{component:"li",item:!0,classes:o,children:e})};var Jo=t(47842);class Ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function Bl(e){const[o,a,d]=e.split(".");return JSON.parse(window.atob(a))}class Pi{getUserId(){return this.result.userId}static fromResult(o){return new Pi(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}=Bl(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){(0,Jo.Z)(this,"result",void 0),this.result=o}}class Qo{static createGuest(){return new Ii}static fromLegacy(o){return Pi.fromResult(o)}static create(o){return new Qo(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){(0,Jo.Z)(this,"identity",void 0),(0,Jo.Z)(this,"authApi",void 0),(0,Jo.Z)(this,"profile",void 0),(0,Jo.Z)(this,"profilePromise",void 0),this.identity=o,this.authApi=a,this.profile=d}}const $l={Component:({config:e,onSignInStarted:o,onSignInSuccess:a,onSignInFailure:d})=>{const{apiRef:p,title:v,message:C}=e,U=(0,z.h_)(p),H=(0,z.h_)(z.VE),N=async()=>{try{o();const de=await U.getBackstageIdentity({instantPopup:!0});if(!de)throw d(),new Error(`The ${v} provider is not configured to support sign-in`);const le=await U.getProfile();a(Qo.create({identity:de.identity,profile:le,authApi:U}))}catch(de){d(),H.post(new Ro.SP("Login failed",de))}};return(0,r.jsx)(Ri,{children:(0,r.jsx)(Or,{variant:"fullHeight",title:v,actions:(0,r.jsx)(ue.Z,{color:"primary",variant:"outlined",onClick:N,children:"Sign In"}),children:(0,r.jsx)(Z.Z,{variant:"body1",children:C})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Qo.create({identity:d.identity,profile:p,authApi:a})}},Dl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(Ri,{children:(0,r.jsx)(Or,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ue.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ii)},children:"Enter"}),children:(0,r.jsxs)(Z.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ii};var Nl=t(63955),Ta=t(86619),Ra=t(74828),Fl=t(45455),Ul=t.n(Fl);const Ml=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,zl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ia=e=>{const{ref:o,...a}=e;return{inputRef:o,...a}},Wl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const a=zl(),{register:d,handleSubmit:p,formState:v}=(0,Nl.cI)({mode:"onChange"}),{errors:C}=v,U=({userId:H,idToken:N})=>{e(),o(Qo.fromLegacy({userId:H,getIdToken:N!==void 0?async()=>N:void 0,profile:{email:`${H}@example.com`}}))};return(0,r.jsx)(Ri,{children:(0,r.jsxs)(Or,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Z.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:a.form,onSubmit:p(U),children:[(0,r.jsxs)(ye.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(C.userId)}),C.userId&&(0,r.jsx)(Ra.Z,{error:!0,children:C.userId.message})]}),(0,r.jsxs)(ye.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(d("idToken",{required:!1,validate:H=>!H||Ml.test(H)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(C.idToken)}),C.idToken&&(0,r.jsx)(Ra.Z,{error:!0,children:C.idToken.message})]}),(0,r.jsx)(ue.Z,{type:"submit",color:"primary",variant:"outlined",className:a.button,disabled:!(v!=null&&v.isDirty)||!Ul()(C),children:"Continue"})]})]})})},loader:async()=>{}},So="@backstage/core:SignInPage:provider",Pa={guest:Dl,custom:Wl,common:$l};function La(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function mc(e){return e.reduce((a,d)=>{if(typeof d=="string")return La(d,a),a[d]={components:Pa[d],id:d},a;const{id:p}=d;return La(p,a),a[p]={components:Pa.common,id:p,config:d},a},{})}const vc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),C=useCallback(H=>{o(IdentityApiSignOutProxy.from({identityApi:H,signOut:async()=>{var N;localStorage.removeItem(So),await((N=H.signOut)===null||N===void 0?void 0:N.call(H))}}))},[o]);useLayoutEffect(()=>{var H;if(!p)return;const N=localStorage.getItem(So);if(N===null){v(!1);return}const de=e[N];if(!de){v(!1);return}let le=!1;return de.components.loader(d,(H=de.config)===null||H===void 0?void 0:H.apiRef).then(Se=>{if(le){localStorage.removeItem(So);return}Se?C(Se):v(!1)}).catch(Se=>{localStorage.removeItem(So),!le&&(a.post(Se),v(!1))}),()=>{le=!0}},[p,a,o,d,e,C]);const U=useMemo(()=>Object.keys(e).map(H=>{const N=e[H],{Component:de}=N.components,le=We=>{C(We)},Se=()=>{localStorage.setItem(So,N.config.id)},Pe=()=>{localStorage.removeItem(So)};return _jsx(de,{config:N.config,onSignInStarted:Se,onSignInSuccess:le,onSignInFailure:Pe},N.id)}),[e,C]);return[p,U]},Vl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),C=getSignInProviders(o),[U,H]=useSignInProviders(C,e);return U?_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:H})]})]})},Hl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[C,U]=useState(),[H,N]=useState(!1),de=async({checkExisting:le,showPopup:Se})=>{try{let Pe;if(le&&(Pe=await p.getBackstageIdentity({optional:!0})),!Pe&&(Se||o)&&(N(!0),Pe=await p.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){N(!0);return}const We=await p.getProfile();a(UserIdentity.create({identity:Pe.identity,authApi:p,profile:We}))}catch(Pe){U(Pe),N(!0)}};return useMountEffect(()=>de({checkExisting:!0})),H?_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:()=>{de({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),C&&C.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:C.message})]})})})})]}):_jsx(Progress,{})};function yc(e){return"provider"in e?_jsx(Hl,{...e}):_jsx(Vl,{...e})}const Gl=(0,c.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Kl=(0,Kt.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(kr.Z);function xc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:C,onChange:U}=e,H=Gl(),[N,de]=useState(0),le=U||((We,Ye)=>de(Ye));let Se;C?React.Children.map(d,We=>{if(React.isValidElement(We)&&(We==null?void 0:We.props.value)===C){var Ye;Se=We==null||(Ye=We.props)===null||Ye===void 0?void 0:Ye.children}}):React.Children.map(d,(We,Ye)=>{React.isValidElement(We)&&Ye===N&&(Se=We==null?void 0:We.props.children)});const Pe=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[p&&_jsx(Kl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:H,value:C||N,onChange:le,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Se}),v&&_jsx(BottomLink,{...v})]})})}const Yl=(0,c.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function bc(e){const{children:o,...a}=e,d=Yl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},60871:function(bt,$e,t){"use strict";t.d($e,{fC:function(){return y},CL:function(){return Ie},sM:function(){return re},$v:function(){return et},v_:function(){return K},hg:function(){return tt},uB:function(){return Ve},R5:function(){return Je},bq:function(){return W},Km:function(){return Ce},Ds:function(){return dt},ni:function(){return V},T0:function(){return S},CO:function(){return Wn},x8:function(){return Fn},rx:function(){return Vn},YO:function(){return Sn},P4:function(){return Pn},NT:function(){return zt},NW:function(){return Me},VE:function(){return ft},W0:function(){return lt},gP:function(){return Et},IY:function(){return wt},F4:function(){return _},ux:function(){return R},Kp:function(){return q},$4:function(){return pt},p_:function(){return k},ZM:function(){return mt},D:function(){return B},gW:function(){return L},E6:function(){return At},z$:function(){return qt},h_:function(){return we},I_:function(){return $},qD:function(){return ve},vJ:function(){return gn},tg:function(){return Mn},Oi:function(){return Jn}});var u=t(52322),r=t(51837),z=t(2784);const P=(0,r.CT)("analytics-context"),m=()=>{const fe=(0,z.useContext)(P);if(fe===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const oe=fe.atVersion(1);if(oe===void 0)throw new Error("No context found for version 1.");return oe},y=fe=>{const{attributes:oe,children:ke}=fe,Ke={...m(),...oe},te=(0,r.EI)({1:Ke});return(0,u.jsx)(P.Provider,{value:te,children:ke})};function c(fe,oe){const ke=Fe=>_jsx(y,{attributes:oe,children:_jsx(fe,{...Fe})});return ke.displayName=`WithAnalyticsContext(${fe.displayName||fe.name||"Component"})`,ke}function $(){const fe=(0,r.Vt)("api-context");if(!fe)throw new Error("API context is not available");const oe=fe.atVersion(1);if(!oe)throw new Error("ApiContext v1 not available");return oe}function we(fe){const ke=$().get(fe);if(!ke)throw new Error(`No implementation available for ${fe}`);return ke}function ue(fe){return function(ke){const Fe=te=>{const D=$(),pe={};for(const Ae in fe)if(fe.hasOwnProperty(Ae)){const Qe=fe[Ae],Xe=D.get(Qe);if(!Xe)throw new Error(`No implementation available for ${Qe}`);pe[Ae]=Xe}return _jsx(ke,{...te,...pe})},Ke=ke.displayName||ke.name||"Component";return Fe.displayName=`withApis(${Ke})`,Fe}}var G=t(47842);class Z{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(oe){if((0,G.Z)(this,"config",void 0),this.config=oe,!oe.id.split(".").flatMap(Fe=>Fe.split("-")).every(Fe=>Fe.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${oe.id}'`)}}function S(fe){return new Z(fe)}function V(fe,oe){return"id"in fe?{api:fe,deps:{},factory:()=>oe}:fe}var re;(function(fe){fe.SignedIn="SignedIn",fe.SignedOut="SignedOut"})(re||(re={}));const q=S({id:"core.auth.google"}),_=S({id:"core.auth.github"}),B=S({id:"core.auth.okta"}),R=S({id:"core.auth.gitlab"}),k=S({id:"core.auth.microsoft"}),L=S({id:"core.auth.onelogin"}),W=S({id:"core.auth.bitbucket"}),Ce=S({id:"core.auth.bitbucket-server"}),Ve=S({id:"core.auth.atlassian"}),et=S({id:"core.alert"}),K=S({id:"core.analytics"}),tt=S({id:"core.apptheme"}),dt=S({id:"core.config"}),Me=S({id:"core.discovery"}),ft=S({id:"core.error"});var Ie;(function(fe){fe[fe.None=0]="None",fe[fe.Active=1]="Active"})(Ie||(Ie={}));const lt=S({id:"core.featureflags"}),Et=S({id:"core.fetch"}),pt=S({id:"core.identity"}),mt=S({id:"core.oauthrequest"}),At=S({id:"core.storage"});class Nt{setContext(oe){this.context=oe}captureEvent(oe,ke,{value:Fe,attributes:Ke}={}){try{this.analyticsApi.captureEvent({action:oe,subject:ke,value:Fe,attributes:Ke,context:this.context})}catch(te){console.warn("Error during analytics event capture. %o",te)}}constructor(oe,ke={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,G.Z)(this,"analyticsApi",void 0),(0,G.Z)(this,"context",void 0),this.analyticsApi=oe,this.context=ke}}function ze(){try{return we(K)}catch{return{captureEvent:()=>{}}}}function qt(){const fe=(0,z.useRef)(null),oe=m(),ke=ze();function Fe(){return fe.current===null&&(fe.current=new Nt(ke)),fe.current}const Ke=Fe();return Ke.setContext(oe),Ke}const ve=()=>{const fe=(0,r.Vt)("app-context");if(!fe)throw new Error("App context is not available");const oe=fe.atVersion(1);if(!oe)throw new Error("AppContext v1 not available");return oe},he=(0,r.uW)("component-data-store",()=>new WeakMap),Ne="__backstage_data";function Je(fe,oe,ke){const Fe=fe;var Ke;let te=(Ke=Fe[Ne])!==null&&Ke!==void 0?Ke:he.get(fe);if(te||(te={map:new Map},Object.defineProperty(Fe,Ne,{enumerable:!1,configurable:!0,writable:!1,value:te}),he.set(fe,te)),te.map.has(oe)){const D=fe.displayName||fe.name;throw new Error(`Attempted to attach duplicate data "${oe}" to component "${D}"`)}te.map.set(oe,ke)}function wt(fe,oe){if(!fe)return;const ke=fe.type;if(!ke)return;var Fe;const Ke=(Fe=ke[Ne])!==null&&Fe!==void 0?Fe:he.get(ke);if(Ke)return Ke.map.get(oe)}const jt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let ot=jt,St=ot;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(oe,ke){(0,G.Z)(this,"id",void 0),(0,G.Z)(this,"params",void 0),(0,G.Z)(this,St,void 0),this.id=oe,this.params=ke,this[ot]="absolute"}}function zt(fe){var oe;return new kt(fe.id,(oe=fe.params)!==null&&oe!==void 0?oe:[])}const Bt=/^\w+$/;let on=null,Wt=null;class Vt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(oe,ke,Fe,Ke){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,Wt,void 0),this.id=oe,this.path=ke,this.parent=Fe,this.params=Ke,this[on]="sub"}}function Nn(fe){const{id:oe,path:ke,parent:Fe}=fe,Ke=ke.split("/").filter(pe=>pe.startsWith(":")).map(pe=>pe.substring(1)),te=[...Fe.params,...Ke];if(Fe.params.some(pe=>Ke.includes(pe)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!ke.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${ke}'`);if(ke.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${ke}'`);for(const pe of Ke)if(!Bt.test(pe))throw new Error(`SubRouteRef path has invalid param, got '${pe}'`);return new Vt(oe,ke,Fe,te)}let In=jt,ln=In;class wn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(oe,ke,Fe){(0,G.Z)(this,"id",void 0),(0,G.Z)(this,"params",void 0),(0,G.Z)(this,"optional",void 0),(0,G.Z)(this,ln,void 0),this.id=oe,this.params=ke,this.optional=Fe,this[In]="external"}}function Fn(fe){var oe;return new wn(fe.id,(oe=fe.params)!==null&&oe!==void 0?oe:[],Boolean(fe.optional))}var Un=t(79635);function Mn(fe){const{pathname:oe}=(0,Un.TH)(),ke=(0,r.Vt)("routing-context");if(!ke)throw new Error("Routing context is not available");const Fe=ke.atVersion(1),Ke=(0,z.useMemo)(()=>Fe&&Fe.resolve(fe,{pathname:oe}),[Fe,fe,oe]);if(!ke)throw new Error("useRouteRef used outside of routing context");if(!Fe)throw new Error("RoutingContext v1 not available");const te="optional"in fe&&fe.optional;if(!Ke&&!te)throw new Error(`No path for ${fe}`);return Ke}function Jn(fe){return(0,Un.UO)()}class nt extends z.Component{static getDerivedStateFromError(oe){return{error:oe}}render(){const{error:oe}=this.state,{app:ke,plugin:Fe}=this.props,{ErrorBoundaryFallback:Ke}=ke.getComponents();return oe?(0,u.jsx)(Ke,{error:oe,resetError:this.handleErrorReset,plugin:Fe}):this.props.children}constructor(...oe){super(...oe),(0,G.Z)(this,"state",{error:void 0}),(0,G.Z)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var zn=t(64355);function Pn(fe){const{component:oe,mountPoint:ke,name:Fe}=fe;return Sn({component:{lazy:()=>oe().then(Ke=>{const te=pe=>{try{Mn(ke)}catch(Ae){if(typeof Ae=="object"&&Ae!==null){const{message:Qe}=Ae;if(typeof Qe=="string"&&Qe.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${ke} 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 Ae}return(0,u.jsx)(Ke,{...pe})},D=Fe||Ke.displayName||Ke.name||"LazyComponent";return te.displayName=`RoutableExtension(${D})`,te},Ke=>D=>{const pe=ve(),{BootErrorPage:Ae}=pe.getComponents();return(0,u.jsx)(Ae,{step:"load-chunk",error:Ke})})},data:{"core.mountPoint":ke},name:Fe})}function Wn(fe){const{component:oe,name:ke}=fe;return Sn({component:oe,name:ke})}function Sn(fe){const{data:oe={},name:ke}=fe;ke||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Fe;if("lazy"in fe.component){const te=fe.component.lazy;Fe=(0,z.lazy)(()=>te().then(D=>({default:D})))}else Fe=fe.component.sync;const Ke=ke||Fe.displayName||Fe.name||"Component";return{expose(te){const D=pe=>{const Ae=ve(),{Progress:Qe}=Ae.getComponents(),Xe=oe==null?void 0:oe["core.mountPoint"];return(0,u.jsx)(z.Suspense,{fallback:(0,u.jsx)(Qe,{}),children:(0,u.jsx)(nt,{app:Ae,plugin:te,children:(0,u.jsx)(y,{attributes:{pluginId:te.getId(),...ke&&{extension:ke},...Xe&&{routeRef:Xe.id}},children:(0,u.jsx)(zn.o,{plugin:te,children:(0,u.jsx)(Fe,{...pe})})})})})};Je(D,"core.plugin",te);for(const[pe,Ae]of Object.entries(oe))Je(D,pe,Ae);return D.displayName=`Extension(${Ke})`,D}}}function sn(fe,oe,ke,Fe){return z.Children.toArray(fe).flatMap(Ke=>{if(!(0,z.isValidElement)(Ke))return[];if(Ke.type===z.Fragment)return sn(Ke.props.children,oe,ke,Fe);if(wt(Ke,"core.featureFlagged")){const te=Ke.props;return("with"in te?oe.isActive(te.with):!oe.isActive(te.without))?sn(Ke.props.children,oe,ke,Fe):[]}if(ke===void 0||ke(Ke))return[Ke];if(Fe)throw new Error(Fe);return sn(Ke.props.children,oe,ke,Fe)})}class Ln{selectByComponentData(oe){const ke=sn(this.node,this.featureFlagsApi,Fe=>wt(Fe,oe.key)!==void 0,oe.withStrictError);return new Ln(ke,this.featureFlagsApi)}findComponentData(oe){return sn(this.node,this.featureFlagsApi,Fe=>wt(Fe,oe.key)!==void 0).map(Fe=>wt(Fe,oe.key)).filter(Fe=>Fe!==void 0)}getElements(){return sn(this.node,this.featureFlagsApi)}constructor(oe,ke){(0,G.Z)(this,"node",void 0),(0,G.Z)(this,"featureFlagsApi",void 0),this.node=oe,this.featureFlagsApi=ke}}function gn(fe,oe,ke=[]){const Fe=we(lt),Ke=new Ln(fe,Fe);return(0,z.useMemo)(()=>oe(Ke),[fe,...ke])}class jn{getId(){return this.config.id}getApis(){var oe;return(oe=this.config.apis)!==null&&oe!==void 0?oe:[]}getFeatureFlags(){var oe,ke;return(ke=(oe=this.config.featureFlags)===null||oe===void 0?void 0:oe.slice())!==null&&ke!==void 0?ke:[]}get routes(){var oe;return(oe=this.config.routes)!==null&&oe!==void 0?oe:{}}get externalRoutes(){var oe;return(oe=this.config.externalRoutes)!==null&&oe!==void 0?oe:{}}provide(oe){return oe.expose(this)}__experimentalReconfigure(oe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(oe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var oe;return(oe=this.options)!==null&&oe!==void 0?oe:{}}toString(){return`plugin{${this.config.id}}`}constructor(oe){(0,G.Z)(this,"config",void 0),(0,G.Z)(this,"options",void 0),this.config=oe,this.options=void 0}}function Vn(fe){return new jn(fe)}},64355:function(bt,$e,t){"use strict";t.d($e,{o:function(){return m},y:function(){return y}});var u=t(52322),r=t(51837),z=t(2784);const P="plugin-context",m=c=>{const{children:$,plugin:we}=c,{Provider:ue}=(0,r.CT)(P);return(0,u.jsx)(ue,{value:(0,r.EI)({1:{plugin:we}}),children:$})};function y(){const c=(0,r.Vt)(P);if(!c)throw new Error("Plugin Options context is not available");const $=c.atVersion(1);if(!$)throw new Error("Plugin Options v1 is not available");return $.plugin.getPluginOptions()}},23054:function(bt,$e,t){"use strict";t.d($e,{SP:function(){return q},dR:function(){return Z},VL:function(){return B},BD:function(){return r}});function u(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const k=R;return!(typeof k.name!="string"||k.name===""||typeof k.message!="string")}function r(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const k=R;if(typeof k.name!="string"||k.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof k.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var z=t(47842),P=t(24852);function m(R,k){const W={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return k!=null&&k.includeStack||delete W.stack,W}function y(R){const k=(0,P.deserializeError)(R);return R.stack||(k.stack=void 0),k}function c(R){if(u(R)){const k=String(R);return k!=="[object Object]"?k:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class $ extends Error{constructor(k,L){var W;let Ce=k;if(L!==void 0){const Ve=c(L);Ce?Ce+=`; caused by ${Ve}`:Ce=`caused by ${Ve}`}super(Ce),(0,z.Z)(this,"cause",void 0),(W=Error.captureStackTrace)===null||W===void 0||W.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=u(L)?L:void 0}}class we extends null{}class ue extends null{}class G extends null{}class Z extends ${}class S extends null{}class V extends null{}class re extends null{}class q extends ${constructor(k,L){super(k,L),this.name=u(L)?L.name:"Error"}}async function _(R){try{const L=await R.text();if(L){var k;if(!((k=R.headers.get("content-type"))===null||k===void 0)&&k.startsWith("application/json"))try{const W=JSON.parse(L);if(W.error&&W.response)return W}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${L}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class B extends Error{static async fromResponse(k){const L=await _(k),W=L.response.statusCode||k.status,Ce=L.error.name||k.statusText,Ve=`Request failed with ${W} ${Ce}`,et=y(L.error);return new B({message:Ve,response:k,data:L,cause:et})}constructor(k){super(k.message),(0,z.Z)(this,"response",void 0),(0,z.Z)(this,"body",void 0),(0,z.Z)(this,"cause",void 0),this.name="ResponseError",this.response=k.response,this.body=k.data,this.cause=k.cause}}},32838:function(bt,$e,t){"use strict";t.d($e,{nW:function(){return q},ae:function(){return G},q3:function(){return Z}});var u=t(60871);const r=(0,u.T0)({id:"core.scmauth"});var z=new WeakMap;class P{async getCredentials(B){const R=new URL(B.url),k=_class_private_field_get(this,z).find(L=>L.isUrlSupported(R));if(!k)throw new Error(`No auth provider available for '${B.url}', see https://backstage.io/link?scm-auth`);return k.getCredentials(B)}constructor(B){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_set(this,z,B)}}var m=new WeakMap,y=new WeakMap,c=new WeakMap,$=new WeakMap;class we{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:B,gitlab:R,azure:k,bitbucket:L})=>we.merge(we.forGithub(B),we.forGitlab(R),we.forAzure(k),we.forBitbucket(L))})}static forAuthApi(B,R){return new we("generic",B,R.host,R.scopeMapping)}static forGithub(B,R){var k;const L=(k=R==null?void 0:R.host)!==null&&k!==void 0?k:"github.com";return new we("github",B,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(B,R){var k;const L=(k=R==null?void 0:R.host)!==null&&k!==void 0?k:"gitlab.com";return new we("gitlab",B,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(B,R){var k;const L=(k=R==null?void 0:R.host)!==null&&k!==void 0?k:"dev.azure.com";return new we("azure",B,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(B,R){var k;const L=(k=R==null?void 0:R.host)!==null&&k!==void 0?k:"bitbucket.org";return new we("bitbucket",B,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...B){return new P(B)}isUrlSupported(B){return B.host===_class_private_field_get(this,y)}getAdditionalScopesForProvider(B){var R;if(!(B!=null&&B.customScopes)||_class_private_field_get(this,$)==="generic")return[];var k;return(k=(R=B.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,$)])!==null&&k!==void 0?k:[]}async getCredentials(B){const{url:R,additionalScope:k,...L}=B,W=_class_private_field_get(this,c).default.slice();k!=null&&k.repoWrite&&W.push(..._class_private_field_get(this,c).repoWrite);const Ce=this.getAdditionalScopesForProvider(k);Ce.length&&W.push(...Ce);const Ve=[...new Set(W)],et=await _class_private_field_get(this,m).getAccessToken(Ve,L);return{token:et,headers:{Authorization:`Bearer ${et}`}}}constructor(B,R,k,L){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,y,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,$,{writable:!0,value:void 0}),_class_private_field_set(this,m,R),_class_private_field_set(this,y,k),_class_private_field_set(this,c,L),_class_private_field_set(this,$,B)}}var ue=t(79158);class G{static fromConfig(B){return ue.Lx.fromConfig(B)}}const Z=(0,u.T0)({id:"integration.scmintegrations"});var S=t(52322),V=t(73250),re=t(2784);const q=_=>{const{type:B}=_,R=(0,u.qD)(),k=V.Z;var L;const W=B&&(L=R.getSystemIcon(B))!==null&&L!==void 0?L:k;return(0,S.jsx)(W,{})}},79158:function(bt,$e,t){"use strict";t.d($e,{Lx:function(){return rr},BT:function(){return Ze}});var u=t(47842),r=t(82717),z=t.n(r),P=t(76635);function m(w){const h=new URL("http://example.com");return h.host=w,h.host===w}function y(w){try{return new URL(w),!0}catch{return!1}}function c(w,h){return{list(){return w},byUrl(x){try{const E=typeof x=="string"?new URL(x):x;return w.find(X=>h(X)===E.host)}catch{return}},byHost(x){return w.find(E=>h(E)===x)}}}function $(w){const{url:h,base:x,lineNumber:E}=w;try{return new URL(h),h}catch{}let X;if(h.startsWith("/")){const{filepath:be}=z()(x);X=new URL(x);const je=(0,P.trimEnd)(X.pathname.substring(0,X.pathname.length-be.length),"/");X.pathname=`${je}${h}`}else X=new URL(h,x);return X.search=new URL(x).search,E&&(X.hash=`L${E}`),X.toString()}const we="amazonaws.com";function ue(w){const h=w.getOptionalString("endpoint");var x;const E=(x=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let X,be;if(h){try{const hn=new URL(h);X=hn.host,be=hn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${h}' is not a valid URL`)}if(be!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${h}'`)}else X=we;const je=w.getOptionalString("accessKeyId"),Ee=w.getOptionalString("secretAccessKey"),ut=w.getOptionalString("roleArn"),Mt=w.getOptionalString("externalId");return{host:X,endpoint:h,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:Ee,roleArn:ut,externalId:Mt}}function G(w){const h=w.map(ue);return h.some(x=>x.host===we)||h.push({host:we}),h}class Z{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return $(h)}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(Z,"factory",({config:w})=>{var h;const x=G((h=w.getOptionalConfigArray("integrations.awsS3"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new Z(E)),E=>E.config.host)});var S=t(90383),V=t(22504),re=t(69866);const q="GB";var _=new WeakMap,B=new WeakMap,R=new WeakMap,k=new WeakMap,L=new WeakMap,W=new WeakMap,Ce=new WeakMap;class Ve{static fromRepoUrl(h){const x=new URL(h);let E,X,be;const je=x.pathname.split("/").map(Hn=>decodeURIComponent(Hn));if(je[2]==="_git"?(E=je[1],X=be=je[3]):je[3]==="_git"?(E=je[1],X=je[2],be=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,X=je[3],be=je[5]),!E||!X||!be)throw new Error("Azure URL must point to a git repository");var Ee;const ut=(Ee=x.searchParams.get("path"))!==null&&Ee!==void 0?Ee:void 0;let Mt;const hn=x.searchParams.get("version");if(hn){if(hn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=hn.slice(2)}return new Ve(x.origin,E,X,be,ut,Mt)}toRepoUrl(){let h;return(0,S.Z)(this,R)===(0,S.Z)(this,k)?h=(0,S.Z)(this,Ce).call(this,(0,S.Z)(this,B),"_git",(0,S.Z)(this,k)):h=(0,S.Z)(this,Ce).call(this,(0,S.Z)(this,B),(0,S.Z)(this,R),"_git",(0,S.Z)(this,k)),(0,S.Z)(this,L)&&h.searchParams.set("path",(0,S.Z)(this,L)),(0,S.Z)(this,W)&&h.searchParams.set("version",q+(0,S.Z)(this,W)),h.toString()}toFileUrl(){if(!(0,S.Z)(this,L))throw new Error("Azure URL must point to a specific path to be able to download a file");const h=(0,S.Z)(this,Ce).call(this,(0,S.Z)(this,B),(0,S.Z)(this,R),"_apis","git","repositories",(0,S.Z)(this,k),"items");return h.searchParams.set("api-version","6.0"),h.searchParams.set("path",(0,S.Z)(this,L)),(0,S.Z)(this,W)&&h.searchParams.set("version",(0,S.Z)(this,W)),h.toString()}toArchiveUrl(){const h=(0,S.Z)(this,Ce).call(this,(0,S.Z)(this,B),(0,S.Z)(this,R),"_apis","git","repositories",(0,S.Z)(this,k),"items");return h.searchParams.set("recursionLevel","full"),h.searchParams.set("download","true"),h.searchParams.set("api-version","6.0"),(0,S.Z)(this,L)&&h.searchParams.set("scopePath",(0,S.Z)(this,L)),(0,S.Z)(this,W)&&h.searchParams.set("version",(0,S.Z)(this,W)),h.toString()}toCommitsUrl(){const h=(0,S.Z)(this,Ce).call(this,(0,S.Z)(this,B),(0,S.Z)(this,R),"_apis","git","repositories",(0,S.Z)(this,k),"commits");return h.searchParams.set("api-version","6.0"),(0,S.Z)(this,W)&&h.searchParams.set("searchCriteria.itemVersion.version",(0,S.Z)(this,W)),h.toString()}getOwner(){return(0,S.Z)(this,B)}getProject(){return(0,S.Z)(this,R)}getRepo(){return(0,S.Z)(this,k)}getPath(){return(0,S.Z)(this,L)}getRef(){return(0,S.Z)(this,W)}constructor(h,x,E,X,be,je){(0,V.Z)(this,_,{writable:!0,value:void 0}),(0,V.Z)(this,B,{writable:!0,value:void 0}),(0,V.Z)(this,R,{writable:!0,value:void 0}),(0,V.Z)(this,k,{writable:!0,value:void 0}),(0,V.Z)(this,L,{writable:!0,value:void 0}),(0,V.Z)(this,W,{writable:!0,value:void 0}),(0,V.Z)(this,Ce,{writable:!0,value:(...Ee)=>{const ut=new URL((0,S.Z)(this,_));return ut.pathname=Ee.map(Mt=>encodeURIComponent(Mt)).join("/"),ut}}),(0,re.Z)(this,_,h),(0,re.Z)(this,B,x),(0,re.Z)(this,R,E),(0,re.Z)(this,k,X),(0,re.Z)(this,L,be),(0,re.Z)(this,W,je)}}const et="dev.azure.com";function K(w){var h;const x=(h=w.getOptionalString("host"))!==null&&h!==void 0?h:et,E=w.getOptionalString("token");if(!m(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:E}}function tt(w){const h=w.map(K);return h.some(x=>x.host===et)||h.push({host:et}),h}class dt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:x,base:E}=h;if(y(x))return x;try{const be=Ve.fromRepoUrl(E),je=new URL(E);var X;const Ee=new URL(`https://a.com${(X=be.getPath())!==null&&X!==void 0?X:""}`),ut=new URL(x,Ee).pathname;return je.searchParams.set("path",ut),h.lineNumber&&(je.searchParams.set("line",String(h.lineNumber)),je.searchParams.set("lineEnd",String(h.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(x,E).toString()}}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(dt,"factory",({config:w})=>{var h;const x=tt((h=w.getOptionalConfigArray("integrations.azure"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new dt(E)),E=>E.config.host)});var Me=t(48834).lW;function ft(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Ie(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function lt(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function Et(w,h){const x=h?{...h}:{};if(w.token){const E=Me.from(`:${w.token}`,"utf8");x.Authorization=`Basic ${E.toString("base64")}`}return{headers:x}}const pt="bitbucket.org",mt="https://api.bitbucket.org/2.0";function At(w){var h;const x=(h=w.getOptionalString("host"))!==null&&h!==void 0?h:pt;let E=w.getOptionalString("apiBaseUrl");const X=w.getOptionalString("token"),be=w.getOptionalString("username"),je=w.getOptionalString("appPassword");if(!m(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return E?E=(0,P.trimEnd)(E,"/"):x===pt?E=mt:E=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:E,token:X,username:be,appPassword:je}}function Nt(w){const h=w.map(At);return h.some(x=>x.host===pt)||h.push({host:pt,apiBaseUrl:mt}),h}class ze{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=$(h);if(!h.lineNumber)return x;const E=new URL(x);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${h.lineNumber}`:E.hash=`${h.lineNumber}`,E.toString()}resolveEditUrl(h){const x=z()(h),E=new URL(h);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",x.ref),E.toString()}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(ze,"factory",({config:w})=>{var h,x,E;const X=Nt((E=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(h=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&h!==void 0?h:[],...(x=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return c(X.map(be=>new ze(be)),be=>be.config.host)});var qt=t(96279),ve=t(48834).lW;async function he(w,h){const{name:x,owner:E,resource:X}=parseGitUrl(w),be=X==="bitbucket.org";let je=be?`${h.apiBaseUrl}/repositories/${E}/${x}`:`${h.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,Ee=await fetch(je,wt(h));if(Ee.status===404&&!be&&(je=`${h.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,Ee=await fetch(je,wt(h))),!Ee.ok){const Mt=`Failed to retrieve default branch from ${je}, ${Ee.status} ${Ee.statusText}`;throw new Error(Mt)}let ut;if(be)ut=(await Ee.json()).mainbranch.name;else{const{displayId:Mt}=await Ee.json();ut=Mt}if(!ut)throw new Error(`Failed to read default branch from ${je}. Response ${Ee.status} ${Ee.json()}`);return ut}async function Ne(w,h){const{name:x,owner:E,ref:X,protocol:be,resource:je,filepath:Ee}=parseGitUrl(w),ut=je==="bitbucket.org";let Mt=X;Mt||(Mt=await he(w,h));const hn=Ee?`&path=${encodeURIComponent(decodeURIComponent(Ee))}`:"";return ut?`${be}://${je}/${E}/${x}/get/${Mt}.tar.gz`:`${h.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Mt}&prefix=${E}-${x}${hn}`}function Je(w,h){try{const{owner:x,name:E,ref:X,filepathtype:be,filepath:je}=parseGitUrl(w);if(!x||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ee=je.replace(/^\//,"");if(h.host==="bitbucket.org"){if(!X)throw new Error("Invalid Bitbucket URL or file path");return`${h.apiBaseUrl}/repositories/${x}/${E}/src/${X}/${Ee}`}return`${h.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ee}?at=${X}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function wt(w){const h={};if(w.token)h.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const x=ve.from(`${w.username}:${w.appPassword}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}const jt="bitbucket.org",ot="https://api.bitbucket.org/2.0";function St(w){const h=jt,x=ot,E=w.getString("username"),X=w.getString("appPassword");return{host:h,apiBaseUrl:x,username:E,appPassword:X}}function kt(w){const h=w.map(St);return h.length===0&&h.push({host:jt,apiBaseUrl:ot}),h}class zt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=$(h);if(h.lineNumber){const E=new URL(x);return E.hash=`lines-${h.lineNumber}`,E.toString()}return x}resolveEditUrl(h){const x=z()(h),E=new URL(h);return E.searchParams.set("mode","edit"),E.searchParams.set("at",x.ref),E.toString()}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(zt,"factory",({config:w})=>{var h;const x=kt((h=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new zt(E)),E=>E.config.host)});var Bt=t(48834).lW;async function on(w,h){const{name:x,owner:E}=parseGitUrl(w),X=`${h.apiBaseUrl}/repositories/${E}/${x}`,be=await fetch(X,Nn(h));if(!be.ok){const ut=`Failed to retrieve default branch from ${X}, ${be.status} ${be.statusText}`;throw new Error(ut)}const Ee=(await be.json()).mainbranch.name;if(!Ee)throw new Error(`Failed to read default branch from ${X}. Response ${be.status} ${be.json()}`);return Ee}async function Wt(w,h){const{name:x,owner:E,ref:X,protocol:be,resource:je}=parseGitUrl(w);let Ee=X;return Ee||(Ee=await on(w,h)),`${be}://${je}/${E}/${x}/get/${Ee}.tar.gz`}function Vt(w,h){try{const{owner:x,name:E,ref:X,filepathtype:be,filepath:je}=parseGitUrl(w);if(!x||!E||be!=="src"&&be!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ee=je.replace(/^\//,"");if(!X)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${h.apiBaseUrl}/repositories/${x}/${E}/src/${X}/${Ee}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function Nn(w){const h={};if(w.username&&w.appPassword){const x=Bt.from(`${w.username}:${w.appPassword}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}function In(w){const h=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token"),X=w.getOptionalString("username"),be=w.getOptionalString("password");if(!m(h))throw new Error(`Invalid Bitbucket Server integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:x,token:E,username:X,password:be}}function ln(w){return w.map(In)}class wn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const x=$(h);if(h.lineNumber){const E=new URL(x);return E.hash=h.lineNumber.toString(),E.toString()}return x}resolveEditUrl(h){return h.includes("?")?h.substring(0,h.indexOf("?")):h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(wn,"factory",({config:w})=>{var h;const x=ln((h=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new wn(E)),E=>E.config.host)});var Fn=t(48834).lW;async function Un(w,h){const{name:x,owner:E}=parseGitUrl(w);let X=`${h.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,be=await fetch(X,nt(h));if(be.status===404&&(X=`${h.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,be=await fetch(X,nt(h))),!be.ok){const ut=`Failed to retrieve default branch from ${X}, ${be.status} ${be.statusText}`;throw new Error(ut)}const{displayId:je}=await be.json(),Ee=je;if(!Ee)throw new Error(`Failed to read default branch from ${X}. Response ${be.status} ${be.json()}`);return Ee}async function Mn(w,h){const{name:x,owner:E,ref:X,filepath:be}=parseGitUrl(w);let je=X;je||(je=await Un(w,h));const Ee=be?`&path=${encodeURIComponent(decodeURIComponent(be))}`:"";return`${h.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${je}&prefix=${E}-${x}${Ee}`}function Jn(w,h){try{const{owner:x,name:E,ref:X,filepathtype:be,filepath:je}=parseGitUrl(w);if(!x||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ee=je.replace(/^\//,"");return`${h.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ee}?at=${X}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function nt(w){const h={};if(w.token)h.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const x=Fn.from(`${w.username}:${w.password}`,"utf8");h.Authorization=`Basic ${x.toString("base64")}`}return{headers:h}}function zn(w){const h=w.getString("host");let x=w.getOptionalString("baseUrl"),E=w.getOptionalString("cloneUrl"),X=w.getOptionalString("gitilesBaseUrl");const be=w.getOptionalString("username"),je=w.getOptionalString("password");if(m(h)){if(x&&!y(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(E&&!y(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(X&&!y(X))throw new Error(`Invalid Gerrit integration config, '${X}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}`,X?X=(0,P.trimEnd)(X,"/"):X=`https://${h}`,E?E=(0,P.trimEnd)(E,"/"):E=x,{host:h,baseUrl:x,cloneUrl:E,gitilesBaseUrl:X,username:be,password:je}}function Pn(w){return w.map(zn)}var Wn=t(48834).lW;const Sn=")]}'";function sn(w,h){const E=h.replace(w.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),X=E.indexOf("+");if(X<=0)throw new Error(`Unable to parse project from url: ${h}`);const be=(0,P.trimStart)(E.slice(0,X).join("/"),"/"),je=E.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${h}`);const Ee=E[je+1],ut=E.slice(je+2).join("/");return{branch:Ee,filePath:ut===""?"/":ut,project:be}}function Ln(w,h,x,E){return`${w.gitilesBaseUrl}/${h}/+/refs/heads/${x}/${(0,P.trimStart)(E,"/")}`}function gn(w){return w.password?"/a/":"/"}function jn(w,h){const{branch:x,project:E}=sn(w,h);return`${w.baseUrl}${gn(w)}projects/${encodeURIComponent(E)}/branches/${x}`}function Vn(w,h){const{project:x}=sn(w,h);return`${w.cloneUrl}${gn(w)}${x}`}function fe(w,h){const{branch:x,filePath:E,project:X}=sn(w,h);return`${w.baseUrl}${gn(w)}projects/${encodeURIComponent(X)}/branches/${x}/files/${encodeURIComponent(E)}/content`}function oe(w){return`${w.baseUrl}${gn(w)}projects/`}function ke(w){const h={};if(!w.password)return h;const x=Wn.from(`${w.username}:${w.password}`,"utf8");return h.Authorization=`Basic ${x.toString("base64")}`,{headers:h}}async function Fe(w){const h=await w.text();if(h.startsWith(Sn))try{return JSON.parse(h.slice(Sn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${h.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${h.slice(0,10)}`)}class Ke{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:x,base:E,lineNumber:X}=h;let be;if(x.startsWith("/")){const{branch:je,project:Ee}=sn(this.config,E);return Ln(this.config,Ee,je,x)}return x?be=new URL(x,E):be=new URL(E),X&&(be.hash=X.toString()),be.toString()}resolveEditUrl(h){return h}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(Ke,"factory",({config:w})=>{var h;const x=Pn((h=w.getOptionalConfigArray("integrations.gerrit"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new Ke(E)),E=>E.config.host)});function te(w){const h=w.getString("host");let x=w.getOptionalString("baseUrl");const E=w.getOptionalString("username"),X=w.getOptionalString("password");if(!m(h))throw new Error(`Invalid Gitea integration config, '${h}' is not a valid host`);return x?x=(0,P.trimEnd)(x,"/"):x=`https://${h}`,{host:h,baseUrl:x,username:E,password:X}}var D=t(48834).lW;function pe(w,h){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[X,be,je,Ee,ut,Mt,...hn]=h.replace(E,"").split("/"),Hn=hn.join("/").replace(/^\//,"");return`${E}/${be}/${je}/_edit/${Mt}/${Hn}`}catch(E){throw new Error(`Incorrect URL: ${h}, ${E}`)}}function Ae(w,h){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[X,be,je,Ee,ut,Mt,...hn]=h.replace(E,"").split("/"),Hn=hn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${be}/${je}/contents/${Hn}?ref=${Mt}`}catch(E){throw new Error(`Incorrect URL: ${h}, ${E}`)}}function Qe(w){const h={},{username:x,password:E}=w;return E?(x?h.Authorization=`basic ${D.from(`${x}:${E}`).toString("base64")}`:h.Authorization=`token ${E}`,{headers:h}):h}class Xe{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(h){return $(h)}resolveEditUrl(h){return pe(this.config,h)}constructor(h){(0,u.Z)(this,"config",void 0),this.config=h}}(0,u.Z)(Xe,"factory",({config:w})=>{var h;const E=((h=w.getOptionalConfigArray("integrations.gitea"))!==null&&h!==void 0?h:[]).map(X=>te(X));return c(E.map(X=>new Xe(X)),X=>X.config.host)});const Tt="github.com",Gt="https://api.github.com",an="https://raw.githubusercontent.com";function ne(w){var h,x;const E=(x=w.getOptionalString("host"))!==null&&x!==void 0?x:Tt;let X=w.getOptionalString("apiBaseUrl"),be=w.getOptionalString("rawBaseUrl");const je=w.getOptionalString("token"),Ee=(h=w.getOptionalConfigArray("apps"))===null||h===void 0?void 0:h.map(ut=>({appId:ut.getNumber("appId"),clientId:ut.getString("clientId"),clientSecret:ut.getString("clientSecret"),webhookSecret:ut.getString("webhookSecret"),privateKey:ut.getString("privateKey"),allowedInstallationOwners:ut.getOptionalStringArray("allowedInstallationOwners")}));if(!m(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return X?X=(0,P.trimEnd)(X,"/"):E===Tt&&(X=Gt),be?be=(0,P.trimEnd)(be,"/"):E===Tt&&(be=an),{host:E,apiBaseUrl:X,rawBaseUrl:be,token:je,apps:Ee}}function Q(w){const h=w.map(ne);return h.some(x=>x.host===Tt)||h.push({host:Tt,apiBaseUrl:Gt,rawBaseUrl:an}),h}function se(w,h,x){try{const{owner:E,name:X,ref:be,filepathtype:je,filepath:Ee}=parseGitUrl(w);if(!E||!X||!be||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const ut=Ee.replace(/^\//,"");return j(h,x)==="api"?`${h.apiBaseUrl}/repos/${E}/${X}/contents/${ut}?ref=${be}`:`${h.rawBaseUrl}/${E}/${X}/${be}/${ut}`}catch(E){throw new Error(`Incorrect URL: ${w}, ${E}`)}}function g(w,h){const x={};return j(w,h)==="api"&&(x.Accept="application/vnd.github.v3.raw"),h.token&&(x.Authorization=`token ${h.token}`),{headers:x}}function j(w,h){return w.apiBaseUrl&&(h.token||!w.rawBaseUrl)?"api":"raw"}var J=t(42822),Y=t(89393),ge=t(26228);class me{async getOrCreateToken(h,x,E){let X=this.tokenCache.get(h);if((!X||this.isExpired(X.expiresAt))&&(X=await E(),X.expiresAt=X.expiresAt.minus({minutes:10}),this.tokenCache.set(h,X)),!this.appliesToRepo(X,x))throw new Error(`The Backstage GitHub application used in the ${h} organization does not have access to a repository with the name ${x}`);return{accessToken:X.token}}appliesToRepo(h,x){return x===void 0?!0:h.repositories!==void 0?h.repositories.includes(x):!0}constructor(){(0,u.Z)(this,"tokenCache",new Map),(0,u.Z)(this,"isExpired",h=>ge.ou.local()>h)}}const Ue={Accept:"application/vnd.github.machine-man-preview+json"};class it{async getInstallationCredentials(h,x){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(h)))return{accessToken:void 0}}return this.cache.getOrCreateToken(h,x,async()=>{const{installationId:X,suspended:be}=await this.getInstallationData(h);if(be)throw new Error(`The GitHub application for ${h} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:X,headers:Ue});let Ee;if(je.data.repository_selection==="selected"){const Mt=new Y.v({baseUrl:this.baseUrl,auth:je.data.token}),hn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var ut;Ee=((ut=hn.repositories)!==null&&ut!==void 0?ut:hn).map(xr=>xr.name)}return{token:je.data.token,expiresAt:ge.ou.fromISO(je.data.expires_at),repositories:Ee}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(h){const E=(await this.getInstallations()).find(be=>{var je,Ee;return((je=be.account)===null||je===void 0||(Ee=je.login)===null||Ee===void 0?void 0:Ee.toLocaleLowerCase("en-US"))===h.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const X=new Error(`No app installation found for ${h} in ${this.baseAuthConfig.appId}`);throw X.name="NotFoundError",X}constructor(h,x){(0,u.Z)(this,"appClient",void 0),(0,u.Z)(this,"baseUrl",void 0),(0,u.Z)(this,"baseAuthConfig",void 0),(0,u.Z)(this,"cache",new me),(0,u.Z)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=h.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:h.appId,privateKey:h.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new Y.v({baseUrl:x,headers:Ue,authStrategy:J.i,auth:this.baseAuthConfig})}}class rt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(h,x){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(Ee=>Ee.getInstallationCredentials(h,x).then(ut=>({credentials:ut,error:void 0}),ut=>({credentials:void 0,error:ut})))),X=E.find(Ee=>Ee.credentials);if(X)return X.credentials.accessToken;const je=E.map(Ee=>Ee.error).find(Ee=>Ee.name!=="NotFoundError");if(je)throw je}constructor(h){var x;(0,u.Z)(this,"apps",void 0);var E;this.apps=(E=(x=h.apps)===null||x===void 0?void 0:x.map(X=>new it(X,h.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class yt{async getCredentials(h){const x=z()(h.url),E=x.owner||x.name,X=x.owner?x.name:void 0;let be="app",je=await this.githubAppCredentialsMux.getAppToken(E,X);return je||(be="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:be}}constructor(h,x){(0,u.Z)(this,"githubAppCredentialsMux",void 0),(0,u.Z)(this,"token",void 0),this.githubAppCredentialsMux=h,this.token=x}}(0,u.Z)(yt,"create",w=>new yt(new rt(w),w.token));class at{static fromIntegrations(h){const x=new Map;return h.github.list().forEach(E=>{const X=SingleInstanceGithubCredentialsProvider.create(E.config);x.set(E.config.host,X)}),new at(x)}async getCredentials(h){const x=new URL(h.url),E=this.providers.get(x.host);if(!E)throw new Error(`There is no GitHub integration that matches ${h.url}. Please add a configuration for an integration.`);return E.getCredentials(h)}constructor(h){_define_property(this,"providers",void 0),this.providers=h}}class qe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return Ze($(h),"tree")}resolveEditUrl(h){return Ze(h,"edit")}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(qe,"factory",({config:w})=>{var h;const x=Q((h=w.getOptionalConfigArray("integrations.github"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new qe(E)),E=>E.config.host)});function Ze(w,h){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,E,X,be)=>`//${E}/${X}/${be}/${h}/`)}const $t=null;class Ht extends qe{get config(){return super.config}constructor(h){super(h)}}(0,u.Z)(Ht,"factory",qe.factory);const Rt=null,It=null,en=null,Dt="gitlab.com",vt="https://gitlab.com/api/v4";function _e(w){const h=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token");let X=w.getOptionalString("baseUrl");if(x?x=(0,P.trimEnd)(x,"/"):h===Dt&&(x=vt),X?X=(0,P.trimEnd)(X,"/"):X=`https://${h}`,m(h)){if(!x||!y(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!y(X))throw new Error(`Invalid GitLab integration config, '${X}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${h}' is not a valid host`);return{host:h,token:E,apiBaseUrl:x,baseUrl:X}}function Ot(w){const h=w.map(_e);return h.some(x=>x.host===Dt)||h.push({host:Dt,apiBaseUrl:vt,baseUrl:`https://${Dt}`}),h}function tn(w){let h="";return w.host!==Dt&&(h=new URL(w.baseUrl).pathname),trimEnd(h,"/")}async function En(w,h){const x=await Qn(w,h);return Cn(w,x,h).toString()}function cn(w){const{token:h=""}=w;return{headers:{"PRIVATE-TOKEN":h}}}function Cn(w,h,x){try{const E=new URL(w),X=E.pathname.split("/blob/").slice(1).join("/blob/"),[be,...je]=X.split("/"),Ee=getGitLabIntegrationRelativePath(x);return E.pathname=[...Ee?[Ee]:[],"api/v4/projects",h,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${be}`,E}catch(E){throw new Error(`Incorrect url: ${w}, ${E}`)}}async function Qn(w,h){const x=new URL(w);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const X=getGitLabIntegrationRelativePath(h);X&&(E=E.replace(X,""));const be=new URL(`${x.origin}${X}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(be.toString(),cn(h)),Ee=await je.json();if(!je.ok)throw new Error(`GitLab Error '${Ee.error}', ${Ee.error_description}`);return Number(Ee.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${w}, ${E}`)}}class kn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return $(h)}resolveEditUrl(h){return mn(h,"edit")}constructor(h){(0,u.Z)(this,"integrationConfig",void 0),this.integrationConfig=h}}(0,u.Z)(kn,"factory",({config:w})=>{var h;const x=Ot((h=w.getOptionalConfigArray("integrations.gitlab"))!==null&&h!==void 0?h:[]);return c(x.map(E=>new kn(E)),E=>E.config.host)});function mn(w,h){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${h}/`)}class rr{static fromConfig(h){return new rr({awsS3:Z.factory({config:h}),azure:dt.factory({config:h}),bitbucket:ze.factory({config:h}),bitbucketCloud:zt.factory({config:h}),bitbucketServer:wn.factory({config:h}),gerrit:Ke.factory({config:h}),github:qe.factory({config:h}),gitlab:kn.factory({config:h}),gitea:Xe.factory({config:h})})}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(h=>h.list())}byUrl(h){let x=Object.values(this.byType).map(E=>E.byUrl(h)).filter(Boolean);if(x.length>1){const E=x.filter(X=>!(X instanceof ze));E.length!==0&&(x=E)}return x[0]}byHost(h){return Object.values(this.byType).map(x=>x.byHost(h)).find(Boolean)}resolveUrl(h){const x=this.byUrl(h.base);return x?x.resolveUrl(h):$(h)}resolveEditUrl(h){const x=this.byUrl(h);return x?x.resolveEditUrl(h):h}constructor(h){(0,u.Z)(this,"byType",void 0),this.byType=h}}},6290:function(bt,$e,t){"use strict";var u={};t.r(u),t.d(u,{TechDocsPlugin:function(){return L.s4}});var r=t(52322),z=t(2784),P=t(28316),m=t(79635),y=t(60871);const c=(0,y.T0)({id:"plugin.techdocs.storageservice"}),$=(0,y.T0)({id:"plugin.techdocs.service"});var we=t(92077),ue=t(95481),G=t(7476),Z=t(93225),S=t(67896),V=t(65124),re=t(22478),q=t(85478),_=t(68435),B=t(3482),R=t(42081),k=t(48431),L=t(89258),W=t(52943),Ce=t(61886),Ve=t(13980),et=t.n(Ve),K=t(47842);class tt{get(n){for(const s of this.holders){const l=s.get(n);if(l)return l}}constructor(...n){(0,K.Z)(this,"holders",void 0),this.holders=n}}var dt=t(51837);const Me=(0,dt.CT)("api-context"),ft=i=>{var n;const{apis:s,children:l}=i,f=(n=(0,z.useContext)(Me))===null||n===void 0?void 0:n.atVersion(1),T=f?new tt(s,f):s;return(0,r.jsx)(Me.Provider,{value:(0,dt.EI)({1:T}),children:l})};ft.propTypes={apis:et().shape({get:et().func.isRequired}).isRequired,children:et().node};class Ie{static validateFactories(n,s){for(const l of s){const f=[l],T=new Set;for(;f.length;){const O=f.shift(),M=n.get(O);if(M)for(const ae of Object.values(M.deps)){if(ae.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);T.has(ae)||(T.add(ae),f.push(ae))}}}}get(n){return this.load(n)}load(n,s=[]){const l=this.apis.get(n.id);if(l)return l;const f=this.factories.get(n);if(!f)return;if(s.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const T=this.loadDeps(n,f.deps,[...s,f.api]),O=f.factory(T);return this.apis.set(n.id,O),O}loadDeps(n,s,l){const f={};for(const T in s)if(s.hasOwnProperty(T)){const O=s[T],M=this.load(O,l);if(!M)throw new Error(`No API factory available for dependency ${O} of dependent ${n}`);f[T]=M}return f}constructor(n){(0,K.Z)(this,"factories",void 0),(0,K.Z)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var lt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(lt||(lt={}));class Et{register(n,s){const l=lt[n],f=this.factories.get(s.api.id);return f&&f.priority>=l?!1:(this.factories.set(s.api.id,{priority:l,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,K.Z)(this,"factories",new Map)}}function pt(i){return new Promise((n,s)=>{const l=i.width||500,f=i.height||700,T=window.screen.width/2-l/2,O=window.screen.height/2-f/2,M=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${O},left=${T}`);let ae="";if(!M||typeof M.closed=="undefined"||M.closed){const ht=new Error("Failed to open auth popup.");ht.name="PopupRejectedError",s(ht);return}const Te=ht=>{if(ht.source!==M||ht.origin!==i.origin)return;const{data:xt}=ht;if(xt.type==="config_info"){ae=xt.targetOrigin;return}if(xt.type!=="authorization_response")return;const Ct=xt;if("error"in Ct){const Ut=new Error(Ct.error.message);Ut.name=Ct.error.name,s(Ut)}else n(Ct.response);Ge()},Oe=setInterval(()=>{if(M.closed){const ht=`Login failed, ${ae&&ae!==window.location.origin?`Incorrect app origin, expected ${ae}`:"popup was closed"}`,xt=new Error(ht);xt.name="PopupClosedError",s(xt),Ge()}},100);function Ge(){window.removeEventListener("message",Te),clearInterval(Oe)}window.addEventListener("message",Te)})}let mt=!1;function At(i){return[...i].join(" ")}class Nt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(l=>{throw new Error(`Auth refresh request failed, ${l}`)});if(!n.ok){const l=new Error(`Auth refresh request failed, ${n.statusText}`);throw l.status=n.status,l}const s=await n.json();if(s.error){const l=new Error(s.error.message);throw s.error.name&&(l.name=s.error.name),l}return await this.sessionTransform(s)}async removeSession(){const n=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(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),l=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),f=await pt({url:l,name:`${this.provider.title} Login`,origin:new URL(l).origin,width:450,height:730});return await this.sessionTransform(f)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const l=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...s,env:this.environment});return`${l}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([l,f])=>{if(typeof f=="string")return`${encodeURIComponent(l)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(l)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,K.Z)(this,"discoveryApi",void 0),(0,K.Z)(this,"environment",void 0),(0,K.Z)(this,"provider",void 0),(0,K.Z)(this,"joinScopesFunc",void 0),(0,K.Z)(this,"authRequester",void 0),(0,K.Z)(this,"sessionTransform",void 0),(0,K.Z)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:l,environment:f,provider:T,joinScopes:O=At,oauthRequestApi:M,sessionTransform:ae=Oe=>Oe}=n;!mt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),mt=!0);var Te;this.enableExperimentalRedirectFlow=s&&(Te=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Te!==void 0?Te:!1,this.authRequester=M.createAuthRequester({provider:T,onAuthRequest:async Oe=>this.enableExperimentalRedirectFlow?this.executeRedirect(Oe):this.showPopup(Oe)}),this.discoveryApi=l,this.environment=f,this.provider=T,this.joinScopesFunc=O,this.sessionTransform=ae}}function ze(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class qt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return ze(l,s)}getExtendedScope(n,s){const l=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const T of f)l.add(T)}if(s)for(const f of s)l.add(f);return l}constructor(n){(0,K.Z)(this,"options",void 0),this.options=n}}var ve=t(82394),he=t.n(ve);let Ne=Symbol.observable;class Je{[Ne](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,l){const f=typeof n=="function"?{next:n,error:s,complete:l}:n;return this.observable.subscribe(f)}constructor(){(0,K.Z)(this,"isClosed",!1),(0,K.Z)(this,"terminatingError",void 0),(0,K.Z)(this,"observable",new(he())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,K.Z)(this,"subscribers",new Set)}}let wt=Symbol.observable;class jt{[wt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,l){const f=typeof n=="function"?{next:n,error:s,complete:l}:n;return this.observable.subscribe(f)}constructor(n){(0,K.Z)(this,"isClosed",void 0),(0,K.Z)(this,"currentValue",void 0),(0,K.Z)(this,"terminatingError",void 0),(0,K.Z)(this,"observable",void 0),(0,K.Z)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(he())(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(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?y.sM.SignedIn:y.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,K.Z)(this,"subject",new jt(y.sM.SignedOut)),(0,K.Z)(this,"signedIn",!1)}}class St{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const l=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),T=this.sessionScopesFunc(l);return ze(T,f)&&(this.currentSession=l),l}catch(l){if(n.optional)return;throw l}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){(0,K.Z)(this,"connector",void 0),(0,K.Z)(this,"helper",void 0),(0,K.Z)(this,"sessionScopesFunc",void 0),(0,K.Z)(this,"sessionShouldRefreshFunc",void 0),(0,K.Z)(this,"stateTracker",new ot),(0,K.Z)(this,"refreshPromise",void 0),(0,K.Z)(this,"currentSession",void 0);const{connector:s,defaultScopes:l=new Set,sessionScopes:f,sessionShouldRefresh:T}=n;this.connector=s,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=T,this.helper=new qt({sessionScopes:f,defaultScopes:l})}}class kt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:l=new Set,sessionScopes:f}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:l})}}const zt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Bt{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=zt,oauthRequestApi:O,defaultScopes:M=[],scopeTransform:ae=Ge=>Ge}=n,Te=new Nt({configApi:s,discoveryApi:l,environment:f,provider:T,oauthRequestApi:O,sessionTransform(Ge){return{...Ge,providerInfo:{idToken:Ge.providerInfo.idToken,accessToken:Ge.providerInfo.accessToken,scopes:Bt.normalizeScopes(ae,Ge.providerInfo.scope),expiresAt:new Date(Date.now()+Ge.providerInfo.expiresInSeconds*1e3)}}}}),Oe=new St({connector:Te,defaultScopes:new Set(M),sessionScopes:Ge=>Ge.providerInfo.scopes,sessionShouldRefresh:Ge=>(Ge.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Bt({sessionManager:Oe,scopeTransform:ae})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const l=Bt.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...s,scopes:l});var T;return(T=f==null?void 0:f.providerInfo.accessToken)!==null&&T!==void 0?T:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var l;return(l=s==null?void 0:s.providerInfo.idToken)!==null&&l!==void 0?l:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const l=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(l))}constructor(n){(0,K.Z)(this,"sessionManager",void 0),(0,K.Z)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const on={id:"github",title:"GitHub",icon:()=>null};class Wt{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=on,oauthRequestApi:O,defaultScopes:M=["read:user"]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:M})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Nn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=Vt,oauthRequestApi:O,defaultScopes:M=["read_user"]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:M})}}const In={id:"google",title:"Google",icon:()=>null},ln="https://www.googleapis.com/auth/";class wn{static create(n){const{configApi:s,discoveryApi:l,oauthRequestApi:f,environment:T="development",provider:O=In,defaultScopes:M=["openid",`${ln}userinfo.email`,`${ln}userinfo.profile`]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:f,provider:O,environment:T,defaultScopes:M,scopeTransform(ae){return ae.map(Te=>Te==="openid"?Te:Te==="profile"||Te==="email"?`${ln}userinfo.${Te}`:Te.startsWith(ln)?Te:`${ln}${Te}`)}})}}const Fn={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Mn="okta.";class Jn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=Fn,oauthRequestApi:O,defaultScopes:M=["openid","email","profile","offline_access"]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:M,scopeTransform(ae){return ae.map(Te=>Un.has(Te)||Te.startsWith(Mn)?Te:`${Mn}${Te}`)}})}}var nt=t(30195);const zn=nt.z.object({profile:nt.z.object({email:nt.z.string().optional(),displayName:nt.z.string().optional(),picture:nt.z.string().optional()}),backstageIdentity:nt.z.object({token:nt.z.string(),identity:nt.z.object({type:nt.z.literal("user"),userEntityRef:nt.z.string(),ownershipEntityRefs:nt.z.array(nt.z.string())})})}),Pn={id:"saml",title:"SAML",icon:()=>null};class Wn{static create(n){const{discoveryApi:s,environment:l="development",provider:f=Pn}=n,T=new DirectAuthConnector({discoveryApi:s,environment:l,provider:f}),O=new StaticAuthSessionManager({connector:T}),M=new AuthSessionStore({manager:O,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Wn(M)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const Sn={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(n){const{configApi:s,environment:l="development",provider:f=Sn,oauthRequestApi:T,discoveryApi:O,defaultScopes:M=["openid","offline_access","profile","email","User.Read"]}=n;return Bt.create({configApi:s,discoveryApi:O,oauthRequestApi:T,provider:f,environment:l,defaultScopes:M})}}const Ln={id:"onelogin",title:"onelogin",icon:()=>null},gn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),jn="onelogin.";class Vn{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=Ln,oauthRequestApi:O}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(ae=>gn.has(ae)||ae.startsWith(jn)?ae:`${jn}${ae}`)}})}}const fe={id:"bitbucket",title:"Bitbucket",icon:()=>null};class oe{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=fe,oauthRequestApi:O,defaultScopes:M=["team"]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:M})}}const ke={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Fe{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=ke,oauthRequestApi:O,defaultScopes:M=["PROJECT_ADMIN"]}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f,defaultScopes:M})}}const Ke={id:"atlassian",title:"Atlassian",icon:()=>null};class te{static create(n){const{configApi:s,discoveryApi:l,environment:f="development",provider:T=Ke,oauthRequestApi:O}=n;return Bt.create({configApi:s,discoveryApi:l,oauthRequestApi:O,provider:T,environment:f})}}class D{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,K.Z)(this,"subject",new Je)}}class pe{captureEvent(n){}}const Ae="theme";class Qe{static createWithStorage(n){const s=new Qe(n);if(!window.localStorage)return s;var l;const f=(l=window.localStorage.getItem(Ae))!==null&&l!==void 0?l:void 0;return s.setActiveThemeId(f),s.activeThemeId$().subscribe(T=>{T?window.localStorage.setItem(Ae,T):window.localStorage.removeItem(Ae)}),window.addEventListener("storage",T=>{if(T.key===Ae){var O;const M=(O=localStorage.getItem(Ae))!==null&&O!==void 0?O:void 0;s.setActiveThemeId(M)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,K.Z)(this,"themes",void 0),(0,K.Z)(this,"activeThemeId",void 0),(0,K.Z)(this,"subject",void 0),this.themes=n,this.subject=new jt(void 0)}}var Xe=t(9850),Tt=t.n(Xe),Gt=t(12782),an=t.n(Gt);const ne=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Q(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function se(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const g={type(i,n,s,l){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${l}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class j{static fromConfigs(n){return n.length===0?new j(void 0):n.reduce((s,{data:l,context:f,filteredKeys:T,deprecatedKeys:O})=>{const M=new j(l,f,s);if(M.filteredKeys=T,O)for(const{key:ae,description:Te}of O)console.warn(`The configuration key '${ae}' of ${f} is deprecated and may be removed soon. ${Te||""}`);return M},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var f;return(f=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var l;const f=(l=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&l!==void 0?l:[];return[...new Set([...s,...f])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const l=Tt()(this.readValue(n)),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(l===void 0){if(!1)var T;return f}else if(f===void 0)return l;return an()({},{value:f},{value:l},(O,M)=>!Q(M)||!Q(O)?M:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const l=this.readValue(n),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(Q(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(g.type(this.fullKey(n),this.context,se(l),"object"));return f}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[T,O]of f.entries())if(!Q(O))return{expected:"object-array",value:O,key:`${n}[${T}]`};return!0});if(!s){if(!1)var l;return}return s.map((f,T)=>this.copy(f,`${n}[${T}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const l=Number(s);if(!Number.isFinite(l))throw new Error(g.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const l=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(l))return!0;if(/^(?:n|no|false|0|off)$/i.test(l))return!1;throw new Error(g.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(g.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[l,f]of s.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${l}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,l){const f=new j(n,this.context,l,this.fullKey(s));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,s){const l=this.readValue(n);if(l===void 0){var f;if(!1)var T;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,s)}const O=s(l);if(O!==!0){const{key:M=n,value:ae=l,expected:Te}=O;throw new TypeError(g.type(this.fullKey(M),this.context,se(ae),Te))}return l}readValue(n){const s=n?n.split("."):[];for(const f of s)if(!ne.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,T]of s.entries())if(Q(l))l=l[T];else if(l!==void 0){const O=this.fullKey(s.slice(0,f).join("."));throw new TypeError(g.type(O,this.context,se(l),"object"))}return l}constructor(n,s="mock-config",l,f=""){(0,K.Z)(this,"data",void 0),(0,K.Z)(this,"context",void 0),(0,K.Z)(this,"fallback",void 0),(0,K.Z)(this,"prefix",void 0),(0,K.Z)(this,"filteredKeys",void 0),(0,K.Z)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=l,this.prefix=f,this.notifiedFilteredKeys=new Set}}const J="Invalid discovery URL pattern,";class Y{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),l=s.join("pluginId");let f;try{f=new URL(l)}catch{throw new Error(`${J} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${J} URL must not have a hash`);if(f.search)throw new Error(`${J} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${J} URL must not end with a slash`);return new Y(s)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){(0,K.Z)(this,"parts",void 0),this.parts=n}}class ge{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,K.Z)(this,"alertApi",void 0),(0,K.Z)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class me{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,K.Z)(this,"subject",new Je)}}class Ue{static forward(n,s){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,s)})}}function it(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 rt{registerFlag(n){it(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===y.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[l,f]of Object.entries(n.states))this.flags.set(l,f);const s=Array.from(this.flags.entries()).filter(([,l])=>l===y.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const l=Object.entries(s).filter(([f,T])=>(it(f),T===y.CL.Active));return new Map(l)}catch{return new Map}}constructor(){(0,K.Z)(this,"registeredFeatureFlags",[]),(0,K.Z)(this,"flags",void 0)}}function yt(i){let n=i.baseImplementation||t.g.fetch;var s;const l=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class at{static create(n){var s,l;const f=qe(n),T=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",O=((l=n.header)===null||l===void 0?void 0:l.value)||(M=>`Bearer ${M}`);return new at(n.identityApi,f,T,O)}apply(n){return async(s,l)=>{const f=new Request(s,l),{token:T}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof T!="string"||!T||!this.allowUrl(f.url)?n(s,l):(f.headers.set(this.headerName,this.headerValue(T)),n(f))}}constructor(n,s,l,f){(0,K.Z)(this,"identityApi",void 0),(0,K.Z)(this,"allowUrl",void 0),(0,K.Z)(this,"headerName",void 0),(0,K.Z)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=l,this.headerValue=f}}function qe(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Ze(i.urlPrefixAllowlist):i.config?Ze([i.config.getString("backend.baseUrl")]):()=>!1}function Ze(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(l=>s===l||s.startsWith(`${l}/`))}function $t(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class Ht{apply(n){return async(s,l)=>{const f=new Request(s,l),T="plugin://";if(!f.url.startsWith(T))return n(s,l);const{hostname:O,pathname:M,search:ae,hash:Te,username:Oe,password:Ge}=new URL(`http://${f.url.substring(T.length)}`);let ht=await this.discoveryApi.getBaseUrl(O);if(Oe||Ge){const Ct=new URL(ht),Ut=`${Oe}${Ge?`:${Ge}`:""}@`;ht=`${Ct.protocol}//${Ut}${Ct.host}${Ct.pathname}`}const xt=`${$t(ht,M)}${ae}${Te}`;return n(xt,typeof s=="string"||Rt(s)?l:s)}}constructor(n){(0,K.Z)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Rt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class It{static resolvePluginProtocol(n){return new Ht(n.discoveryApi)}static injectIdentityAuth(n){return at.create(n)}constructor(){}}function en(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function Dt(i,...n){const s=new Set(i);for(const l of n)for(const f of l)s.add(f);return s}class vt{request(n){return new Promise((s,l)=>{this.requests.push({scopes:n,resolve:s,reject:l}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(l=>en(n,l.scopes)?(l.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,l)=>Dt(s,l.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,K.Z)(this,"requests",[]),(0,K.Z)(this,"subject",new jt(this.getCurrentPending()))}}class _e{createAuthRequester(n){const s=new vt,l=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:f=>{const T=this.currentRequests.slice(),O=this.makeAuthRequest(f,n);O?T[l]=O:delete T[l],this.currentRequests=T,this.subject.next(T.filter(Boolean))}}),f=>s.request(f)}makeAuthRequest(n,s){const{scopes:l}=n;if(l)return{provider:s.provider,trigger:async()=>{const f=await s.onAuthRequest(l);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){(0,K.Z)(this,"subject",new jt([])),(0,K.Z)(this,"currentRequests",[]),(0,K.Z)(this,"handlerCount",0)}}const Ot=new Map;class tn{static create(n){var s;return new tn((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of Ot.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(l)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,l="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(s=JSON.parse(f,(T,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),l="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:l}}forBucket(n){const s=`${this.namespace}/${n}`;return Ot.has(s)||Ot.set(s,new tn(s,this.errorApi)),Ot.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return tn.hasSubscribed||(tn.addStorageEventListener(),tn.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const l of this.subscribers)l.next(s)}constructor(n,s){(0,K.Z)(this,"namespace",void 0),(0,K.Z)(this,"errorApi",void 0),(0,K.Z)(this,"subscribers",void 0),(0,K.Z)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(he())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}(0,K.Z)(tn,"hasSubscribed",!1);const En=(0,z.createContext)(void 0);function cn(){const[i]=(0,m.is)((0,r.jsx)(m.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var Cn=t(27381);const Qn=(i,n)=>{try{var s,l;const f=(0,Cn.fp)(n,{pathname:i}),T=(s=f==null?void 0:f.filter(M=>{var ae;return((ae=M==null?void 0:M.route.routeRefs)===null||ae===void 0?void 0:ae.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!T)return{};let O;return T.routeRefs.size===1&&(O=T.routeRefs.values().next().value),{extension:"App",pluginId:((l=T.plugin)===null||l===void 0?void 0:l.getId())||"root",...O?{routeRef:O.id}:{}}}catch{return{}}},kn=({pathname:i,search:n,hash:s})=>{const l=(0,y.z$)();return(0,z.useEffect)(()=>{l.captureEvent("navigate",`${i}${n}${s}`)},[l,i,n,s]),null},mn=({routeObjects:i})=>{const{pathname:n,search:s,hash:l}=(0,m.TH)();return(0,r.jsx)(y.fC,{attributes:Qn(n,i),children:(0,r.jsx)(kn,{pathname:n,search:s,hash:l})})};function rr(i){return cn()?w(i):""}function w(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function h({component:i,appIdentityProxy:n,children:s}){const[l,f]=(0,z.useState)(),T=(0,y.h_)(y.Ds),O=rr(T);return l?(n.setTarget(l,{signOutTargetUrl:O||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(i,{onSignInSuccess:f})}function x(i){const{Router:n,SignInPage:s}=(0,y.qD)().getComponents(),l=(0,y.h_)(y.Ds),f=w(l),T=`${f}/*`,O=(0,z.useContext)(En);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:M,appIdentityProxy:ae}=O;return s?cn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(mn,{routeObjects:M}),(0,r.jsx)(h,{component:s,appIdentityProxy:ae,children:(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:T,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(mn,{routeObjects:M}),(0,r.jsx)(h,{component:s,appIdentityProxy:ae,children:i.children})]}):(ae.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:f||"/"}),cn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(mn,{routeObjects:M}),(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:T,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(mn,{routeObjects:M}),i.children]}))}var E=t(90383),X=t(22504),be=t(69866),je=t(64279);function Ee(i){const n={};for(const l in i.collectors)i.collectors.hasOwnProperty(l)&&(n[l]=i.collectors[l]());const s=[{node:z.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:l,parent:f,contexts:T}=s.shift();z.Children.forEach(l,O=>{if(!(0,z.isValidElement)(O))return;const M={};for(const ae in n)if(n.hasOwnProperty(ae)){const Te=n[ae];M[ae]=Te.visit(Te.accumulator,O,f,T[ae])}for(const ae of i.discoverers){const Te=ae(O);Te&&s.push({node:Te,parent:O,contexts:M})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function ut(i,n){return()=>({accumulator:i(),visit:n})}function Mt(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function hn(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var l;return(l=i.props)===null||l===void 0?void 0:l.element}}const Hn=ut(()=>new Set,(i,n)=>{const s=(0,y.IY)(n,"core.plugin");s&&i.add(s)}),xr=i=>{const{children:n}=i,s=(0,y.h_)(y.W0),l="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,y.R5)(xr,"core.featureFlagged",!0);const Rr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Ir(i){const n=i;if(n!=null&&n.type){var s,l;return(l=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&l!==void 0?l:String(n.type)}return String(n)}function eo(i,n=new Array){return z.Children.forEach(i,s=>{if(!(0,z.isValidElement)(s))return;const l=(0,y.IY)(s,"core.mountPoint");if(l){const f=(0,y.IY)(s,"core.plugin");n.push({routeRef:l,plugin:f})}eo(s.props.children,n)}),n}const jo=ut(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,l)=>{var f,T;if(l!=null&&l.isElementAncestor)return l;if((s==null?void 0:s.props.element)===n)return{...l,isElementAncestor:!0};const O=(f=n.props)===null||f===void 0?void 0:f.path,M=(0,y.IY)(n,"core.mountPoint");if(M&&O)throw new Error(`Path property may not be set directly on a routable extension "${Ir(n)}"`);var ae;const Te=(ae=l==null||(T=l.obj)===null||T===void 0?void 0:T.children)!==null&&ae!==void 0?ae:i.objects;if(O!==void 0){if(typeof O!="string")throw new Error(`Element path must be a string at "${Ir(n)}"`);const xt=O.startsWith("/")?O.slice(1):O,Ct=n.props.element;if((0,y.IY)(n,"core.gatherMountPoints")){var Oe;if(Ct)throw new Error(`Mount point gatherers may not have an element prop "${Ir(n)}"`);const Ut={path:xt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Oe=n.props)===null||Oe===void 0?void 0:Oe.caseSensitive),children:[Rr],plugin:void 0};return Te.push(Ut),{obj:Ut,gatherPath:xt,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(Ct){var Ge;const[Ut,...Ft]=eo(Ct);if(Ft.length>0)throw new Error(`Route element with path "${O}" may not contain multiple routable extensions`);if(!Ut)return l;const{routeRef:Bn,plugin:tr}=Ut,nr={path:xt,element:"mounted",routeRefs:new Set([Bn]),caseSensitive:Boolean((Ge=n.props)===null||Ge===void 0?void 0:Ge.caseSensitive),children:[Rr],plugin:tr};return Te.push(nr),i.paths.set(Bn,xt),i.parents.set(Bn,l==null?void 0:l.routeRef),{obj:nr,routeRef:Bn!=null?Bn:l==null?void 0:l.routeRef,gatherPath:xt,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(M){var ht;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${Ir(n)}" with mount point "${M}" must be assigned a path`);return l==null||(ht=l.obj)===null||ht===void 0||ht.routeRefs.add(M),i.paths.set(M,l.gatherPath),i.parents.set(M,l==null?void 0:l.gatherRouteRef),{...l,routeRef:M}}return l}),ar=ut(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,l)=>{var f,T,O;if((s==null?void 0:s.props.element)===n)return l;let M=l==null?void 0:l.obj,ae=l==null?void 0:l.routeRef,Te=l==null?void 0:l.sticky;const Oe=(f=n.props)===null||f===void 0?void 0:f.path;var Ge;const ht=(Ge=M==null?void 0:M.children)!==null&&Ge!==void 0?Ge:i.objects,xt=Boolean((T=n.props)===null||T===void 0?void 0:T.caseSensitive);let Ct=l==null?void 0:l.path;if((0,y.IY)(n,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");Ct=Oe}const Ut=(O=n.props)===null||O===void 0?void 0:O.element;let Ft=(0,y.IY)(n,"core.mountPoint");if(!Ft&&(0,z.isValidElement)(Ut)&&(Ft=(0,y.IY)(Ut,"core.mountPoint")),Ft){let nr=Oe;if(Ct&&(nr?Ct=void 0:nr=Ct),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Ft,nr),ae&&Te?(i.parents.set(Ft,ae),Oe&&(ae=Ft,Te=!1)):(i.parents.set(Ft,ae),ae=Ft),Oe?(M={caseSensitive:xt,path:Oe,element:"mounted",routeRefs:new Set([Ft]),children:[Rr],plugin:(0,y.IY)(n.props.element,"core.plugin")},ht.push(M)):M==null||M.routeRefs.add(Ft)}if((0,y.IY)(n,"core.gatherMountPoints")&&(Te=!0),(0,y.IY)(n,"core.gatherMountPoints")){if(!Oe)throw new Error("Mount point gatherer must have a path");if(!Ft){var tr;M={caseSensitive:xt,path:Oe,element:"gathered",routeRefs:new Set,children:[Rr],plugin:l==null||(tr=l.obj)===null||tr===void 0?void 0:tr.plugin},ht.push(M)}}return{obj:M,path:Ct,routeRef:ae,sticky:Te}}),Gn=ut(()=>new Set,(i,n)=>{if(n.type===xr){const s=n.props;i.add("with"in s?s.with:s.without)}}),Xn=(0,dt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lr(i){return i[Xn]==="absolute"}function Nr(i){return i[Xn]==="sub"}function Eo(i){return i[Xn]==="external"}function mr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function _o(i,n,s){let l,f="";if(lr(i))l=i;else if(Nr(i))l=i.parent,f=i.path;else if(Eo(i)){const M=s.get(i);if(!M)return[void 0,""];if(lr(M))l=M;else if(Nr(M))l=M.parent,f=M.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${M}`)}else throw i[Xn]?new Error(`Unknown or invalid route ref type, ${i[Xn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!l)return[void 0,""];const T=n.get(l);if(T===void 0)return[void 0,""];const O=mr(T,f);return[l,O]}function Ao(i,n,s,l,f){var T;const O=(T=(0,Cn.fp)(f,n))!==null&&T!==void 0?T:[],M=Array();let ae=-1;for(let Ge=i;Ge&&(ae=O.findIndex(ht=>ht.route.routeRefs.has(Ge)),ae===-1);Ge=l.get(Ge))M.unshift(Ge);M.length===0&&(ae-=1);const Te=ae===-1?"":O[ae].pathname,Oe=M.slice(0,-1).map(Ge=>{const ht=s.get(Ge);if(ht===void 0)throw new Error(`No path for ${Ge}`);if(ht.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ge} as it has parameters`);return ht});return`${mr(Te,...Oe)}/`}class to{resolve(n,s){const[l,f]=_o(n,this.routePaths,this.routeBindings);if(!l)return;let T;typeof s=="string"?T=this.trimPath(s):s.pathname?T={...s,pathname:this.trimPath(s.pathname)}:T=s;const O=this.appBasePath+Ao(l,T,this.routePaths,this.routeParents,this.routeObjects);return(...[ae])=>mr(O,(0,Cn.Gn)(f,ae))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,l,f,T){(0,K.Z)(this,"routePaths",void 0),(0,K.Z)(this,"routeParents",void 0),(0,K.Z)(this,"routeObjects",void 0),(0,K.Z)(this,"routeBindings",void 0),(0,K.Z)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=l,this.routeBindings=f,this.appBasePath=T}}const qn=(0,dt.CT)("routing-context"),Pr=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:l,basePath:f="",children:T})=>{const O=new to(i,n,s,l,f),M=(0,dt.EI)({1:O});return(0,r.jsx)(qn.Provider,{value:M,children:T})};function Lr(i,n){const s=new Set(n.values());s.delete(void 0);for(const l of n.keys()){if(s.has(l))continue;let f=l,T="";for(;f;){const M=i.get(f);if(M===void 0)throw new Error(`No path for ${f}`);T=mr(M,T),f=n.get(f)}const O=T.match(/:(\w+)/g);if(O){for(let M=0;M<O.length;M++)for(let ae=M+1;ae<O.length;ae++)if(O[ae]===O[M])throw new Error(`Parameter ${O[ae]} is duplicated in path ${T}`)}}}function To(i,n){for(const s of n)if(s.externalRoutes){for(const[l,f]of Object.entries(s.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${l}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Fr=(0,dt.CT)("app-context"),Ur=({appContext:i,children:n})=>{const s=(0,dt.EI)({1:i});return(0,r.jsx)(Fr.Provider,{value:s,children:n})};function cr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Mr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class zr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw cr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Mr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw cr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Mr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Mr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,K.Z)(this,"target",void 0),(0,K.Z)(this,"waitForTarget",void 0),(0,K.Z)(this,"resolveTarget",()=>{}),(0,K.Z)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Ro=t(72164);function Io(i,n,s){if(i!==void 0){const f=s.find(T=>T.id===i);if(f)return f}if(n){const f=s.find(T=>T.variant==="dark");if(f)return f}const l=s.find(f=>f.variant==="light");return l||s[0]}const Po=()=>{const i=(0,z.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,z.useState)(i.matches);return(0,z.useEffect)(()=>{const l=f=>{s(f.matches)};return i.addListener(l),()=>{i.removeListener(l)}},[i]),n};function Lo({children:i}){const n=(0,y.h_)(y.hg),s=(0,Ro.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?Po():!1,f=Io(s,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const no=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?s.push(...f):s.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const l=window.__APP_CONFIG__;return l&&s.push({context:"window",data:l}),s};class es{add(n,s){return this.apis.push([n.id,s]),s}build(){return new vr(new Map(this.apis))}constructor(){(0,K.Z)(this,"apis",[])}}class vr{static builder(){return new es}static from(n){return new vr(new Map(n.map(([s,l])=>[s.id,l])))}static with(n,s){return new vr(new Map([[n.id,s]]))}with(n,s){return new vr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,K.Z)(this,"apis",void 0),this.apis=n}}function ko(i){const n=new Map;return i&&i({bind:(l,f)=>{for(const[T,O]of Object.entries(f)){const M=l[T];if(!M)throw new Error(`Key ${T} is not an existing external route`);if(!O&&!M.optional)throw new Error(`External route ${T} is required but was undefined`);O&&n.set(M,O)}}}),n}function ro(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function Oo(i,n,s){var l;const f=Boolean(i),T=(0,je.default)(i||(()=>Promise.resolve([])));let O;if(f&&T.loading){const{Progress:Te}=n;O=(0,r.jsx)(Te,{})}else if(T.error){const{BootErrorPage:Te}=n;O=(0,r.jsx)(Te,{step:"load-config",error:T.error})}const{ThemeProvider:M=Lo}=n;if(O)return{node:(0,r.jsx)(ft,{apis:vr.with(y.hg,s),children:(0,r.jsx)(M,{children:O})})};let ae;if(!((l=T.value)===null||l===void 0)&&l.length){const Te=j.fromConfigs(T.value),Oe=Te.getOptionalString("app.baseUrl"),Ge=Te.getOptionalString("backend.baseUrl");let ht=T.value;const xt={data:{},context:"relative-resolver"};if(Oe&&Ge){const Ct=new URL(Oe).origin,Ut=new URL(Ge).origin;if(Ct===Ut){const Ft=ro(Ge);Ge!==Ft&&(xt.data.backend={baseUrl:Ft})}}if(Oe){const Ct=ro(Oe);Oe!==Ct&&(xt.data.app={baseUrl:Ct})}Object.keys(xt.data).length&&(ht=ht.concat([xt])),ae=j.fromConfigs(ht)}else ae=j.fromConfigs([]);return{api:ae}}class oo{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,K.Z)(this,"app",void 0),this.app=n}}var dr=new WeakMap;class br{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,r.jsx)(s,{children:n})}getProvider(){if((0,E.Z)(this,dr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,be.Z)(this,dr,!0);const n=new oo(this);let s=!1;return({children:f})=>{const T=(0,z.useRef)(!0),O=(0,z.useMemo)(()=>Qe.createWithStorage(this.themes),[]),{routing:M,featureFlags:ae,routeBindings:Te}=(0,z.useMemo)(()=>{const xt=Ee({root:f,discoverers:[Mt,hn],collectors:{routing:cn()?ar:jo,collectedPlugins:Hn,featureFlags:Gn}});return xt.collectedPlugins.forEach(Ct=>this.plugins.add(Ct)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...xt,routeBindings:ko(this.bindRoutes)}},[f]);s||(s=!0,Lr(M.paths,M.parents),To(Te,this.plugins));const Oe=Oo(this.configLoader,this.components,O),Ge="api"in Oe;if(Ge){const{api:xt}=Oe;this.configApi=xt}if("node"in Oe)return Oe.node;if(Ge&&T.current){T.current=!1;const xt=this.getApiHolder().get(y.W0);if(xt){for(const Ft of this.featureFlags)xt.registerFlag({...Ft,pluginId:""});for(const Ft of this.plugins.values())if("getFeatureFlags"in Ft)for(const Bn of Ft.getFeatureFlags())xt.registerFlag({name:Bn.name,pluginId:Ft.getId()});else for(const Bn of Ft.output())Bn.type==="feature-flag"&&xt.registerFlag({name:Bn.name,pluginId:Ft.getId()});const Ct=xt.getRegisteredFlags(),Ut=new Set(Ct.map(Ft=>Ft.name));for(const Ft of ae)Ut.has(Ft)||xt.registerFlag({name:Ft,pluginId:""})}}const{ThemeProvider:ht=Lo}=this.components;return(0,r.jsx)(ft,{apis:this.getApiHolder(),children:(0,r.jsx)(Ur,{appContext:n,children:(0,r.jsx)(ht,{children:(0,r.jsx)(Pr,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:Te,basePath:rr(Oe.api),children:(0,r.jsx)(En.Provider,{value:{routeObjects:M.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return x}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Ie.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:y.hg,deps:{},factory:()=>Qe.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:y.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:y.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:y.W0,deps:{},factory:()=>new rt});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Ie.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ie(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const l of n){const f=l.getId();if(s.has(f))throw new Error(`Duplicate plugin found '${f}'`);s.add(f)}}constructor(n){(0,K.Z)(this,"apiHolder",void 0),(0,K.Z)(this,"configApi",void 0),(0,K.Z)(this,"apis",void 0),(0,K.Z)(this,"icons",void 0),(0,K.Z)(this,"plugins",void 0),(0,K.Z)(this,"featureFlags",void 0),(0,K.Z)(this,"components",void 0),(0,K.Z)(this,"themes",void 0),(0,K.Z)(this,"configLoader",void 0),(0,K.Z)(this,"defaultApis",void 0),(0,K.Z)(this,"bindRoutes",void 0),(0,K.Z)(this,"appIdentityProxy",new zr),(0,K.Z)(this,"apiFactoryRegistry",void 0),(0,X.Z)(this,dr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var l;this.plugins=new Set((l=n.plugins)!==null&&l!==void 0?l:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var T;this.configLoader=(T=n.configLoader)!==null&&T!==void 0?T:no;var O;this.defaultApis=(O=n.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new Et}}function Zo(i){return new br(i)}let Wr=!1;const Bo=i=>{const n=(0,y.qD)(),{NotFoundErrorPage:s}=n.getComponents(),l=(0,z.useMemo)(()=>cn(),[]),T=[...(0,y.vJ)(i.children,O=>O.getElements().flatMap(M=>{let ae=M.props.path;if(ae==="")return[];var Te;ae=(Te=ae==null?void 0:ae.replace(/\/\*$/,""))!==null&&Te!==void 0?Te:"/";let Oe=l?M:M.props.element;return!l&&!Oe&&(Oe=M,Wr||(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] />} />."),Wr=!0)),[{path:ae,element:Oe,children:M.props.children?[{path:ae==="/"?"/":"*",element:M.props.children}]:void 0}]}).sort((M,ae)=>ae.path.localeCompare(M.path)).map(M=>({...M,path:M.path==="/"?"/":`${M.path}/*`}))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,m.V$)(T)},kr=(0,y.T0)({id:"plugin.permission.api"});var Kt;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Kt||(Kt={}));function ts(i,n){return i.name===n.name}function $o(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function ns(i){return i.attributes.action==="create"}function rs(i){return i.attributes.action==="read"}function os(i){return i.attributes.action==="update"}function ss(i){return i.attributes.action==="delete"}function is(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const l=n;return i.authorize(l,s)}}}function or({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Or=t(23054),as=t(96279),Do=t.n(as),so=t(9571);const Vr=nt.z.lazy(()=>nt.z.object({rule:nt.z.string(),resourceType:nt.z.string(),params:nt.z.record(nt.z.any()).optional()}).or(nt.z.object({anyOf:nt.z.array(Vr).nonempty()})).or(nt.z.object({allOf:nt.z.array(Vr).nonempty()})).or(nt.z.object({not:Vr}))),b=nt.z.object({result:nt.z.literal(Kt.ALLOW).or(nt.z.literal(Kt.DENY))}),A=nt.z.union([nt.z.object({result:nt.z.literal(Kt.ALLOW).or(nt.z.literal(Kt.DENY))}),nt.z.object({result:nt.z.literal(Kt.CONDITIONAL),pluginId:nt.z.string(),resourceType:nt.z.string(),conditions:Vr})]),I=(i,n)=>nt.z.object({items:nt.z.array(nt.z.intersection(nt.z.object({id:nt.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:l})=>n.has(l)),{message:"Items in response do not match request"})});class F{async authorize(n,s){return this.makeRequest(n,b,s)}async authorizeConditional(n,s){return this.makeRequest(n,A,s)}async makeRequest(n,s,l){if(!this.enabled)return n.map(Oe=>({result:Kt.ALLOW}));const f={items:n.map(Oe=>({id:so.Z(),...Oe}))},T=await this.discovery.getBaseUrl("permission"),O=await Do()(`${T}/authorize`,{method:"POST",body:JSON.stringify(f),headers:{...this.getAuthorizationHeader(l==null?void 0:l.token),"content-type":"application/json"}});if(!O.ok)throw await Or.VL.fromResponse(O);const M=await O.json(),Te=I(s,new Set(f.items.map(({id:Oe})=>Oe))).parse(M).items.reduce((Oe,Ge)=>(Oe[Ge.id]=Ge,Oe),{});return f.items.map(Oe=>Te[Oe.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class ee{static create(n){const{config:s,discovery:l,identity:f}=n,T=new F({discovery:l,config:s});return new ee(T,f)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,K.Z)(this,"permissionClient",void 0),(0,K.Z)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var ce=t(69984);function ie(i){const n=(0,y.h_)(kr),{data:s,error:l}=(0,ce.ZP)(i,async f=>{if($o(f.permission)&&!f.resourceRef)return Kt.DENY;const{result:T}=await n.authorize(f);return T});return l?{error:l,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Kt.ALLOW}}const ye=i=>{const{permission:n,resourceRef:s,errorComponent:l,...f}=i,T=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),O=useApp(),{NotFoundErrorPage:M}=O.getComponents();let ae=l===void 0?_jsx(M,{}):l;return T.loading?ae=null:T.allowed&&(ae=i.element),_jsx(Route,{...f,element:ae})};function Re(i){const{permission:n,resourceRef:s}=i,l=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),f=useApp();if(l.loading)return null;if(l.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:T}=f.getComponents();return _jsx(T,{})}const Le=[(0,y.ni)({api:y.NW,deps:{configApi:y.Ds},factory:({configApi:i})=>Y.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,y.ni)({api:y.$v,deps:{},factory:()=>new D}),(0,y.ni)({api:y.v_,deps:{},factory:()=>new pe}),(0,y.ni)({api:y.VE,deps:{alertApi:y.$v},factory:({alertApi:i})=>{const n=new ge(i,new me);return Ue.forward(n,{hidden:!1}),n}}),(0,y.ni)({api:y.E6,deps:{errorApi:y.VE},factory:({errorApi:i})=>tn.create({errorApi:i})}),(0,y.ni)({api:y.gP,deps:{configApi:y.Ds,identityApi:y.$4,discoveryApi:y.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>yt({middleware:[It.resolvePluginProtocol({discoveryApi:s}),It.injectIdentityAuth({identityApi:n,config:i})]})}),(0,y.ni)({api:y.ZM,deps:{},factory:()=>new _e}),(0,y.ni)({api:y.Kp,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>wn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.p_,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>sn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.F4,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Wt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.D,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Jn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.ux,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Nn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.gW,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Vn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.bq,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>oe.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.Km,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fe.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,y.ni)({api:y.uB,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>te.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:kr,deps:{discovery:y.NW,identity:y.$4,config:y.Ds},factory:({config:i,discovery:n,identity:s})=>ee.create({config:i,discovery:n,identity:s})})];var Be=t(77277),xe=t(23196),He=t(39857);function ct({children:i}){return(0,m.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(m.VA,{children:i})}const st=()=>(0,r.jsx)(xe.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),De=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(ct,{children:(0,r.jsx)(xe.mf,{status:"501",statusMessage:s})})},gt=({error:i,resetError:n,plugin:s})=>(0,r.jsx)(xe.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(Be.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Zt={Progress:xe.Ex,Router:He.VK,NotFoundErrorPage:st,BootErrorPage:De,ErrorBoundaryFallback:gt};var vn=t(43642),Yt=t(80079),An=t(90941),pn=t(32915),yn=t(40562),xn=t(21853),Zr=t(60744),Hr=t(66569),Gr=t(30254),Tn=t(13384),On=t(15933),Sr=t(58838),Os=t(86737),Zi=t(4989),Zs=t(44407),Bi=t(18628),Cr=t(84219),Bs=t(98685),$i=t(39781);const Di={brokenImage:Yt.Z,catalog:Bi.Z,scaffolder:pn.Z,techdocs:yn.Z,search:xn.Z,chat:Zr.Z,dashboard:Hr.Z,docs:Gr.Z,email:Tn.Z,github:Sr.Z,group:Cr.Z,help:Os.Z,"kind:api":On.Z,"kind:component":Zs.Z,"kind:domain":vn.Z,"kind:group":Cr.Z,"kind:location":Zi.Z,"kind:system":An.Z,"kind:user":Bs.Z,user:Bs.Z,warning:$i.Z};var Ni=t(73689),$s=t(48032);const ur={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")`},hr={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 _n(i){const{colors:n,shape:s,options:l}=i,T=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,O=`${s}, ${T}`;var M;const ae=(M=l==null?void 0:l.fontColor)!==null&&M!==void 0?M:"#FFFFFF";return{colors:n,shape:s,backgroundImage:O,fontColor:ae}}const No={home:_n({colors:hr.teal,shape:ur.wave}),documentation:_n({colors:hr.pinkSea,shape:ur.wave2}),tool:_n({colors:hr.purpleSky,shape:ur.round}),service:_n({colors:hr.marineBlue,shape:ur.wave}),website:_n({colors:hr.veryBlue,shape:ur.wave}),library:_n({colors:hr.rubyRed,shape:ur.wave}),other:_n({colors:hr.darkGrey,shape:ur.wave}),app:_n({colors:hr.toastyOrange,shape:ur.wave}),apis:_n({colors:hr.teal,shape:ur.wave2}),card:_n({colors:hr.greens,shape:ur.wave})},Ds=16,Ns='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Fs(i){const{palette:n,htmlFontSize:s=Ds,fontFamily:l=Ns,defaultPageTheme:f,pageTheme:T=No}=i;if(!T[f])throw new Error(`${f} is not defined in pageTheme.`);var O;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:l,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:T[f],getPageTheme:({themeId:M})=>(O=T[M])!==null&&O!==void 0?O:T[f]}}function Us(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:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,$s.darken)(i.palette.link,.3),background:(0,$s.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 ls(i){const n=Fs(i),s=(0,Ni.Z)(n),l=Us(s);return{...s,overrides:l}}var Ms=t(34505);const Fi=ls({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:Ms.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:No}),cs=ls({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:Ms.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:No});var Ui=t(98192),ds=t(15222),us=t(41547),Fo=t(87561);const hs=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(ds.Z,{}),Provider:({children:i})=>(0,r.jsx)(us.Z,{theme:Fi,children:(0,r.jsx)(Fo.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Ui.Z,{}),Provider:({children:i})=>(0,r.jsx)(us.Z,{theme:cs,children:(0,r.jsx)(Fo.ZP,{children:i})})}];function zs(i){var n,s,l,f;return Zo({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Zt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Le,icons:{...Di,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(l=i==null?void 0:i.featureFlags)!==null&&l!==void 0?l:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:hs})}var io=t(25271),ao=t(76635);async function Ws({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,ao.isArray)(l))return;var f;const T=new Set((f=s.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(ao.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,M,ae,Te])=>(0,io.eE)({kind:M,namespace:ae,name:Te})).forEach(O=>T.add(O)),await s.set("entityRefs",Array.from(T)),await n.remove("starredEntities")}class Vs{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,K.Z)(this,"settingsStore",void 0),(0,K.Z)(this,"starredEntities",void 0),(0,K.Z)(this,"subscribers",new Set),(0,K.Z)(this,"observable",new(he())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)}))),Ws(n).then(),this.settingsStore=n.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:l=>{var f;this.starredEntities=new Set((f=l.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Mi=t(33414),Kr=t(79692),Hs=t(12420),Zn=t(40303),Gs=t(19928);function zi(){const i=useApi(catalogApiRef),{error:n,loading:s,value:l}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(T=>{var O;return((O=T.facets.kind)===null||O===void 0?void 0:O.map(M=>M.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:l!=null?l:[]}}function Ks(i,n,s){let l=i;return n&&(l=l.filter(T=>n.some(O=>O.toLocaleLowerCase("en-US")===T.toLocaleLowerCase("en-US")))),s&&!i.some(T=>T.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(l=l.concat([s])),l.sort().reduce((T,O)=>(T[O.toLocaleLowerCase("en-US")]=O,T),{})}const Ys=(0,Kr.Z)(i=>(0,Hs.Z)({root:{...i.typography.h4}}));function Js(i){var n;const{initialFilter:s="component",allowedKinds:l}=i,f=Ys(),{allKinds:T}=useAllKinds(),{filters:O,updateFilters:M,queryParameters:{kind:ae}}=useEntityList(),Te=useMemo(()=>[ae].flat()[0],[ae]);var Oe;const[Ge,ht]=useState((Oe=Te!=null?Te:(n=O.kind)===null||n===void 0?void 0:n.value)!==null&&Oe!==void 0?Oe:s);useEffect(()=>{Te&&ht(Te)},[Te]),useEffect(()=>{var Ct;if(!((Ct=O.kind)===null||Ct===void 0)&&Ct.value){var Ut;ht((Ut=O.kind)===null||Ut===void 0?void 0:Ut.value)}},[O.kind]),useEffect(()=>{M({kind:Ge?new EntityKindFilter(Ge):void 0})},[Ge,M]);const xt=filterKinds(T,l,Ge);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ge.toLocaleLowerCase("en-US"),onChange:Ct=>ht(Ct.target.value),classes:f,children:Object.keys(xt).map(Ct=>_jsx(MenuItem,{value:Ct,children:`${pluralize(xt[Ct])}`},Ct))})}var Qs=t(86359),Uo=t(95544),Wi=t(99688),lo=t(12231),Yr=t(86136),co=t(49378),er=t(85256),Xs=t(80030),_s=t(61837),Vi=t(79784),Hi=t(50758),Gi=t(31654),Ki=t(43054),Yi=t(65759),Oa=t(49280),uo=t(96641);function Ji(i){const{entity:n,loading:s,error:l}=(0,uo.ce)(),{allowed:f,loading:T,error:O}=ie({permission:i,resourceRef:n?(0,io.eE)(n):void 0});return s||T?{loading:!0,allowed:!1}:l?{loading:!1,allowed:!1,error:l}:{loading:!1,allowed:f,error:O}}const ps="catalog-entity",ei=or({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ps}),ti=or({name:"catalog.entity.create",attributes:{action:"create"}}),ho=or({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ps}),ni=or({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ps}),ri=or({name:"catalog.location.read",attributes:{action:"read"}}),oi=or({name:"catalog.location.create",attributes:{action:"create"}}),Mo=or({name:"catalog.location.delete",attributes:{action:"delete"}}),fs=[ei,ti,ho,ni,ri,oi,Mo];var po=t(49166);function gs(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:l,onClose:f}=i,T=typeof(n==null?void 0:n.disableUnregister)=="boolean";var O;const M=(O=!s||(T?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&O!==void 0?O:!1;let ae=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ae=(0,r.jsxs)(lo.Z,{onClick:()=>{f(),l()},disabled:M,children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(po.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:ae})}const ms=(0,Kr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function pr(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:l,onInspectEntity:f}=i,[T,O]=(0,z.useState)(),M=ms(),Te=Ji(ho).allowed,Oe=Ut=>{O(Ut.currentTarget)},Ge=()=>{O(void 0)},ht=(0,y.h_)(y.$v),xt=(0,z.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ht.post({message:"Copied!",severity:"info",display:"transient"}))},[ht]),Ct=n&&[...n.map(Ut=>(0,r.jsxs)(lo.Z,{onClick:()=>{Ge(),Ut.onClick()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Ut.Icon,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:Ut.title})]},Ut.title)),(0,r.jsx)(er.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xs.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(_s.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!T,role:"button",onClick:Oe,"data-testid":"menu-button",className:M.button,id:"long-menu",children:(0,r.jsx)(Ki.Z,{})})}),(0,r.jsx)(Vi.ZP,{open:Boolean(T),onClose:Ge,anchorEl:T,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Hi.Z,{children:[Ct,(0,r.jsx)(gs,{unregisterEntityOptions:s,isUnregisterAllowed:Te,onUnregisterEntity:l,onClose:Ge}),(0,r.jsxs)(lo.Z,{onClick:()=>{Ge(),f()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Gi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(lo.Z,{onClick:()=>{Ge(),xt()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Yi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Copy entity URL"})]})]})})]})}const vs="plugin.catalog.entityLayoutRoute",fo=()=>null;(0,y.R5)(fo,vs,!0),(0,y.R5)(fo,"core.gatherMountPoints",!0);function si(i){const{entity:n,title:s}=i;return(0,r.jsxs)(Uo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Uo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,r.jsx)(Zn.LH,{entity:n})]})}function Qi(i,n,s,l){var f;const T=(f=i!=null?i:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var O;const M=(O=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&O!==void 0?O:"";var ae,Te,Oe;return{headerTitle:`${(Oe=(Te=(ae=l==null?void 0:l.metadata.title)!==null&&ae!==void 0?ae:s)!==null&&Te!==void 0?Te:l==null?void 0:l.metadata.name)!==null&&Oe!==void 0?Oe:""}${M&&M!==io.zG?` in ${M}`:""}`,headerType:(()=>{let ht=T.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(ht+=" \u2014 ",ht+=l.spec.type.toLocaleLowerCase("en-US")),ht})()}}function sr(i){var n;const{entity:s}=i,l=(0,Zn.hF)(s,io.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(xe.i9,{label:"Owner",value:(0,r.jsx)(Zn.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(xe.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ys=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:T,NotFoundComponent:O}=i,{kind:M,namespace:ae,name:Te}=(0,y.Oi)(Zn.wi),{entity:Oe,loading:Ge,error:ht}=(0,Zn.ce)(),xt=(0,m.TH)(),Ct=(0,y.vJ)(T,bo=>bo.selectByComponentData({key:vs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Br})=>{if(Oe){if(Br.if&&!Br.if(Oe))return[]}else return[];return[{path:Br.path,title:Br.title,children:Br.children,tabProps:Br.tabProps}]}),[Oe]),{headerTitle:Ut,headerType:Ft}=Qi(M,ae,Te,Oe),[Bn,tr]=(0,z.useState)(!1),[nr,Qr]=(0,z.useState)(!1),ji=(0,m.s0)(),Ei=async()=>{tr(!1),Qr(!1),ji("/")};(0,z.useEffect)(()=>{tr(!1),Qr(!1)},[xt.pathname]);var Yo;return(0,r.jsxs)(xe.T3,{themeId:(Yo=Oe==null||(n=Oe.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&Yo!==void 0?Yo:"home",children:[(0,r.jsx)(xe.h4,{title:(0,r.jsx)(si,{title:Ut,entity:Oe}),pageTitleOverride:Ut,type:Ft,children:Oe&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sr,{entity:Oe}),(0,r.jsx)(pr,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>Qr(!0)})]})}),Ge&&(0,r.jsx)(xe.Ex,{}),Oe&&(0,r.jsx)(xe.tn,{routes:Ct}),ht&&(0,r.jsx)(xe.VY,{children:(0,r.jsx)(Wi.Z,{severity:"error",children:ht.toString()})}),!Ge&&!ht&&!Oe&&(0,r.jsx)(xe.VY,{children:O||(0,r.jsxs)(xe.GB,{title:"Entity not found",children:["There is no ",M," with the requested"," ",(0,r.jsx)(xe.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Zn.pp,{open:Bn,entity:Oe,onConfirm:Ei,onClose:()=>tr(!1)}),(0,r.jsx)(Zn.U_,{open:nr,entity:Oe,onClose:()=>Qr(!1)})]})};ys.Route=fo;function Xi(i){const{open:n,onClose:s,onConfirm:l,entity:f}=i,[T,O]=useState(!1),M=useApi(catalogApiRef),ae=useApi(alertApiRef),Te=async()=>{O(!0);try{const Oe=f.metadata.uid;await M.removeEntityByUid(Oe),l()}catch(Oe){assertError(Oe),ae.post({message:Oe.message})}finally{O(!1)}};return _jsxs(Dialog,{open:n,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:T,onClick:Te,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var go=t(19625);function qi(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function _i(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,l]=useState(!1),{entity:f}=useEntity(),T=async()=>{l(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>l(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:f,onConfirm:T,onClose:()=>l(!1)})]})}var mo=t(4791);const xs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function zo(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var T,O;return{errors:((O=(T=f.entity.status)===null||T===void 0?void 0:T.items)!==null&&O!==void 0?O:[]).filter(xs).map(Te=>Te.error).filter(Te=>Boolean(Te)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ii(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await zo(stringifyEntityRef(i),s)).items.length>0}function ai(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:l,error:f,value:T}=useAsync(async()=>zo(n,s),[n,s]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!T?null:_jsx(_Fragment,{children:T.items.map((O,M)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((ae,Te)=>_jsx(ResponseErrorPanel,{error:ae},Te))]},M))})}const vo="core.backstage.entitySwitch",bs=i=>null;(0,y.R5)(bs,vo,!0);const Ss=i=>{var n;const{entity:s,loading:l}=(0,Zn.ce)(),f=(0,y.I_)(),T=(0,y.vJ)(i.children,ae=>ae.selectByComponentData({key:vo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Te=>{if(l)return[];const{if:Oe,children:Ge}=Te.props;return s?[{if:Oe==null?void 0:Oe(s,{apis:f}),children:Ge}]:[{if:Oe===void 0,children:Ge}]}),[f,s,l]);if(T.some(ae=>typeof ae.if=="object"&&"then"in ae.if))return(0,r.jsx)(Cs,{results:T,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ae=T.filter(Te=>Te.if).map(Te=>Te.children);return ae.length===0?Jr(T):(0,r.jsx)(r.Fragment,{children:ae})}var M;return(M=(n=T.find(ae=>ae.if))===null||n===void 0?void 0:n.children)!==null&&M!==void 0?M:Jr(T)};function Cs({results:i,renderMultipleMatches:n}){const{loading:s,value:l}=(0,je.default)(async()=>{const f=i.map(async({if:O,children:M})=>{try{if(await O)return M}catch{}return null});if(n==="all"){const O=(await Promise.all(f)).filter(Boolean);return O.length===0?Jr(i):(0,r.jsx)(r.Fragment,{children:O})}var T;return(T=(await Promise.all(f)).find(Boolean))!==null&&T!==void 0?T:Jr(i)},[i]);return s||!l?null:l}function Jr(i){var n,s;return(s=(n=i.filter(l=>l.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}Ss.Case=bs;const ea=null,Wo=Zn._i.Filters,ta=Zn._i.Content;var na=t(85877),ws=t(15096);const Rn=(0,y.rx)({id:"catalog",apis:[(0,y.ni)({api:Zn.Ah,deps:{discoveryApi:y.NW,fetchApi:y.gP},factory:({discoveryApi:i,fetchApi:n})=>new mo.MS({discoveryApi:i,fetchApi:n})}),(0,y.ni)({api:Zn.p3,deps:{storageApi:y.E6},factory:({storageApi:i})=>new Vs({storageApi:i})})],routes:{catalogIndex:go._Z,catalogEntity:Zn.wi},externalRoutes:{createComponent:go.yw,viewTechDoc:go.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ra=Rn.provide((0,y.P4)({name:"CatalogIndexPage",component:()=>t.e(9323).then(t.bind(t,89323)).then(i=>i.CatalogPage),mountPoint:go._Z})),li=Rn.provide((0,y.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:Zn.wi})),oa=Rn.provide((0,y.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),ci=Rn.provide((0,y.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),sa=Rn.provide((0,y.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),Vo=Rn.provide((0,y.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),di=Rn.provide((0,y.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),ia=Rn.provide((0,y.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),ui=Rn.provide((0,y.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),aa=Rn.provide((0,y.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),hi=Rn.provide((0,y.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),pi=Rn.provide((0,y.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),Kn=Rn.provide((0,y.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}})),la=Rn.provide((0,ws.E5)({name:"CatalogSearchResultListItem",component:()=>t.e(7670).then(t.bind(t,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var js=t(32838);class fi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const f=`${await this.getApiOrigin()}/${s}`,T=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(T.status===404)throw new Error("Page not found");return T.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,l){const f=await this.getApiOrigin();return new URL(n,`${f}/${l}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:l}){(0,K.Z)(this,"configApi",void 0),(0,K.Z)(this,"discoveryApi",void 0),(0,K.Z)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=l}}class Es{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:l}){(0,K.Z)(this,"configApi",void 0),(0,K.Z)(this,"discoveryApi",void 0),(0,K.Z)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=l}}const gi=[(0,y.ni)({api:Ce.Dl,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new fi({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:Ce.gT,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new Es({configApi:i,discoveryApi:n,identityApi:s})}),(0,y.ni)({api:js.q3,deps:{configApi:y.Ds},factory:({configApi:i})=>js.ae.fromConfig(i)})],ca={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ho={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function mi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function vi(){const i=await no(),n=await mi();return[...i,{context:"detected",data:n?ca:Ho}]}var yi=t(58845);const yo=(0,Kr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var xi=()=>{const i=yo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const As=(0,Kr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ha=()=>{const i=As();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const pa=(0,Kr.Z)({root:{width:xe.po.drawerWidthClosed,height:3*xe.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:xe.po.drawerWidthClosed,marginLeft:24}}),bi=()=>{const i=pa(),{isOpen:n}=(0,xe.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(xe.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(xi,{}):(0,r.jsx)(ha,{})})})},fa=({children:i})=>(0,r.jsxs)(xe.tR,{children:[(0,r.jsxs)(xe.YE,{children:[(0,r.jsx)(bi,{}),(0,r.jsx)(xe.v7,{}),(0,r.jsx)(xe.R6,{icon:yi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ga=t(32388),Go=t(4142);const Ko=(0,Kr.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 ir;(function(i){i.LIGHT="light",i.DARK="dark"})(ir||(ir={}));const xo=()=>{const i=(0,y.h_)(y.hg),n=Ko(),[s,l]=(0,z.useState)(i.getActiveThemeId()===ir.DARK?ir.DARK:ir.LIGHT),f={[ir.LIGHT]:{icon:Go.Z,title:"Dark theme"},[ir.DARK]:{icon:ga.Z,title:"Light theme"}},{title:T,icon:O}=f[s],M=()=>{l(ae=>{const Te=ae===ir.LIGHT?ir.DARK:ir.LIGHT;return i.setActiveThemeId(Te),Te})};return(0,r.jsx)(Uo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(Xs.ZP,{title:T,arrow:!0,children:(0,r.jsx)(_s.Z,{size:"small",onClick:M,children:(0,r.jsx)(O,{className:n.headerIcon})})})})},Si=()=>(0,r.jsxs)(L.I6,{children:[(0,r.jsx)(Z.S,{}),(0,r.jsx)(S.F,{withSearch:!1})]}),Ts=(0,r.jsx)(Si,{}),Rs=zs({apis:gi,configLoader:vi,plugins:Object.values(u)}),Ci=Rs.getProvider(),Is=Rs.getRouter(),wi=L.s4.provide((0,Ce.KY)({name:"ThemeToggleAddon",component:xo,location:Ce.oZ.Header})),Ps=(0,r.jsxs)(Bo,{children:[(0,r.jsx)(m.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(m.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(li,{})}),(0,r.jsx)(m.AW,{path:"/docs",element:(0,r.jsx)(L.Jl,{}),children:(0,r.jsx)(B.u,{})}),(0,r.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(L.I6,{}),children:[Ts,(0,r.jsx)(Ce.DR,{children:(0,r.jsx)(wi,{})})]})]});var ma=()=>(0,r.jsx)(Ci,{children:(0,r.jsx)(Is,{children:(0,r.jsx)(fa,{children:Ps})})});P.render((0,r.jsx)(ma,{}),document.getElementById("root"))},51837:function(bt,$e,t){"use strict";t.d($e,{CT:function(){return y},EI:function(){return we},uW:function(){return P},Vt:function(){return c}});function u(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=u(),z=ue=>`__@backstage/${ue}__`;function P(ue,G){const Z=z(ue);let S=r[Z];return S||(S=G(),r[Z]=S,S)}var m=t(2784);function y(ue){return P(ue,()=>(0,m.createContext)(void 0))}function c(ue){return(0,m.useContext)(y(ue))}function $(ue){return{set(G){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(G))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function we(ue){Object.freeze(ue);const G={atVersion(Z){return ue[Z]}};return Object.defineProperty(G,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),G}},96641:function(bt,$e,t){"use strict";t.d($e,{X2:function(){return we},ce:function(){return ue},h$:function(){return c}});var u=t(52322),r=t(25271),z=t(60871),P=t(51837),m=t(2784);const y=(0,P.CT)("entity-context"),c=G=>{const{children:Z,entity:S,loading:V,error:re,refresh:q}=G,_={entity:S,loading:V,error:re,refresh:q};return(0,u.jsx)(y.Provider,{value:(0,P.EI)({1:_}),children:(0,u.jsx)(z.fC,{attributes:{...S?{entityRef:(0,r.eE)(S)}:void 0},children:Z})})},$=G=>_jsx(c,{entity:G.entity,loading:!Boolean(G.entity),error:void 0,refresh:void 0,children:G.children});function we(){const G=(0,P.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const Z=G.atVersion(1);if(!Z)throw new Error("EntityContext v1 not available");if(!Z.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:Z.entity}}function ue(){const G=(0,P.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const Z=G.atVersion(1);if(!Z)throw new Error("EntityContext v1 not available");const{entity:S,loading:V,error:re,refresh:q}=Z;return{entity:S,loading:V,error:re,refresh:q}}},40303:function(bt,$e,t){"use strict";t.d($e,{h$:function(){return Ne.h$},n3:function(){return u.n3},_i:function(){return R},tW:function(){return Vn},df:function(){return Tt},UO:function(){return Wt},dq:function(){return Q},nl:function(){return so},dx:function(){return dt},rI:function(){return Ie},u3:function(){return Ze},xE:function(){return En},sL:function(){return cn},LH:function(){return w},U_:function(){return Zo},pp:function(){return $o},EW:function(){return or},Ah:function(){return z},wi:function(){return Ve},hF:function(){return lt.hF},CV:function(){return lt.CV},$3:function(){return K},p3:function(){return P},ce:function(){return Ne.ce},X2:function(){return Ne.X2},wp:function(){return Vt},ZW:function(){return sn},eK:function(){return Mn},CR:function(){return zn}});var u=t(4791),r=t(60871);const z=(0,r.T0)({id:"plugin.catalog.service"}),P=(0,r.T0)({id:"catalog-react.starred-entities"});var m=t(82394);class y{async toggleStarred(A){this.starredEntities.delete(A)||this.starredEntities.add(A);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(A=>(A.next(new Set(this.starredEntities)),this.subscribers.add(A),()=>{this.subscribers.delete(A)})))}}var c=t(52322),$=t(2784),we=t(41156),ue=t(60364),G=t(77277),Z=t(4190),S=t(95544),V=t(90436),re=t(60905),q=t(36444);const _=b=>{const A=(0,we.Z)(ce=>ce.breakpoints.down("md")),I=(0,ue.Z)(),[F,ee]=(0,$.useState)(!1);return A?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(G.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>ee(!0),startIcon:(0,c.jsx)(q.Z,{}),children:"Filters"}),(0,c.jsx)(Z.ZP,{open:F,onClose:()=>ee(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(S.Z,{m:2,children:[(0,c.jsx)(V.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),b.children]})})]}):(0,c.jsx)(re.Z,{item:!0,lg:2,children:b.children})},B=b=>(0,c.jsx)(re.Z,{item:!0,xs:12,lg:10,children:b.children}),R=b=>(0,c.jsx)(re.Z,{container:!0,style:{position:"relative"},children:b.children});R.Filters=_,R.Content=B;var k=t(23196),L=t(47842),W=t(25271),Ce=t(51837);const Ve=(0,Ce.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function et(b){var A,I;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(I=(A=b.metadata.namespace)===null||A===void 0?void 0:A.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:b.metadata.name}}function K(b,A){const I=A==null?void 0:A.defaultKind;let F,ee,ce;return"metadata"in b?(F=b.kind,ee=b.metadata.namespace,ce=b.metadata.name):(F=b.kind,ee=b.namespace,ce=b.name),(ee===void 0||ee==="")&&(ee=W.zG),(A==null?void 0:A.defaultNamespace)!==void 0?(A==null?void 0:A.defaultNamespace)===ee&&(ee=void 0):ee===W.zG&&(ee=void 0),F=F.toLocaleLowerCase("en-US"),F=I&&I.toLocaleLowerCase("en-US")===F?void 0:F,`${F?`${F}:`:""}${ee?`${ee}/`:""}${ce}`}var tt=t(80030);const dt=(0,$.forwardRef)((b,A)=>{const{entityRef:I,defaultKind:F,title:ee,children:ce,...ie}=b,ye=(0,r.tg)(Ve);let Re,Le,Be;if(typeof I=="string"){const De=(0,W.of)(I);Re=De.kind,Le=De.namespace,Be=De.name}else"metadata"in I?(Re=I.kind,Le=I.metadata.namespace,Be=I.metadata.name):(Re=I.kind,Le=I.namespace,Be=I.name);Re=Re.toLocaleLowerCase("en-US");var xe;Le=(xe=Le==null?void 0:Le.toLocaleLowerCase("en-US"))!==null&&xe!==void 0?xe:W.zG;const He={kind:Re,namespace:Le,name:Be},ct=K({kind:Re,namespace:Le,name:Be},{defaultKind:F}),st=(0,c.jsxs)(k.rU,{...ie,ref:A,to:ye(He),children:[ce,!ce&&(ee!=null?ee:ct)]});return ee?(0,c.jsx)(tt.ZP,{title:ct,children:st}):st});var Me=t(64279);function ft(b){const{entityRefs:A,defaultKind:I,getTitle:F,...ee}=b,ce=(0,r.h_)(z),{value:ie=new Array,loading:ye,error:Re}=(0,Me.default)(async()=>{const Le=A.reduce((xe,He)=>"metadata"in He?xe:[...xe,(0,W.of)(He)],new Array),Be=A.filter(xe=>"metadata"in xe);return Le.length>0?[...(await ce.getEntities({filter:Le.map(xe=>({kind:xe.kind,"metadata.namespace":xe.namespace,"metadata.name":xe.name}))})).items,...Be]:Be},[A]);return ye?(0,c.jsx)(k.Ex,{}):Re?(0,c.jsx)(k.yu,{error:Re}):(0,c.jsx)(c.Fragment,{children:ie.map((Le,Be)=>(0,c.jsxs)($.Fragment,{children:[Be>0&&", ",(0,c.jsx)(dt,{...ee,defaultKind:I,entityRef:Le,title:F(Le)})]},Be))})}function Ie(b){const{entityRefs:A,defaultKind:I,fetchEntities:F,getTitle:ee,...ce}=b;return F?(0,c.jsx)(ft,{...ce,defaultKind:I,entityRefs:A,getTitle:ee}):(0,c.jsx)(c.Fragment,{children:A.map((ie,ye)=>(0,c.jsxs)($.Fragment,{children:[ye>0&&", ",(0,c.jsx)(dt,{...ce,defaultKind:I,entityRef:ie,title:ee?ee(ie):void 0})]},ye))})}var lt=t(49280);class Et{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(A){(0,L.Z)(this,"value",void 0),this.value=A}}class pt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(A){(0,L.Z)(this,"value",void 0),this.value=A}}class mt{filterEntity(A){var I;return this.values.every(F=>((I=A.metadata.tags)!==null&&I!==void 0?I:[]).includes(F))}toQueryValue(){return this.values}constructor(A){(0,L.Z)(this,"values",void 0),this.values=A}}class At{filterEntity(A){const I=this.toUpperArray(this.value.split(/\s/)),F=this.toUpperArray([A.metadata.tags]),ee=this.toUpperArray([A.metadata.name,A.metadata.title]);for(const ce of I)if(F.every(ie=>ie!==ce)&&ee.every(ie=>!ie.includes(ce)))return!1;return!0}toUpperArray(A){return A.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(A){_define_property(this,"value",void 0),this.value=A}}class Nt{filterEntity(A){return this.values.some(I=>(0,lt.hF)(A,W.S4).some(F=>K(F,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(A){(0,L.Z)(this,"values",void 0),this.values=A}}class ze{filterEntity(A){return this.values.some(I=>{var F;return((F=A.spec)===null||F===void 0?void 0:F.lifecycle)===I})}toQueryValue(){return this.values}constructor(A){(0,L.Z)(this,"values",void 0),this.values=A}}class qt{filterEntity(A){switch(this.value){case"owned":return this.isOwnedEntity(A);case"starred":return this.isStarredEntity(A);default:return!0}}toQueryValue(){return this.value}constructor(A,I,F){(0,L.Z)(this,"value",void 0),(0,L.Z)(this,"isOwnedEntity",void 0),(0,L.Z)(this,"isStarredEntity",void 0),this.value=A,this.isOwnedEntity=I,this.isStarredEntity=F}}class ve{filterEntity(A){var I;const F=(I=A.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return F!==void 0&&this.value.toString()===F}constructor(A){(0,L.Z)(this,"value",void 0),this.value=A}}class he{filterEntity(A){var I,F;const ee=(A==null||(I=A.status)===null||I===void 0||(F=I.items)===null||F===void 0?void 0:F.length)>0;return ee!==void 0&&this.value===ee}constructor(A){(0,L.Z)(this,"value",void 0),this.value=A}}var Ne=t(96641),Je=t(76635),wt=t.n(Je),jt=t(19126),ot=t.n(jt),St=t(79635),kt=t(69294),zt=t(48760),Bt=t(90736);const on=(0,$.createContext)(void 0),Wt=b=>{const A=(0,Bt.default)(),I=(0,r.h_)(z),[F,ee]=(0,$.useState)({}),ce=(0,St.TH)();var ie;const ye=(0,$.useMemo)(()=>(ie=ot().parse(ce.search,{ignoreQueryPrefix:!0}).filters)!==null&&ie!==void 0?ie:{},[ce]),[Re,Le]=(0,$.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Be,error:xe},He]=(0,kt.default)(async()=>{const De=(0,Je.compact)(Object.values(F)),gt=(0,lt.Gz)(De),Zt=(0,lt.wq)(De),vn=(0,lt.wq)((0,Je.compact)(Object.values(Re.appliedFilters))),Yt=Object.keys(F).reduce((pn,yn)=>{const xn=F[yn];return xn!=null&&xn.toQueryValue&&(pn[yn]=xn.toQueryValue()),pn},{});if((0,Je.isEqual)(vn,Zt))Le({appliedFilters:F,backendEntities:Re.backendEntities,entities:Re.backendEntities.filter(gt)});else{const pn=await I.getEntities({filter:Zt});Le({appliedFilters:F,backendEntities:pn.items,entities:pn.items.filter(gt)})}if(A()){var An;const pn=ot().parse(ce.search,{ignoreQueryPrefix:!0}),yn=ot().stringify({...pn,filters:Yt},{addQueryPrefix:!0,arrayFormat:"repeat"}),xn=`${window.location.pathname}${yn}`;(An=window.history)===null||An===void 0||An.replaceState(null,document.title,xn)}},[I,ye,F,Re],{loading:!0});(0,zt.Z)(He,10,[F]);const ct=(0,$.useCallback)(De=>{ee(gt=>{const Zt=typeof De=="function"?De(gt):De;return{...gt,...Zt}})},[]),st=(0,$.useMemo)(()=>({filters:Re.appliedFilters,entities:Re.entities,backendEntities:Re.backendEntities,updateFilters:ct,queryParameters:ye,loading:Be,error:xe}),[Re,ct,ye,Be,xe]);return(0,c.jsx)(on.Provider,{value:st,children:b.children})};function Vt(){const b=(0,$.useContext)(on);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var Nn=t(18149),In=t.n(Nn),ln=t(829),wn=t.n(ln);function Fn(){const b=(0,r.h_)(z),{filters:{kind:A,type:I},queryParameters:{type:F},updateFilters:ee}=Vt(),ce=(0,$.useMemo)(()=>[F].flat().filter(Boolean),[F]);var ie;const[ye,Re]=(0,$.useState)(ce.length?ce:(ie=I==null?void 0:I.getTypes())!==null&&ie!==void 0?ie:[]);(0,$.useEffect)(()=>{ce.length&&Re(ce)},[ce]);const[Le,Be]=(0,$.useState)([]),xe=(0,$.useMemo)(()=>A==null?void 0:A.value,[A]),{error:He,loading:ct,value:st}=(0,Me.default)(async()=>xe?await b.getEntityFacets({filter:{kind:xe},facets:["spec.type"]}).then(Zt=>Zt.facets["spec.type"]||[]):[],[xe,b]),De=(0,$.useRef)(st);return(0,$.useEffect)(()=>{const gt=De.current;if(De.current=st,ct||!xe||gt===st||!st)return;const Zt=[...new Set(wn()(st,Yt=>-Yt.count).map(Yt=>Yt.value.toLocaleLowerCase("en-US")))];Be(Zt);const vn=ye.filter(Yt=>Zt.includes(Yt));In()(ye,vn)||Re(vn)},[ct,xe,ye,Re,st]),(0,$.useEffect)(()=>{ee({type:ye.length?new pt(ye):void 0})},[ye,ee]),{loading:ct,error:He,availableTypes:Le,selectedTypes:ye,setSelectedTypes:Re}}const Un=20;function Mn(b,A){var I,F;const ee=A==null||(I=A.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),ce=A==null||(F=A.kind)===null||F===void 0?void 0:F.toLocaleLowerCase("en-US"),ie=(0,r.h_)(z),{loading:ye,value:Re,error:Le}=(0,Me.default)(async()=>{var Be;const xe=(Be=b.relations)===null||Be===void 0?void 0:Be.map(De=>({type:De.type,target:(0,W.of)(De.targetRef)})).filter(De=>(!ee||De.type.toLocaleLowerCase("en-US")===ee)&&(!ce||De.target.kind===ce));if(!xe)return[];const He=Object.values((0,Je.groupBy)(xe,({target:De})=>`${De.kind}:${De.namespace}`.toLocaleLowerCase("en-US"))),ct=[];for(const De of He)ct.push({kind:De[0].target.kind,namespace:De[0].target.namespace,nameBatches:(0,Je.chunk)(De.map(gt=>gt.target.name),Un)});return(await Promise.all(ct.flatMap(De=>De.nameBatches.map(gt=>ie.getEntities({filter:{kind:De.kind,"metadata.namespace":De.namespace,"metadata.name":gt}}))))).flatMap(De=>De.items)},[b,ee,ce]);return{entities:Re,loading:ye,error:Le}}var Jn=t(72164);function nt(b){return typeof b=="string"?b:(0,W.eE)(b)}function zn(){const b=(0,r.h_)(P),A=(0,Jn.Z)(b.starredEntitie$(),new Set),I=(0,$.useCallback)(ee=>A.has(nt(ee)),[A]),F=(0,$.useCallback)(ee=>b.toggleStarred(nt(ee)).then(),[b]);return{starredEntities:A,toggleStarredEntity:F,isStarredEntity:I}}function Pn(b){return typeof b=="string"?b:(0,W.eE)(b)}function Wn(b){const A=(0,r.h_)(P),[I,F]=(0,$.useState)(!1);return(0,$.useEffect)(()=>{const ce=A.starredEntitie$().subscribe({next(ie){F(ie.has(Pn(b)))}});return()=>{ce.unsubscribe()}},[b,A]),{toggleStarredEntity:(0,$.useCallback)(()=>A.toggleStarred(Pn(b)).then(),[b,A]),isStarredEntity:I}}var Sn=t(75435);function sn(){const b=(0,r.h_)(r.$4),{loading:A,value:I}=(0,Me.default)(async()=>{const{ownershipEntityRefs:ee}=await b.getBackstageIdentity();return ee},[]),F=(0,$.useMemo)(()=>{const ee=new Set(I!=null?I:[]);return ce=>{const ie=(0,Sn.h)(ce,W.S4).map(W.eE);for(const ye of ie)if(ee.has(ye))return!0;return!1}},[I]);return(0,$.useMemo)(()=>({loading:A,isOwnedEntity:F}),[A,F])}function Ln(){const b=(0,r.h_)(z),{error:A,loading:I,value:F}=(0,Me.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(ce=>{var ie;return((ie=ce.facets.kind)===null||ie===void 0?void 0:ie.map(ye=>ye.value).sort())||[]}),[b]);return{loading:I,error:A,allKinds:F!=null?F:[]}}function gn(b,A,I){let F=b;return A&&(F=F.filter(ce=>A.some(ie=>ie.toLocaleLowerCase("en-US")===ce.toLocaleLowerCase("en-US")))),I&&!b.some(ce=>ce.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(F=F.concat([I])),F.sort().reduce((ce,ie)=>(ce[ie.toLocaleLowerCase("en-US")]=ie,ce),{})}function jn(b){var A;const{filters:I,queryParameters:{kind:F},updateFilters:ee}=Vt(),ce=(0,$.useMemo)(()=>[F].flat()[0],[F]);var ie;const[ye,Re]=(0,$.useState)((ie=ce!=null?ce:(A=I.kind)===null||A===void 0?void 0:A.value)!==null&&ie!==void 0?ie:b.initialFilter);(0,$.useEffect)(()=>{ce&&Re(ce)},[ce]),(0,$.useEffect)(()=>{var He;if(!((He=I.kind)===null||He===void 0)&&He.value){var ct;Re((ct=I.kind)===null||ct===void 0?void 0:ct.value)}},[I.kind]),(0,$.useEffect)(()=>{ee({kind:ye?new Et(ye):void 0})},[ye,ee]);const{allKinds:Le,loading:Be,error:xe}=Ln();return{loading:Be,error:xe,allKinds:Le!=null?Le:[],selectedKind:ye,setSelectedKind:Re}}const Vn=b=>{const{allowedKinds:A,hidden:I,initialFilter:F="component"}=b,ee=(0,r.h_)(r.$v),{error:ce,allKinds:ie,selectedKind:ye,setSelectedKind:Re}=jn({initialFilter:F});if((0,$.useEffect)(()=>{ce&&ee.post({message:"Failed to load entity kinds",severity:"error"})},[ce,ee]),ce)return null;const Le=gn(ie,A,ye),Be=Object.keys(Le).map(xe=>({value:xe,label:Le[xe]}));return I?null:(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsx)(k.Ph,{label:"Kind",items:Be,selected:ye.toLocaleLowerCase("en-US"),onChange:xe=>Re(String(xe))})})};var fe=t(79692),oe=t(5806),ke=t(21324),Fe=t(86619),Ke=t(19996),te=t(25505),D=t(38016),pe=t(88013);const Ae=(0,fe.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Qe=(0,c.jsx)(te.Z,{fontSize:"small"}),Xe=(0,c.jsx)(Ke.Z,{fontSize:"small"}),Tt=b=>{var A;const{initialFilter:I=[]}=b,F=Ae(),{updateFilters:ee,backendEntities:ce,filters:ie,queryParameters:{lifecycles:ye}}=Vt(),Re=(0,$.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var Le;const[Be,xe]=(0,$.useState)(Re.length?Re:(Le=(A=ie.lifecycles)===null||A===void 0?void 0:A.values)!==null&&Le!==void 0?Le:I);(0,$.useEffect)(()=>{Re.length&&xe(Re)},[Re]);const He=(0,$.useMemo)(()=>[...new Set(ce.map(ct=>{var st;return(st=ct.spec)===null||st===void 0?void 0:st.lifecycle}).filter(Boolean))].sort(),[ce]);return(0,$.useEffect)(()=>{ee({lifecycles:Be.length&&He.length?new ze(Be):void 0})},[Be,ee,He]),He.length?(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsxs)(V.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(pe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:He,value:Be,onChange:(ct,st)=>xe(st),renderOption:(ct,{selected:st})=>(0,c.jsx)(oe.Z,{control:(0,c.jsx)(ke.Z,{icon:Qe,checkedIcon:Xe,checked:st}),label:ct}),size:"small",popupIcon:(0,c.jsx)(D.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:ct=>(0,c.jsx)(Fe.Z,{...ct,className:F.input,variant:"outlined"})})]})}):null},Gt=(0,fe.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),an=(0,c.jsx)(te.Z,{fontSize:"small"}),ne=(0,c.jsx)(Ke.Z,{fontSize:"small"}),Q=()=>{var b;const A=Gt(),{updateFilters:I,backendEntities:F,filters:ee,queryParameters:{owners:ce}}=Vt(),ie=(0,$.useMemo)(()=>[ce].flat().filter(Boolean),[ce]);var ye;const[Re,Le]=(0,$.useState)(ie.length?ie:(ye=(b=ee.owners)===null||b===void 0?void 0:b.values)!==null&&ye!==void 0?ye:[]);(0,$.useEffect)(()=>{ie.length&&Le(ie)},[ie]);const Be=(0,$.useMemo)(()=>[...new Set(F.flatMap(xe=>(0,lt.hF)(xe,W.S4).map(He=>K(He,{defaultKind:"group"}))).filter(Boolean))].sort(),[F]);return(0,$.useEffect)(()=>{I({owners:Re.length&&Be.length?new Nt(Re):void 0})},[Re,I,Be]),Be.length?(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsxs)(V.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(pe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Be,value:Re,onChange:(xe,He)=>Le(He),renderOption:(xe,{selected:He})=>(0,c.jsx)(oe.Z,{control:(0,c.jsx)(ke.Z,{icon:an,checkedIcon:ne,checked:He}),label:xe}),size:"small",popupIcon:(0,c.jsx)(D.Z,{"data-testid":"owner-picker-expand"}),renderInput:xe=>(0,c.jsx)(Fe.Z,{...xe,className:A.input,variant:"outlined"})})]})}):null},se=b=>{const A=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:A(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},g=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),j=b=>{var A;const I=(A=b.entity.spec.profile)===null||A===void 0?void 0:A.email;return I?_jsx(EmailCardAction,{email:I}):null},J=b=>{var A;const I=(A=b.entity.spec.profile)===null||A===void 0?void 0:A.email;return I?_jsx(EmailCardAction,{email:I}):null},Y=(0,fe.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),ge=4,me=b=>{var A,I,F;const{entityRef:ee,children:ce,delayTime:ie=500}=b,ye=Y(),Re=useApiHolder(),Le=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Be,xe]=useState(!1),He=useMemo(()=>debounce(()=>xe(!0),ie),[ie]),[{loading:ct,error:st,value:De},gt]=useAsyncFn(async()=>{const vn=Re.get(catalogApiRef);if(vn){const Yt=await vn.getEntityByRef(ee);if(!Yt)throw new Error(`${ee} not found`);return Yt}},[Re,ee]),Zt=()=>{xe(!1),He.cancel()};return useEffect(()=>{Le.isOpen&&!De&&!st&&!ct&&gt()},[Le.isOpen,gt,De,st,ct]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:He,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Le),children:ce})}),Be&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(Le),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Zt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[st&&_jsx(ResponseErrorPanel,{error:st}),ct&&_jsx(Progress,{}),De&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:De.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:De.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:De.kind}),De.metadata.description&&_jsx(Typography,{className:ye.descriptionTypography,paragraph:!0,children:De.metadata.description}),_jsx(Typography,{children:(A=De.spec)===null||A===void 0?void 0:A.type}),_jsxs(Box,{marginTop:"0.5em",children:[(De.metadata.tags||[]).slice(0,ge).map(vn=>_jsx(Chip,{size:"small",label:vn},vn)),((I=De.metadata.tags)===null||I===void 0?void 0:I.length)&&((F=De.metadata.tags)===null||F===void 0?void 0:F.length)>ge&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!st&&De&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(De)&&_jsx(UserCardActions,{entity:De}),isGroupEntity(De)&&_jsx(GroupCardActions,{entity:De}),_jsx(EntityCardActions,{entity:De})]})})]})})]})},Ue=(0,fe.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),it=()=>{var b;const A=Ue(),{filters:I,updateFilters:F}=useEntityList();var ee;const[ce,ie]=useState((ee=(b=I.text)===null||b===void 0?void 0:b.value)!==null&&ee!==void 0?ee:"");return useDebounce(()=>{F({text:ce.length?new EntityTextFilter(ce):void 0})},250,[ce,F]),_jsx(Toolbar,{className:A.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:A.input,placeholder:"Search",autoComplete:"off",onChange:ye=>ie(ye.target.value),value:ce,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ie(""),edge:"end",disabled:ce.length===0,children:_jsx(Clear,{})})})})})})},rt=Object.freeze({createEntityRefColumn(b){const{defaultKind:A}=b;function I(F){var ee;return((ee=F.metadata)===null||ee===void 0?void 0:ee.title)||K(F,{defaultKind:A})}return{title:"Name",highlight:!0,customFilterAndSearch(F,ee){return I(ee).includes(F)},customSort(F,ee){return I(F).localeCompare(I(ee))},render:F=>{var ee;return(0,c.jsx)(dt,{entityRef:F,defaultKind:A,title:(ee=F.metadata)===null||ee===void 0?void 0:ee.title})}}},createEntityRelationColumn(b){const{title:A,relation:I,defaultKind:F,filter:ee}=b;function ce(ye){return(0,lt.hF)(ye,I,ee)}function ie(ye){return ce(ye).map(Re=>K(Re,{defaultKind:F})).join(", ")}return{title:A,customFilterAndSearch(ye,Re){return ie(Re).includes(ye)},customSort(ye,Re){return ie(ye).localeCompare(ie(Re))},render:ye=>(0,c.jsx)(Ie,{entityRefs:ce(ye),defaultKind:F})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:W.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:W.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:W.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,c.jsx)(k.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),yt=[rt.createEntityRefColumn({defaultKind:"system"}),rt.createDomainColumn(),rt.createOwnerColumn(),rt.createMetadataDescriptionColumn()],at=[rt.createEntityRefColumn({defaultKind:"component"}),rt.createSystemColumn(),rt.createOwnerColumn(),rt.createSpecTypeColumn(),rt.createSpecLifecycleColumn(),rt.createMetadataDescriptionColumn()],qe=(0,fe.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),Ze=b=>{const{entities:A,title:I,emptyContent:F,variant:ee="gridItem",columns:ce}=b,ie=qe(),ye={minWidth:"0",width:"100%"};return ee==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,c.jsx)(k.iA,{columns:ce,title:I,style:ye,emptyContent:F&&(0,c.jsx)("div",{className:ie.empty,children:F}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:A})};Ze.columns=rt,Ze.systemEntityColumns=yt,Ze.componentEntityColumns=at;const $t=(0,c.jsx)(te.Z,{fontSize:"small"}),Ht=(0,c.jsx)(Ke.Z,{fontSize:"small"});function Rt({selected:b}){return(0,c.jsx)(ke.Z,{icon:$t,checkedIcon:Ht,checked:b})}const It=(0,$.memo)(b=>{const{selected:A,value:I,availableOptions:F,showCounts:ee}=b,ce=ee?`${I} (${F==null?void 0:F[I]})`:I;return(0,c.jsx)(oe.Z,{control:(0,c.jsx)(Rt,{selected:A}),label:ce})});var en=t(72779),Dt=t.n(en);const vt=(0,fe.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function _e(b){const A=vt();return(0,c.jsx)(Fe.Z,{variant:"outlined",...b,className:Dt()(A.input,b.className)})}function Ot(b){var A;const{label:I,name:F,path:ee,showCounts:ce,Filter:ie,InputProps:ye}=b,{updateFilters:Re,filters:Le,queryParameters:{[F]:Be}}=Vt(),xe=(0,r.h_)(z),{value:He}=(0,Me.default)(async()=>{var Yt;const An=ee,{facets:pn}=await xe.getEntityFacets({facets:[An],filter:(Yt=Le.kind)===null||Yt===void 0?void 0:Yt.getCatalogFilters()});return Object.fromEntries(pn[An].map(({value:yn,count:xn})=>[yn,xn]))},[Le.kind]),ct=(0,$.useMemo)(()=>[Be].flat().filter(Boolean),[Be]);var st;const[De,gt]=(0,$.useState)(ct.length?ct:(st=(A=Le[F])===null||A===void 0?void 0:A.values)!==null&&st!==void 0?st:[]);(0,$.useEffect)(()=>{ct.length&&!wt().isEqual(De,ct)&&gt(ct)},[De,ct]);const Zt=Object.keys(He!=null?He:{}),vn=De.length&&Zt.length;return(0,$.useEffect)(()=>{Re({[F]:vn?new ie(De):void 0})},[F,vn,De,ie,Re]),Le[F]&&!("values"in Le[F])||!Zt.length?null:(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsxs)(V.Z,{variant:"button",component:"label",children:[I,(0,c.jsx)(pe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Zt,value:De,onChange:(Yt,An)=>gt(An),renderOption:(Yt,{selected:An})=>(0,c.jsx)(It,{selected:An,value:Yt,availableOptions:He,showCounts:!!ce}),size:"small",popupIcon:(0,c.jsx)(D.Z,{"data-testid":`${String(F)}-picker-expand`}),renderInput:Yt=>(0,c.jsx)(_e,{...Yt,...ye})})]})})}const tn=(0,fe.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),En=b=>{const A=tn();return(0,c.jsx)(Ot,{label:"Tags",name:"tags",path:"metadata.tags",Filter:mt,showCounts:b.showCounts,InputProps:{className:A.input}})},cn=b=>{const{hidden:A,initialFilter:I}=b,F=(0,r.h_)(r.$v),{error:ee,availableTypes:ce,selectedTypes:ie,setSelectedTypes:ye}=Fn();if((0,$.useEffect)(()=>{ee&&F.post({message:"Failed to load entity types",severity:"error"}),I&&ye([I])},[ee,F,I,ye]),ce.length===0||ee)return null;const Re=[{value:"all",label:"all"},...ce.map(Be=>({value:Be,label:Be}))];var Le;return A?null:(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsx)(k.Ph,{label:"Type",items:Re,selected:(Le=Re.length>1?ie[0]:void 0)!==null&&Le!==void 0?Le:"all",onChange:Be=>ye(Be==="all"?[]:[String(Be)])})})};var Cn=t(15459),Qn=t(61837),kn=t(11640),mn=t(28347);const rr=(0,Cn.Z)({root:{color:"#f3ba37"}})(kn.Z),w=b=>{const{toggleStarredEntity:A,isStarredEntity:I}=Wn(b.entity);return(0,c.jsx)(Qn.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>A(),children:(0,c.jsx)(tt.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(rr,{}):(0,c.jsx)(mn.Z,{})})})};var h=t(8629),x=t(79249),E=t(38724),X=t(99152),be=t(6487),je=t(49429),Ee=t(55999),ut=t(39412);const Mt=ut.Z;function hn(b,A){if(b)return b.toLocaleLowerCase("en-US");if(A)try{return(0,W.of)(A).kind.toLocaleLowerCase("en-US")}catch{return}}function Hn(b,A){const I=(0,r.qD)(),F=hn(b,A);return F&&I.getSystemIcon(`kind:${F}`)||Mt}function xr(b){const{kind:A,entityRef:I,...F}=b,ee=Hn(A,I);return(0,c.jsx)(ee,{...F})}const Rr=(0,fe.Z)(b=>({node:{fill:b.palette.grey[300],stroke:b.palette.grey[300],"&.primary":{fill:b.palette.primary.light,stroke:b.palette.primary.light},"&.secondary":{fill:b.palette.secondary.light,stroke:b.palette.secondary.light}},text:{fill:b.palette.getContrastText(b.palette.grey[300]),"&.primary":{fill:b.palette.primary.contrastText},"&.secondary":{fill:b.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Ir(b){const A=(0,r.h_)(z),I=(0,W.eE)(b),{loading:F,error:ee,value:ce}=(0,Me.default)(async()=>{const ie=await A.getEntityAncestors({entityRef:I}),ye=new Array,Re=new Array;for(const Le of ie.items){const Be=(0,W.eE)(Le.entity),xe=Be===ie.rootEntityRef;ye.push({id:Be,root:xe,...Le.entity});for(const He of Le.parentEntityRefs)Re.push({from:Be,to:He})}return{nodes:ye,edges:Re}},[I]);return{loading:F,error:ee,nodes:(ce==null?void 0:ce.nodes)||[],edges:(ce==null?void 0:ce.edges)||[]}}function eo({node:b}){const A=Rr(),I=(0,St.s0)(),F=(0,r.tg)(Ve),[ee,ce]=(0,$.useState)(0),[ie,ye]=(0,$.useState)(0),Re=(0,$.useRef)(null);(0,$.useLayoutEffect)(()=>{if(Re.current){let{height:gt,width:Zt}=Re.current.getBBox();gt=Math.round(gt),Zt=Math.round(Zt),(gt!==ie||Zt!==ee)&&(ce(Zt),ye(gt))}},[ee,ie]);const Le=10,Be=ie,xe=Be+Le,He=xe+ee+Le*2,ct=ie+Le*2,st=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?K({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),De=()=>{I(F({kind:b.kind,namespace:b.metadata.namespace||W.zG,name:b.metadata.name}))};return(0,c.jsxs)("g",{onClick:De,className:A.clickable,children:[(0,c.jsx)("rect",{className:Dt()(A.node,b.root?"secondary":"primary"),width:He,height:ct,rx:10}),(0,c.jsx)(xr,{kind:b.kind,y:Le,x:Le,width:Be,height:Be,className:Dt()(A.text,b.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Re,className:Dt()(A.text,b.root?"secondary":"primary"),y:ct/2,x:xe+(ee+Le*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:st})]})}function jo(b){const{loading:A,error:I,nodes:F,edges:ee}=Ir(b.entity);return A?(0,c.jsx)(k.Ex,{}):I?(0,c.jsx)(k.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(Ee.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,c.jsx)(k.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,c.jsx)(S.Z,{mt:4,children:(0,c.jsx)(k.mn,{nodes:F,edges:ee,renderNode:eo,direction:k.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var ar=t(11776),Gn=t(38402),Xn=t(86136),lr=t(99688),Nr=t(49378),Eo=t(54506),mr=t(94339),_o=t(24579),Ao=t(27685);const to=(0,fe.Z)(b=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:b.spacing(2)},helpIcon:{marginLeft:b.spacing(1),color:b.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function qn(b){const A=to();return(0,c.jsx)(Nr.Z,{...b,primaryTypographyProps:{className:A.monospace},secondaryTypographyProps:{className:A.monospace}})}function Pr(b){const A=to();return(0,c.jsx)(Eo.Z,{className:A.monospace,children:b.children})}function Lr(b){return(0,c.jsx)(S.Z,{mt:2,children:(0,c.jsx)(mr.Z,{variant:"outlined",children:(0,c.jsxs)(_o.Z,{children:[(0,c.jsxs)(V.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,c.jsx)(Ur,{to:b.helpLink})]}),b.children]})})})}function To(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function Fr(b){const[A,I]=b.entry,F=To(I);return(0,c.jsxs)(Gn.Z,{children:[b.indent&&(0,c.jsx)(Xn.Z,{}),(0,c.jsx)(qn,{primary:A,secondary:F?(0,c.jsx)(k.rU,{to:F,children:I}):I})]})}function Ur(b){const A=to();return(0,c.jsx)(k.rU,{to:b.to,className:A.helpIcon,children:(0,c.jsx)(Ao.Z,{fontSize:"inherit"})})}const cr=(0,fe.Z)({root:{display:"flex",flexDirection:"column"}});function Mr(b){var A,I;const F=(0,r.h_)(z),ee=(0,W.eE)(b),ce=(A=b.metadata.annotations)===null||A===void 0?void 0:A[W.P1],ie=(I=b.metadata.annotations)===null||I===void 0?void 0:I[W.q1],{loading:ye,error:Re,value:Le}=(0,Me.default)(async()=>!ce&&!ie?[]:(await F.getEntities({filter:[...ce?[{[`metadata.annotations.${W.P1}`]:ce}]:[],...ie?[{[`metadata.annotations.${W.q1}`]:ie}]:[]]})).items,[ce,ie]);return{loading:ye,error:Re,location:ce,originLocation:ie,colocatedEntities:Le==null?void 0:Le.filter(Be=>(0,W.eE)(Be)!==ee)}}function zr(b){return(0,c.jsxs)(ar.Z,{dense:!0,children:[b.header&&(0,c.jsx)(Fr,{entry:b.header},"header"),b.entities.map(A=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(xr,{kind:A.kind})}),(0,c.jsx)(qn,{primary:(0,c.jsx)(dt,{entityRef:A})})]},(0,W.eE)(A)))]})}function Ro(b){const{entity:A}=b,{loading:I,error:F,location:ee,originLocation:ce,colocatedEntities:ie}=Mr(A);if(I)return(0,c.jsx)(k.Ex,{});if(F)return(0,c.jsx)(k.Gk,{error:F});if(!ee&&!ce)return(0,c.jsx)(lr.Z,{severity:"warning",children:"Entity had no location information."});if(!(ie!=null&&ie.length))return(0,c.jsx)(lr.Z,{severity:"info",children:"There were no other entities on this location."});if(ee===ce)return(0,c.jsx)(zr,{entities:ie});const ye=ie.filter(Le=>{var Be;return((Be=Le.metadata.annotations)===null||Be===void 0?void 0:Be[W.P1])===ee}),Re=ie.filter(Le=>{var Be;return((Be=Le.metadata.annotations)===null||Be===void 0?void 0:Be[W.q1])===ce});return(0,c.jsxs)(c.Fragment,{children:[ye.length>0&&(0,c.jsx)(zr,{entities:ye,header:["At the same location",ee]}),Re.length>0&&(0,c.jsx)(zr,{entities:Re,header:["At the same origin",ce]})]})}function Io(b){const A=cr();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(Ee.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,c.jsx)("div",{className:A.root,children:(0,c.jsx)(Ro,{entity:b.entity})})]})}function Po(b){return Object.fromEntries([...Object.entries(b)].sort((A,I)=>A[0]<I[0]?-1:1))}function Lo(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(Ee.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(Ee.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(k.Oi,{text:JSON.stringify(Po(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var no=t(3440),es=t.n(no);const vr=(0,fe.Z)({root:{display:"flex",flexDirection:"column"}});function ko(b){var A,I;const F=vr(),{apiVersion:ee,kind:ce,metadata:ie,spec:ye,relations:Re=[],status:Le={}}=b.entity,Be=es()(wn()(Re,xe=>xe.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:F.root,children:[(0,c.jsx)(Lr,{title:"Identity",children:(0,c.jsxs)(ar.Z,{dense:!0,children:[(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"apiVersion",secondary:ee})}),(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"kind",secondary:ce})}),(ye==null?void 0:ye.type)&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"spec.type",secondary:ye.type})}),ie.uid&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"uid",secondary:ie.uid})}),ie.etag&&(0,c.jsx)(Gn.Z,{children:(0,c.jsx)(qn,{primary:"etag",secondary:ie.etag})})]})}),(0,c.jsxs)(Lr,{title:"Metadata",children:[!!Object.keys(ie.annotations||{}).length&&(0,c.jsx)(ar.Z,{dense:!0,subheader:(0,c.jsxs)(Pr,{children:["Annotations",(0,c.jsx)(Ur,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ie.annotations).map(xe=>(0,c.jsx)(Fr,{indent:!0,entry:xe},xe[0]))}),!!Object.keys(ie.labels||{}).length&&(0,c.jsx)(ar.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:"Labels"}),children:Object.entries(ie.labels).map(xe=>(0,c.jsx)(Fr,{indent:!0,entry:xe},xe[0]))}),!!(!((A=ie.tags)===null||A===void 0)&&A.length)&&(0,c.jsx)(ar.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:"Tags"}),children:ie.tags.map((xe,He)=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{}),(0,c.jsx)(qn,{primary:xe})]},`${xe}-${He}`))})]}),!!Re.length&&(0,c.jsx)(Lr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Be).map(([xe,He],ct)=>(0,c.jsx)("div",{children:(0,c.jsx)(ar.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:xe}),children:He.map(st=>(0,c.jsxs)(Gn.Z,{children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(xr,{entityRef:st.targetRef})}),(0,c.jsx)(qn,{primary:(0,c.jsx)(dt,{entityRef:st.targetRef})})]},st.targetRef))})},ct))}),!!(!((I=Le.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Lr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Le.items.map((xe,He)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(V.Z,{children:[xe.level,": ",xe.type]}),(0,c.jsx)(S.Z,{ml:2,children:xe.message})]},He))})]})]})}var ro=t(72847);function Oo(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(Ee.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(Ee.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(k.Oi,{text:ro.ZP.stringify(Po(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const oo=(0,fe.Z)(b=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:b.palette.background.paper},tabs:{borderRight:`1px solid ${b.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function dr(b){const{children:A,value:I,index:F,...ee}=b,ce=oo();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==F,id:`vertical-tabpanel-${F}`,"aria-labelledby":`vertical-tab-${F}`,className:ce.tabContents,...ee,children:I===F&&(0,c.jsx)(S.Z,{pl:3,pr:3,children:A})})}function br(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function Zo(b){const A=oo(),[I,F]=$.useState(0);return(0,$.useEffect)(()=>{F(0)},[b.open]),b.entity?(0,c.jsxs)(h.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:A.fullHeightDialog},children:[(0,c.jsx)(x.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(E.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:A.root,children:[(0,c.jsxs)(X.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(ee,ce)=>F(ce),"aria-label":"Inspector options",className:A.tabs,children:[(0,c.jsx)(be.Z,{label:"Overview",...br(0)}),(0,c.jsx)(be.Z,{label:"Ancestry",...br(1)}),(0,c.jsx)(be.Z,{label:"Colocated",...br(2)}),(0,c.jsx)(be.Z,{label:"Raw JSON",...br(3)}),(0,c.jsx)(be.Z,{label:"Raw YAML",...br(4)})]}),(0,c.jsx)(dr,{value:I,index:0,children:(0,c.jsx)(ko,{entity:b.entity})}),(0,c.jsx)(dr,{value:I,index:1,children:(0,c.jsx)(jo,{entity:b.entity})}),(0,c.jsx)(dr,{value:I,index:2,children:(0,c.jsx)(Io,{entity:b.entity})}),(0,c.jsx)(dr,{value:I,index:3,children:(0,c.jsx)(Lo,{entity:b.entity})}),(0,c.jsx)(dr,{value:I,index:4,children:(0,c.jsx)(Oo,{entity:b.entity})})]})}),(0,c.jsx)(je.Z,{children:(0,c.jsx)(G.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var Wr=t(85256);function Bo(b){var A;const I=(0,r.h_)(z),F=(A=b.metadata.annotations)===null||A===void 0?void 0:A[W.q1],ee=b.metadata.uid,ce=F==="bootstrap:bootstrap",ie=(0,Me.default)(async()=>{const st=I.getLocationByRef(F);let De;if(!F)De=Promise.resolve([]);else{const gt=`metadata.annotations.${W.q1}`;De=I.getEntities({filter:{[gt]:F},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Zt=>Zt.items)}return Promise.all([st,De]).then(([gt,Zt])=>({location:gt,colocatedEntities:Zt}))},[I,b]),ye=(0,$.useCallback)(async function(){const{location:De}=ie.value;await I.removeLocationById(De.id)},[I,ie]),Re=(0,$.useCallback)(async function(){await I.removeEntityByUid(ee)},[I,ee]);if(ce)return{type:"bootstrap",location:F,deleteEntity:Re};const{loading:Le,error:Be,value:xe}=ie;if(Le)return{type:"loading"};if(Be)return{type:"error",error:Be};const{location:He,colocatedEntities:ct}=xe;return He?{type:"unregister",location:F,colocatedEntities:ct.map(W.iB),unregisterLocation:ye,deleteEntity:Re}:{type:"only-delete",deleteEntity:Re}}var kr=t(23054);const Kt=(0,fe.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ts=({entity:b,onConfirm:A,onClose:I})=>{const F=(0,r.h_)(r.$v),ee=(0,r.h_)(r.Ds),ce=Kt(),ie=Bo(b),[ye,Re]=(0,$.useState)(!1),[Le,Be]=(0,$.useState)(!1);var xe;const He=(xe=ee.getOptionalString("app.title"))!==null&&xe!==void 0?xe:"Backstage",ct=(0,$.useCallback)(async function(){if("unregisterLocation"in ie){Be(!0);try{await ie.unregisterLocation(),A()}catch(Zt){(0,kr.BD)(Zt),F.post({message:Zt.message})}finally{Be(!1)}}},[F,A,ie]),st=(0,$.useCallback)(async function(){if("deleteEntity"in ie){Be(!0);try{await ie.deleteEntity(),A()}catch(Zt){(0,kr.BD)(Zt),F.post({message:Zt.message})}finally{Be(!1)}}},[F,A,ie]),De=()=>(0,c.jsx)(je.Z,{className:ce.dialogActions,children:(0,c.jsx)(G.Z,{onClick:I,color:"primary",children:"Cancel"})});return ie.type==="loading"?(0,c.jsx)(k.Ex,{}):ie.type==="error"?(0,c.jsx)(k.Gk,{error:ie.error}):ie.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(lr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ie.location,'"). If you believe this is in error, please contact the ',He," ","integrator."]}),(0,c.jsxs)(S.Z,{marginTop:2,children:[!ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:ce.advancedButton,onClick:()=>Re(!0),children:"Advanced Options"}),(0,c.jsx)(De,{})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:st,children:"Delete Entity"}),(0,c.jsx)(De,{})]})]})]}):ie.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:st,children:"Delete Entity"}),(0,c.jsx)(De,{})]}):ie.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ee.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(Ee.Z,{component:"ul",children:ie.colocatedEntities.map(gt=>(0,c.jsx)("li",{children:(0,c.jsx)(dt,{entityRef:gt})},`${gt.kind}:${gt.namespace}/${gt.name}`))}),(0,c.jsx)(Ee.Z,{children:"Located at the following location:"}),(0,c.jsx)(Ee.Z,{component:"ul",children:(0,c.jsx)("li",{children:ie.location})}),(0,c.jsxs)(Ee.Z,{children:["To undo, just re-register the entity in ",He,"."]}),(0,c.jsxs)(S.Z,{marginTop:2,children:[(0,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:ct,children:"Unregister Location"}),!ye&&(0,c.jsx)(S.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:ce.advancedButton,onClick:()=>Re(!0),children:"Advanced Options"})})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(S.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(Wr.Z,{})}),(0,c.jsx)(Ee.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:st,children:"Delete Entity"})]})]}):(0,c.jsx)(lr.Z,{severity:"error",children:"Internal error: Unknown state"})},$o=b=>{const{open:A,onConfirm:I,onClose:F,entity:ee}=b;return(0,c.jsxs)(h.Z,{open:A,onClose:F,children:[(0,c.jsx)(x.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(E.Z,{children:(0,c.jsx)(ts,{entity:ee,onConfirm:I,onClose:F})})]})};var ns=t(12231),rs=t(9520),os=t(47603);const ss=(0,fe.Z)(b=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:b.spacing(1,0,1,0)},title:{margin:b.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:b.palette.text.primary},menuItem:{minHeight:b.spacing(6)},groupWrapper:{margin:b.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function is(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:os.Z},{id:"starred",label:"Starred",icon:kn.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const or=b=>{const{initialFilter:A,availableFilters:I}=b,F=ss(),ee=(0,r.h_)(r.Ds);var ce;const ie=(ce=ee.getOptionalString("organization.name"))!==null&&ce!==void 0?ce:"Company",{filters:ye,updateFilters:Re,backendEntities:Le,queryParameters:{kind:Be,user:xe},loading:He}=Vt(),ct=["starred","all"],st=is(ie).map(Tn=>({...Tn,items:Tn.items.filter(({id:On})=>["group","user"].some(Sr=>Sr===Be)?ct.includes(On):!I||I.includes(On))})).filter(({items:Tn})=>!!Tn.length),{isStarredEntity:De}=zn(),{isOwnedEntity:gt,loading:Zt}=sn(),vn=He||Zt,Yt=(0,$.useMemo)(()=>new qt("owned",gt,De),[gt,De]),An=(0,$.useMemo)(()=>new qt("starred",gt,De),[gt,De]),pn=(0,$.useMemo)(()=>[xe].flat()[0],[xe]),[yn,xn]=(0,$.useState)(pn!=null?pn:A),Zr=(0,$.useMemo)(()=>Le.filter((0,lt.Gz)((0,Je.compact)(Object.values({...ye,user:void 0})))),[ye,Le]),Hr=(0,$.useMemo)(()=>({all:Zr.length,starred:Zr.filter(Tn=>An.filterEntity(Tn)).length,owned:Zr.filter(Tn=>Yt.filterEntity(Tn)).length}),[Zr,An,Yt]);(0,$.useEffect)(()=>{pn&&xn(pn)},[pn]),(0,$.useEffect)(()=>{!vn&&yn&&yn!=="all"&&Hr[yn]===0&&xn("all")},[vn,Hr,yn,xn]),(0,$.useEffect)(()=>{Re({user:yn?new qt(yn,gt,De):void 0})},[yn,gt,De,Re]);var Gr;return(0,c.jsx)(mr.Z,{className:F.root,children:st.map(Tn=>(0,c.jsxs)($.Fragment,{children:[(0,c.jsx)(V.Z,{variant:"subtitle2",component:"span",className:F.title,children:Tn.name}),(0,c.jsx)(mr.Z,{className:F.groupWrapper,children:(0,c.jsx)(ar.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Tn.name,children:Tn.items.map(On=>{var Sr;return(0,c.jsxs)(ns.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>xn(On.id),selected:On.id===((Sr=ye.user)===null||Sr===void 0?void 0:Sr.value),className:F.menuItem,disabled:Hr[On.id]===0,"data-testid":`user-picker-${On.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[On.icon&&(0,c.jsx)(Xn.Z,{className:F.listIcon,children:(0,c.jsx)(On.icon,{fontSize:"small"})}),(0,c.jsx)(Nr.Z,{children:(0,c.jsxs)(V.Z,{variant:"body1",children:[On.label," "]})}),(0,c.jsx)(rs.Z,{children:(Gr=Hr[On.id])!==null&&Gr!==void 0?Gr:"-"})]},On.id)})})})]},Tn.name))})},Or=(0,fe.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),as=(0,c.jsx)(te.Z,{fontSize:"small"}),Do=(0,c.jsx)(Ke.Z,{fontSize:"small"}),so=()=>{const b=Or(),{updateFilters:A}=Vt(),[I,F]=(0,$.useState)([]);function ee(ye){A({orphan:ye?new ve(ye):void 0})}function ce(ye){A({error:ye?new he(ye):void 0})}const ie=["Is Orphan","Has Error"];return(0,c.jsx)(S.Z,{pb:1,pt:1,children:(0,c.jsxs)(V.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(pe.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ie,value:I,onChange:(ye,Re)=>{F(Re),ee(Re.includes("Is Orphan")),ce(Re.includes("Has Error"))},renderOption:(ye,{selected:Re})=>(0,c.jsx)(oe.Z,{control:(0,c.jsx)(ke.Z,{icon:as,checkedIcon:Do,checked:Re}),label:ye}),size:"small",popupIcon:(0,c.jsx)(D.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,c.jsx)(Fe.Z,{...ye,className:b.input,variant:"outlined"})})]})})};function Vr(b){const{children:A,value:I}=b;var F;const[ee,ce]=useState((F=I==null?void 0:I.filters)!==null&&F!==void 0?F:{}),ie=useCallback(st=>{ce(De=>{const gt=typeof st=="function"?st(De):st;return{...De,...gt}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,Le,Be,xe,He;const ct=useMemo(()=>({entities:(Re=I==null?void 0:I.entities)!==null&&Re!==void 0?Re:ye.entities,backendEntities:(Le=I==null?void 0:I.backendEntities)!==null&&Le!==void 0?Le:ye.backendEntities,updateFilters:(Be=I==null?void 0:I.updateFilters)!==null&&Be!==void 0?Be:ie,filters:ee,loading:(xe=I==null?void 0:I.loading)!==null&&xe!==void 0?xe:!1,queryParameters:(He=I==null?void 0:I.queryParameters)!==null&&He!==void 0?He:ye.queryParameters,error:I==null?void 0:I.error}),[I,ye,ee,ie]);return _jsx(EntityListContext.Provider,{value:ct,children:A})}},75435:function(bt,$e,t){"use strict";t.d($e,{h:function(){return r}});var u=t(25271);function r(z,P,m){var y;let c=(z==null||(y=z.relations)===null||y===void 0?void 0:y.filter($=>$.type===P).map($=>(0,u.of)($.targetRef)))||[];return m!=null&&m.kind&&(c=c.filter($=>$.kind.toLocaleLowerCase("en-US")===m.kind.toLocaleLowerCase("en-US"))),c}},49280:function(bt,$e,t){"use strict";t.d($e,{hF:function(){return z.h},CV:function(){return m},wq:function(){return u},Gz:function(){return r}});function u(c){return c.reduce(($,we)=>({...$,...we.getCatalogFilters?we.getCatalogFilters():{}}),{})}function r(c){return $=>c.every(we=>!we.filterEntity||we.filterEntity($))}var z=t(75435),P=t(25271);function m(c,$){var we;const ue=(we=c.metadata.annotations)===null||we===void 0?void 0:we[P.M6];if(ue)try{const G=(0,P.Ou)(ue),Z=$.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:Z==null?void 0:Z.type}}catch{return}}function y(c,$){const we=new Set([...getEntityRelations(c,RELATION_MEMBER_OF,{kind:"group"}),...c?[getCompoundEntityRef(c)]:[]].map(stringifyEntityRef)),ue=getEntityRelations($,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of ue)if(we.has(G))return!0;return!1}},33414:function(bt,$e,t){"use strict";t.r($e),t.d($e,{AboutCard:function(){return dt},AboutContent:function(){return K},AboutField:function(){return W}});var u=t(52322),r=t(25271),z=t(23196),P=t(60871),m=t(32838),y=t(40303),c=t(79692),$=t(94339),we=t(32552),ue=t(61837),G=t(85256),Z=t(24579),S=t(52866),V=t(30254),re=t(27604),q=t(2784),_=t(19625),B=t(60905),R=t(7089),k=t(90436);const L=(0,c.Z)(Me=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Me.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function W(Me){const{label:ft,value:Ie,gridSizes:lt,children:Et}=Me,pt=L(),mt=(0,P.vJ)(Et,Nt=>Nt.getElements()),At=mt.length>0?mt:(0,u.jsx)(k.Z,{variant:"body2",className:pt.value,children:Ie||"unknown"});return(0,u.jsxs)(B.Z,{item:!0,...lt,children:[(0,u.jsx)(k.Z,{variant:"h2",className:pt.label,children:ft}),At]})}var Ce=t(24851);const Ve=(0,c.Z)({description:{wordBreak:"break-word"}});function et(Me,ft,Ie){if(ft==="url"||Me.includes("://"))return Me;const lt=Ie.type==="file"?`file://${Ie.target}`:Ie.target;return ft==="file"||Ie.type==="file"?new URL(Me,lt).href:lt}function K(Me){var ft,Ie,lt,Et,pt,mt,At,Nt;const{entity:ze}=Me,qt=Ve(),ve=ze.kind.toLocaleLowerCase("en-US")==="system",he=ze.kind.toLocaleLowerCase("en-US")==="resource",Ne=ze.kind.toLocaleLowerCase("en-US")==="component",Je=ze.kind.toLocaleLowerCase("en-US")==="api",wt=ze.kind.toLocaleLowerCase("en-US")==="template",jt=ze.kind.toLocaleLowerCase("en-US")==="location",ot=ze.kind.toLocaleLowerCase("en-US")==="group",St=(0,y.hF)(ze,r.cz,{kind:"system"}),kt=(0,y.hF)(ze,r.cz,{kind:"component"}),zt=(0,y.hF)(ze,r.cz,{kind:"domain"}),Bt=(0,y.hF)(ze,r.S4);let on;try{on=(0,r.CV)(ze)}catch{on=void 0}return(0,u.jsxs)(B.Z,{container:!0,children:[(0,u.jsx)(W,{label:"Description",gridSizes:{xs:12},children:(0,u.jsx)(z.SA,{className:qt.description,content:(ze==null||(ft=ze.metadata)===null||ft===void 0?void 0:ft.description)||"No description"})}),(0,u.jsx)(W,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,u.jsx)(y.rI,{entityRefs:Bt,defaultKind:"group"})}),(ve||zt.length>0)&&(0,u.jsx)(W,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:zt.length>0&&(0,u.jsx)(y.rI,{entityRefs:zt,defaultKind:"domain"})}),(Je||Ne||he||St.length>0)&&(0,u.jsx)(W,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:St.length>0&&(0,u.jsx)(y.rI,{entityRefs:St,defaultKind:"system"})}),Ne&&kt.length>0&&(0,u.jsx)(W,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,u.jsx)(y.rI,{entityRefs:kt,defaultKind:"component"})}),(Je||Ne||he||wt||ot||jt||typeof(ze==null||(Ie=ze.spec)===null||Ie===void 0?void 0:Ie.type)=="string")&&(0,u.jsx)(W,{label:"Type",value:ze==null||(lt=ze.spec)===null||lt===void 0?void 0:lt.type,gridSizes:{xs:12,sm:6,lg:4}}),(Je||Ne||typeof(ze==null||(Et=ze.spec)===null||Et===void 0?void 0:Et.lifecycle)=="string")&&(0,u.jsx)(W,{label:"Lifecycle",value:ze==null||(pt=ze.spec)===null||pt===void 0?void 0:pt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,u.jsx)(W,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((ze==null||(mt=ze.metadata)===null||mt===void 0?void 0:mt.tags)||[]).map(Wt=>(0,u.jsx)(R.Z,{size:"small",label:Wt},Wt))}),jt&&((ze==null||(At=ze.spec)===null||At===void 0?void 0:At.targets)||(ze==null||(Nt=ze.spec)===null||Nt===void 0?void 0:Nt.target))&&(0,u.jsx)(W,{label:"Targets",gridSizes:{xs:12},children:(0,u.jsx)(Ce.s,{cols:1,items:(ze.spec.targets||[ze.spec.target]).map(Wt=>Wt).map(Wt=>{var Vt;return{text:Wt,href:et(Wt,(ze==null||(Vt=ze.spec)===null||Vt===void 0?void 0:Vt.type)||"unknown",on)}})})})]})}const tt=(0,c.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function dt(Me){var ft,Ie,lt;const{variant:Et}=Me,pt=tt(),{entity:mt}=(0,y.X2)(),At=(0,P.h_)(m.q3),Nt=(0,P.h_)(y.Ah),ze=(0,P.h_)(P.$v),qt=(0,P.h_)(P.VE),ve=(0,P.tg)(_.jU),he=(0,y.CV)(mt,At),Ne=(ft=mt.metadata.annotations)===null||ft===void 0?void 0:ft[r.Tf],Je={label:"View Source",disabled:!he,icon:(0,u.jsx)(m.nW,{type:he==null?void 0:he.integrationType}),href:he==null?void 0:he.locationTargetUrl},wt={label:"View TechDocs",disabled:!(!((Ie=mt.metadata.annotations)===null||Ie===void 0)&&Ie["backstage.io/techdocs-ref"])||!ve,icon:(0,u.jsx)(V.Z,{}),href:ve&&ve({namespace:mt.metadata.namespace||r.zG,kind:mt.kind,name:mt.metadata.name})};let jt="";Et==="gridItem"?jt=pt.gridItemCard:Et==="fullHeight"&&(jt=pt.fullHeightCard);let ot="";Et==="gridItem"?ot=pt.gridItemCardContent:Et==="fullHeight"&&(ot=pt.fullHeightCardContent);const St=(lt=mt.metadata.annotations)===null||lt===void 0?void 0:lt[r.P1],kt=(St==null?void 0:St.startsWith("url:"))||(St==null?void 0:St.startsWith("file:")),zt=(0,q.useCallback)(async()=>{try{await Nt.refreshEntity((0,r.eE)(mt)),ze.post({message:"Refresh scheduled",severity:"info"})}catch(Bt){qt.post(Bt)}},[Nt,ze,qt,mt]);return(0,u.jsxs)($.Z,{className:jt,children:[(0,u.jsx)(we.Z,{title:"About",action:(0,u.jsxs)(u.Fragment,{children:[kt&&(0,u.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:zt,children:(0,u.jsx)(S.Z,{})}),(0,u.jsx)(ue.Z,{component:z.rU,"aria-label":"Edit",disabled:!Ne,title:"Edit Metadata",to:Ne!=null?Ne:"#",children:(0,u.jsx)(re.Z,{})})]}),subheader:(0,u.jsx)(z.M6,{links:[Je,wt]})}),(0,u.jsx)(G.Z,{}),(0,u.jsx)(Z.Z,{className:ot,children:(0,u.jsx)(K,{entity:mt})})]})}},86359:function(bt,$e,t){"use strict";t.d($e,{E:function(){return _}});var u=t(52322),r=t(25271),z=t(23196),P=t(40303),m=t(90436),y=t(15459),c=t(27604),$=t(2997),we=t(11640),ue=t(28347),G=t(76635),Z=t(2784),S=t(7089);const V=Object.freeze({createNameColumn(B){function R(k){var L;return((L=k.metadata)===null||L===void 0?void 0:L.title)||(0,P.$3)(k,{defaultKind:B==null?void 0:B.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:k},{entity:L}){return R(k).localeCompare(R(L))},render:({entity:k})=>{var L;return(0,u.jsx)(P.dx,{entityRef:k,defaultKind:(B==null?void 0:B.defaultKind)||"Component",title:(L=k.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:B})=>(0,u.jsx)(P.rI,{entityRefs:B.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:B})=>(0,u.jsx)(P.rI,{entityRefs:B.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:B})=>{var R,k;return(0,u.jsx)(u.Fragment,{children:((B==null||(R=B.spec)===null||R===void 0?void 0:R.targets)||(B==null||(k=B.spec)===null||k===void 0?void 0:k.target))&&(0,u.jsx)(z.Or,{text:(B.spec.targets||[B.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:B})=>(0,u.jsx)(z.Or,{text:B.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:B})=>(0,u.jsx)(u.Fragment,{children:B.metadata.tags&&B.metadata.tags.map(R=>(0,u.jsx)(S.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(B){return{title:"Title",field:"entity.metadata.title",hidden:B==null?void 0:B.hidden,searchable:!0}},createLabelColumn(B,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:k})=>{var L;const W=(L=k.metadata)===null||L===void 0?void 0:L.labels,Ce=W&&W[B]||(R==null?void 0:R.defaultValue);return(0,u.jsx)(u.Fragment,{children:Ce&&(0,u.jsx)(S.Z,{label:Ce,size:"small",variant:"outlined"},Ce)})},width:"auto"}}}),re=(0,y.Z)({root:{color:"#f3ba37"}})(we.Z),q=(B,R)=>{const k=L=>L.metadata.title||(0,P.$3)(L,{defaultKind:"Component"});return k(B).localeCompare(k(R))},_=B=>{var R,k;const{columns:L,actions:W,tableOptions:Ce,subtitle:Ve,emptyContent:et}=B,{isStarredEntity:K,toggleStarredEntity:tt}=(0,P.CR)(),{loading:dt,error:Me,entities:ft,filters:Ie}=(0,P.wp)(),lt=(0,Z.useMemo)(()=>{var ve;return[V.createTitleColumn({hidden:!0}),V.createNameColumn({defaultKind:(ve=Ie.kind)===null||ve===void 0?void 0:ve.value}),...he(),V.createMetadataDescriptionColumn(),V.createTagsColumn()];function he(){var Ne;switch((Ne=Ie.kind)===null||Ne===void 0?void 0:Ne.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=Ie.kind)===null||R===void 0?void 0:R.value]),Et=Ie.type===void 0;var pt;const mt=(0,G.capitalize)((pt=(k=Ie.user)===null||k===void 0?void 0:k.value)!==null&&pt!==void 0?pt:"all");if(Me)return(0,u.jsx)("div",{children:(0,u.jsx)(z.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,u.jsx)(z.Oi,{language:"text",text:Me.toString()})})});const At=[({entity:ve})=>{var he;const Ne=(he=ve.metadata.annotations)===null||he===void 0?void 0:he[r.l2],Je="View";return{icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:Je}),(0,u.jsx)($.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:ve})=>{var he;const Ne=(he=ve.metadata.annotations)===null||he===void 0?void 0:he[r.Tf],Je="Edit";return{icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:Je}),(0,u.jsx)(c.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:ve})=>{const he=K(ve),Ne=he?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{variant:"srOnly",children:Ne}),he?(0,u.jsx)(re,{}):(0,u.jsx)(ue.Z,{})]}),tooltip:Ne,onClick:()=>tt(ve)}}],Nt=ft.sort(q).map(ve=>{const he=(0,P.hF)(ve,r.cz,{kind:"system"}),Ne=(0,P.hF)(ve,r.S4);return{entity:ve,resolved:{name:(0,P.$3)(ve,{defaultKind:"Component"}),ownedByRelationsTitle:Ne.map(Je=>(0,P.$3)(Je,{defaultKind:"group"})).join(", "),ownedByRelations:Ne,partOfSystemRelationTitle:he.map(Je=>(0,P.$3)(Je,{defaultKind:"system"})).join(", "),partOfSystemRelations:he}}}),ze=(L||lt).find(ve=>ve.title==="Type");ze&&(ze.hidden=!Et);const qt=Nt.length>20;return(0,u.jsx)(z.iA,{isLoading:dt,columns:L||lt,options:{paging:qt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!dt,padding:"dense",pageSizeOptions:[20,50,100],...Ce},title:`${mt} (${ft.length})`,data:Nt,actions:W||At,subtitle:Ve,emptyContent:et})};_.columns=V},85877:function(bt,$e,t){"use strict";t.r($e),t.d($e,{EntityLabelsCard:function(){return Z},hasLabels:function(){return S}});var u=t(52322),r=t(40303),z=t(2784),P=t(23196),m=t(79692),y=t(90436),c=t(77277);const $=`metadata:
34
- name: example
35
- labels:
36
- javaVersion: 1.2.3`,we=(0,m.Z)(V=>({code:{borderRadius:6,margin:`${V.spacing(2)}px 0px`,background:V.palette.type==="dark"?"#444":V.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const V=we();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(y.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,u.jsx)("div",{className:V.code,children:(0,u.jsx)(P.Oi,{text:$,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,u.jsx)(c.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const G=(0,m.Z)(V=>({key:{fontWeight:"bold"}})),Z=V=>{var re;const{variant:q,title:_}=V,{entity:B}=(0,r.X2)(),R=G(),k=[{render:W=>(0,u.jsx)(y.Z,{className:R.key,variant:"body2",children:W.key})},{field:"value"}],L=B==null||(re=B.metadata)===null||re===void 0?void 0:re.labels;return(0,u.jsx)(P.rJ,{title:_||"Labels",variant:q,children:!L||Object.keys(L).length===0?(0,u.jsx)(ue,{}):(0,u.jsx)(P.iA,{columns:k,data:Object.keys(L).map(W=>({key:W,value:L[W]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function S(V){var re,q;return!(V==null||(re=V.metadata)===null||re===void 0)&&re.labels?Object.keys(V==null||(q=V.metadata)===null||q===void 0?void 0:q.labels).some(Boolean):!1}},24851:function(bt,$e,t){"use strict";t.d($e,{s:function(){return re}});var u=t(52322),r=t(90348),z=t(11861),P=t(2784),m=t(79692),y=t(95544),c=t(90436),$=t(52160),we=t(23196);const ue=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function G(q){const{href:_,text:B,Icon:R}=q,k=ue();return(0,u.jsxs)(y.Z,{display:"flex",children:[(0,u.jsx)(y.Z,{mr:1,className:k.svgIcon,children:(0,u.jsx)(c.Z,{component:"div",children:R?(0,u.jsx)(R,{}):(0,u.jsx)($.Z,{})})}),(0,u.jsx)(y.Z,{flexGrow:"1",children:(0,u.jsx)(we.rU,{to:_,target:"_blank",rel:"noopener",children:B||_})})]})}var Z=t(41156);const S={xs:1,sm:1,md:1,lg:2,xl:3};function V(q){const _=[(0,Z.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,Z.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,Z.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,Z.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,Z.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let B=1;if(typeof q=="number")B=q;else{var R;const L=(R=_.find(W=>W!==null))!==null&&R!==void 0?R:"xs";var k;B=(k=q==null?void 0:q[L])!==null&&k!==void 0?k:S[L]}return B}function re(q){const{items:_,cols:B=void 0}=q,R=V(B);return(0,u.jsx)(r.Z,{rowHeight:"auto",cols:R,children:_.map(({text:k,href:L,Icon:W},Ce)=>(0,u.jsx)(z.Z,{children:(0,u.jsx)(G,{href:L,text:k!=null?k:L,Icon:W})},Ce))})}},19625:function(bt,$e,t){"use strict";t.d($e,{_Z:function(){return P},jU:function(){return z},yw:function(){return r}});var u=t(60871);const r=(0,u.x8)({id:"create-component",optional:!0}),z=(0,u.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),P=(0,u.NT)({id:"catalog"})},15096:function(bt,$e,t){"use strict";t.d($e,{FA:function(){return we},qO:function(){return pt},Nd:function(){return K},E5:function(){return Tt},Rx:function(){return L}});var u=t(60871);const r=(0,u.T0)({id:"plugin.search.queryservice"});class z{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Q){_define_property(this,"mockedResults",void 0),this.mockedResults=Q}}var P=t(52322),m=t(2784),y=t(38402),c=t(79692);const $=(0,c.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),we=ne=>{const{text:Q,preTag:se,postTag:g}=ne,j=$(),J=(0,m.useMemo)(()=>Q.split(new RegExp(`(${se}.+?${g})`)),[g,se,Q]);return(0,P.jsx)(P.Fragment,{children:J.map((Y,ge)=>Y.includes(se)?(0,P.jsx)("mark",{className:j.highlight,children:Y.replace(new RegExp(`${se}|${g}`,"g"),"")},ge):Y)})};var ue=t(48760),G=t(50581),Z=t(61837),S=t(74603),V=t(21853),re=t(33375),q=t(76635),_=t(64279),B=t(1849),R=t(51837);const k=(0,R.CT)("search-context"),L=()=>{const ne=(0,m.useContext)(k);if(!ne)throw new Error("useSearch must be used within a SearchContextProvider");const Q=ne.atVersion(1);if(!Q)throw new Error("No SearchContext v1 found");return Q},W=()=>(0,m.useContext)(k)!==void 0,Ce={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Ve=(ne=Ce)=>{var Q,se,g,j;const J=(0,u.h_)(r),[Y,ge]=(0,m.useState)(ne.term),[me,Ue]=(0,m.useState)(ne.types),[it,rt]=(0,m.useState)(ne.filters),[yt,at]=(0,m.useState)(ne.pageLimit),[qe,Ze]=(0,m.useState)(ne.pageCursor),$t=(0,B.Z)(Y),Ht=(0,B.Z)(it),Rt=(0,_.default)(()=>J.query({term:Y,types:me,filters:it,pageLimit:yt,pageCursor:qe}),[Y,me,it,yt,qe]),It=!Rt.loading&&!Rt.error&&((Q=Rt.value)===null||Q===void 0?void 0:Q.nextPageCursor),en=!Rt.loading&&!Rt.error&&((se=Rt.value)===null||se===void 0?void 0:se.previousPageCursor),Dt=(0,m.useCallback)(()=>{var Ot;Ze((Ot=Rt.value)===null||Ot===void 0?void 0:Ot.nextPageCursor)},[(g=Rt.value)===null||g===void 0?void 0:g.nextPageCursor]),vt=(0,m.useCallback)(()=>{var Ot;Ze((Ot=Rt.value)===null||Ot===void 0?void 0:Ot.previousPageCursor)},[(j=Rt.value)===null||j===void 0?void 0:j.previousPageCursor]);return(0,m.useEffect)(()=>{$t!==void 0&&Y!==$t&&Ze(void 0)},[Y,$t,Ze]),(0,m.useEffect)(()=>{Ht!==void 0&&!(0,q.isEqual)(it,Ht)&&Ze(void 0)},[it,Ht,Ze]),{result:Rt,term:Y,setTerm:ge,types:me,setTypes:Ue,filters:it,setFilters:rt,pageLimit:yt,setPageLimit:at,pageCursor:qe,setPageCursor:Ze,fetchNextPage:It?Dt:void 0,fetchPreviousPage:en?vt:void 0}},et=ne=>{const{initialState:Q,children:se}=ne,g=Ve(Q);return(0,P.jsx)(u.fC,{attributes:{searchTypes:g.types.sort().join(",")},children:(0,P.jsx)(k.Provider,{value:(0,R.EI)({1:g}),children:se})})},K=ne=>{const{initialState:Q,inheritParentContextIfAvailable:se,children:g}=ne;return W()&&se?(0,P.jsx)(P.Fragment,{children:g}):(0,P.jsx)(et,{initialState:Q,children:g})},tt=({children:ne})=>{var Q;const se=it=>(0,B.Z)(it)!==it,g=(0,u.z$)(),{term:j,result:J}=L();var Y;const ge=(Y=(Q=J.value)===null||Q===void 0?void 0:Q.numberOfResults)!==null&&Y!==void 0?Y:void 0,Ue=se(J.loading)&&!J.loading;return(0,m.useEffect)(()=>{j&&Ue&&g.captureEvent("search",j,{value:ge})},[g,j,ge,Ue]),(0,P.jsx)(P.Fragment,{children:ne})};function dt(ne){return(0,m.forwardRef)((Q,se)=>(0,P.jsx)(K,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(ne,{...Q,ref:se})}))}const Me=dt((0,m.forwardRef)((ne,Q)=>{const{onChange:se,onKeyDown:g=()=>{},onClear:j=()=>{},onSubmit:J=()=>{},debounceTime:Y=200,clearButton:ge=!0,fullWidth:me=!0,value:Ue,placeholder:it,inputProps:rt={},endAdornment:yt,...at}=ne,qe=(0,u.h_)(u.Ds),[Ze,$t]=(0,m.useState)("");(0,m.useEffect)(()=>{$t(_e=>_e!==Ue?String(Ue):_e)},[Ue]),(0,ue.Z)(()=>se(Ze),Y,[Ze]);const Ht=(0,m.useCallback)(_e=>{$t(_e.target.value)},[$t]),Rt=(0,m.useCallback)(_e=>{g&&g(_e),J&&_e.key==="Enter"&&J()},[g,J]),It=(0,m.useCallback)(()=>{se(""),j&&j()},[se,j]),en=it!=null?it:`Search in ${qe.getOptionalString("app.title")||"Backstage"}`,Dt=(0,P.jsx)(G.Z,{position:"start",children:(0,P.jsx)(Z.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,P.jsx)(V.Z,{})})}),vt=(0,P.jsx)(G.Z,{position:"end",children:(0,P.jsx)(Z.Z,{"aria-label":"Clear",size:"small",onClick:It,children:(0,P.jsx)(re.Z,{})})});return(0,P.jsx)(tt,{children:(0,P.jsx)(S.Z,{"data-testid":"search-bar-next",ref:Q,value:Ze,placeholder:en,startAdornment:Dt,endAdornment:ge?vt:yt,inputProps:{"aria-label":"Search",...rt},fullWidth:me,onChange:Ht,onKeyDown:Rt,...at})})})),ft=dt((0,m.forwardRef)((ne,Q)=>{const{value:se="",onChange:g,...j}=ne,{term:J,setTerm:Y}=L();(0,m.useEffect)(()=>{se&&Y(String(se))},[se,Y]);const ge=(0,m.useCallback)(me=>{g?g(me):Y(me)},[g,Y]);return(0,P.jsx)(u.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,P.jsx)(Me,{...j,ref:Q,value:J,onChange:ge})})}));var Ie=t(4614),lt=t(88013);const pt=(ne=>Q=>(0,P.jsx)(K,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(ne,{...Q})}))(function(Q){const{loading:se,value:g,onChange:j=()=>{},options:J=[],getOptionLabel:Y=It=>String(It),inputPlaceholder:ge,inputDebounceTime:me,freeSolo:Ue=!0,fullWidth:it=!0,clearOnBlur:rt=!1,"data-testid":yt="search-autocomplete",...at}=Q,{setTerm:qe}=L(),Ze=(0,m.useCallback)(It=>It?typeof It=="string"?It:Y(It):"",[Y]),$t=(0,m.useMemo)(()=>Ze(g),[g,Ze]),Ht=(0,m.useCallback)((It,en,Dt,vt)=>{qe(Ze(en)),j(It,en,Dt,vt)},[Ze,qe,j]),Rt=(0,m.useCallback)(({InputProps:{ref:It,endAdornment:en},InputLabelProps:Dt,...vt})=>(0,P.jsx)(ft,{...vt,ref:It,clearButton:!1,value:$t,placeholder:ge,debounceTime:me,endAdornment:se?(0,P.jsx)(Ie.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):en}),[se,$t,ge,me]);return(0,P.jsx)(lt.ZP,{...at,"data-testid":yt,value:g,onChange:Ht,options:J,getOptionLabel:Y,renderInput:Rt,freeSolo:Ue,fullWidth:it,clearOnBlur:rt})}),mt=ne=>{const{icon:Q,primaryText:se,primaryTextTypographyProps:g,secondaryText:j,secondaryTextTypographyProps:J,disableTextTypography:Y}=ne;return _jsxs(_Fragment,{children:[Q?_jsx(ListItemIcon,{children:Q}):null,_jsx(ListItemText,{primary:se,primaryTypographyProps:g,secondary:j,secondaryTypographyProps:J,disableTypography:Y})]})};var At=t(42494),Nt=t(84899),ze=t(5806),qt=t(21324),ve=t(56939),he=t(73698),Ne=t(12231),Je=t(86619),wt=t(7089),jt=t(69294);const ot=(ne,Q,se=[],g=250)=>{const j=(0,m.useRef)({}),J=ne||(()=>Promise.resolve([])),[Y,ge]=(0,jt.default)(J,[Q],{loading:!0});if((0,ue.Z)(()=>{j.current[Q]===void 0&&(j.current[Q]=ge(Q).then(Ue=>(j.current[Q]=Ue,Ue)))},g,[ge,Q]),se.length)return{loading:!1,value:se};const me=j.current[Q];return Array.isArray(me)?{loading:!1,value:me}:Y},St=(ne,Q)=>{const{setFilters:se}=L();(0,m.useEffect)(()=>{Q&&[Q].flat().length>0&&se(g=>({...g,[ne]:Q}))},[])},kt=ne=>{const{className:Q,defaultValue:se,name:g,values:j,valuesDebounceMs:J,label:Y,filterSelectedOptions:ge,limitTags:me,multiple:Ue}=ne,[it,rt]=(0,m.useState)("");St(g,se);const yt=typeof j=="function"?j:void 0,at=typeof j=="function"?void 0:j,{value:qe,loading:Ze}=ot(yt,it,at,J),{filters:$t,setFilters:Ht}=L(),Rt=$t[g]||(Ue?[]:null),It=(vt,_e)=>{Ht(Ot=>{const{[g]:tn,...En}=Ot;return _e?{...En,[g]:_e}:{...En}})},en=vt=>(0,P.jsx)(Je.Z,{...vt,name:"search",variant:"outlined",label:Y,fullWidth:!0}),Dt=(vt,_e)=>vt.map((Ot,tn)=>(0,P.jsx)(wt.Z,{label:Ot,color:"primary",..._e({index:tn})}));return(0,P.jsx)(lt.ZP,{filterSelectedOptions:ge,limitTags:me,multiple:Ue,className:Q,id:`${Ue?"multi-":""}select-filter-${g}--select`,options:qe||[],loading:Ze,value:Rt,onChange:It,onInputChange:(vt,_e)=>rt(_e),renderInput:en,renderTags:Dt})},zt=(0,c.Z)({label:{textTransform:"capitalize"}}),Bt=ne=>{const{className:Q,defaultValue:se,label:g,name:j,values:J=[],valuesDebounceMs:Y}=ne,ge=zt(),{filters:me,setFilters:Ue}=L();St(j,se);const it=typeof J=="function"?J:void 0,rt=typeof J=="function"?void 0:J,{value:yt=[],loading:at}=ot(it,"",rt,Y),qe=$t=>{const{target:{value:Ht,checked:Rt}}=$t;Ue(It=>{const{[j]:en,...Dt}=It,vt=(en||[]).filter(Ot=>Ot!==Ht),_e=Rt?[...vt,Ht]:vt;return _e.length?{...Dt,[j]:_e}:Dt})};var Ze;return(0,P.jsxs)(At.Z,{className:Q,disabled:at,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[g?(0,P.jsx)(Nt.Z,{className:ge.label,children:g}):null,yt.map($t=>(0,P.jsx)(ze.Z,{control:(0,P.jsx)(qt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":$t},value:$t,name:$t,onChange:qe,checked:((Ze=me[j])!==null&&Ze!==void 0?Ze:[]).includes($t)}),label:$t},$t))]})},on=ne=>{const{className:Q,defaultValue:se,label:g,name:j,values:J,valuesDebounceMs:Y}=ne,ge=zt();St(j,se);const me=typeof J=="function"?J:void 0,Ue=typeof J=="function"?void 0:J,{value:it=[],loading:rt}=ot(me,"",Ue,Y),{filters:yt,setFilters:at}=L(),qe=Ze=>{const{target:{value:$t}}=Ze;at(Ht=>{const{[j]:Rt,...It}=Ht;return $t?{...It,[j]:$t}:It})};return(0,P.jsxs)(At.Z,{disabled:rt,className:Q,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[g?(0,P.jsx)(ve.Z,{className:ge.label,margin:"dense",children:g}):null,(0,P.jsxs)(he.Z,{variant:"outlined",value:yt[j]||"",onChange:qe,children:[(0,P.jsx)(Ne.Z,{value:"",children:(0,P.jsx)("em",{children:"All"})}),it.map(Ze=>(0,P.jsx)(Ne.Z,{value:Ze,children:Ze},Ze))]})]})},Wt=ne=>{const{component:Q,...se}=ne;return(0,P.jsx)(Q,{...se})};Wt.Checkbox=ne=>(0,P.jsx)(Wt,{...ne,component:Bt}),Wt.Select=ne=>(0,P.jsx)(Wt,{...ne,component:on}),Wt.Autocomplete=ne=>(0,P.jsx)(Wt,{...ne,component:kt});var Vt=t(48834).lW;const Nn=ne=>Vt.from(ne.toString(),"utf-8").toString("base64"),In=ne=>ne?Number(Vt.from(ne,"base64").toString("utf-8")):0,ln=ne=>{const{total:Q=-1,cursor:se,hasNextPage:g,onCursorChange:j,limit:J=25,limitLabel:Y="Results per page:",limitText:ge=({from:qe,to:Ze})=>Q>0?`of ${Q}`:`${qe}-${Ze}`,limitOptions:me,onLimitChange:Ue,...it}=ne,rt=useMemo(()=>In(se),[se]),yt=useCallback((qe,Ze)=>{j==null||j(Nn(Ze))},[j]),at=useCallback(qe=>{const Ze=qe.target.value;Ue==null||Ue(parseInt(Ze,10))},[Ue]);return _jsx(TablePagination,{...it,component:"div",count:Q,page:rt,nextIconButtonProps:{...g!==void 0&&{disabled:!g}},onPageChange:yt,rowsPerPage:J,labelRowsPerPage:Y,labelDisplayedRows:ge,rowsPerPageOptions:me,onRowsPerPageChange:at})},wn=ne=>{const{pageLimit:Q,setPageLimit:se,pageCursor:g,setPageCursor:j,fetchNextPage:J}=useSearch();return _jsx(ln,{...ne,hasNextPage:!!J,limit:Q,onLimitChange:se,cursor:g,onCursorChange:j})};var Fn=t(23196);const Un=ne=>{const{children:Q}=ne,se=useSearch(),{result:g,...j}=se;return Q(g,j)},Mn=ne=>{const{query:Q,children:se}=ne,g=useApi(searchApiRef),j=useAsync(()=>{const{term:J="",types:Y=[],filters:ge={},...me}=Q;return g.query({...me,term:J,types:Y,filters:ge})},[Q]);return se(j,Q)},Jn=ne=>{const{query:Q,children:se}=ne;return Q?_jsx(Mn,{query:Q,children:se}):_jsx(Un,{children:se})},nt=ne=>{const{query:Q,children:se,noResultsComponent:g=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...j}=ne;return _jsx(Jn,{query:Q,children:({loading:J,error:Y,value:ge})=>J?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):ge!=null&&ge.results.length?isFunction(se)?se(ge):_jsx(SearchResultListItemExtensions,{...j,results:ge.results,children:se}):g})},zn=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(nt,{...ne})}),Pn=({result:ne,highlight:Q,icon:se,secondaryAction:g,lineClamp:j=5})=>ne?_jsxs(_Fragment,{children:[se&&_jsx(ListItemIcon,{children:se}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ne.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)||""}):ne.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:j,overflow:"hidden"},color:"textSecondary",variant:"body2",children:Q!=null&&Q.fields.text?_jsx(HighlightedSearchResultText,{text:Q.fields.text,preTag:Q.preTag,postTag:Q.postTag}):ne.text})}),g&&_jsx(Box,{alignItems:"flex-end",children:g})]}):null,Wn=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Pn,{...ne})}),Sn=ne=>{const{error:Q,loading:se,resultItems:g,renderResultItem:j=me=>_jsx(DefaultResultListItem,{result:me.document},me.document.location),disableRenderingWithNoResults:J,noResultsComponent:Y=J?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ge}=ne;return se?_jsx(Progress,{}):Q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Q}):g!=null&&g.length?_jsx(List,{...ge,children:g.map(j)}):_jsx(_Fragment,{children:Y})},sn=ne=>{const{query:Q,renderResultItem:se,children:g,...j}=ne,J=useSearchResultListItemExtensions(g);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Q,children:({loading:Y,error:ge,value:me})=>_jsx(Sn,{...j,error:ge,loading:Y,resultItems:me==null?void 0:me.results,renderResultItem:se!=null?se:J})})})};var Ln=t(19126);const gn=(0,c.Z)(ne=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ne.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ne.spacing(.5)}})),jn=ne=>{const Q=gn(),{label:se,children:g,...j}=ne;return _jsx(Chip,{...j,className:Q.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[se,": ",g]})})},Vn=()=>null,fe=(0,c.Z)(ne=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ne.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),oe=ne=>{const Q=fe(),{label:se,value:g="None",onChange:j,onDelete:J}=ne,Y=useCallback(ge=>{j(ge.target.value)},[j]);return _jsx(jn,{label:se,onDelete:J,children:_jsx(Typography,{role:"textbox",component:"span",className:Q.root,onChange:Y,contentEditable:!0,suppressContentEditableWarning:!0,children:g})})},ke=(0,c.Z)(ne=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Fe=ne=>{const Q=ke(),{label:se,value:g="none",onChange:j,onDelete:J,children:Y}=ne,ge=useCallback(me=>{j(me.target.value)},[j]);return _jsx(jn,{label:se,onDelete:J,children:_jsxs(Select,{className:Q.root,value:g,onChange:ge,input:_jsx(InputBase,{}),IconComponent:Vn,children:[_jsx(MenuItem,{value:"none",children:"None"}),Y]})})};function Ke(ne){const Q=gn(),[se,g]=useState(null),{error:j,loading:J,icon:Y,title:ge,titleProps:me={},link:Ue=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Q.listSubheaderLinkIcon})]}),linkProps:it={},filterOptions:rt,renderFilterOption:yt=_e=>_jsx(MenuItem,{value:String(_e),children:_e},String(_e)),filterFields:at,renderFilterField:qe,resultItems:Ze,renderResultItem:$t=_e=>_jsx(DefaultResultListItem,{result:_e.document},_e.document.location),disableRenderingWithNoResults:Ht,noResultsComponent:Rt=Ht?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...It}=ne,en=useCallback(_e=>{g(_e.currentTarget)},[]),Dt=useCallback(()=>{g(null)},[]);if(J)return _jsx(Progress,{});if(j)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:j});if(!(Ze!=null&&Ze.length))return _jsx(_Fragment,{children:Rt});var vt;return _jsxs(List,{...It,children:[_jsxs(ListSubheader,{className:Q.listSubheader,children:[Y,_jsx(Typography,{className:Q.listSubheaderName,component:"strong",...me,children:ge}),rt?_jsx(Chip,{className:Q.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:en}):null,rt?_jsx(Menu,{id:"filters-menu",anchorEl:se,open:Boolean(se),onClose:Dt,onClick:Dt,keepMounted:!0,children:rt.map(yt)}):null,at==null?void 0:at.map(_e=>(vt=qe==null?void 0:qe(_e))!==null&&vt!==void 0?vt:null),_jsx(Link,{className:Q.listSubheaderLink,to:"/search",...it,children:Ue})]}),Ze.map($t)]})}function te(ne){const{query:Q,children:se,renderResultItem:g,linkProps:j={},...J}=ne,Y=useSearchResultListItemExtensions(se);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Q,children:({loading:ge,error:me,value:Ue},{term:it,types:rt,pageCursor:yt,filters:at={}})=>{const qe=`/search?${qs.stringify({term:it,types:rt,filters:at,pageCursor:yt,query:it},{arrayFormat:"brackets"})}`;return _jsx(Ke,{...J,error:me,loading:ge,linkProps:{to:qe,...j},filterFields:Object.keys(at),resultItems:Ue==null?void 0:Ue.results,renderResultItem:g!=null?g:Y})}})})}const D=(0,c.Z)(ne=>({root:{display:"flex",justifyContent:"space-between",gap:ne.spacing(2),margin:ne.spacing(2,0)}})),pe=()=>{const{fetchNextPage:ne,fetchPreviousPage:Q}=useSearch(),se=D();return!ne&&!Q?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:se.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Q,onClick:Q,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ne,onClick:ne,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Ae="search.results.list.items.extensions.v1",Qe=(ne,Q)=>{for(const se of ne){if(!isValidElement(se))continue;const g=getComponentData(se,Ae);if(g!=null&&g(Q))return cloneElement(se,{rank:Q.rank,highlight:Q.highlight,result:Q.document,...se.props})}return null},Xe=ne=>{const{rank:Q,result:se,noTrack:g,children:j,alignItems:J="flex-start",...Y}=ne,ge=(0,u.z$)(),me=(0,m.useCallback)(()=>{g||se&&ge.captureEvent("discover",se.title,{attributes:{to:se.location},value:Q})},[Q,se,g,ge]);return(0,P.jsx)(y.Z,{divider:!0,alignItems:J,onClickCapture:me,...Y,children:j})},Tt=ne=>{const{name:Q,component:se,predicate:g=()=>!0}=ne;return(0,u.YO)({name:Q,component:{lazy:()=>se().then(j=>J=>(0,P.jsx)(Xe,{rank:J.rank,result:J.result,noTrack:J.noTrack,children:(0,m.createElement)(j,J)}))},data:{[Ae]:g}})},Gt=ne=>{const Q=useElementFilter(ne,se=>se.selectByComponentData({key:Ae}).getElements(),[ne]);return useCallback((se,g)=>{const j=Qe(Q,se);return _jsx(Fragment,{children:j!=null?j:_jsx(Xe,{rank:se.rank,result:se.document,children:_jsx(DefaultResultListItem,{rank:se.rank,highlight:se.highlight,result:se.document})})},g)},[Q])},an=ne=>{const{results:Q,children:se,...g}=ne,j=Gt(se);return _jsx(List,{...g,children:Q.map(j)})}},61886:function(bt,$e,t){"use strict";t.d($e,{Ox:function(){return Ie},jM:function(){return m},Zz:function(){return y},oZ:function(){return K},DR:function(){return c},ZS:function(){return Ve},VA:function(){return pt},KY:function(){return we},gT:function(){return V},Dl:function(){return re},ux:function(){return Et},$L:function(){return S},x1:function(){return et}});var u=t(52322),r=t(2784),z=t(79635),P=t(60871);const m="techdocs.addons.addon.v1",y="techdocs.addons.wrapper.v1",c=()=>null;(0,P.R5)(c,y,!0);const $=ve=>`${m}.${ve.toLocaleLowerCase("en-US")}`;function we(ve){const{name:he,component:Ne}=ve;return(0,P.YO)({name:he,component:{sync:Je=>(0,u.jsx)(Ne,{...Je})},data:{[m]:ve,[$(he)]:!0}})}const ue=(ve,he)=>ve.selectByComponentData({key:he}).getElements()[0],G=ve=>ve.selectByComponentData({key:y}).selectByComponentData({key:m}),Z=ve=>ve.selectByComponentData({key:y}).findComponentData({key:m}),S=()=>{const ve=(0,z.pC)(),he=(0,P.vJ)(ve,G),Ne=(0,P.vJ)(ve,Z),Je=(0,r.useCallback)(ot=>{if(!he||!ot)return null;const St=$(ot.name);var kt;return(kt=ue(he,St))!==null&&kt!==void 0?kt:null},[he]),wt=(0,r.useCallback)(ot=>{const St=Ne.find(kt=>kt.name===ot);return St?Je(St):null},[Ne,Je]),jt=(0,r.useCallback)(ot=>{const St=Ne.filter(kt=>kt.location===ot);return St.length?St.map(Je):null},[Ne,Je]);return{renderComponentByName:wt,renderComponentsByLocation:jt}},V=(0,P.T0)({id:"plugin.techdocs.service"}),re=(0,P.T0)({id:"plugin.techdocs.storageservice"});var q=t(64279),_=t(77446),B=t(25271),R=t(51837);function k(ve,he){return he.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ve.kind=ve.kind.toLocaleLowerCase(),ve.name=ve.name.toLocaleLowerCase(),ve.namespace=ve.namespace.toLocaleLowerCase()),ve}const L=(ve,he)=>(0,B.eE)(ve)===(0,B.eE)(he),W={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},Ce=(0,R.CT)("techdocs-reader-page-context"),Ve=(0,r.memo)(ve=>{const{entityRef:he,children:Ne}=ve,Je=(0,P.h_)(V),wt=(0,P.h_)(P.Ds),jt=(0,q.default)(async()=>Je.getEntityMetadata(he),[he]),ot=(0,_.Z)(async()=>Je.getTechDocsMetadata(he),[he]),[St,kt]=(0,r.useState)(W.title),[zt,Bt]=(0,r.useState)(W.subtitle),[on,Wt]=(0,r.useState)(W.shadowRoot);(0,r.useEffect)(()=>{on&&!ot.value&&!ot.loading&&ot.retry()},[ot.value,ot.loading,on,ot.retry,ot]);const Vt={metadata:ot,entityRef:k(he,wt),entityMetadata:jt,shadowRoot:on,setShadowRoot:Wt,title:St,setTitle:kt,subtitle:zt,setSubtitle:Bt},Nn=(0,R.EI)({1:Vt});return(0,u.jsx)(P.fC,{attributes:{entityRef:(0,B.eE)(he)},children:(0,u.jsx)(Ce.Provider,{value:Nn,children:Ne instanceof Function?Ne(Vt):Ne})})},(ve,he)=>L(ve.entityRef,he.entityRef)),et=()=>{const ve=(0,r.useContext)(Ce);if(ve===void 0)return W;const he=ve.atVersion(1);if(he===void 0)throw new Error("No context found for version 1.");return he},K=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var tt=t(70882),dt=t(50236),Me=t(19219),ft=t(23196);const Ie="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",lt=ve=>{(0,r.useEffect)(()=>{if(!ve)return()=>{};const he=ve.querySelectorAll('head > link[rel="stylesheet"]');var Ne;let Je=(Ne=he==null?void 0:he.length)!==null&&Ne!==void 0?Ne:0;const wt=new CustomEvent(Ie);if(!Je)return ve.dispatchEvent(wt),()=>{};const jt=()=>{--Je===0&&ve.dispatchEvent(wt)};return he==null||he.forEach(ot=>{ot.addEventListener("load",jt)}),()=>{he==null||he.forEach(ot=>{ot.removeEventListener("load",jt)})}},[ve])},Et=ve=>{const[he,Ne]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ve)return()=>{};Ne(!0);const Je=ve.style;Je.setProperty("opacity","0");const wt=()=>{Ne(!1),Je.setProperty("opacity","1")};return ve.addEventListener(Ie,wt),()=>{ve.removeEventListener(Ie,wt)}},[ve]),he},pt=ve=>{const{element:he,onAppend:Ne,children:Je}=ve,[wt,jt]=(0,r.useState)((0,tt.Ue)({...(0,dt.Z)(),insertionPoint:void 0}));lt(he);const ot=Et(he),St=(0,r.useCallback)(kt=>{if(!he||!kt)return;jt((0,tt.Ue)({...(0,dt.Z)(),insertionPoint:he.querySelector("head")||void 0}));let zt=kt.shadowRoot;zt||(zt=kt.attachShadow({mode:"open"})),zt.replaceChildren(he),typeof Ne=="function"&&Ne(zt)},[he,Ne]);return(0,u.jsxs)(u.Fragment,{children:[ot&&(0,u.jsx)(ft.Ex,{}),(0,u.jsxs)(Me.ZP,{jss:wt,sheetsManager:new Map,children:[(0,u.jsx)("div",{ref:St,"data-testid":"techdocs-native-shadowroot"}),Je]})]})};var mt=t(54073);const At=()=>{const{shadowRoot:ve}=useTechDocsReaderPage();return ve},Nt=ve=>{const he=At();return he?ve.map(Ne=>he==null?void 0:he.querySelectorAll(Ne)).filter(Ne=>Ne.length).map(Ne=>Array.from(Ne)).flat():[]},ze=ve=>ve.toString()&&ve.rangeCount&&ve.getRangeAt(0).getBoundingClientRect().top,qt=(ve=0)=>{const he=At(),[Ne,Je]=useState(null),wt=useMemo(()=>debounce(()=>{const jt=he,ot=jt.getSelection?jt.getSelection():document.getSelection();ot&&ze(ot)?Je(ot):Je(null)},ve),[he,Je,ve]);return useEffect(()=>(window.document.addEventListener("selectionchange",wt),()=>{wt.cancel(),window.document.removeEventListener("selectionchange",wt)}),[wt]),Ne}},52943:function(bt,$e,t){"use strict";t.r($e),t.d($e,{EmbeddedDocsRouter:function(){return q},Router:function(){return re},isTechDocsAvailable:function(){return V}});var u=t(52322),r=t(2784),z=t(79635),P=t(40303),m=t(23196),y=t(25271),c=t(89258),$=t(65124),we=t(67896);const ue=({entity:_})=>{const B=(0,y.iB)(_);return(0,u.jsxs)(c.I6,{entityRef:B,children:[(0,u.jsx)($.b,{}),(0,u.jsx)(we.F,{withSearch:!1})]})};var G=t(18662),Z=t(7476);const S="backstage.io/techdocs-ref",V=_=>{var B,R;return Boolean(_==null||(B=_.metadata)===null||B===void 0||(R=B.annotations)===null||R===void 0?void 0:R[S])},re=()=>(0,u.jsxs)(z.Z5,{children:[(0,u.jsx)(z.AW,{path:"/",element:(0,u.jsx)(G.TechDocsIndexPage,{})}),(0,u.jsx)(z.AW,{path:"/:namespace/:kind/:name/*",element:(0,u.jsx)(Z.TechDocsReaderPage,{})})]}),q=_=>{var B;const{children:R}=_,{entity:k}=(0,P.X2)(),L=(0,z.V$)([{path:"/*",element:(0,u.jsx)(ue,{entity:k}),children:[{path:"*",element:R}]}]);return((B=k.metadata.annotations)===null||B===void 0?void 0:B[S])?L:(0,u.jsx)(m.sk,{annotation:S})}},92077:function(bt,$e,t){"use strict";t.d($e,{k:function(){return y},p:function(){return m}});var u=t(47842),r=t(23054),z=t(76372),P=t.n(z);class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata($){const{kind:we,namespace:ue,name:G}=$,S=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${we}/${G}`,V=await this.fetchApi.fetch(`${S}`);if(!V.ok)throw await r.VL.fromResponse(V);return await V.json()}async getEntityMetadata($){const{kind:we,namespace:ue,name:G}=$,S=`${await this.getApiOrigin()}/metadata/entity/${ue}/${we}/${G}`,V=await this.fetchApi.fetch(`${S}`);if(!V.ok)throw await r.VL.fromResponse(V);return await V.json()}constructor($){(0,u.Z)(this,"configApi",void 0),(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.configApi=$.configApi,this.discoveryApi=$.discoveryApi,this.fetchApi=$.fetchApi}}class y{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var $;return($=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&$!==void 0?$:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs($,we){const{kind:ue,namespace:G,name:Z}=$,V=`${await this.getStorageUrl()}/${G}/${ue}/${Z}/${we}`,re=await this.fetchApi.fetch(`${V.endsWith("/")?V:`${V}/`}index.html`);let q="";switch(re.status){case 404:throw q="Page not found. ",we||(q+="This could be because there is no index.md file in the root of the docs directory of this repository."),new r.dR(q);case 500:throw q="Could not generate documentation or an error in the TechDocs backend. ",new Error(q);default:break}return re.text()}async syncEntityDocs($,we=()=>{}){const{kind:ue,namespace:G,name:Z}=$,V=`${await this.getApiOrigin()}/sync/${G}/${ue}/${Z}`,{token:re}=await this.identityApi.getCredentials();return new Promise((q,_)=>{const B=new z.EventSourcePolyfill(V,{withCredentials:!0,headers:re?{Authorization:`Bearer ${re}`}:{}});B.addEventListener("log",R=>{R.data&&we(JSON.parse(R.data))}),B.addEventListener("finish",R=>{let k=!1;R.data&&({updated:k}=JSON.parse(R.data)),q(k?"updated":"cached")}),B.onerror=R=>{switch(B.close(),R.status){case 404:_(new r.dR(R.message));return;default:_(new Error(R.data));return}}})}async getBaseUrl($,we,ue){const{kind:G,namespace:Z,name:S}=we,re=`${await this.getApiOrigin()}/static/docs/${Z}/${G}/${S}/${ue}`;return new URL($,re.endsWith("/")?re:`${re}/`).toString()}constructor($){(0,u.Z)(this,"configApi",void 0),(0,u.Z)(this,"discoveryApi",void 0),(0,u.Z)(this,"identityApi",void 0),(0,u.Z)(this,"fetchApi",void 0),this.configApi=$.configApi,this.discoveryApi=$.discoveryApi,this.identityApi=$.identityApi,this.fetchApi=$.fetchApi}}},51953:function(bt,$e,t){"use strict";t.d($e,{D:function(){return u}});function u(r,z){return z.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(bt,$e,t){"use strict";t.d($e,{u:function(){return $}});var u=t(52322),r=t(2784),z=t(23196),P=t(40303),m=t(42081),y=t(48431),c=t(68435);const $=we=>{const{initialFilter:ue="owned",columns:G,actions:Z}=we;return(0,u.jsx)(m.j,{children:(0,u.jsxs)(z.VY,{children:[(0,u.jsx)(z.yW,{title:"",children:(0,u.jsx)(z.qt,{children:"Discover documentation in your ecosystem."})}),(0,u.jsx)(P.UO,{children:(0,u.jsxs)(P._i,{children:[(0,u.jsxs)(P._i.Filters,{children:[(0,u.jsx)(y.f,{}),(0,u.jsx)(P.EW,{initialFilter:ue}),(0,u.jsx)(P.dq,{}),(0,u.jsx)(P.xE,{})]}),(0,u.jsx)(P._i.Content,{children:(0,u.jsx)(c.n,{actions:Z,columns:G})})]})})]})})}},85478:function(bt,$e,t){"use strict";t.d($e,{f:function(){return G}});var u=t(52322),r=t(95573),z=t(51953),P=t(60871),m=t(23196),y=t(94339),c=t(16111),$=t(24579),we=t(14503),ue=t(2784);const G=q=>{const{entities:_}=q,B=(0,P.tg)(r.Fw),R=(0,P.h_)(P.Ds);if(!_)return null;var k,L;return(0,u.jsx)(m.Oh,{"data-testid":"docs-explore",children:_!=null&&_.length?_.map((W,Ce)=>(0,u.jsxs)(y.Z,{children:[(0,u.jsx)(c.Z,{children:(0,u.jsx)(m.hu,{title:(k=W.metadata.title)!==null&&k!==void 0?k:W.metadata.name})}),(0,u.jsx)($.Z,{children:W.metadata.description}),(0,u.jsx)(we.Z,{children:(0,u.jsx)(m.Qj,{to:B({namespace:(0,z.D)((L=W.metadata.namespace)!==null&&L!==void 0?L:"default",R),kind:(0,z.D)(W.kind,R),name:(0,z.D)(W.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Ce)):null})};var Z=t(40303);const S={title:"All Documentation",filterPredicate:()=>!0},V=q=>{const{entities:_,group:B}=q,{loading:R,isOwnedEntity:k}=useEntityOwnership(),L=_.filter(Ce=>B.filterPredicate==="ownedByUser"?R?!1:k(Ce):typeof B.filterPredicate=="function"&&B.filterPredicate(Ce)),W=(()=>typeof B.title=="string"?_jsx(ContentHeader,{title:B.title}):B.title)();return L.length===0?null:_jsxs(Content,{children:[W,_jsx(DocsCardGrid,{entities:L})]})},re=q=>{const{loading:_,error:B,entities:R}=useEntityList();if(B)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:B.toString()})});if(_)return _jsx(Progress,{});if(R.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 k,L;return R.sort((W,Ce)=>((k=W.metadata.title)!==null&&k!==void 0?k:W.metadata.name).localeCompare((L=Ce.metadata.title)!==null&&L!==void 0?L:Ce.metadata.name)),_jsx(Content,{children:(q.groups||[S]).map((W,Ce)=>_jsx(V,{entities:R,group:W},`${W.title}-${Ce}`))})}},68435:function(bt,$e,t){"use strict";t.d($e,{H:function(){return R},n:function(){return k}});var u=t(52322),r=t(2784),z=t(95074),P=t(76635),m=t(23196),y=t(40303),c=t(60871),$=t(25271),we=t(95573),ue=t(39981),G=t(2337),Z=t(11640),S=t(28347);const V=(0,G.Z)({root:{color:"#f3ba37"}})(Z.Z),re={createCopyDocsUrlAction(L){return W=>({icon:()=>(0,u.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${W.resolved.docsUrl}`)})},createStarEntityAction(L,W){return Ce=>{const Ve=Ce.entity,et=L(Ve);return{cellStyle:{paddingLeft:"1em"},icon:()=>et?(0,u.jsx)(V,{}):(0,u.jsx)(S.Z,{}),tooltip:et?"Remove from favorites":"Add to favorites",onClick:()=>W(Ve)}}}};function q(L){return L.metadata.title||L.metadata.name}const _={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,u.jsx)(m.uw,{value:(0,u.jsx)(m.rU,{to:L.resolved.docsUrl,children:q(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,u.jsx)(y.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var B=t(51953);const R=L=>{const{entities:W,title:Ce,loading:Ve,columns:et,actions:K,options:tt}=L,[,dt]=(0,z.Z)(),Me=(0,c.tg)(we.Fw),ft=(0,c.h_)(c.Ds);if(!W)return null;const Ie=W.map(pt=>{const mt=(0,y.hF)(pt,$.S4);var At;return{entity:pt,resolved:{docsUrl:Me({namespace:(0,B.D)((At=pt.metadata.namespace)!==null&&At!==void 0?At:"default",ft),kind:(0,B.D)(pt.kind,ft),name:(0,B.D)(pt.metadata.name,ft)}),ownedByRelations:mt,ownedByRelationsTitle:mt.map(Nt=>(0,y.$3)(Nt,{defaultKind:"group"})).join(", ")}}}),lt=[_.createNameColumn(),_.createOwnerColumn(),_.createTypeColumn()],Et=[re.createCopyDocsUrlAction(dt)];return(0,u.jsx)(u.Fragment,{children:Ve||Ie&&Ie.length>0?(0,u.jsx)(m.iA,{isLoading:Ve,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...tt},data:Ie,columns:et||lt,actions:K||Et,title:Ce?`${Ce} (${Ie.length})`:`All (${Ie.length})`}):(0,u.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,u.jsx)(m.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};R.columns=_,R.actions=re;const k=L=>{var W;const{columns:Ce,actions:Ve,options:et}=L,{loading:K,error:tt,entities:dt,filters:Me}=(0,y.wp)(),{isStarredEntity:ft,toggleStarredEntity:Ie}=(0,y.CR)(),[,lt]=(0,z.Z)();var Et;const pt=(0,P.capitalize)((Et=(W=Me.user)===null||W===void 0?void 0:W.value)!==null&&Et!==void 0?Et:"all"),mt=[re.createCopyDocsUrlAction(lt),re.createStarEntityAction(ft,Ie)];return tt?(0,u.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,u.jsx)(m.Oi,{language:"text",text:tt.toString()})}):(0,u.jsx)(R,{title:pt,entities:dt,loading:K,actions:Ve||mt,columns:Ce,options:et})};k.columns=_,k.actions=re},18662:function(bt,$e,t){"use strict";t.r($e),t.d($e,{TechDocsIndexPage:function(){return m}});var u=t(52322),r=t(2784),z=t(79635),P=t(3482);const m=y=>(0,z.pC)()||(0,u.jsx)(P.u,{...y})},42081:function(bt,$e,t){"use strict";t.d($e,{j:function(){return m}});var u=t(52322),r=t(2784),z=t(23196),P=t(60871);const m=y=>{const{children:c}=y,$=(0,P.h_)(P.Ds);var we;const ue=`Documentation available in ${(we=$.getOptionalString("organization.name"))!==null&&we!==void 0?we:"Backstage"}`;return(0,u.jsx)(z.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:c})}},48431:function(bt,$e,t){"use strict";t.d($e,{f:function(){return P}});var u=t(2784),r=t(40303);class z{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const P=()=>{const{updateFilters:m}=(0,r.wp)();return(0,u.useEffect)(()=>{m({techdocs:new z})},[m]),null}},89258:function(bt,$e,t){"use strict";t.d($e,{I6:function(){return G},Jl:function(){return ue},s4:function(){return y}});var u=t(61886),r=t(92077),z=t(95573),P=t(60871),m=t(15096);const y=(0,P.rx)({id:"techdocs",apis:[(0,P.ni)({api:u.Dl,deps:{configApi:P.Ds,discoveryApi:P.NW,identityApi:P.$4,fetchApi:P.gP},factory:({configApi:S,discoveryApi:V,identityApi:re,fetchApi:q})=>new r.k({configApi:S,discoveryApi:V,identityApi:re,fetchApi:q})}),(0,P.ni)({api:u.gT,deps:{configApi:P.Ds,discoveryApi:P.NW,fetchApi:P.gP},factory:({configApi:S,discoveryApi:V,fetchApi:re})=>new r.p({configApi:S,discoveryApi:V,fetchApi:re})})],routes:{root:z._Z,docRoot:z.Fw,entityContent:z.pd}}),c=y.provide((0,P.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(S=>S.Router),mountPoint:z._Z})),$=y.provide((0,P.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(S=>S.EmbeddedDocsRouter),mountPoint:z.pd})),we=y.provide((0,P.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(S=>S.TechDocsCustomHome),mountPoint:z._Z})),ue=y.provide((0,P.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(S=>S.TechDocsIndexPage),mountPoint:z._Z})),G=y.provide((0,P.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(S=>S.TechDocsReaderPage),mountPoint:z.Fw})),Z=y.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(t.bind(t,55511)).then(S=>S.TechDocsSearchResultListItem),predicate:S=>S.type==="techdocs"}))},7476:function(bt,$e,t){"use strict";t.r($e),t.d($e,{TechDocsReaderLayout:function(){return G},TechDocsReaderPage:function(){return Z}});var u=t(52322),r=t(2784),z=t(79635),P=t(23196),m=t(61886),y=t(67896),c=t(93225),$=t(65124),we=t(95573),ue=t(60871);const G=S=>{const{withSearch:V,withHeader:re=!0}=S;return(0,u.jsxs)(P.T3,{themeId:"documentation",children:[re&&(0,u.jsx)(c.S,{}),(0,u.jsx)($.b,{}),(0,u.jsx)(y.F,{withSearch:V})]})},Z=S=>{const{kind:V,name:re,namespace:q}=(0,ue.Oi)(we.Fw),{children:_,entityRef:B={kind:V,name:re,namespace:q}}=S,R=(0,z.pC)();if(!_){const L=R?r.Children.toArray(R.props.children):[];var k;const Ce=L.flatMap(Ve=>{var et;return(k=Ve==null||(et=Ve.props)===null||et===void 0?void 0:et.children)!==null&&k!==void 0?k:[]}).find(Ve=>!(0,ue.IY)(Ve,m.Zz)&&!(0,ue.IY)(Ve,m.jM));return(0,u.jsx)(m.ZS,{entityRef:B,children:Ce||(0,u.jsx)(G,{})})}return(0,u.jsx)(m.ZS,{entityRef:B,children:({metadata:L,entityMetadata:W,onReady:Ce})=>(0,u.jsx)("div",{className:"techdocs-reader-page",children:(0,u.jsx)(P.T3,{themeId:"documentation",children:_ instanceof Function?_({entityRef:B,techdocsMetadataValue:L.value,entityMetadataValue:W.value,onReady:Ce}):_})})})}},67896:function(bt,$e,t){"use strict";t.d($e,{F:function(){return Q}});var u=t(52322),r=t(2784),z=t(79692),P=t(60905),m=t(61886),y=t(23196),c=t(22478),$=t(4614),we=t(77277),ue=t(99688),G=t(12420),Z=t(90436),S=t(61837),V=t(4190),re=t(87685);const q=(0,z.Z)(g=>(0,G.Z)({paper:{width:"100%",[g.breakpoints.up("sm")]:{width:"75%"},[g.breakpoints.up("md")]:{width:"50%"},padding:g.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:g.palette.background.default}})),_=({buildLog:g,onClose:j})=>{const J=q(),Y=g.length===0?"Waiting for logs...":g.join(`
37
- `);return(0,u.jsxs)(P.Z,{container:!0,direction:"column",className:J.root,spacing:0,wrap:"nowrap",children:[(0,u.jsxs)(P.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,u.jsx)(Z.Z,{variant:"h5",children:"Build Details"}),(0,u.jsx)(S.Z,{title:"Close the drawer",onClick:j,color:"inherit",children:(0,u.jsx)(re.Z,{})},"dismiss")]}),(0,u.jsx)(P.Z,{item:!0,xs:!0,children:(0,u.jsx)(y.nU,{text:Y,classes:{root:J.logs}})})]})},B=({buildLog:g})=>{const j=q(),[J,Y]=(0,r.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(we.Z,{color:"inherit",onClick:()=>Y(!0),children:"Show Build Logs"}),(0,u.jsx)(V.ZP,{classes:{paper:j.paper},anchor:"right",open:J,onClose:()=>Y(!1),children:(0,u.jsx)(_,{buildLog:g,onClose:()=>Y(!1)})})]})};var R=t(60871);const k=({errorMessage:g})=>{const j=(0,R.h_)(R.Ds).getOptionalString("techdocs.builder");let J="";return j!=="local"&&(J="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,u.jsx)(y.mf,{status:"404",statusMessage:g||"Documentation not found",additionalInfo:J})};var L=t(95481);const W=(0,z.Z)(g=>({root:{marginBottom:g.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Ce=()=>{let g=null;const j=W(),{state:J,contentReload:Y,contentErrorMessage:ge,syncErrorMessage:me,buildLog:Ue}=(0,L.DK)();return J==="INITIAL_BUILD"&&(g=(0,u.jsx)(ue.Z,{classes:{root:j.root},variant:"outlined",severity:"info",icon:(0,u.jsx)($.Z,{size:"24px"}),action:(0,u.jsx)(B,{buildLog:Ue}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),J==="CONTENT_STALE_REFRESHING"&&(g=(0,u.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,u.jsx)($.Z,{size:"24px"}),action:(0,u.jsx)(B,{buildLog:Ue}),classes:{root:j.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),J==="CONTENT_STALE_READY"&&(g=(0,u.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,u.jsx)(we.Z,{color:"inherit",onClick:()=>Y(),children:"Refresh"}),classes:{root:j.root},children:"A newer version of this documentation is now available, please refresh to view."})),J==="CONTENT_STALE_ERROR"&&(g=(0,u.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,u.jsx)(B,{buildLog:Ue}),classes:{root:j.root,message:j.message},children:["Building a newer version of this documentation failed."," ",me]})),J==="CONTENT_NOT_FOUND"&&(g=(0,u.jsxs)(u.Fragment,{children:[me&&(0,u.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,u.jsx)(B,{buildLog:Ue}),classes:{root:j.root,message:j.message},children:["Building a newer version of this documentation failed."," ",me]}),(0,u.jsx)(k,{errorMessage:ge})]})),g};var Ve=t(79635),et=t(60364),K=t(41156),tt=t(32838),dt=t(35368),Me=t.n(dt);const ft=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Ie=/^https:\/\/fonts\.googleapis\.com/,lt=/^https:\/\/fonts\.gstatic\.com/,Et=g=>g.nodeName==="LINK",pt=g=>{const j=(g==null?void 0:g.getAttribute("href"))||"",J=j.match(ft),Y=j.match(Ie),ge=j.match(lt);return J||Y||ge},mt=g=>(Et(g)&&!pt(g)&&g.remove(),g),At=g=>g.nodeName==="IFRAME",Nt=(g,j)=>{const J=g.getAttribute("src")||"";try{const{host:Y}=new URL(J);return j.includes(Y)}catch{return!1}},ze=g=>j=>(At(j)&&!Nt(j,g)&&j.remove(),j),qt=()=>{const g=(0,R.h_)(R.Ds);return(0,r.useMemo)(()=>g.getOptionalConfig("techdocs.sanitizer"),[g])},ve=()=>{const g=qt();return(0,r.useCallback)(async j=>{const J=g==null?void 0:g.getOptionalStringArray("allowedIframeHosts");Me().addHook("beforeSanitizeElements",mt);const Y=["link"];return J&&(Y.push("iframe"),Me().addHook("beforeSanitizeElements",ze(J))),Me().sanitize(j.outerHTML,{ADD_TAGS:Y,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[g])};var he=t(41128),Ne=({theme:g})=>`
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: ${g.palette.text.primary};
47
- --md-default-fg-color--light: ${g.palette.text.secondary};
48
- --md-default-fg-color--lighter: ${(0,he.$n)(g.palette.text.secondary,.7)};
49
- --md-default-fg-color--lightest: ${(0,he.$n)(g.palette.text.secondary,.3)};
50
-
51
- /* BACKGROUND */
52
- --md-default-bg-color:${g.palette.background.default};
53
- --md-default-bg-color--light: ${g.palette.background.paper};
54
- --md-default-bg-color--lighter: ${(0,he.$n)(g.palette.background.paper,.7)};
55
- --md-default-bg-color--lightest: ${(0,he.$n)(g.palette.background.paper,.3)};
56
-
57
- /* PRIMARY */
58
- --md-primary-fg-color: ${g.palette.primary.main};
59
- --md-primary-fg-color--light: ${g.palette.primary.light};
60
- --md-primary-fg-color--dark: ${g.palette.primary.dark};
61
- --md-primary-bg-color: ${g.palette.primary.contrastText};
62
- --md-primary-bg-color--light: ${(0,he.$n)(g.palette.primary.contrastText,.7)};
63
-
64
- /* ACCENT */
65
- --md-accent-fg-color: var(--md-primary-fg-color);
66
-
67
- /* SHADOW */
68
- --md-shadow-z1: ${g.shadows[1]};
69
- --md-shadow-z2: ${g.shadows[2]};
70
- --md-shadow-z3: ${g.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: ${g.palette.text.primary};
107
- --md-code-bg-color: ${g.palette.background.paper};
108
- --md-code-hl-color: ${(0,he.Fq)(g.palette.warning.main,.5)};
109
- --md-code-hl-keyword-color: ${g.palette.type==="dark"?g.palette.primary.light:g.palette.primary.dark};
110
- --md-code-hl-function-color: ${g.palette.type==="dark"?g.palette.secondary.light:g.palette.secondary.dark};
111
- --md-code-hl-string-color: ${g.palette.type==="dark"?g.palette.success.light:g.palette.success.dark};
112
- --md-code-hl-number-color: ${g.palette.type==="dark"?g.palette.error.light:g.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: ${g.palette.text.primary};
127
- --md-typeset-del-color: ${g.palette.type==="dark"?(0,he.Fq)(g.palette.error.dark,.5):(0,he.Fq)(g.palette.error.light,.5)};
128
- --md-typeset-ins-color: ${g.palette.type==="dark"?(0,he.Fq)(g.palette.success.dark,.5):(0,he.Fq)(g.palette.success.light,.5)};
129
- --md-typeset-mark-color: ${g.palette.type==="dark"?(0,he.Fq)(g.palette.warning.dark,.5):(0,he.Fq)(g.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
- `,Je=({theme:g})=>`
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: ${g.typography.fontFamily};
152
- font-family: var(--md-text-font-family);
153
- background-color: unset;
154
- }
155
- `;const wt="224px";var jt=({theme:g,sidebar:j})=>`
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:${g.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: ${g.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, .md-footer__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: ${j.isPinned?`calc(-12.1rem + ${wt})`:"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 ot=["h1","h2","h3","h4","h5","h6"];var St=({theme:g})=>`
356
- /*================== Typeset ==================*/
357
-
358
- .md-typeset {
359
- font-size: var(--md-typeset-font-size);
360
- }
361
-
362
- ${ot.reduce((j,J)=>{var Y;const ge=(Y=g.typography.htmlFontSize)!==null&&Y!==void 0?Y:16,me=g.typography[J],{lineHeight:Ue,fontFamily:it,fontWeight:rt,fontSize:yt}=me,at=qe=>{let Ze=1;return typeof qe=="number"&&(Ze=qe/ge*.6),typeof qe=="string"&&(Ze=qe.replace("rem","")),`calc(${Ze} * var(--md-typeset-font-size))`};return j.concat(`
363
- .md-typeset ${J} {
364
- color: var(--md-default-fg-color);
365
- line-height: ${Ue};
366
- font-family: ${it};
367
- font-weight: ${rt};
368
- font-size: ${at(yt)};
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 ${g.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
- `,kt=()=>`
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
- `,zt=({theme:g})=>`
431
- /*================== Extensions ==================*/
432
-
433
- /* HIGHLIGHT */
434
- .highlight .md-clipboard:after {
435
- content: unset;
436
- }
437
-
438
- .highlight .nx {
439
- color: ${g.palette.type==="dark"?"#ff53a3":"#ec407a"};
440
- }
441
-
442
- /* CODE HILITE */
443
- .codehilite .gd {
444
- background-color: ${g.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
445
- }
446
-
447
- .codehilite .gi {
448
- background-color: ${g.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: ${g.palette.action.disabledBackground};
479
- }
480
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
481
- background-color: ${g.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 Bt=[Ne,Je,jt,St,kt,zt],on=()=>(0,y.Pf)(),Wt=()=>{const g=on(),j=(0,et.Z)();return(0,r.useMemo)(()=>{const J={theme:j,sidebar:g};return Bt.reduce((Y,ge)=>Y+ge(J),"")},[j,g])},Vt=()=>{const g=Wt();return(0,r.useCallback)(j=>(j.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${g}</style>`),j),[g])},Nn=(g,j,J)=>{const Y=g==="src"&&j.endsWith(".svg"),ge=!j.match(/^([a-z]*:)?\/\//i),me=j.startsWith(J);return Y&&(ge||me)},In=({techdocsStorageApi:g,entityId:j,path:J})=>async Y=>{const ge=await g.getApiOrigin(),me=async(Ue,it)=>{for(const rt of Ue)if(rt.hasAttribute(it)){const yt=rt.getAttribute(it);if(!yt)return;const at=await g.getBaseUrl(yt,j,J);if(Nn(it,yt,ge))try{const Ze=await(await fetch(at,{credentials:"include"})).text();rt.setAttribute(it,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Ze)))}`)}catch{rt.setAttribute("alt",`Error: ${yt}`)}else rt.setAttribute(it,at)}};return await Promise.all([me(Y.querySelectorAll("img"),"src"),me(Y.querySelectorAll("script"),"src"),me(Y.querySelectorAll("source"),"src"),me(Y.querySelectorAll("link"),"href"),me(Y.querySelectorAll("a[download]"),"href")]),Y};var ln=t(79158),wn=t(67097),Fn=t(28316),Un=t(82717),Mn=t.n(Un);const Jn=g=>j=>{var J;const Y=j.querySelector('[title="Edit this page"]');if(!Y||!Y.href)return j;const ge=new URL(Y.href),me=g.byUrl(ge);if((me==null?void 0:me.type)!=="github"&&(me==null?void 0:me.type)!=="gitlab")return j;const Ue=((J=j.querySelector("article>h1"))===null||J===void 0?void 0:J.childNodes[0].textContent)||"",it=encodeURIComponent(`Documentation Feedback: ${Ue}`),rt=encodeURIComponent(`Page source:
499
- ${Y.href}
500
-
501
- Feedback:`),yt=(me==null?void 0:me.type)==="github"?(0,ln.BT)(ge.href,"blob"):ge.href,at=Mn()(yt),qe=`/${at.organization}/${at.name}`,Ze=Y.cloneNode();switch(me==null?void 0:me.type){case"gitlab":Ze.href=`${ge.origin}${qe}/issues/new?issue[title]=${it}&issue[description]=${rt}`;break;case"github":Ze.href=`${ge.origin}${qe}/issues/new?title=${it}&body=${rt}`;break;default:return j}return Fn.render(r.createElement(wn.Z),Ze),Ze.style.paddingLeft="5px",Ze.title="Leave feedback for this page",Ze.id="git-feedback-link",Y==null||Y.insertAdjacentElement("beforebegin",Ze),j};var nt=t(44882);const zn=()=>g=>{const j=g.querySelector('.md-header label[for="__drawer"]'),J=g.querySelector("article");if(!j||!J)return g;const Y=j.cloneNode();return Fn.render(r.createElement(nt.Z),Y),Y.id="toggle-sidebar",Y.title="Toggle Sidebar",Y.classList.add("md-content__button"),Y.style.setProperty("padding","0 0 0 5px"),Y.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(Y),g},Pn=()=>g=>(((J,Y)=>{Array.from(J).filter(ge=>ge.hasAttribute(Y)).forEach(ge=>{const me=ge.getAttribute(Y);if(me){me.match(/^https?:\/\//i)&&ge.setAttribute("target","_blank");try{const Ue=Wn(window.location.href);ge.setAttribute(Y,new URL(me,Ue).toString())}catch{ge.replaceWith(ge.textContent||me)}}})})(Array.from(g.getElementsByTagName("a")),"href"),g);function Wn(g){const j=new URL(g);return!j.pathname.endsWith("/")&&!j.pathname.endsWith(".html")&&(j.pathname+="/"),j.toString()}const Sn=({baseUrl:g,onClick:j})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",ge=>{const Ue=Y.getAttribute("href");Ue&&Ue.startsWith(g)&&!Y.hasAttribute("download")&&(ge.preventDefault(),j(ge,Ue))})}),J);var sn=t(15459),Ln=t(80030),gn=t(72379),jn=t(41547),Vn=t(95074);const fe=(0,sn.Z)(g=>({tooltip:{fontSize:"inherit",color:g.palette.text.primary,margin:0,padding:g.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Ln.ZP),oe=()=>(0,u.jsx)(gn.Z,{children:(0,u.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ke=({text:g})=>{const[j,J]=(0,r.useState)(!1),[,Y]=(0,Vn.Z)(),ge=(0,r.useCallback)(()=>{Y(g),J(!0)},[g,Y]),me=(0,r.useCallback)(()=>{J(!1)},[J]);return(0,u.jsx)(fe,{title:"Copied to clipboard",placement:"left",open:j,onClose:me,leaveDelay:1e3,children:(0,u.jsx)(we.Z,{className:"md-clipboard md-icon",onClick:ge,children:(0,u.jsx)(oe,{})})})},Fe=g=>j=>{const J=j.querySelectorAll("pre > code");for(const ge of J){var Y;const me=ge.textContent||"",Ue=document.createElement("div");ge==null||(Y=ge.parentElement)===null||Y===void 0||Y.prepend(Ue),Fn.render((0,u.jsx)(jn.Z,{theme:g,children:(0,u.jsx)(ke,{text:me})}),Ue)}return j},Ke=()=>g=>{var j;return(j=g.querySelector(".md-header"))===null||j===void 0||j.remove(),g},te=()=>g=>{var j,J;return(j=g.querySelector(".md-footer .md-copyright"))===null||j===void 0||j.remove(),(J=g.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),g},D=({onLoading:g,onLoaded:j})=>J=>(g(),J.addEventListener(m.Ox,function Y(){j(),J.removeEventListener(m.Ox,Y)}),J),pe=()=>g=>(g.addEventListener(m.Ox,function j(){if(window.location.hash){var J;const Y=window.location.hash.slice(1);(J=g==null?void 0:g.querySelector(`[id="${Y}"]`))===null||J===void 0||J.scrollIntoView()}g.removeEventListener(m.Ox,j)}),g),Ae=()=>g=>(setTimeout(()=>{const j=g==null?void 0:g.querySelectorAll("li.md-nav__item--active");j.length!==0&&(j.forEach(Y=>{const ge=Y==null?void 0:Y.querySelector("input");ge!=null&&ge.checked||ge==null||ge.click()}),j[j.length-1].scrollIntoView())},200),g),Qe=async(g,j)=>{let J;if(typeof g=="string")J=new DOMParser().parseFromString(g,"text/html").documentElement;else if(g instanceof Element)J=g;else throw new Error("dom is not a recognized type");for(const Y of j)J=await Y(J);return J},Xe="screen and (max-width: 76.1875em)",Tt=g=>{const j=(0,Ve.s0)(),J=(0,et.Z)(),Y=(0,K.Z)(Xe),ge=ve(),me=Vt(),Ue=(0,R.z$)(),it=(0,R.h_)(m.Dl),rt=(0,R.h_)(tt.q3),{state:yt,path:at,content:qe}=(0,L.DK)(),[Ze,$t]=(0,r.useState)(null),Ht=(0,m.ux)(Ze),Rt=(0,r.useCallback)(()=>{if(!Ze)return;Ze.querySelectorAll(".md-sidebar").forEach(_e=>{if(Y)_e.style.top="0px";else{const cn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Ot;const Cn=(Ot=cn==null?void 0:cn.getBoundingClientRect().top)!==null&&Ot!==void 0?Ot:0;var tn;let Qn=(tn=Ze.getBoundingClientRect().top)!==null&&tn!==void 0?tn:0;const kn=Ze.querySelector(".md-container > .md-tabs");var En;const mn=(En=kn==null?void 0:kn.getBoundingClientRect().height)!==null&&En!==void 0?En:0;Qn<Cn&&(Qn=Cn),_e.style.top=`${Math.max(Qn,0)+mn}px`}_e.style.setProperty("opacity","1")})},[Ze,Y]);(0,r.useEffect)(()=>(window.addEventListener("resize",Rt),window.addEventListener("scroll",Rt,!0),()=>{window.removeEventListener("resize",Rt),window.removeEventListener("scroll",Rt,!0)}),[Ze,Rt]);const It=(0,r.useCallback)(()=>{if(!Ze)return;const vt=Ze.querySelector(".md-footer");vt&&(vt.style.width=`${Ze.getBoundingClientRect().width}px`)},[Ze]);(0,r.useEffect)(()=>(window.addEventListener("resize",It),()=>{window.removeEventListener("resize",It)}),[Ze,It]),(0,r.useEffect)(()=>{Ht||(It(),Rt())},[yt,Ht,It,Rt]);const en=(0,r.useCallback)((vt,_e)=>Qe(vt,[ge,In({techdocsStorageApi:it,entityId:g,path:_e}),Pn(),zn(),Ke(),te(),Jn(rt),me]),[g,rt,it,ge,me]),Dt=(0,r.useCallback)(async vt=>Qe(vt,[pe(),Ae(),Fe(J),Sn({baseUrl:window.location.origin,onClick:(_e,Ot)=>{var tn;const En=_e.ctrlKey||_e.metaKey,cn=new URL(Ot),Cn=`${cn.pathname}${cn.search}${cn.hash}`,Qn=((tn=_e.target)===null||tn===void 0?void 0:tn.innerText)||Ot,kn=Ot.replace(window.location.origin,"");if(Ue.captureEvent("click",Qn,{attributes:{to:kn}}),cn.hash)if(En)window.open(Cn,"_blank");else{var mn;j(Cn),(mn=vt==null?void 0:vt.querySelector(`[id="${cn.hash.slice(1)}"]`))===null||mn===void 0||mn.scrollIntoView()}else En?window.open(Cn,"_blank"):j(Cn)}}),D({onLoading:()=>{},onLoaded:()=>{var _e;(_e=vt.querySelector(".md-nav__title"))===null||_e===void 0||_e.removeAttribute("for")}}),D({onLoading:()=>{Array.from(vt.querySelectorAll(".md-sidebar")).forEach(Ot=>{Ot.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,j,Ue]);return(0,r.useEffect)(()=>{if(!qe)return()=>{};let vt=!0;return en(qe,at).then(async _e=>{if(!(_e!=null&&_e.innerHTML)||!vt)return;window.scroll({top:0});const Ot=await Dt(_e);$t(Ot)}),()=>{vt=!1}},[qe,at,en,Dt]),Ze};var Gt=t(8560);const an=()=>{const g=(0,m.$L)(),{shadowRoot:j}=(0,m.x1)(),J=j==null?void 0:j.querySelector('[data-md-component="content"]'),Y=j==null?void 0:j.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ge=Y==null?void 0:Y.querySelector('[data-techdocs-addons-location="primary sidebar"]');ge||(ge=document.createElement("div"),ge.setAttribute("data-techdocs-addons-location","primary sidebar"),Y==null||Y.prepend(ge));const me=j==null?void 0:j.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ue=me==null?void 0:me.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ue||(Ue=document.createElement("div"),Ue.setAttribute("data-techdocs-addons-location","secondary sidebar"),me==null||me.prepend(Ue)),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Gt.Z,{container:ge,children:g.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,u.jsx)(Gt.Z,{container:J,children:g.renderComponentsByLocation(m.oZ.Content)}),(0,u.jsx)(Gt.Z,{container:Ue,children:g.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},ne=(0,z.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Q=(0,L.m1)(g=>{var j;const{withSearch:J=!0,onReady:Y}=g,ge=ne(),{entityMetadata:{value:me,loading:Ue},entityRef:it,setShadowRoot:rt}=(0,m.x1)(),yt=Tt(it),at=(0,r.useCallback)(qe=>{rt(qe),Y instanceof Function&&Y()},[rt,Y]);return Ue===!1&&!me?(0,u.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):yt?(0,u.jsx)(y.VY,{children:(0,u.jsxs)(P.Z,{container:!0,children:[(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(Ce,{})}),J&&(0,u.jsx)(P.Z,{className:ge.search,xs:"auto",item:!0,children:(0,u.jsx)(c.S,{entityId:it,entityTitle:me==null||(j=me.metadata)===null||j===void 0?void 0:j.title})}),(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(m.VA,{element:yt,onAppend:at,children:(0,u.jsx)(an,{})})})]})}):(0,u.jsx)(y.VY,{children:(0,u.jsx)(P.Z,{container:!0,children:(0,u.jsx)(P.Z,{xs:12,item:!0,children:(0,u.jsx)(Ce,{})})})})}),se=null},93225:function(bt,$e,t){"use strict";t.d($e,{S:function(){return q}});var u=t(52322),r=t(2784),z=t(18671),P=t(60905),m=t(98069),y=t(60364),c=t(73250),$=t(61886),we=t(40303),ue=t(25271),G=t(23196),Z=t(60871),S=t(76635),V=t(95573);const re=(0,u.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),q=_=>{const{palette:{common:{white:B}}}=(0,y.Z)(),{children:R}=_,k=(0,$.$L)(),L=(0,Z.h_)(Z.Ds),{title:W,setTitle:Ce,subtitle:Ve,setSubtitle:et,entityRef:K,metadata:{value:tt,loading:dt},entityMetadata:{value:Me,loading:ft}}=(0,$.x1)();(0,r.useEffect)(()=>{tt&&(Ce(tt.site_name),et(()=>{let{site_description:he}=tt;return(!he||he==="None")&&(he=""),he}))},[tt,Ce,et]);const Ie=L.getOptional("app.title")||"Backstage",lt=[W,Ve,Ie].filter(Boolean).join(" | "),{locationMetadata:Et,spec:pt}=Me||{},mt=pt==null?void 0:pt.lifecycle,At=Me?(0,we.hF)(Me,ue.S4):[],Nt=(0,Z.tg)(V._Z)(),ze=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(G.i9,{label:(0,S.capitalize)((Me==null?void 0:Me.kind)||"entity"),value:(0,u.jsx)(we.dx,{color:"inherit",entityRef:K,title:Me==null?void 0:Me.metadata.title,defaultKind:"Component"})}),At.length>0&&(0,u.jsx)(G.i9,{label:"Owner",value:(0,u.jsx)(we.rI,{color:"inherit",entityRefs:At,defaultKind:"group"})}),mt?(0,u.jsx)(G.i9,{label:"Lifecycle",value:mt}):null,Et&&Et.type!=="dir"&&Et.type!=="file"?(0,u.jsx)(G.i9,{label:"",value:(0,u.jsxs)(P.Z,{container:!0,direction:"column",alignItems:"center",style:{color:B},children:[(0,u.jsx)(P.Z,{style:{padding:0},item:!0,children:(0,u.jsx)(c.Z,{style:{marginTop:"-25px"}})}),(0,u.jsx)(P.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Et.target}):null]});return!ft&&Me===void 0||!dt&&tt===void 0?null:(0,u.jsxs)(G.h4,{type:"Documentation",typeLink:Nt,title:W||re,subtitle:Ve===""?void 0:Ve||re,children:[(0,u.jsx)(z.Z,{titleTemplate:"%s",children:(0,u.jsx)("title",{children:lt})}),ze,R,k.renderComponentsByLocation($.oZ.Header)]})}},65124:function(bt,$e,t){"use strict";t.d($e,{b:function(){return Z}});var u=t(52322),r=t(2784),z=t(79692),P=t(15223),m=t(95544),y=t(80030),c=t(61837),$=t(48348),we=t(47603),ue=t(61886);const G=(0,z.Z)(S=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:S.spacing(3,3,0)}})),Z=S=>{const V=G(),[re,q]=(0,r.useState)(null),_=(0,r.useCallback)(Ve=>{q(Ve.currentTarget)},[]),B=(0,r.useCallback)(()=>{q(null)},[]),{entityMetadata:{value:R,loading:k}}=(0,ue.x1)(),L=(0,ue.$L)(),W=L.renderComponentsByLocation(ue.oZ.Subheader),Ce=L.renderComponentsByLocation(ue.oZ.Settings);return!W&&!Ce||k===!1&&!R?null:(0,u.jsx)(P.Z,{classes:V,...S.toolbarProps,children:(0,u.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[W,Ce?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(y.ZP,{title:"Settings",children:(0,u.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:_,children:(0,u.jsx)(we.Z,{})})}),(0,u.jsx)($.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:re,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(re),onClose:B,keepMounted:!0,children:(0,u.jsx)("div",{children:Ce})})]}):null]})})}},95481:function(bt,$e,t){"use strict";t.d($e,{DK:function(){return Z},m1:function(){return V}});var u=t(52322),r=t(2784),z=t(79635),P=t(61886),m=t(60871),y=t(64279),c=t(77446);function $({contentLoading:re,content:q,activeSyncState:_}){return re||_==="BUILD_READY_RELOAD"||!q&&_==="CHECKING"?"CHECKING":!q&&_==="BUILDING"?"INITIAL_BUILD":q?_==="BUILDING"?"CONTENT_STALE_REFRESHING":_==="BUILD_READY"?"CONTENT_STALE_READY":_==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function we(re,q){const _={...re};switch(q.type){case"sync":q.state==="CHECKING"&&(_.buildLog=[]),_.activeSyncState=q.state,_.syncError=q.syncError;break;case"contentLoading":_.contentLoading=!0,_.contentError=void 0;break;case"content":typeof q.path=="string"&&(_.path=q.path),_.contentLoading=!1,_.content=q.content,_.contentError=q.contentError;break;case"buildLog":_.buildLog=_.buildLog.concat(q.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(_.activeSyncState)&&["contentLoading","content"].includes(q.type)&&(_.activeSyncState="UP_TO_DATE",_.buildLog=[]),_}function ue(re,q,_,B){var R,k;const[L,W]=(0,r.useReducer)(we,{activeSyncState:"CHECKING",path:B,contentLoading:!0,buildLog:[]}),Ce=(0,m.h_)(P.Dl),{retry:Ve}=(0,c.Z)(async()=>{W({type:"contentLoading"});try{const tt=await Ce.getEntityDocs({kind:re,namespace:q,name:_},B);return W({type:"content",content:tt,path:B}),tt}catch(tt){W({type:"content",contentError:tt,path:B})}},[Ce,re,q,_,B]),et=(0,r.useRef)({content:void 0,reload:()=>{}});return et.current={content:L.content,reload:Ve},(0,y.default)(async()=>{W({type:"sync",state:"CHECKING"});const tt=setTimeout(()=>{W({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ce.syncEntityDocs({kind:re,namespace:q,name:_},Me=>{W({type:"buildLog",log:Me})})){case"updated":et.current.content?W({type:"sync",state:"BUILD_READY"}):(et.current.reload(),W({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":W({type:"sync",state:"UP_TO_DATE"});break;default:W({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(dt){W({type:"sync",state:"ERROR",syncError:dt})}finally{clearTimeout(tt)}},[re,_,q,Ce,W,et]),{state:(0,r.useMemo)(()=>$({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:Ve,path:L.path,content:L.content,contentErrorMessage:(R=L.contentError)===null||R===void 0?void 0:R.toString(),syncErrorMessage:(k=L.syncError)===null||k===void 0?void 0:k.toString(),buildLog:L.buildLog}}const G=(0,r.createContext)({}),Z=()=>(0,r.useContext)(G),S=re=>{const{children:q}=re,{"*":_=""}=(0,z.UO)(),{entityRef:B}=(0,P.x1)(),{kind:R,namespace:k,name:L}=B,W=ue(R,k,L,_);return(0,u.jsx)(G.Provider,{value:W,children:q instanceof Function?q(W):q})},V=re=>q=>(0,u.jsx)(S,{children:(0,u.jsx)(re,{...q})})},95573:function(bt,$e,t){"use strict";t.d($e,{Fw:function(){return z},_Z:function(){return r},pd:function(){return P}});var u=t(60871);const r=(0,u.NT)({id:"techdocs:index-page"}),z=(0,u.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),P=(0,u.NT)({id:"techdocs:catalog-reader-view"})},55511:function(bt,$e,t){"use strict";t.r($e),t.d($e,{TechDocsSearchResultListItem:function(){return ue}});var u=t(52322),r=t(2784),z=t(79692),P=t(49378),m=t(86136),y=t(90436),c=t(23196),$=t(15096);const we=(0,z.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=G=>{const{result:Z,highlight:S,lineClamp:V=5,asListItem:re=!0,asLink:q=!0,title:_,icon:B}=G,R=we(),k=({children:Ce})=>q?(0,u.jsx)(c.rU,{noTrack:!0,to:Z.location,children:Ce}):(0,u.jsx)(u.Fragment,{children:Ce}),L=()=>{const Ce=S!=null&&S.fields.title?(0,u.jsx)($.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):Z.title,Ve=S!=null&&S.fields.entityTitle?(0,u.jsx)($.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):Z.entityTitle,et=S!=null&&S.fields.name?(0,u.jsx)($.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):Z.name;return Z?(0,u.jsx)(P.Z,{className:R.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,u.jsx)(k,{children:_||(0,u.jsxs)(u.Fragment,{children:[Ce," | ",Ve!=null?Ve:et," docs"]})}),secondary:(0,u.jsx)(y.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:V,overflow:"hidden"},color:"textSecondary",variant:"body2",children:S!=null&&S.fields.text?(0,u.jsx)($.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):Z.text})}):null},W=({children:Ce})=>re?(0,u.jsxs)(u.Fragment,{children:[B&&(0,u.jsx)(m.Z,{children:typeof B=="function"?B(Z):B}),(0,u.jsx)("div",{className:R.flexContainer,children:Ce})]}):(0,u.jsx)(u.Fragment,{children:Ce});return(0,u.jsx)(W,{children:(0,u.jsx)(L,{})})}},22478:function(bt,$e,t){"use strict";t.d($e,{S:function(){return G}});var u=t(52322),r=t(15096),z=t(79692),P=t(27556),m=t(2784),y=t(79635),c=t(55511);const $=(0,z.Z)(Z=>({root:{width:"100%"},bar:{padding:Z.spacing(1)}})),we=Z=>Z==null?void 0:Z.document,ue=Z=>{const{entityId:S,entityTitle:V,debounceTime:re=150}=Z,[q,_]=(0,m.useState)(!1),B=(0,y.s0)(),{setFilters:R,result:{loading:k,value:L}}=(0,r.Rx)(),W=$(),[Ce,Ve]=(0,m.useState)([]);(0,m.useEffect)(()=>{let Me=!0;if(Me&&L){const ft=L.results.slice(0,10);Ve(ft)}return()=>{Me=!1}},[k,L]);const{kind:et,name:K,namespace:tt}=S;(0,m.useEffect)(()=>{R(Me=>({...Me,kind:et,namespace:tt,name:K}))},[et,tt,K,R]);const dt=(Me,ft)=>{if(we(ft)){const{location:Ie}=ft.document;B(Ie)}};return(0,u.jsx)(P.Z,{className:W.bar,variant:"outlined",children:(0,u.jsx)(r.qO,{classes:{root:W.root},"data-testid":"techdocs-search-bar",size:"small",open:q,getOptionLabel:()=>"",filterOptions:Me=>Me,onClose:()=>{_(!1)},onFocus:()=>{_(!0)},onChange:dt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ce,renderOption:({document:Me,highlight:ft})=>(0,u.jsx)(c.TechDocsSearchResultListItem,{result:Me,lineClamp:3,asListItem:!1,asLink:!1,title:Me.title,highlight:ft}),loading:k,inputDebounceTime:re,inputPlaceholder:`Search ${V||S.name} docs`,freeSolo:!1})})},G=Z=>{const S={term:"",types:["techdocs"],pageCursor:"",filters:Z.entityId};return(0,u.jsx)(r.Nd,{initialState:S,children:(0,u.jsx)(ue,{...Z})})}},53260:function(){}},function(bt){var $e=function(u){return bt(bt.s=u)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,5109,6816,5218,4736],function(){return $e(6290)});var t=bt.O()}]);})();
502
-
503
- //# sourceMappingURL=main.d717207e.js.map