@techdocs/cli 1.4.0-next.2 → 1.4.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +8 -0
- package/dist/embedded-app/.config-schema.json +5 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/6051.18a39235.chunk.js +4 -0
- package/dist/embedded-app/static/6051.18a39235.chunk.js.map +1 -0
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js → 8951.4ffeac5f.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.8fbde266.chunk.js.map → 8951.4ffeac5f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js → 9323.a4a386cd.chunk.js} +1 -1
- package/dist/embedded-app/static/{9323.f715e2ef.chunk.js.map → 9323.a4a386cd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.d717207e.js +503 -0
- package/dist/embedded-app/static/main.d717207e.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.617f168b.js → module-material-ui.1f3c23cb.js} +2 -2
- package/dist/embedded-app/static/{module-material-ui.617f168b.js.map → module-material-ui.1f3c23cb.js.map} +1 -1
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js +30 -0
- package/dist/embedded-app/static/module-react-router-dom.34e67991.js.map +1 -0
- package/dist/embedded-app/static/module-yaml.feabae04.js +136 -0
- package/dist/embedded-app/static/module-yaml.feabae04.js.map +1 -0
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js} +2 -2
- package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_java.a244ed31.chunk.js.map → react-syntax-highlighter_languages_highlight_java.0c380b2f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.e99a7512.js → runtime.d717207e.js} +2 -2
- package/dist/embedded-app/static/{runtime.e99a7512.js.map → runtime.d717207e.js.map} +1 -1
- package/dist/embedded-app/static/vendor.d717207e.js +252 -0
- package/dist/embedded-app/static/vendor.d717207e.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +8 -7
- package/dist/embedded-app/static/6051.784227d8.chunk.js +0 -4
- package/dist/embedded-app/static/6051.784227d8.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.e99a7512.js +0 -503
- package/dist/embedded-app/static/main.e99a7512.js.map +0 -1
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js +0 -12
- package/dist/embedded-app/static/module-remix-run.4d35bb97.js.map +0 -1
- package/dist/embedded-app/static/module-yaml.2570b3eb.js +0 -136
- package/dist/embedded-app/static/module-yaml.2570b3eb.js.map +0 -1
- package/dist/embedded-app/static/vendor.e99a7512.js +0 -270
- package/dist/embedded-app/static/vendor.e99a7512.js.map +0 -1
|
@@ -1,503 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Ct,Be,n){"use strict";n.d(Be,{n3:function(){return m},MS:function(){return M}});var h=n(25271),r=n(23054),F=n(96279),P=n.n(F);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function y(xe){return!xe.cursor}function l(xe){return!y(xe)}class M{async getEntityAncestors(V,K){const{kind:S,namespace:B,name:Y}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}/ancestry`,K)}async getLocationById(V,K){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,K)}async getEntities(V,K){const{filter:S=[],fields:B=[],order:Y,offset:ce,limit:ee,after:X}=V!=null?V:{},w=this.getParams(S);if(B.length&&w.push(`fields=${B.map(encodeURIComponent).join(",")}`),Y)for(const ne of[Y].flat())ne&&w.push(`order=${encodeURIComponent(ne.order)}:${encodeURIComponent(ne.field)}`);ce!==void 0&&w.push(`offset=${ce}`),ee!==void 0&&w.push(`limit=${ee}`),X!==void 0&&w.push(`after=${encodeURIComponent(X)}`);const O=w.length?`?${w.join("&")}`:"",$=await this.requestRequired("GET",`/entities${O}`,K),T=(ne,Te)=>{var qe,Qe;if(((qe=ne.metadata)===null||qe===void 0?void 0:qe.name)===void 0||ne.kind===void 0||((Qe=Te.metadata)===null||Qe===void 0?void 0:Qe.name)===void 0||Te.kind===void 0)return 0;const it=(0,h.eE)(ne),Ue=(0,h.eE)(Te);return it<Ue?-1:it>Ue?1:0};return{items:$.sort(T)}}async getEntitiesByRefs(V,K){var S;const B={entityRefs:V.entityRefs};!((S=V.fields)===null||S===void 0)&&S.length&&(B.fields=V.fields);const ce=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ee=await this.fetchApi.fetch(ce,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify(B)});if(!ee.ok)throw await r.VL.fromResponse(ee);const{items:X}=await ee.json();return{items:X}}async queryEntities(V={},K){const S=[];if(y(V)){var B,Y;const{fields:ee=[],filter:X,limit:w,orderFields:O,fullTextFilter:$}=V;S.push(...this.getParams(X)),w!==void 0&&S.push(`limit=${w}`),O!==void 0&&(Array.isArray(O)?O:[O]).forEach(({field:ne,order:Te})=>S.push(`sortField=${ne},${Te}`)),ee.length&&S.push(`fields=${ee.map(encodeURIComponent).join(",")}`);const T=$==null||(B=$.term)===null||B===void 0?void 0:B.trim();T&&S.push(`fullTextFilterTerm=${T}`),!($==null||(Y=$.fields)===null||Y===void 0)&&Y.length&&S.push(`fullTextFilterFields=${$.fields.join(",")}`)}else{const{fields:ee=[],limit:X,cursor:w}=V;S.push(`cursor=${w}`),X!==void 0&&S.push(`limit=${X}`),ee.length&&S.push(`fields=${ee.map(encodeURIComponent).join(",")}`)}const ce=S.length?`?${S.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ce}`,K)}async getEntityByRef(V,K){const{kind:S,namespace:B,name:Y}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}`,K)}async getEntityByName(V,K){const{kind:S,namespace:B="default",name:Y}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(S)}/${encodeURIComponent(B)}/${encodeURIComponent(Y)}`,K)}async refreshEntity(V,K){const S=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(S.status!==200)throw new Error(await S.text())}async getEntityFacets(V,K){const{filter:S=[],facets:B}=V,Y=this.getParams(S);for(const ee of B)Y.push(`facet=${encodeURIComponent(ee)}`);const ce=Y.length?`?${Y.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ce}`,K)}async addLocation(V,K){const{type:S="url",target:B,dryRun:Y}=V,ce=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${Y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({type:S,target:B})});if(ce.status!==201)throw new Error(await ce.text());const{location:ee,entities:X,exists:w}=await ce.json();if(!ee)throw new Error(`Location wasn't added: ${B}`);return{location:ee,entities:X,exists:w}}async getLocationByRef(V,K){return(await this.requestRequired("GET","/locations",K)).map(B=>B.data).find(B=>V===(0,h.NZ)(B))}async removeLocationById(V,K){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,K)}async removeEntityByUid(V,K){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,K)}async validateEntity(V,K,S){const B=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:V,location:K})});if(B.ok)return{valid:!0};if(B.status!==400)throw await r.VL.fromResponse(B);const{errors:Y=[]}=await B.json();return{valid:!1,errors:Y}}async requestIgnored(V,K,S){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,Y=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},ce=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!ce.ok)throw await r.VL.fromResponse(ce)}async requestRequired(V,K,S){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,Y=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},ce=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!ce.ok)throw await r.VL.fromResponse(ce);return ce.json()}async requestOptional(V,K,S){const B=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,Y=S!=null&&S.token?{Authorization:`Bearer ${S.token}`}:{},ce=await this.fetchApi.fetch(B,{method:V,headers:Y});if(!ce.ok){if(ce.status===404)return;throw await r.VL.fromResponse(ce)}return await ce.json()}getParams(V=[]){const K=[];for(const S of[V].flat()){const B=[];for(const[Y,ce]of Object.entries(S))for(const ee of[ce].flat())ee===m?B.push(encodeURIComponent(Y)):typeof ee=="string"&&B.push(`${encodeURIComponent(Y)}=${encodeURIComponent(ee)}`);B.length&&K.push(`filter=${B.join(",")}`)}return K}constructor(V){this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:P()}}}},25271:function(Ct,Be,n){"use strict";n.d(Be,{Tf:function(){return F},P1:function(){return re},q1:function(){return Oe},M6:function(){return Pe},l2:function(){return r},zG:function(){return h},w$:function(){return ln},nP:function(){return Tn},aS:function(){return wn},S4:function(){return en},cz:function(){return Bn},iB:function(){return At},CV:function(){return Rt},of:function(){return wt},Ou:function(){return pt},eE:function(){return gt},NZ:function(){return Ht}});const h="default",r="backstage.io/view-url",F="backstage.io/edit-url",P="kubernetes.io/api-server",m="kubernetes.io/api-server-certificate-authority",y="kubernetes.io/auth-provider";var l=n(76635),M=n.n(l);class xe{async enforce(U){return U.metadata.namespace?U:lodash.merge({metadata:{namespace:this.namespace}},U)}constructor(U=DEFAULT_NAMESPACE){this.namespace=U}}class V{static isValidPrefixAndOrSuffix(U,he,Ke,Ve){if(typeof U!="string")return!1;const at=U.split(he);return at.length===1?Ve(at[0]):at.length===2?Ke(at[0])&&Ve(at[1]):!1}static isJsonSafe(U){try{return M().isEqual(U,JSON.parse(JSON.stringify(U)))}catch{return!1}}static isValidDnsSubdomain(U){return typeof U=="string"&&U.length>=1&&U.length<=253&&U.split(".").every(V.isValidDnsLabel)}static isValidDnsLabel(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(U)}static isValidTag(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(U)}static isValidUrl(U){if(typeof U!="string")return!1;try{return new URL(U),!0}catch{return!1}}static isValidString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}static isNonEmptyString(U){var he;return typeof U=="string"&&((he=U==null?void 0:U.trim())===null||he===void 0?void 0:he.length)>=1}}var K=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}}}}}'),S=n(27991),B=n.n(S),Y=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"}}}`),ce=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}}}}}}'),ee=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 X=new Map,w=[K,Y,ce,ee];function O(de){if(!(de!=null&&de.length))throw new TypeError("Unknown error");const U=de[0];throw new TypeError(`${U.instancePath||"<root>"} ${U.message}${U.params?` - ${Object.entries(U.params).map(([he,Ke])=>`${he}: ${Ke}`).join(", ")}`:""}`)}function $(de,U={}){var he;const Ke=(he=U==null?void 0:U.disableCache)!==null&&he!==void 0?he:!1,Ve=Ke?"":JSON.stringify(de);if(!Ke){const Xt=X.get(Ve);if(Xt)return Xt}const at=T(de),It=new(B())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});at.length&&It.addSchema(at,void 0,void 0,!0);const tn=It.compile(de);return Ke||X.set(Ve,tn),tn}function T(de){if(typeof de!="object")return[];const U=new Set;de.$id&&U.add(de.$id);const he=new Array,Ke=[de];for(;Ke.length;){const Ve=Ke.pop();for(const at of ne(Ve))if(!U.has(at)){U.add(at);const It=w.find(tn=>tn.$id===at);It&&(he.push(It),Ke.push(It))}}return he}function*ne(de){const U=[de];for(;U.length;){const he=U.pop();if(typeof he=="object"&&he)for(const[Ke,Ve]of Object.entries(he))Ke==="$ref"&&typeof Ve=="string"?yield Ve.split("#")[0]:U.push(Ve)}}function Te(de){const U=compileAjvSchema(de||entityEnvelopeSchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}function qe(de){const U=$(de);return he=>{var Ke;if(U(he)===!0)return he;const at=(Ke=U.errors)===null||Ke===void 0?void 0:Ke.filter(It=>["/kind","/apiVersion"].includes(It.instancePath));if(at!=null&&at.length&&at.every(It=>It.keyword==="enum"))return!1;throw O(U.errors)}}function Qe(de){const U=compileAjvSchema(de||entitySchema);return he=>{if(U(he)===!0)return he;throw throwAjvError(U.errors)}}class it{static isValidApiVersion(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,he=>he.length>=1&&he.length<=63&&/^[a-z0-9A-Z]+$/.test(he))}static isValidKind(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(U)}static isValidObjectName(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(U)}static isValidNamespace(U){return V.isValidDnsLabel(U)}static isValidLabelKey(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,it.isValidObjectName)}static isValidLabelValue(U){return U===""||it.isValidObjectName(U)}static isValidAnnotationKey(U){return V.isValidPrefixAndOrSuffix(U,"/",V.isValidDnsSubdomain,it.isValidObjectName)}static isValidAnnotationValue(U){return typeof U=="string"}}const Ue={isValidApiVersion:it.isValidApiVersion,isValidKind:it.isValidKind,isValidEntityName:it.isValidObjectName,isValidNamespace:it.isValidNamespace,isValidLabelKey:it.isValidLabelKey,isValidLabelValue:it.isValidLabelValue,isValidAnnotationKey:it.isValidAnnotationKey,isValidAnnotationValue:it.isValidAnnotationValue,isValidTag:de=>typeof de=="string"&&de.length>=1&&de.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(de)};function Et(de={}){return{...Ue,...de}}class He{async enforce(U){function he(g,R,J){if(R==null)throw new Error(`${g} must have a value`);let G;try{G=J(R)}catch(ae){throw new Error(`${g} could not be validated, ${ae}`)}if(!G){let ae;switch(J.name){case"isValidLabelValue":case"isValidObjectName":ae="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":ae="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":ae="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":ae="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":ae="a string";break;case"isValidKind":ae="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":ae="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":ae="a non empty string";break;default:ae=void 0;break}const me=ae?` expected ${ae} but found "${R}".`:"";throw new Error(`"${g}" is not valid;${me} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ke(g,R,J){return R===void 0||he(g,R,J)}he("apiVersion",U.apiVersion,this.validators.isValidApiVersion),he("kind",U.kind,this.validators.isValidKind),he("metadata.name",U.metadata.name,this.validators.isValidEntityName),Ke("metadata.namespace",U.metadata.namespace,this.validators.isValidNamespace);var Ve;for(const[g,R]of Object.entries((Ve=U.metadata.labels)!==null&&Ve!==void 0?Ve:[]))he(`labels.${g}`,g,this.validators.isValidLabelKey),he(`labels.${g}`,R,this.validators.isValidLabelValue);var at;for(const[g,R]of Object.entries((at=U.metadata.annotations)!==null&&at!==void 0?at:[]))he(`annotations.${g}`,g,this.validators.isValidAnnotationKey),he(`annotations.${g}`,R,this.validators.isValidAnnotationValue);var It;const tn=(It=U.metadata.tags)!==null&&It!==void 0?It:[];for(let g=0;g<tn.length;++g)he(`tags.${g}`,tn[g],this.validators.isValidTag);var Xt;const sn=(Xt=U.metadata.links)!==null&&Xt!==void 0?Xt:[];for(let g=0;g<sn.length;++g){var q,W,le;he(`links.${g}.url`,(q=sn[g])===null||q===void 0?void 0:q.url,CommonValidatorFunctions.isValidUrl),Ke(`links.${g}.title`,(W=sn[g])===null||W===void 0?void 0:W.title,CommonValidatorFunctions.isNonEmptyString),Ke(`links.${g}.icon`,(le=sn[g])===null||le===void 0?void 0:le.icon,KubernetesValidatorFunctions.isValidObjectName)}return U}constructor(U=makeValidator()){this.validators=U}}class st{async enforce(U){if(!this.validate){const Ve=new Ajv({allowUnionTypes:!0});this.validate=Ve.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(U)===!0)return U;const[Ke]=this.validate.errors||[];throw Ke?new Error(`Malformed envelope, ${Ke.instancePath||"<root>"} ${Ke.message}`):new Error("Malformed envelope, Unknown error")}}function je(de){let U=de.indexOf(":");const he=de.indexOf("/");he!==-1&&he<U&&(U=-1);const Ke=U===-1?void 0:de.slice(0,U),Ve=he===-1?void 0:de.slice(U+1,he),at=de.slice(Math.max(U+1,he+1));if(Ke===""||Ve===""||at==="")throw new TypeError(`Entity reference "${de}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ke,namespace:Ve,name:at}}function At(de){return{kind:de.kind,namespace:de.metadata.namespace||h,name:de.metadata.name}}function wt(de,U){if(!de)throw new Error("Entity reference must not be empty");const he=U==null?void 0:U.defaultKind,Ke=(U==null?void 0:U.defaultNamespace)||h;let Ve,at,It;if(typeof de=="string"){const W=je(de);var tn;Ve=(tn=W.kind)!==null&&tn!==void 0?tn:he;var Xt;at=(Xt=W.namespace)!==null&&Xt!==void 0?Xt:Ke,It=W.name}else{var sn;Ve=(sn=de.kind)!==null&&sn!==void 0?sn:he;var q;at=(q=de.namespace)!==null&&q!==void 0?q:Ke,It=de.name}if(Ve)if(at){if(!It){const W=JSON.stringify(de);throw new Error(`Entity reference ${W} had missing or empty name`)}}else{const W=JSON.stringify(de);throw new Error(`Entity reference ${W} had missing or empty namespace`)}else{const W=JSON.stringify(de);throw new Error(`Entity reference ${W} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ve,namespace:at,name:It}}function gt(de){let U,he,Ke;if("metadata"in de){U=de.kind;var Ve;he=(Ve=de.metadata.namespace)!==null&&Ve!==void 0?Ve:h,Ke=de.metadata.name}else{U=de.kind;var at;he=(at=de.namespace)!==null&&at!==void 0?at:h,Ke=de.name}return`${U.toLocaleLowerCase("en-US")}:${he.toLocaleLowerCase("en-US")}/${Ke.toLocaleLowerCase("en-US")}`}class xt{async enforce(U){let he=U;for(const Ke of this.policies){const Ve=await Ke.enforce(he);if(!Ve)throw new Error(`Policy ${Ke.constructor.name} did not return a result`);he=Ve}return he}constructor(U){this.policies=U}}class Tt{async enforce(U){for(const he of this.policies){const Ke=await he.enforce(U);if(Ke)return Ke}throw new Error("The entity did not match any known policy")}constructor(U){this.policies=U}}const Lt={allOf(de){return new xt(de)},oneOf(de){return new Tt(de)}};var ze=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 Ie(de){let U;return{async check(he){return U||(U=qe(de)),U(he)===he}}}const we=Ie(ze);var Ee=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Ne=Ie(Ee);var nt=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 zt=Ie(nt);var ht=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Nt=Ie(ht);var vt=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 jt=Ie(vt),en="ownedBy",on="ownerOf",Sn="consumesApi",Pt="apiConsumedBy",an="providesApi",Cn="apiProvidedBy",Tn="dependsOn",ln="dependencyOf",qn="parentOf",On="childOf",_n="memberOf",lt="hasMember",Bn="partOf",wn="hasPart";var cn=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 $n=Ie(cn);var Wn=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 jn=Ie(Wn);var Gn=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 ve=Ie(Gn),re="backstage.io/managed-by-location",Oe="backstage.io/managed-by-origin-location",Pe="backstage.io/source-location",Ge=/^[\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 pt(de){if(typeof de!="string")throw new TypeError(`Unable to parse location ref '${de}', unexpected argument ${typeof de}`);const U=de.indexOf(":");if(U<0)throw new TypeError(`Unable to parse location ref '${de}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const he=de.substring(0,U).trim(),Ke=de.substring(U+1).trim();if(!he||!Ke)throw new TypeError(`Unable to parse location ref '${de}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(he==="http"||he==="https")throw new TypeError(`Invalid location ref '${de}', please prefix it with 'url:', e.g. 'url:${de}'`);if(Ge.test(Ke))throw new TypeError(`Invalid location ref '${de}', target is a javascript: URL`);return{type:he,target:Ke}}function Ht(de){const{type:U,target:he}=de;if(U){if(!he)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Ge.test(he))throw new TypeError(`Invalid location ref '${U}:${he}', target is a javascript: URL`);return`${U}:${he}`}function Rt(de){var U,he,Ke,Ve,at;const It=(at=(U=de.metadata)===null||U===void 0||(he=U.annotations)===null||he===void 0?void 0:he[Pe])!==null&&at!==void 0?at:(Ke=de.metadata)===null||Ke===void 0||(Ve=Ke.annotations)===null||Ve===void 0?void 0:Ve[re];if(!It)throw new Error(`Entity '${gt(de)}' is missing location`);return pt(It)}},23196:function(Ct,Be,n){"use strict";n.d(Be,{Oi:function(){return Ee},VY:function(){return St},yW:function(){return il},XF:function(){return zt},mn:function(){return de},NX:function(){return h},ub:function(){return le},mf:function(){return ul},yu:function(){return xn},h4:function(){return wa},M6:function(){return Rn},i9:function(){return Cl},aR:function(){return tr},rJ:function(){return Or},Oh:function(){return Il},hu:function(){return El},rU:function(){return Ue},Qj:function(){return He},nU:function(){return Lr},SA:function(){return Co},sk:function(){return dt},Or:function(){return xr},T3:function(){return ja},g9:function(){return Pl},Ex:function(){return io},Gk:function(){return x},tn:function(){return eo},Ph:function(){return An},YE:function(){return pi},v7:function(){return c},R6:function(){return Es},tR:function(){return aa},uw:function(){return Fr},qt:function(){return Xi},iA:function(){return Ca},GB:function(){return Zn},po:function(){return er},mZ:function(){return Uo},Pf:function(){return Mo}});var h={};n.r(h),n.d(h,{Nm:function(){return ht},ht:function(){return jt},LJ:function(){return vt}});var r=n(52322),F=n(60871),P=n(19928),m=n(2784);function y(e){const[o,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(ue=>a(ie=>ie.concat(ue)));return()=>{N.unsubscribe()}},[d]);const[Z]=o;if(useEffect(()=>{if(Z&&Z.display==="transient"){const N=setTimeout(()=>{a(ue=>{const ie=ue.filter(ye=>ye!==Z);return ie.length===ue.length?ue:ie})},j);return()=>clearTimeout(N)}},[Z,j]),o.length===0)return null;const H=()=>{a(N=>N.filter(ue=>ue!==Z))};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:Z.severity,children:_jsxs(Typography,{component:"span",children:[String(Z.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var l=n(79692);const M=(0,l.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function xe(e){const{displayName:o,picture:a,customStyles:d}=e,p=M();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:a,className:p.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(o)})})}var V=n(77277),K=n(86689),S=n(90436),B=n(72779),Y=n.n(B),ce=n(76635),ee=n(79635),X=n(39857);function w(){const[e]=(0,ee.is)((0,r.jsx)(ee.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const O=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),$=e=>/^([a-z+.-]+):/.test(e),T=/^[\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,ne=window.open;if(ne&&!ne.__backstage){const e=function(...a){const d=String(a[0]);if(T.test(d))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ne.apply(this,a)};e.__backstage=!0,window.open=e}const Te=()=>{try{return(0,F.h_)(F.Ds).getOptionalString("app.baseUrl")}catch{return}},qe=()=>{const e="http://sample.dev";var o;const a=(o=Te())!==null&&o!==void 0?o:"/",{pathname:d}=new URL(a,e);return(0,ce.trimEnd)(d,"/")},Qe=e=>{let o=String(e);const a=qe(),d=$(o),p=o.startsWith(a);return!d&&!p&&(o=a.concat(o)),o},it=e=>{if(e instanceof Array)return e.map(it).join(" ").trim();if(typeof e=="object"&&e){var o;return it(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},Ue=m.forwardRef(({onClick:e,noTrack:o,...a},d)=>{const p=O(),v=(0,F.z$)(),j=w()?Qe(a.to):a.to,Z=it(a.children)||j,H=$(j),N=H&&!!/^https?:/.exec(j);if(T.test(j))throw new Error("Link component rejected javascript: URL as a security precaution");const ue=ie=>{e==null||e(ie),o||v.captureEvent("click",Z,{attributes:{to:j}})};return H?(0,r.jsxs)(K.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:ue,className:Y()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(S.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(K.Z,{...a,ref:d,component:X.rU,to:j,onClick:ue})}),Et=m.forwardRef((e,o)=>(0,r.jsx)(Ue,{ref:o,...e,color:"initial"})),He=m.forwardRef((e,o)=>(0,r.jsx)(V.Z,{ref:o,component:Et,...e})),st=null;var je=n(95544),At=n(60364),wt=n(83229),gt=n(26639),xt=n(39595),Tt=n(61837),Lt=n(80030),ze=n(19353),Ie=n(95074);function we(e){const{text:o,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,F.h_)(F.VE),[j,Z]=(0,m.useState)(!1),[{error:H},N]=(0,Ie.Z)();(0,m.useEffect)(()=>{H&&v.post(H)},[H,v]);const ue=ie=>{ie.stopPropagation(),Z(!0),N(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Lt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>Z(!1),open:j,children:(0,r.jsx)(Tt.Z,{onClick:ue,"aria-label":p,children:(0,r.jsx)(ze.Z,{})})})})}function Ee(e){const{text:o,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,Z=(0,At.Z)(),H=Z.palette.type==="dark"?gt.Z:xt.Z,N=Z.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(je.Z,{position:"relative",children:[(0,r.jsx)(wt.Z,{customStyle:v,language:a,style:H,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:Z.palette.textVerySubtle},lineProps:ue=>p!=null&&p.includes(ue)?{style:{backgroundColor:N}}:{},children:o}),j&&(0,r.jsx)(je.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(we,{text:o})})]})}var Ne=n(41156),nt=n(88188);function zt(e){const{title:o,to:a}=e,d=(0,Ne.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(Tt.Z,{component:X.rU,color:"primary",title:o,size:"small",to:a,children:(0,r.jsx)(nt.Z,{})}):(0,r.jsx)(V.Z,{component:X.rU,variant:"contained",color:"primary",to:a,children:o}):null}var ht;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(ht||(ht={}));var Nt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Nt||(Nt={}));var vt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(vt||(vt={}));var jt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(jt||(jt={}));var en=n(27397),on=n(11105),Sn=n(97963),Pt=n(46506),an=n.n(Pt),Cn=n(54073),Tn=n.n(Cn),ln=n(10368);const qn=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function On({node:{id:e}}){const o=qn(),[a,d]=m.useState(0),[p,v]=m.useState(0),j=m.useRef(null);m.useLayoutEffect(()=>{if(j.current){let{height:ue,width:ie}=j.current.getBBox();ue=Math.round(ue),ie=Math.round(ie),(ue!==p||ie!==a)&&(d(ie),v(ue))}},[a,p]);const Z=10,H=a+Z*2,N=p+Z*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:j,className:o.text,y:N/2,x:H/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const _n="arrow-marker",lt="node",Bn="edge",wn="label",cn=(0,ln.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),$n=e=>(0,r.jsx)(On,{...e});function Wn({render:e=$n,setNode:o,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,Z=a,H=cn(),N=m.useRef(null);return m.useLayoutEffect(()=>{if(N.current){let{height:ue,width:ie}=N.current.getBBox();ue=Math.round(ue),ie=Math.round(ie),(ue!==p||ie!==d)&&o(a.id,{...a,height:ue,width:ie})}},[a,d,p,o]),(0,r.jsx)("g",{ref:N,"data-testid":lt,className:H.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:Z})})}var jn=n(76985),Gn=n(39829),ve=n(19574),re=n.n(ve);const Oe=(0,ln.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Pe({edge:{label:e}}){const o=Oe();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const Ge=(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"}),pt=e=>(0,r.jsx)(Pe,{...e});function Ht({render:e=pt,setEdge:o,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:Z,height:H,points:N}=d,ue=d,ie=Ge(),ye=m.useRef(null);m.useLayoutEffect(()=>{if(ye.current){let{height:Je,width:Ot}=ye.current.getBBox();Je=Math.round(Je),Ot=Math.round(Ot),(Je!==H||Ot!==Z)&&o(a,{...d,height:Je,width:Ot})}},[d,H,Z,o,a]);let Le="";const Me=m.useMemo(()=>jn.Z().x(Je=>Je.x).y(Je=>Je.y).curve(Gn[p]),[p]);if(N){const Je=N.filter(Ot=>re()(Ot.x)&&re()(Ot.y));Le=Me(Je)||""}return(0,r.jsxs)(r.Fragment,{children:[Le&&(0,r.jsx)("path",{"data-testid":Bn,className:ie.path,d:Le}),ue.label?(0,r.jsx)("g",{ref:ye,"data-testid":wn,className:ie.label,transform:`translate(${v},${j})`,children:e({edge:ue})}):null]})}const Rt="workspace";function de(e){var o,a;const{edges:d,nodes:p,renderNode:v,direction:j=ht.TOP_BOTTOM,align:Z,nodeMargin:H=50,edgeMargin:N=10,rankMargin:ue=50,paddingX:ie=0,paddingY:ye=0,acyclicer:Le,ranker:Me=vt.NETWORK_SIMPLEX,labelPosition:Je=jt.RIGHT,labelOffset:Ot=10,edgeRanks:Yt=1,edgeWeight:nn=1,renderLabel:rn,defs:Bt,zoom:_t="enabled",curve:Jt="curveMonotoneX",fit:Cr="grow",...wr}=e,jr=(0,Sn.Z)(),[Er,Li]=m.useState(100),[Ur,Pi]=m.useState(100),Qt=m.useRef(new(an()).graphlib.Graph),[mo,Rs]=m.useState(((o=Qt.current.graph())===null||o===void 0?void 0:o.width)||0),[Mr,ki]=m.useState(((a=Qt.current.graph())===null||a===void 0?void 0:a.height)||0),[Mn,vr]=m.useState([]),[to,no]=m.useState([]),hn=Math.max(mo,Er),bn=Math.max(Mr,Ur),vo=Math.min(Mr,Ur),ro=Cr==="grow"?bn:vo,Yo=m.useMemo(()=>Tn()(mn=>{if(!mn)return;const zn=on.Z(mn),pn=on.Z(mn.getElementById(Rt));function hr(){zn.call(en.sP().scaleExtent([1,10]).on("zoom",Ar=>{Ar.transform.x=Math.min(0,Math.max(Ar.transform.x,hn-hn*Ar.transform.k)),Ar.transform.y=Math.min(0,Math.max(Ar.transform.y,bn-bn*Ar.transform.k)),pn.attr("transform",Ar.transform)}))}_t==="enabled"?hr():_t==="enable-on-click"&&zn.on("click",()=>hr());const{width:pr,height:Ls}=mn.getBoundingClientRect();Er!==pr&&Li(pr),Ur!==Ls&&Pi(Ls)},100),[Ur,Er,hn,bn,_t]),Pa=m.useCallback(()=>{const mn=Qt.current.nodes(),zn=Qt.current.edges();mn.forEach(pn=>{p.some(pr=>pr.id===pn)||Qt.current.removeNode(pn)}),zn.forEach(pn=>{d.some(pr=>pr.from===pn.v&&pr.to===pn.w)||Qt.current.removeEdge(pn.v,pn.w)}),p.forEach(pn=>{const hr=Qt.current.nodes().find(pr=>pn.id===pr);if(hr&&Qt.current.node(hr)){const{width:pr,height:Ls,x:Ar,y:Ql}=Qt.current.node(hr);Qt.current.setNode(hr,{...pn,width:pr,height:Ls,x:Ar,y:Ql})}else Qt.current.setNode(pn.id,{...pn,width:0,height:0})}),d.forEach(pn=>{Qt.current.setEdge(pn.from,pn.to,{...pn,label:pn.label,width:0,height:0,labelpos:Je,labeloffset:Ot,weight:nn,minlen:Yt})})},[d,p,Je,Ot,nn,Yt]),Jo=m.useMemo(()=>Tn()(()=>{an().layout(Qt.current);const{height:mn,width:zn}=Qt.current.graph(),pn=Math.max(0,mn||0),hr=Math.max(0,zn||0);Rs(hr),ki(pn),vr(Qt.current.nodes()),no(Qt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Qt.current.setGraph({rankdir:j,align:Z,nodesep:H,edgesep:N,ranksep:ue,marginx:ie,marginy:ye,acyclicer:Le,ranker:Me}),Pa(),Jo(),Jo.cancel),[Le,Z,j,N,ie,ye,H,ue,Me,Pa,Jo]);function Yl(mn,zn){return Qt.current.setNode(mn,zn),Jo(),Qt.current}function Jl(mn,zn){return Qt.current.setEdge(mn,zn),Jo(),Qt.current}return(0,r.jsxs)("svg",{ref:Yo,...wr,width:"100%",height:ro,viewBox:`0 0 ${hn} ${bn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:_n,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:jr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Bt]}),(0,r.jsx)("g",{id:Rt,children:(0,r.jsxs)("svg",{width:mo,height:Mr,y:bn/2-Mr/2,x:hn/2-mo/2,viewBox:`0 0 ${mo} ${Mr}`,children:[to.map(mn=>{const zn=Qt.current.edge(mn);return zn?(0,r.jsx)(Ht,{id:mn,setEdge:Jl,render:rn,edge:zn,curve:Jt},`${mn.v}-${mn.w}`):null}),Mn.map(mn=>{const zn=Qt.current.node(mn);return zn?(0,r.jsx)(Wn,{setNode:Yl,render:v,node:zn},mn):null})]})})]})}var U;const he=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(U=e.palette.banner.warning)!==null&&U!==void 0?U:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Ke=e=>{const{variant:o,message:a,id:d,fixed:p=!1}=e,v=he(),Z=useApi(storageApiRef).forBucket("notifications");var H;const N=(H=Z.snapshot("dismissedBanners").value)!==null&&H!==void 0?H:[],[ue,ie]=useState(new Set(N)),ye=useObservable(Z.observe$("dismissedBanners"));useEffect(()=>{if(ye!=null&&ye.value){var Me;const Je=(Me=ye==null?void 0:ye.value)!==null&&Me!==void 0?Me:[];ie(new Set(Je))}},[ye==null?void 0:ye.value]);const Le=()=>{Z.set("dismissedBanners",[...ue,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ue.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:Le,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Ve=n(60905),at=n.p+"static/missingAnnotation.67f79e98..svg",It=n.p+"static/noInformation.4b426325..svg",tn=n.p+"static/createComponent.975d1e1e..svg",Xt=n.p+"static/noBuild.1715fa71..svg";const sn=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),q=({missing:e})=>{const o=sn();switch(e){case"field":return(0,r.jsx)("img",{src:at,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:It,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:tn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Xt,alt:"no Build",className:o.generalImg});default:return null}},W=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function le(e){const{title:o,description:a,missing:d,action:p}=e,v=W();return(0,r.jsxs)(Ve.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Ve.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Ve.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Ve.Z,{item:!0,xs:!0,children:(0,r.jsx)(S.Z,{variant:"h5",children:o})}),(0,r.jsx)(Ve.Z,{item:!0,xs:!0,children:(0,r.jsx)(S.Z,{variant:"body1",children:a})}),(0,r.jsx)(Ve.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Ve.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)(q,{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`,R=/^.*ANNOTATION.*$/m,J=g.match(R)[0],G=g.split(`
|
|
12
|
-
`).findIndex(e=>R.test(e)),ae=(0,l.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+G)}function Fe(e){const o=e.map(a=>J.replace("ANNOTATION",a)).join(`
|
|
13
|
-
`);return g.replace(J,o)}function Ye(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 dt(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=ae();return(0,r.jsx)(le,{missing:"field",title:"Missing Annotation",description:Ye(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(je.Z,{className:v.code,children:(0,r.jsx)(Ee,{text:Fe(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:me(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(V.Z,{color:"primary",component:Ue,to:p,children:"Read more"})]})})}var yt=n(11776),rt=n(38402),_e=n(49378),De=n(41128),$t=n(27616),Kt=n(8284),kt=n(70660),Zt=n(91750),Wt=n(38016);const Gt=(e,o)=>(o.palette.type==="light"?De._j:De.$n)(o.palette[e].light,.6),ut=(e,o)=>(o.palette.type==="light"?De.$n:De._j)(o.palette[e].light,.9),We=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Gt(o,e)}})),Ft=({severity:e})=>{const o=We({severity:e});return(0,r.jsx)(Zt.Z,{classes:o})},dn=({severity:e})=>{const o=We({severity:e});return(0,r.jsx)(Wt.Z,{classes:o})},vn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:o})=>ut(o,e),color:({severity:o})=>Gt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Gt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Gt(o,e),backgroundColor:({severity:o})=>ut(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"}),In=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Zn(e){const{severity:o="warning",title:a,message:d,children:p,defaultExpanded:v}=e,j=vn({severity:o}),Z=In(o)+(a?`: ${a}`:"");return(0,r.jsxs)($t.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,r.jsxs)(Kt.Z,{expandIcon:(0,r.jsx)(dn,{severity:o}),className:j.summary,children:[(0,r.jsx)(Ft,{severity:o}),(0,r.jsx)(S.Z,{className:j.summaryText,variant:"subtitle1",children:Z})]}),(d||p)&&(0,r.jsx)(kt.Z,{children:(0,r.jsxs)(Ve.Z,{container:!0,children:[d&&(0,r.jsx)(Ve.Z,{item:!0,xs:12,children:(0,r.jsx)(S.Z,{className:j.message,variant:"body1",children:d})}),p&&(0,r.jsx)(Ve.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const yn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Kn=({error:e,message:o,stack:a,children:d})=>{const p=yn();return(0,r.jsxs)(yt.Z,{dense:!0,children:[(0,r.jsxs)(rt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(_e.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(we,{text:e})]}),(0,r.jsxs)(rt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(_e.Z,{classes:{secondary:p.text},primary:"Message",secondary:o}),(0,r.jsx)(we,{text:o})]}),a&&(0,r.jsxs)(rt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(_e.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(we,{text:a})]}),d]})};function xn(e){const{title:o,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(Zn,{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 C=n(85256);const u=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function x(e){var o;const{title:a,error:d,defaultExpanded:p}=e,v=u();if(d.name!=="ResponseError")return(0,r.jsx)(xn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:j,cause:Z}=d,{request:H,response:N}=j,ue=`${N.statusCode}: ${Z.name}`,ie=H&&`${H.method} ${H.url}`,ye=Z.message.replace(/\\n/g,`
|
|
14
|
-
`),Le=(o=Z.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Me=JSON.stringify(j,void 0,2);return(0,r.jsxs)(xn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:ue,message:ye,stack:Le},children:[ie&&(0,r.jsxs)(rt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(_e.Z,{classes:{secondary:v.text},primary:"Request",secondary:H?`${ie}`:void 0}),(0,r.jsx)(we,{text:ie})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Z,{component:"li",className:v.divider}),(0,r.jsx)(rt.Z,{alignItems:"flex-start",children:(0,r.jsx)(_e.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(Ee,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var E=n(28316);function Q(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function pe(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Ce(e){const o=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||Q(e);return p||pe(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return o.current||(o.current=document.createElement("div")),o.current}return a()}var be=null;const ct="core.calloutSeen";function Vt(){const[e,o]=useState(()=>{const d=localStorage.getItem(ct);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(ct),Z={...v?JSON.parse(v):{},[d]:p};o(Z),localStorage.setItem(ct,JSON.stringify(Z))},[]);return{states:e,setState:a}}function un(e){const{states:o,setState:a}=Vt(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:o[e]===!0,markSeen:d}}function Yn(e){const{seen:o,markSeen:a}=un(e);return{show:o===!1,hide:a}}const nr=(0,l.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 zr(e){const{featureId:o,title:a,description:d,children:p}=e,{show:v,hide:j}=useShowCallout(o),Z=usePortal("core.callout"),H=useRef(null),[N,ue]=useState(),ie=nr(),ye=useCallback(()=>{if(H.current){const Le=H.current.getBoundingClientRect(),Me=Math.max(Le.width,Le.height),Je=800,Ot=Le.x-(Me-Le.width)/2-Je,Yt=Le.y-(Me-Le.height)/2-Je,nn=Me+2*Je,rn=450,Bt=Le.x+Le.width/2-rn,_t=Le.y-(Me-Le.height)/2+Me+20;ue({dotLeft:Ot,dotTop:Yt,dotSize:nn,borderWidth:Je,textTop:_t,textLeft:Bt,textWidth:rn})}},[]);return useEffect(()=>(window.addEventListener("resize",ye),window.addEventListener("scroll",ye),()=>{window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye)}),[ye]),useLayoutEffect(ye,[H.current,ye]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:ie.featureWrapper,ref:H,children:p}),createPortal(_jsx(Box,{className:ie.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:ie.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:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx(Box,{className:ie.pulseCircle})}),_jsxs(Box,{className:ie.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})]})]})})}),Z)]}):_jsx(_Fragment,{children:p})}var oo=n(35292);const yo=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function xo({color:e="primary",disabled:o=!1,href:a="#",icon:d=(0,r.jsx)(oo.Z,{}),label:p,onClick:v,title:j}){const Z=yo();return o?(0,r.jsxs)(je.Z,{title:j,className:Y()(Z.link,Z.disabled),children:[d,(0,r.jsx)(S.Z,{variant:"caption",component:"span",className:Z.label,children:p})]}):(0,r.jsxs)(Ue,{title:j,className:Y()(Z.link,Z[e]),to:a,onClick:v,children:[d,(0,r.jsx)(S.Z,{variant:"caption",component:"span",className:Z.label,children:p})]})}const or=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Rn(e){const{links:o}=e,a=or();return(0,r.jsx)("nav",{className:a.links,children:o.map((d,p)=>(0,r.jsx)(xo,{...d},p+1))})}const sr=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
|
-
`},yr=100,Tr=10,Ir=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:yr,height:`calc(100% + ${Tr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Tr,background:`linear-gradient(90deg, ${sr(e.palette.type)})`},fadeRight:{right:-Tr,background:`linear-gradient(270deg, ${sr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Wr(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 j=p.scrollLeft,Z=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([j,Z])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,a]}function bo(e,o,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame(Z=>{if(!e.current)return;const H=Z-v,N=Math.abs(d)*H/o,ie=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:ie});const ye=d-ie;Math.sign(d)!==Math.sign(ye)?p(0):p(ye)});return()=>cancelAnimationFrame(j)},[e,d,o,a]),p}function Qo(e){const{scrollStep:o=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,j=Ir(e),Z=React.useRef(),[H,N]=Wr(Z),ue=bo(Z,a,d),ie=ye=>{Z.current&&ue(ye?o:-o)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:Z,children:p}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:H===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:N===0})}),H>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ie(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ie(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Vr=(0,l.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 rr(e){const o=Vr(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 Rr=(0,m.lazy)(()=>Promise.all([n.e(5869),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Lr(e){const{Progress:o}=(0,F.qD)().getComponents();return(0,r.jsx)(m.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Rr,{...e})})}var So=n(28865),Hr=n(60251);const Gr=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Pr=(e,o)=>o?typeof o=="string"?e+o:m.Children.toArray(o.props.children).reduce(Pr,e):e,fr=({level:e,children:o})=>{const p=m.Children.toArray(o).reduce(Pr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},o)},Kr={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)(Ee,{language:v[1],text:p}):(0,r.jsx)("code",{className:o,...d,children:a})},h1:fr,h2:fr,h3:fr,h4:fr,h5:fr,h6:fr};function Co(e){const{content:o,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:j}=e,Z=Gr();return(0,r.jsx)(So.D,{remarkPlugins:a==="gfm"?[Hr.Z]:[],className:`${Z.markdown} ${j}`,children:o,components:Kr,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var wo=n(23054);const Yr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),jo=({request:e,busy:o,setBusy:a})=>{const d=Yr(),[p,v]=useState(),j=async()=>{a(!0);try{await e.trigger()}catch(H){v(isError(H)?H.message:"An unspecified error occurred")}finally{a(!1)}},Z=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(Z,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var Xo=null;const gr=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function qo(e){const o=gr(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach(Z=>Z.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:v.map(Z=>_jsx(LoginRequestListItem,{request:Z,busy:a,setBusy:d},Z.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var so=n(15277),Eo=n.n(so),Ao=n(29862);const kr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function xr(e){const[o,a]=(0,m.useState)(!1),d=(0,Ao.t)(),p=kr(),v=Z=>{d()&&a(Z)};var j;return(0,r.jsx)(Lt.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(Eo(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var br=n(67358);function io(e){const o=(0,At.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)(br.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(je.Z,{display:"none"})}var To=n(94339),Jr=n(14503),Vn=n(24579),Io=n(32552),Ln=n(15459),_o=n(27597);const es=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function ts(e){const{link:o,title:a,onClick:d}=e,p=es();return(0,r.jsxs)(je.Z,{children:[(0,r.jsx)(C.Z,{}),(0,r.jsx)(Ue,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(je.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(je.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(S.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(_o.Z,{className:p.arrow})]})})]})}const ns=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(S.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(S.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(He,{to:o.href,variant:"contained",children:o.name})},rs=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)(xn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(ns,{slackChannel:o})}):a}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ir=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ro=(0,Ln.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Jr.Z),ao={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:j,variant:Z,children:H,headerStyle:N,headerProps:ue,icon:ie,action:ye,actionsClassName:Le,actions:Me,cardClassName:Je,actionsTopRight:Ot,className:Yt,noPadding:nn,titleTypographyProps:rn}=e,Bt=ir();let _t={},Jt={};Z&&Z.split(/[\s]+/g).forEach(Er=>{_t={..._t,...ao.card[Er]},Jt={...Jt,...ao.cardContent[Er]}});const Cr=()=>!a&&!ie?null:(0,r.jsxs)("div",{className:Bt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:Bt.subheader,children:a}),ie]}),wr=j||(v?{slackChannel:v}:{});return(0,r.jsx)(To.Z,{style:_t,className:Yt,children:(0,r.jsxs)(rs,{...wr,children:[o&&(0,r.jsx)(Io.Z,{classes:{root:Bt.header,title:Bt.headerTitle,subheader:Bt.headerSubheader,avatar:Bt.headerAvatar,action:Bt.headerAction,content:Bt.headerContent},title:o,subheader:Cr(),action:ye,style:{...N},titleTypographyProps:rn,...ue}),Ot&&(0,r.jsx)(Ro,{children:Ot}),d&&(0,r.jsx)(C.Z,{}),(0,r.jsx)(Vn.Z,{className:Y()(Je,{[Bt.noPadding]:nn}),style:Jt,children:H}),Me&&(0,r.jsx)(Jr.Z,{className:Le,children:Me}),p&&(0,r.jsx)(ts,{...p})]})})}var os=n(39307);const Br=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),Lo={fractional:!0,inverse:!1,unit:"%",max:100},b=({palette:e,value:o,inverse:a,max:d})=>{if(isNaN(o))return"#ddd";const p=d||Lo.max,v=a?p-o:o;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function A(e){const[o,a]=useState(null),{getColor:d=b}=e,p=Br(e),{palette:v}=useTheme(),{value:j,fractional:Z,inverse:H,unit:N,max:ue,description:ie}={...Lo,...e},ye=Z?Math.round(j*ue):j,Le=ue!==100?Math.round(j):ye,[Me,Je]=useState(!1);return useEffect(()=>{const Ot=o,Yt=()=>Je(!0),nn=()=>Je(!1);return Ot&&ie?(Ot.addEventListener("mouseenter",Yt),Ot.addEventListener("mouseleave",nn),()=>{Ot.removeEventListener("mouseenter",Yt),Ot.removeEventListener("mouseleave",nn)}):()=>{Je(!1)}},[ie,o]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ye,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Le,inverse:H,max:ue}),className:p.circle}),ie&&Me?_jsx(Box,{className:p.description,children:ie}):_jsx(Box,{className:p.overlay,children:isNaN(j)?"N/A":`${Le}${N}`})]})}const L=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function D(e){const o=L(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:j,description:Z,icon:H,variant:N,getColor:ue}=e,ie={inverse:v,description:Z,getColor:ue,value:p};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:j,variant:N,icon:H,children:_jsx(Gauge,{...ie})})})}function _(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 se=n(21324),oe=n(7089),fe=n(1292),Se=n(42494),Re=n(74603),ge=n(56939),ke=n(12231),et=n(73698),Xe=n(12420),ot=n(72379);const $e=(0,l.Z)(e=>(0,Xe.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Dt=()=>{const e=$e();return(0,r.jsx)(ot.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 fn=(0,l.Z)(e=>(0,Xe.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Pn=()=>{const e=fn();return(0,r.jsx)(ot.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 gn=(0,Ln.Z)(e=>(0,Xe.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),En=(0,l.Z)(e=>(0,Xe.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 An(e){const{multiple:o,items:a,label:d,placeholder:p,selected:v,onChange:j,triggerReset:Z,native:H=!1,disabled:N=!1,margin:ue}=e,ie=En(),[ye,Le]=(0,m.useState)(v||(o?[]:"")),[Me,Je]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Le(o?[]:"")},[Z,o]),(0,m.useEffect)(()=>{v!==void 0&&Le(v)},[v]);const Ot=Bt=>{Le(Bt.target.value),j(Bt.target.value)},Yt=Bt=>{if(N){Bt.preventDefault();return}Je(_t=>o&&!(Bt.target instanceof HTMLElement)?!0:!_t)},nn=()=>{Je(!1)},rn=Bt=>()=>{const _t=ye.filter(Jt=>Jt!==Bt);Le(_t),j(_t)};return(0,r.jsx)(je.Z,{className:ie.root,children:(0,r.jsx)(fe.Z,{onClickAway:nn,children:(0,r.jsxs)(Se.Z,{className:ie.formControl,children:[(0,r.jsx)(ge.Z,{className:ie.formLabel,children:d}),(0,r.jsxs)(et.Z,{"aria-label":d,value:ye,native:H,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:o,margin:ue,onChange:Ot,onClick:Yt,open:Me,input:(0,r.jsx)(gn,{}),label:d,tabIndex:0,renderValue:Bt=>{var _t;return o&&ye.length!==0?(0,r.jsx)(je.Z,{className:ie.chips,children:Bt.map(Jt=>{var Cr,wr;return(0,r.jsx)(oe.Z,{label:(Cr=a.find(jr=>jr.value===Jt))===null||Cr===void 0?void 0:Cr.label,clickable:!0,onDelete:rn(Jt),className:ie.chip},(wr=a.find(jr=>jr.value===Jt))===null||wr===void 0?void 0:wr.value)})}):(0,r.jsx)(S.Z,{children:ye.length===0?p||"":(_t=a.find(Jt=>Jt.value===Bt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>Me?(0,r.jsx)(Pn,{}):(0,r.jsx)(Dt,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!o&&(0,r.jsx)(ke.Z,{value:[],children:p}),H?a&&a.map(Bt=>(0,r.jsx)("option",{value:Bt.value,children:Bt.label},Bt.value)):a&&a.map(Bt=>(0,r.jsxs)(ke.Z,{value:Bt.value,children:[o&&(0,r.jsx)(se.Z,{color:"primary",checked:ye.includes(Bt.value)||!1,className:ie.checkbox}),Bt.label]},Bt.value))]})]})})})}const mr=()=>{},$r=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:mr,stepHistory:[],setStepHistory:mr,onStepChange:mr});function lo(e){const{children:o,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,j]=useState(p),[Z,H]=useState([0]);useEffect(()=>{j(p)},[p]);const N=[];let ue;return Children.forEach(o,ie=>{isValidElement(ie)&&(ie.props.end?ue=ie:N.push(ie))}),_jsxs(_Fragment,{children:[_jsx($r.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:Z,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&&ue]})}const kn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Dn=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Sr=({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")}),Ps=({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"}),ks=({text:e,handleClick:o,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),Oi=({actions:e={},children:o})=>{const a=kn(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:Z,onStepChange:H}=useContext(VerticalStepperContext),N=(Le,Me)=>{Me&&Me(),H&&H(p,Le),v(Le)},ue=()=>{const Le=e.nextStep?e.nextStep(p,d-1):p+1;N(Le,e.onNext),Z([...j,Le])},ie=()=>{j.pop(),N(j[j.length-1],e.onBack),Z([...j])},ye=()=>{N(0,e.onRestart),Z([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(ks,{text:e.backText,handleClick:ie,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Ps,{text:e.skipText,handleClick:ue,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Sr,{text:e.nextText,handleClick:ue,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Dn,{text:e.restartText,handleClick:ye,stepIndex:p}),o]})},ss=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Os(e){const{title:o,children:a,end:d,actions:p,...v}=e,j=ss();return d?_jsxs(Box,{className:j.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 Zr=(0,l.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Bi(e){const o=Zr(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=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Bs(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ar(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function lr(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function cr(e){const o=Zr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var is=n(74600),as=n(15584);const $s=e=>(0,Xe.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Zs={root:{border:"0",verticalAlign:"top"}},Ds=e=>(0,Xe.Z)({root:{margin:e.spacing(0,0,-1,0)}}),ls=e=>(0,Xe.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),cs=(0,Ln.Z)($s,{name:"BackstageMetadataTableTitleCell"})(as.Z),Ns=(0,Ln.Z)(Zs,{name:"BackstageMetadataTableCell"})(as.Z),Zi=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Di=({title:e,children:o,...a})=>_jsxs(TableRow,{children:[e&&_jsx(cs,{children:e}),_jsx(Ns,{colSpan:e?1:2,...a,children:o})]}),ds=(0,Ln.Z)(Ds,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(yt.Z,{disablePadding:!0,className:e.root,children:o})),Fs=(0,Ln.Z)(ls,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(rt.Z,{className:e.root,children:o})),Po=(0,Xe.Z)({root:{margin:"0 0",listStyleType:"none"}}),Us=e=>(0,Xe.Z)({root:{...Po.root,paddingLeft:e.spacing(1)}}),us=(0,Ln.Z)(Po,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(ds,{classes:e,children:o})),Qr=(0,Ln.Z)(Us,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(ds,{classes:e,children:o}));function hs(e,o){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:ko(d)},p));return o?_jsx(Qr,{children:a}):_jsx(us,{children:a})}function Ms(e,o,a){const d=Object.keys(e).map(p=>{const v=ko(e[p],!0),j=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},p)});return o?_jsx(Qr,{children:d}):_jsx(us,{children:d})}function ko(e,o,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ms(e,o,a):Array.isArray(e)?hs(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ni=({value:e,options:o})=>_jsx(Fragment,{children:ko(e,o)}),Dr=({title:e,value:o,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ni,{value:o,options:a})});function zs(e,o){return Object.keys(e).map(a=>_jsx(Dr,{title:a,value:e[a],options:o},a))}function Hn(e){const{metadata:o,dense:a=!0,options:d}=e,p=zs(o,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Fi=n(49429),Ui=n(86136),Ws=n(79784),Vs=n(19126),Hs=n.n(Vs);function Mi(e){return qs.stringify(e,{strictNullHandling:!0})}function co(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function ps(e,o){return co(e)[o]}function uo(e,o,a){const d={...co(e),[o]:a};return Mi(d)}function Oo(e,o=250){const[a,d]=useSearchParams(),p=a.toString(),[v,j]=useState(ps(p,e));return useEffect(()=>{const Z=ps(p,e);j(H=>isEqual(Z,H)?H:Z)},[p,j,e]),useDebouncedEffect(()=>{const Z=uo(p,e,v);p!==Z&&d(Z,{replace:!0})},[d,v,p,e],o),[v,j]}const ho={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 fs(){const o=(0,F.I_)().get(F.Ds),a=o==null?void 0:o.getOptionalConfig("app.support");if(!a)return ho;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 gs=n(80079);function Jn(e,o){const d=(0,F.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(gs.Z,{...o})}function zi(e){return Jn("brokenImage",e)}function Wi(e){return Jn("catalog",e)}function Vi(e){return Jn("chat",e)}function Hi(e){return Jn("dashboard",e)}function Gi(e){return Jn("docs",e)}function ka(e){return Jn("email",e)}function Ki(e){return Jn("github",e)}function Yi(e){return Jn("group",e)}function Nr(e){return Jn("help",e)}function Ji(e){return Jn("user",e)}function Qi(e){return Jn("warning",e)}const ms=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Gs=({icon:e})=>{const o=(0,F.qD)();var a;const d=e&&(a=o.getSystemIcon(e))!==null&&a!==void 0?a:Nr;return(0,r.jsx)(d,{})};var Bo;const Ks=({link:e})=>(0,r.jsx)(Ue,{to:e.url,children:(Bo=e.title)!==null&&Bo!==void 0?Bo:e.url}),Ys=({item:e})=>{var o;return(0,r.jsxs)(rt.Z,{children:[(0,r.jsx)(Ui.Z,{children:(0,r.jsx)(Gs,{icon:e.icon})}),(0,r.jsx)(_e.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)(Ks,{link:d},d.url)],[])})]})};function Xi(e){const{title:o,items:a,children:d}=e,{items:p}=fs(),[v,j]=(0,m.useState)(!1),[Z,H]=(0,m.useState)(null),N=ms(),ue=(0,Ne.Z)(Le=>Le.breakpoints.down("sm")),ie=Le=>{H(Le.currentTarget),j(!0)},ye=()=>{j(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{display:"flex",ml:1,children:ue?(0,r.jsx)(Tt.Z,{color:"primary",size:"small",onClick:ie,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(Nr,{})}):(0,r.jsx)(V.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ie,startIcon:(0,r.jsx)(Nr,{}),children:"Support"})}),(0,r.jsxs)(Ws.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:Z,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ye,children:[(0,r.jsxs)(yt.Z,{className:N.popoverList,children:[o&&(0,r.jsx)(rt.Z,{alignItems:"flex-start",children:(0,r.jsx)(S.Z,{variant:"subtitle1",children:o})}),m.Children.map(d,(Le,Me)=>(0,r.jsx)(rt.Z,{alignItems:"flex-start",children:Le},`child-${Me}`)),(a!=null?a:p).map((Le,Me)=>(0,r.jsx)(Ys,{item:Le},`item-${Me}`))]}),(0,r.jsx)(Fi.Z,{children:(0,r.jsx)(V.Z,{color:"primary",onClick:ye,"aria-label":"Close",children:"Close"})})]})]})}var $o=n(18671),Zo=n(16060);const po=72,vs=24,Do=18,er={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-vs*2,iconPadding:vs,selectedIndicatorWidth:3,userBadgePadding:Do,userBadgeDiameter:po-Do*2,mobileSidebarHeight:56},Js=e=>({...er,...e,iconContainerWidth:er.drawerWidthClosed,iconSize:er.drawerWidthClosed-er.iconPadding*2,userBadgeDiameter:er.drawerWidthClosed-er.userBadgePadding*2}),ys={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:er.defaultOpenDelayMs+200},Qs=e=>({...ys,...e}),qi="@backstage/core/sidebar-intro-dismissed",dr=(0,m.createContext)({sidebarConfig:er,submenuConfig:ys}),Xr=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var _i=n(50023),ea=n(4190),Xs=n(87685),_s=n(44882),qr=n(51837);const ei={isOpen:!1,setOpen:()=>{}},ti=(0,m.createContext)(ei),No=(0,qr.CT)("sidebar-open-state-context");function Fo(e){const{children:o,value:a}=e;return(0,r.jsx)(ti.Provider,{value:a,children:(0,r.jsx)(No.Provider,{value:(0,qr.EI)({1:a}),children:o})})}const Uo=()=>{const e=(0,m.useContext)(No),o=(0,m.useContext)(ti);if(e===void 0)return o||ei;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var ni=n(57998);const _r={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ri=(0,m.createContext)(_r),oi=(0,qr.CT)("sidebar-pin-state-context");function ta(e){const{children:o,value:a}=e;return(0,r.jsx)(ri.Provider,{value:a,children:(0,r.jsx)(oi.Provider,{value:(0,qr.EI)({1:a}),children:o})})}const Mo=()=>{const e=(0,m.useContext)(oi),o=(0,m.useContext)(ri);if(e===void 0)return o||_r;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},si=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Nn=e=>{const{to:o,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,m.useContext)(dr),j=si({sidebarConfig:v}),Z=(0,ee.TH)(),{selectedMenuItemIndex:H,setSelectedMenuItemIndex:N}=(0,m.useContext)(ai),ue=(ye,Le)=>{N(Le===H?-1:Le)},ie=p===H&&H>=0||p!==H&&!(H>=0)&&o===Z.pathname;return(0,r.jsx)(ni.Z,{"aria-label":a,label:a,icon:d,component:Ue,to:o||Z.pathname,onChange:ue,value:p,selected:ie,classes:j})},ii=e=>{const{children:o,to:a,label:d,icon:p,value:v}=e,{isMobile:j}=Mo();return j?(0,r.jsx)(Nn,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:o})},xs=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),na=e=>(0,ce.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),ra=m.createElement(ii).type,oa=({children:e,label:o="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(dr),v=xs({sidebarConfig:p});return(0,r.jsxs)(ea.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(je.Z,{className:v.overlayHeader,children:[(0,r.jsx)(S.Z,{variant:"h3",children:o}),(0,r.jsx)(Tt.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Xs.Z,{})})]}),(0,r.jsx)(je.Z,{component:"nav",children:e})]})},ai=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),sa=e=>{const{sidebarConfig:o}=(0,m.useContext)(dr),{children:a}=e,d=xs({sidebarConfig:o}),p=(0,ee.TH)(),[v,j]=(0,m.useState)(-1);(0,m.useEffect)(()=>{j(-1)},[p.pathname]);let Z=(0,F.vJ)(a,N=>N.getElements().filter(ue=>ue.type===ra));if(a)Z.length?Z=na(Z):Z.push((0,r.jsx)(ii,{icon:(0,r.jsx)(_s.Z,{}),children:a},"default_menu"));else return null;const H=v>=0&&!Z[v].props.to;return(0,r.jsx)(Fo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ai.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,r.jsx)(oa,{label:Z[v]&&Z[v].props.label,open:H,onClose:()=>j(-1),children:Z[v]&&Z[v].props.children}),(0,r.jsx)(_i.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:Z})]})})};var zo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(zo||(zo={}));const li={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(zo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(zo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ia=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ci=(0,m.createContext)({content:{contentRef:void 0}});function aa(e){const[o,a]=(0,m.useState)(()=>li.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(dr),p=(0,m.useRef)(null),v=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{li.setSidebarPinState(o)},[o]);const j=(0,Ne.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),Z=()=>a(!o),H=ia({isPinned:o,sidebarConfig:d});return(0,r.jsx)(ta,{value:{isPinned:o,toggleSidebarPinState:Z,isMobile:j},children:(0,r.jsx)(ci.Provider,{value:v,children:(0,r.jsx)(je.Z,{className:H.root,children:e.children})})})}function di(){const{content:e}=(0,m.useContext)(ci);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 ui=(0,l.Z)(e=>({drawer:o=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:o.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),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 Fn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Fn||(Fn={}));const hi=e=>{const{sidebarConfig:o}=(0,m.useContext)(dr),{openDelayMs:a=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=ui({sidebarConfig:o}),Z=(0,Ne.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[H,N]=(0,m.useState)(Fn.Closed),ue=(0,m.useRef)(),{isPinned:ie,toggleSidebarPinState:ye}=Mo(),Le=()=>{ie||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),H!==Fn.Open&&!Z&&(ue.current=window.setTimeout(()=>{ue.current=void 0,N(Fn.Open)},a),N(Fn.Idle)))},Me=()=>{ie||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),H===Fn.Idle?N(Fn.Closed):H===Fn.Open&&(ue.current=window.setTimeout(()=>{ue.current=void 0,N(Fn.Closed)},d)))},Je=H===Fn.Open&&!Z||ie,Ot=Yt=>{Yt?(N(Fn.Open),ye()):(N(Fn.Closed),ye())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(fi,{}),(0,r.jsx)(Fo,{value:{isOpen:Je,setOpen:Ot},children:(0,r.jsx)(je.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Le,onFocus:p?()=>{}:Le,onMouseLeave:p?()=>{}:Me,onBlur:p?()=>{}:Me,children:(0,r.jsx)(je.Z,{className:Y()(j.drawer,{[j.drawerOpen]:Je}),children:v})})})]})},pi=e=>{var o;const a=Js((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const p=Qs((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:Z,closeDelayMs:H}=e,{isMobile:N}=Mo();return N?(0,r.jsx)(sa,{children:v}):(0,r.jsx)(dr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(hi,{openDelayMs:Z,closeDelayMs:H,disableExpandOnHover:j,children:v})})};function fi(){const{sidebarConfig:e}=(0,m.useContext)(dr),{focusContent:o,contentRef:a}=di(),d=ui({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(V.Z,{onClick:o,variant:"contained",className:Y()(d.visuallyHidden),children:"Skip to content"}):null}function bs(e,o){const a=new URLSearchParams(o.search).toString(),d=Hs().parse(a),p=new URLSearchParams(e.search).toString(),v=Hs().parse(p);return(0,ce.isEqual)(o.pathname,e.pathname)&&(0,ce.isMatch)(v,d)}const gi=(0,l.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"}),la=e=>{const{title:o,subtitle:a,to:d,icon:p,dropdownItems:v}=e,j=gi(),{setIsHoveredOn:Z}=useContext(SidebarItemWithSubmenuContext),H=()=>{Z(!1)},N=useResolvedPath(d!=null?d:""),ue=useLocation();let ie=isLocationMatch(ue,N);const[ye,Le]=useState(!1),Me=()=>{Le(!ye)};return v!==void 0?(v.some(Je=>{const Ot=resolvePath(Je.to);return ie=isLocationMatch(ue,Ot),ie}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:Je=>Je.stopPropagation(),className:classnames(j.item,ie?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]}),ye?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&ye&&_jsx(Box,{className:j.dropdown,children:v.map((Je,Ot)=>_jsx(Tooltip,{title:Je.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Je.to,underline:"none",className:j.dropdownItem,onClick:H,onTouchStart:Yt=>Yt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:Je.title})})},Ot))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,ie?j.selected:void 0),onClick:H,onTouchStart:Je=>Je.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]})]})})})};var Wo;const mi=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Wo=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Wo!==void 0?Wo:"#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}=Uo(),{sidebarConfig:a,submenuConfig:d}=(0,m.useContext)(dr),p=o?a.drawerWidthOpen:a.drawerWidthClosed,v=mi({left:p,submenuConfig:d}),{isHoveredOn:j}=(0,m.useContext)(Xr),[Z,H]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{H(j)},[j]),(0,r.jsxs)(je.Z,{className:Y()(v.drawer,{[v.drawerOpen]:Z}),children:[(0,r.jsx)(S.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var ca=n(26739),fo=n(76600),yi=n(83543),da=n(59797),Ss=n(98989);const xi=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ua=()=>{const e=xi();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 ha=null;const bi=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),pa=()=>{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 fa=null,Qn,Vo;const Si=e=>(0,l.Z)(o=>{var a,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Qn=(a=o.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&Qn!==void 0?Qn:"#404040"}},highlighted:{background:(Vo=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Vo!==void 0?Vo:"#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 go(e){return(0,m.useMemo)(()=>Si(e),[e])()}const Cs=(e,o)=>(0,F.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:j})=>d=d||bs(o,(0,Zo.i3)(j)));return}p&&(d=bs(o,(0,Zo.i3)(p)))}}),d},[o.pathname]);function ws(e){return e.to===void 0}const Ci=m.createElement(vi).type,wi=m.forwardRef(function({to:o,end:a,style:d,className:p,activeStyle:v,caseSensitive:j,activeClassName:Z="active","aria-current":H="page",...N},ue){let{pathname:ie}=(0,ee.TH)(),{pathname:ye}=(0,ee.WU)(o);j||(ie=ie.toLocaleLowerCase("en-US"),ye=ye.toLocaleLowerCase("en-US"));let Le=ie===ye;!Le&&!a&&(Le=ie.startsWith(`${ye}/`));const Me=Le?H:void 0;return(0,r.jsx)(X.rU,{...N,to:o,ref:ue,"aria-current":Me,style:{...d,...Le?v:void 0},className:Y()([p,Le?Z:void 0])})}),js=(0,m.forwardRef)((e,o)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:Z,children:H,className:N,...ue}=e,{sidebarConfig:ie}=(0,m.useContext)(dr),ye=go(ie),{isOpen:Le}=Uo(),Me=!Le&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Je=(0,r.jsxs)(je.Z,{style:Me,children:[(0,r.jsx)(a,{fontSize:"small"}),!Le&&v?(0,r.jsx)(Ss.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Ot=(0,r.jsx)(ca.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:Y()({[ye.closedItemIcon]:!Le}),children:Je}),Yt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{"data-testid":"login-button",className:ye.iconContainer,children:Ot}),d&&(0,r.jsx)(S.Z,{variant:"subtitle2",className:ye.label,children:d}),(0,r.jsx)("div",{className:ye.secondaryAction,children:H})]}),nn=Le?Yt:Ot,rn={onClick:Z,className:Y()(N,ye.root,Le?ye.open:ye.closed,ws(e)&&ye.buttonItem,{[ye.highlightable]:!j})};return ws(e)?(0,r.jsx)(V.Z,{role:"button","aria-label":d,...rn,ref:o,children:nn}):(0,r.jsx)(wi,{...rn,activeClassName:ye.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...ue,children:nn})}),ga=({children:e,...o})=>{const{sidebarConfig:a}=(0,m.useContext)(dr),d=go(a),[p,v]=(0,m.useState)(!1),j=(0,ee.TH)(),Z=Cs(e,j),H=(0,Ne.Z)(ye=>ye.breakpoints.down("sm")),N=()=>{v(!0)},ue=()=>{v(!1)},ie=()=>H?p?(0,r.jsx)(da.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(yi.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(Ss.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(Xr.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ue,onTouchStart:p?ue:N,onMouseEnter:N,className:Y()(p&&d.highlighted),children:[(0,r.jsx)(js,{hasSubmenu:!0,className:Z?d.selected:"",...o,children:ie()}),p&&e]})})},Es=(0,m.forwardRef)((e,o)=>{const[a]=(0,F.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Ci));return a?(0,r.jsx)(ga,{...e,children:a}):(0,r.jsx)(js,{...e,ref:o})});function i(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[a,d]=useState(""),p=go(o),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(a),d("")},Z=ie=>{ie.key==="Enter"&&(ie.preventDefault(),j())},H=ie=>{d(ie.target.value)},N=ie=>{ie.preventDefault(),ie.stopPropagation()},ue=ie=>{j(),ie.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(Es,{icon:v,to:e.to,onClick:ue,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:H,onKeyDown:Z,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const t=(0,fo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),s=(0,fo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),c=(0,fo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),f=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),I=(0,fo.Z)("div")(({theme:e})=>{const o=f(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),k=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=go(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.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,{})})})},z=(0,l.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function te(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),a=z({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 Ze=e=>{const{text:o,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(te,{text:o,onClose:v})})},Ae=null,tt="And your recently viewed plugins will pop up here!";function ft(e){const{isOpen:o}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},Z=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},H=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ze,{text:Ae,onDismiss:Z}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ze,{text:tt,onDismiss:H})]}):null}const bt=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function St(e){const{className:o,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:j}=di(),Z=bt();return(0,r.jsx)("article",{ref:j,tabIndex:-1,...v,className:Y()(Z.root,o,{[Z.stretch]:a,[Z.noPadding]:d}),children:p})}var Ut=n(6487),Mt=n(99152);const Un=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function tr(e){const{tabs:o,onChange:a,selectedIndex:d}=e,[p,v]=(0,m.useState)(d!=null?d:0),j=Un(),Z=(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)(je.Z,{className:j.tabsWrapper,children:(0,r.jsx)(Mt.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:Z,value:p,children:o.map((H,N)=>(0,m.createElement)(Ut.Z,{...H.tabProps,"data-testid":`header-tab-${N}`,label:H.label,key:H.id,value:N,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function ur(e){const o=(0,ee.UO)(),d=e.map(({path:ye,children:Le})=>({caseSensitive:!1,path:`${ye}/*`,element:Le})).sort((ye,Le)=>Le.path.replace(/\/\*$/,"").localeCompare(ye.path.replace(/\/\*$/,"")));var p;const v=(p=(0,ee.V$)(d))!==null&&p!==void 0?p:e[0].children;var j;let Z=(j=o["*"])!==null&&j!==void 0?j:"";Z.startsWith("/")||(Z=`/${Z}`);var H;const[N]=(H=(0,Zo.fp)(d,Z))!==null&&H!==void 0?H:[],ue=N?e.findIndex(ye=>`${ye.path}/*`===N.route.path):0;var ie;return{index:ue===-1?0:ue,element:v,route:(ie=e[ue])!==null&&ie!==void 0?ie:e[0]}}function eo(e){const{routes:o}=e,a=(0,ee.s0)(),{index:d,route:p,element:v}=ur(o),j=(0,m.useMemo)(()=>o.map(H=>({id:H.path,label:H.title,tabProps:H.tabProps})),[o]),Z=H=>{let{path:N}=o[H];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tr,{tabs:j,selectedIndex:d,onChange:Z}),(0,r.jsxs)(St,{children:[(0,r.jsx)($o.q,{title:p.title}),v]})]})}const Ho=()=>null;(0,F.R5)(Ho,"core.gatherMountPoints",!0);function As(e){const o=(0,r.jsx)(Ho,{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 As(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:j}=a.props;return[{path:d,title:p,children:v,tabProps:j}]})}function Go(e){const o=As(e.children);return(0,r.jsx)(eo,{routes:o})}Go.Route=Ho;const ji=(0,l.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Fr(e){const{value:o,subvalue:a}=e,d=ji();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{className:d.value,children:o}),(0,r.jsx)(je.Z,{className:d.subvalue,children:a})]})}var Ts=n(67222),Oa=n(21070),Ba=n(90324),$a=n(98281),Za=n(48049),ma=n(51209),va=n(33375),Da=n(44233),Na=n(27604),Ei=n(36444),Fa=n(37971),Ua=n(59709),Ma=n(17373),za=n(3702),Wa=n(93111);const Va=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ha=e=>{var o;const a=Va(),{onChangeFilters:d}=e,[p,v]=(0,m.useState)({...e.selectedFilters}),[j,Z]=(0,m.useState)(!1),H=()=>{v({}),Z(N=>!N)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(je.Z,{className:a.root,children:[(0,r.jsxs)(je.Z,{className:a.header,children:[(0,r.jsx)(je.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(V.Z,{color:"primary",onClick:H,children:"Clear all"})]}),(0,r.jsx)(je.Z,{className:a.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(N=>(0,r.jsx)(An,{triggerReset:j,...N.element,selected:p[N.element.label],onChange:ue=>v({...p,[N.element.label]:ue})},N.element.label))})]})},ya={Add:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Oa.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)(va.Z,{...e,ref:o})),Delete:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Da.Z,{...e,ref:o})),DetailPanel:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ma.Z,{...e,ref:o})),Edit:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Na.Z,{...e,ref:o})),Export:(0,m.forwardRef)((e,o)=>(0,r.jsx)(za.Z,{...e,ref:o})),Filter:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ei.Z,{...e,ref:o})),FirstPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Fa.Z,{...e,ref:o})),LastPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ua.Z,{...e,ref:o})),NextPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(ma.Z,{...e,ref:o})),PreviousPage:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Za.Z,{...e,ref:o})),ResetSearch:(0,m.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),Search:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Ei.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)(Ma.Z,{...e,ref:o})),ViewColumn:(0,m.forwardRef)((e,o)=>(0,r.jsx)(Wa.Z,{...e,ref:o}))};function xa(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 Ga=(0,Ln.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Ts.W$),ba=(0,Ln.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Ts.UW),Ka=(0,l.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ya=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ja(e,o){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=o.palette.textContrast,typeof p=="object")p.fontWeight=o.typography.fontWeightBold;else{const v=p;p=(j,Z,H)=>({...v(j,Z,H),fontWeight:o.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function Qa(e,o){return(0,ce.transform)(e,(a,d,p)=>{(0,ce.isEqual)(d,o[p])||(a[p]=d)})}const Sa={search:"",filtersOpen:!1,filters:{}};function Xa(e){const{toolbarRef:o,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,j=Ka(),Z=(0,m.useCallback)(H=>{e.onSearchChanged(H),a(H)},[e,a]);return d?(0,r.jsxs)(je.Z,{className:j.root,children:[(0,r.jsxs)(je.Z,{className:j.root,children:[(0,r.jsx)(Tt.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(Ei.Z,{})}),(0,r.jsxs)(S.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(ba,{...e,ref:o,onSearchChanged:Z})]}):(0,r.jsx)(ba,{...e,ref:o,onSearchChanged:Z})}function Ca(e){const{data:o,columns:a,options:d,title:p,subtitle:v,filters:j,initialState:Z,emptyContent:H,onStateChange:N,components:ue,...ie}=e,ye=Ya(),Le=(0,At.Z)(),Me={...Sa,...Z},[Je,Ot]=(0,m.useState)(Me.filtersOpen),Yt=(0,m.useCallback)(()=>Ot(Mn=>!Mn),[Ot]),[nn,rn]=(0,m.useState)(0),[Bt,_t]=(0,m.useState)(o),[Jt,Cr]=(0,m.useState)(Me.filters),wr=Ja(a,Le),[jr,Er]=(0,m.useState)(Me.search);(0,m.useEffect)(()=>{if(N){const Mn=Qa({search:jr,filtersOpen:Je,filters:Jt},Sa);N(Mn)}},[jr,Je,Jt,N]);const Li={headerStyle:{textTransform:"uppercase"}},Ur=(0,m.useCallback)(Mn=>{var vr;return(vr=a.find(to=>to.title===Mn))===null||vr===void 0?void 0:vr.field},[a]);(0,m.useEffect)(()=>{if(typeof o=="function")return;if(!Jt){_t(o);return}const Mn=Object.values(Jt);if(o&&Mn.flat().length){const vr=o.filter(to=>!!Object.entries(Jt).filter(([,no])=>!!no.length).every(([no,hn])=>{const bn=xa(to,Ur(no));return Array.isArray(bn)&&Array.isArray(hn)?bn.some(vo=>hn.includes(vo)):Array.isArray(bn)?bn.includes(hn):Array.isArray(hn)?hn.includes(bn):bn===hn}));_t(vr)}else _t(o);rn(Mn.flat().length)},[o,Jt,Ur]);const Pi=(Mn,vr)=>{const to=hn=>{const bn=new Set,vo=ro=>{ro!=null&&bn.add(ro)};return vr&&vr.forEach(ro=>{const Yo=xa(ro,Ur(hn));Array.isArray(Yo)?Yo.forEach(vo):vo(Yo)}),bn},no=hn=>({placeholder:"All results",label:hn.column,multiple:hn.type==="multiple-select",items:[...to(hn.column)].sort().map(bn=>({label:bn,value:bn}))});return Mn.map(hn=>({type:hn.type,element:no(hn)}))},Qt=!!(j!=null&&j.length),mo=(0,m.useCallback)(Mn=>(0,r.jsx)(Xa,{setSearch:Er,hasFilters:Qt,selectedFiltersLength:nn,toggleFilters:Yt,...Mn}),[Yt,Qt,nn,Er]),Rs=typeof o!="function"&&o.length===0,Mr=a.length,ki=(0,m.useCallback)(Mn=>H&&Rs?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Mr,children:H})})}):(0,r.jsx)(Ts.os,{...Mn}),[Rs,H,Mr]);return(0,r.jsxs)(je.Z,{className:ye.root,children:[Je&&o&&typeof o!="function"&&(j==null?void 0:j.length)&&(0,r.jsx)(Ha,{filters:Pi(j,o),selectedFilters:Jt,onChangeFilters:Cr}),(0,r.jsx)(Ts.ZP,{components:{Header:Ga,Toolbar:mo,Body:ki,...ue},options:{...Li,...d},columns:wr,icons:ya,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(S.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Bt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...ie})]})}Ca.icons=Object.freeze(ya);const Xl=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})})},qa=(0,l.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:o=>o.isNext?"auto":"0",marginRight:o=>o.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),ql=e=>{const o=qa(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})},_a=(e,o)=>o?e?"20px":"0":"40px",el=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:o=>_a(o.isFirstNav,o.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),_l=e=>{const o=el(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:o,disableRipple:!0,...p})},tl=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),ec=e=>{const o=tl(e);return _jsx(Tabs,{classes:o,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},nl=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function tc(e){const{tabs:o}=e,a=nl(),[d,p]=useState([0,0]),[v,j]=useState(0),[Z,H]=useState(0),[N,ue]=useState([[]]),ie=useRef(),{width:ye}=useWindowSize(),Le=(nn,rn)=>{p([v,rn])},Me=()=>{j(v-1)},Je=()=>{j(v+1)},Ot=()=>v+1<N.length;useEffect(()=>{const rn=v===0?1:2,Bt=ie.current.offsetWidth-20-rn*30,_t=d[0]*Z+d[1],Jt=Math.floor(Bt/170);H(Jt),ue(chunkArray(o,Jt)),p([Math.floor(_t/Jt),_t%Jt])},[ye,o]);const Yt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:ie,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Yt,onChange:Le,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Me,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)),Ot()&&_jsx(StyledIcon,{isNext:!0,onClick:Je,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Yt!==!1?N[v].map((nn,rn)=>_jsx(TabPanel,{value:rn,index:Yt,children:nn.content},rn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var nc=n(44311);function rl(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 rc(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:rl(e.data,o)})]})}const ol=e=>(0,l.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),sl=({title:e="Unknown page",className:o})=>(0,r.jsx)(S.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function il(e){const{description:o,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,j=ol({textAlign:v})(),Z=d||(0,r.jsx)(sl,{title:a,className:j.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($o.q,{title:a}),(0,r.jsxs)(je.Z,{className:j.container,children:[(0,r.jsxs)(je.Z,{className:j.leftItemsBox,children:[Z,o&&(0,r.jsx)(S.Z,{className:j.description,variant:"body2",children:o})]}),(0,r.jsx)(je.Z,{className:j.rightItemsBox,children:p})]})]})}var al=n.p+"static/mic-drop.fe3ef4d0..svg";const ll=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),cl=()=>{const e=ll();return(0,r.jsx)("img",{src:al,className:e.micDrop,alt:"Girl dropping mic from her hands"})},dl=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function ul(e){const{status:o,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=dl(),j=(0,ee.s0)(),Z=fs();return(0,r.jsxs)(Ve.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Ve.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(S.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",a]}),(0,r.jsx)(S.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(S.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(S.Z,{variant:"h6",children:[(0,r.jsx)(Ue,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(Ue,{to:p||Z.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(cl,{})]})}var hl=n(16173);const pl=(0,Ln.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(S.Z),Ai=(0,Ln.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(je.Z);function fl(e){const{children:o,...a}=e,[d,p]=m.useState(null),v=m.Children.toArray(o),[j,Z,...H]=v,N=H.length?H.pop():v[v.length-1],ue=v.length>3,ie=Me=>{p(Me.currentTarget)},ye=()=>{p(null)},Le=Boolean(d);return(0,r.jsxs)(m.Fragment,{children:[(0,r.jsxs)(hl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(Ai,{clone:!0,children:j}),v.length>2&&(0,r.jsx)(Ai,{clone:!0,children:Z}),ue&&(0,r.jsx)(pl,{onClick:ie,children:"..."}),(0,r.jsx)(je.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(Ws.ZP,{open:Le,anchorEl:d,onClose:ye,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(yt.Z,{children:H.map((Me,Je)=>(0,r.jsx)(rt.Z,{button:!0,children:(0,r.jsx)(Ai,{clone:!0,children:Me})},Je))})})]})}const gl=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ml=({type:e,typeLink:o,classes:a,pageTitle:d})=>e?o?(0,r.jsxs)(fl,{className:a.breadcrumb,children:[(0,r.jsx)(Ue,{to:o,children:e}),(0,r.jsx)(S.Z,{children:d})]}):(0,r.jsx)(S.Z,{className:a.type,children:e}):null,vl=({pageTitle:e,classes:o,tooltip:a})=>{const d=(0,r.jsx)(S.Z,{className:o.title,variant:"h1",children:e});return a?(0,r.jsx)(Lt.ZP,{title:a,placement:"top-start",children:d}):d},yl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(S.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function wa(e){const{children:o,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:j,type:Z,typeLink:H}=e,N=gl(),ie=(0,F.h_)(F.Ds).getOptionalString("app.title")||"Backstage",ye=a||v,Le=v||a,Me=`${ye} | %s | ${ie}`,Je=`${ye} | ${ie}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($o.q,{titleTemplate:Me,defaultTitle:Je}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(je.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(ml,{classes:N,type:Z,typeLink:H,pageTitle:Le}),(0,r.jsx)(vl,{classes:N,pageTitle:Le,tooltip:j}),(0,r.jsx)(yl,{classes:N,subtitle:p})]}),(0,r.jsx)(Ve.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:o})]})]})}const xl=({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 oc(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((j,Z)=>_jsx(xl,{...j},`header-action-menu-${Z}`))})})]})}const bl=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Sl=({value:e,className:o})=>(0,r.jsx)(S.Z,{className:o,children:e});function Cl(e){const{label:o,value:a,url:d}=e,p=bl(),v=(0,r.jsx)(Sl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Ve.Z,{item:!0,children:(0,r.jsxs)(S.Z,{component:"span",className:p.root,children:[(0,r.jsx)(S.Z,{className:p.label,children:o}),d?(0,r.jsx)(Ue,{to:d,children:v}):v]})})}const wl=e=>(0,Xe.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),jl=(0,l.Z)(wl,{name:"BackstageItemCardHeader"});function El(e){const{title:o,subtitle:a,children:d}=e,p=jl(e);return(0,r.jsxs)(je.Z,{className:p.root,children:[a&&(0,r.jsx)(S.Z,{variant:"subtitle2",component:"h3",children:a}),o&&(0,r.jsx)(S.Z,{variant:"h6",component:"h4",children:o}),d]})}function sc(e){const{description:o,tags:a,title:d,type:p,subtitle:v,label:j,onClick:Z,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,ue)=>_jsx(Chip,{size:"small",label:N},ue))}):null,o]}),_jsxs(CardActions,{children:[!H&&_jsx(LinkButton,{to:"#",onClick:Z,color:"primary",children:j}),H&&_jsx(LinkButton,{to:H,color:"primary",children:j})]})]})}const Al=e=>(0,Xe.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),Tl=(0,l.Z)(Al,{name:"BackstageItemCardGrid"});function Il(e){const{children:o,...a}=e,d=Tl(a);return(0,r.jsx)(je.Z,{className:d.root,...a,children:o})}var Rl=n(41547);const Ll=(0,l.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 ja(e){const{themeId:o,children:a}=e,d=Ll();return(0,r.jsx)(Rl.Z,{theme:p=>({...p,page:p.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:a})})}function Pl(e){const{themeId:o,children:a,...d}=e;return(0,r.jsxs)(ja,{themeId:o,children:[(0,r.jsx)(wa,{...d}),a]})}var Xn=n(30195);const ic=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),Ea={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function kl(e){const o=new Date(Date.now()+Ea.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-Ea.tokenExpiryMarginMillis)}class ac{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:kl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:o},a}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(o){this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const lc=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},Ol=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ti=({children:e})=>{const o=Ol();return(0,r.jsx)(Ve.Z,{component:"li",item:!0,classes:o,children:e})};class Ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const 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 Ri{getUserId(){return this.result.userId}static fromResult(o){return new Ri(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){this.result=o}}class Ko{static createGuest(){return new Ii}static fromLegacy(o){return Ri.fromResult(o)}static create(o){return new Ko(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!a)throw new TypeError(`Invalid user entity reference "${o}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,a,d){this.identity=o,this.authApi=a,this.profile=d}}const $l={Component:({config:e,onSignInSuccess:o})=>{const{apiRef:a,title:d,message:p}=e,v=(0,F.h_)(a),j=(0,F.h_)(F.VE),Z=async()=>{try{const H=await v.getBackstageIdentity({instantPopup:!0});if(!H)throw new Error(`The ${d} provider is not configured to support sign-in`);const N=await v.getProfile();o(Ko.create({identity:H.identity,profile:N,authApi:v}))}catch(H){j.post(new wo.SP("Login failed",H))}};return(0,r.jsx)(Ti,{children:(0,r.jsx)(Or,{variant:"fullHeight",title:d,actions:(0,r.jsx)(V.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,r.jsx)(S.Z,{variant:"body1",children:p})})})},loader:async(e,o)=>{const a=e.get(o),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Ko.create({identity:d.identity,profile:p,authApi:a})}},Zl={Component:({onSignInSuccess:e})=>(0,r.jsx)(Ti,{children:(0,r.jsx)(Or,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(V.Z,{color:"primary",variant:"outlined",onClick:()=>e(new Ii),children:"Enter"}),children:(0,r.jsxs)(S.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 Dl=n(63955),Aa=n(86619),Ta=n(74828),Nl=n(45455),Fl=n.n(Nl);const Ul=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ml=(0,l.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}},zl={Component:({onSignInSuccess:e})=>{const o=Ml(),{register:a,handleSubmit:d,formState:p}=(0,Dl.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:Z,idToken:H})=>{e(Ko.fromLegacy({userId:Z,getIdToken:H!==void 0?async()=>H:void 0,profile:{email:`${Z}@example.com`}}))};return(0,r.jsx)(Ti,{children:(0,r.jsxs)(Or,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(S.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:o.form,onSubmit:d(j),children:[(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Aa.Z,{...Ia(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,r.jsx)(Ta.Z,{error:!0,children:v.userId.message})]}),(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Aa.Z,{...Ia(a("idToken",{required:!1,validate:Z=>!Z||Ul.test(Z)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,r.jsx)(Ta.Z,{error:!0,children:v.idToken.message})]}),(0,r.jsx)(V.Z,{type:"submit",color:"primary",variant:"outlined",className:o.button,disabled:!(p!=null&&p.isDirty)||!Fl()(v),children:"Continue"})]})]})})},loader:async()=>{}},Is="@backstage/core:SignInPage:provider",Ra={guest:Zl,custom:zl,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 gc(e){return e.reduce((a,d)=>{if(typeof d=="string")return La(d,a),a[d]={components:Ra[d],id:d},a;const{id:p}=d;return La(p,a),a[p]={components:Ra.common,id:p,config:d},a},{})}const mc=(e,o)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),j=useCallback(H=>{o(IdentityApiSignOutProxy.from({identityApi:H,signOut:async()=>{var N;localStorage.removeItem(Is),await((N=H.signOut)===null||N===void 0?void 0:N.call(H))}}))},[o]);useLayoutEffect(()=>{var H;if(!p)return;const N=localStorage.getItem(Is);if(N===null){v(!1);return}const ue=e[N];if(!ue){v(!1);return}let ie=!1;return ue.components.loader(d,(H=ue.config)===null||H===void 0?void 0:H.apiRef).then(ye=>{ie||(ye?j(ye):v(!1))}).catch(ye=>{ie||(localStorage.removeItem(Is),a.post(ye),v(!1))}),()=>{ie=!0}},[p,a,o,d,e,j]);const Z=useMemo(()=>Object.keys(e).map(H=>{const N=e[H],{Component:ue}=N.components,ie=ye=>{localStorage.setItem(Is,N.id),j(ye)};return _jsx(ue,{config:N.config,onSignInSuccess:ie},N.id)}),[e,j]);return[p,Z]},Wl=({onSignInSuccess:e,providers:o=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(o),[Z,H]=useSignInProviders(j,e);return Z?_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})]})]})},Vl=({provider:e,auto:o,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,Z]=useState(),[H,N]=useState(!1),ue=async({checkExisting:ie,showPopup:ye})=>{try{let Le;if(ie&&(Le=await p.getBackstageIdentity({optional:!0})),!Le&&(ye||o)&&(N(!0),Le=await p.getBackstageIdentity({instantPopup:!0}),!Le))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Le){N(!0);return}const Me=await p.getProfile();a(UserIdentity.create({identity:Le.identity,authApi:p,profile:Me}))}catch(Le){Z(Le),N(!0)}};return useMountEffect(()=>ue({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:()=>{ue({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function vc(e){return"provider"in e?_jsx(Vl,{...e}):_jsx(Wl,{...e})}const Hl=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Gl=(0,Ln.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Io.Z);function yc(e){const{slackChannel:o,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:j,onChange:Z}=e,H=Hl(),[N,ue]=useState(0),ie=Z||((Me,Je)=>ue(Je));let ye;j?React.Children.map(d,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===j){var Je;ye=Me==null||(Je=Me.props)===null||Je===void 0?void 0:Je.children}}):React.Children.map(d,(Me,Je)=>{React.isValidElement(Me)&&Je===N&&(ye=Me==null?void 0:Me.props.children)});const Le=a||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[p&&_jsx(Gl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:H,value:j||N,onChange:ie,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ye}),v&&_jsx(BottomLink,{...v})]})})}const Kl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function xc(e){const{children:o,...a}=e,d=Kl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},60871:function(Ct,Be,n){"use strict";n.d(Be,{fC:function(){return y},CL:function(){return st},sM:function(){return Y},$v:function(){return qe},v_:function(){return Qe},hg:function(){return it},uB:function(){return Te},R5:function(){return Ne},bq:function(){return T},Km:function(){return ne},Ds:function(){return Ue},ni:function(){return B},T0:function(){return S},CO:function(){return Bn},x8:function(){return Cn},rx:function(){return Gn},YO:function(){return wn},P4:function(){return lt},NT:function(){return vt},NW:function(){return Et},VE:function(){return He},W0:function(){return je},gP:function(){return At},IY:function(){return nt},F4:function(){return ee},ux:function(){return w},Kp:function(){return ce},$4:function(){return wt},p_:function(){return O},ZM:function(){return gt},D:function(){return X},gW:function(){return $},E6:function(){return xt},z$:function(){return ze},h_:function(){return xe},I_:function(){return M},qD:function(){return Ie},vJ:function(){return Wn},tg:function(){return ln},Oi:function(){return qn}});var h=n(52322),r=n(51837),F=n(2784);const P=(0,r.CT)("analytics-context"),m=()=>{const ve=(0,F.useContext)(P);if(ve===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const re=ve.atVersion(1);if(re===void 0)throw new Error("No context found for version 1.");return re},y=ve=>{const{attributes:re,children:Oe}=ve,Ge={...m(),...re},pt=(0,r.EI)({1:Ge});return(0,h.jsx)(P.Provider,{value:pt,children:Oe})};function l(ve,re){const Oe=Pe=>_jsx(y,{attributes:re,children:_jsx(ve,{...Pe})});return Oe.displayName=`WithAnalyticsContext(${ve.displayName||ve.name||"Component"})`,Oe}function M(){const ve=(0,r.Vt)("api-context");if(!ve)throw new Error("API context is not available");const re=ve.atVersion(1);if(!re)throw new Error("ApiContext v1 not available");return re}function xe(ve){const Oe=M().get(ve);if(!Oe)throw new Error(`No implementation available for ${ve}`);return Oe}function V(ve){return function(Oe){const Pe=pt=>{const Ht=M(),Rt={};for(const de in ve)if(ve.hasOwnProperty(de)){const U=ve[de],he=Ht.get(U);if(!he)throw new Error(`No implementation available for ${U}`);Rt[de]=he}return _jsx(Oe,{...pt,...Rt})},Ge=Oe.displayName||Oe.name||"Component";return Pe.displayName=`withApis(${Ge})`,Pe}}class K{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(re){if(this.config=re,!re.id.split(".").flatMap(Pe=>Pe.split("-")).every(Pe=>Pe.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${re.id}'`)}}function S(ve){return new K(ve)}function B(ve,re){return"id"in ve?{api:ve,deps:{},factory:()=>re}:ve}var Y;(function(ve){ve.SignedIn="SignedIn",ve.SignedOut="SignedOut"})(Y||(Y={}));const ce=S({id:"core.auth.google"}),ee=S({id:"core.auth.github"}),X=S({id:"core.auth.okta"}),w=S({id:"core.auth.gitlab"}),O=S({id:"core.auth.microsoft"}),$=S({id:"core.auth.onelogin"}),T=S({id:"core.auth.bitbucket"}),ne=S({id:"core.auth.bitbucket-server"}),Te=S({id:"core.auth.atlassian"}),qe=S({id:"core.alert"}),Qe=S({id:"core.analytics"}),it=S({id:"core.apptheme"}),Ue=S({id:"core.config"}),Et=S({id:"core.discovery"}),He=S({id:"core.error"});var st;(function(ve){ve[ve.None=0]="None",ve[ve.Active=1]="Active"})(st||(st={}));const je=S({id:"core.featureflags"}),At=S({id:"core.fetch"}),wt=S({id:"core.identity"}),gt=S({id:"core.oauthrequest"}),xt=S({id:"core.storage"});class Tt{setContext(re){this.context=re}captureEvent(re,Oe,{value:Pe,attributes:Ge}={}){try{this.analyticsApi.captureEvent({action:re,subject:Oe,value:Pe,attributes:Ge,context:this.context})}catch(pt){console.warn("Error during analytics event capture. %o",pt)}}constructor(re,Oe={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=re,this.context=Oe}}function Lt(){try{return xe(Qe)}catch{return{captureEvent:()=>{}}}}function ze(){const ve=(0,F.useRef)(null),re=m(),Oe=Lt();function Pe(){return ve.current===null&&(ve.current=new Tt(Oe)),ve.current}const Ge=Pe();return Ge.setContext(re),Ge}const Ie=()=>{const ve=(0,r.Vt)("app-context");if(!ve)throw new Error("App context is not available");const re=ve.atVersion(1);if(!re)throw new Error("AppContext v1 not available");return re},we=(0,r.uW)("component-data-store",()=>new WeakMap),Ee="__backstage_data";function Ne(ve,re,Oe){const Pe=ve;var Ge;let pt=(Ge=Pe[Ee])!==null&&Ge!==void 0?Ge:we.get(ve);if(pt||(pt={map:new Map},Object.defineProperty(Pe,Ee,{enumerable:!1,configurable:!0,writable:!1,value:pt}),we.set(ve,pt)),pt.map.has(re)){const Ht=ve.displayName||ve.name;throw new Error(`Attempted to attach duplicate data "${re}" to component "${Ht}"`)}pt.map.set(re,Oe)}function nt(ve,re){if(!ve)return;const Oe=ve.type;if(!Oe)return;var Pe;const Ge=(Pe=Oe[Ee])!==null&&Pe!==void 0?Pe:we.get(Oe);if(Ge)return Ge.map.get(re)}const zt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let ht=zt;class Nt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(re,Oe){this.id=re,this.params=Oe,this[ht]="absolute"}}function vt(ve){var re;return new Nt(ve.id,(re=ve.params)!==null&&re!==void 0?re:[])}const jt=/^\w+$/;let en=null;class on{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(re,Oe,Pe,Ge){this.id=re,this.path=Oe,this.parent=Pe,this.params=Ge,this[en]="sub"}}function Sn(ve){const{id:re,path:Oe,parent:Pe}=ve,Ge=Oe.split("/").filter(Rt=>Rt.startsWith(":")).map(Rt=>Rt.substring(1)),pt=[...Pe.params,...Ge];if(Pe.params.some(Rt=>Ge.includes(Rt)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Oe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Oe}'`);if(Oe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Oe}'`);for(const Rt of Ge)if(!jt.test(Rt))throw new Error(`SubRouteRef path has invalid param, got '${Rt}'`);return new on(re,Oe,Pe,pt)}let Pt=zt;class an{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(re,Oe,Pe){this.id=re,this.params=Oe,this.optional=Pe,this[Pt]="external"}}function Cn(ve){var re;return new an(ve.id,(re=ve.params)!==null&&re!==void 0?re:[],Boolean(ve.optional))}var Tn=n(79635);function ln(ve){const{pathname:re}=(0,Tn.TH)(),Oe=(0,r.Vt)("routing-context");if(!Oe)throw new Error("Routing context is not available");const Pe=Oe.atVersion(1),Ge=(0,F.useMemo)(()=>Pe&&Pe.resolve(ve,{pathname:re}),[Pe,ve,re]);if(!Oe)throw new Error("useRouteRef used outside of routing context");if(!Pe)throw new Error("RoutingContext v1 not available");const pt="optional"in ve&&ve.optional;if(!Ge&&!pt)throw new Error(`No path for ${ve}`);return Ge}function qn(ve){return(0,Tn.UO)()}class On extends F.Component{static getDerivedStateFromError(re){return{error:re}}render(){const{error:re}=this.state,{app:Oe,plugin:Pe}=this.props,{ErrorBoundaryFallback:Ge}=Oe.getComponents();return re?(0,h.jsx)(Ge,{error:re,resetError:this.handleErrorReset,plugin:Pe}):this.props.children}constructor(...re){super(...re),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}var _n=n(64355);function lt(ve){const{component:re,mountPoint:Oe,name:Pe}=ve;return wn({component:{lazy:()=>re().then(Ge=>{const pt=Rt=>{try{ln(Oe)}catch(de){if(typeof de=="object"&&de!==null){const{message:U}=de;if(typeof U=="string"&&U.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Oe} 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 de}return(0,h.jsx)(Ge,{...Rt})},Ht=Pe||Ge.displayName||Ge.name||"LazyComponent";return pt.displayName=`RoutableExtension(${Ht})`,pt},Ge=>Ht=>{const Rt=Ie(),{BootErrorPage:de}=Rt.getComponents();return(0,h.jsx)(de,{step:"load-chunk",error:Ge})})},data:{"core.mountPoint":Oe},name:Pe})}function Bn(ve){const{component:re,name:Oe}=ve;return wn({component:re,name:Oe})}function wn(ve){const{data:re={},name:Oe}=ve;Oe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Pe;if("lazy"in ve.component){const pt=ve.component.lazy;Pe=(0,F.lazy)(()=>pt().then(Ht=>({default:Ht})))}else Pe=ve.component.sync;const Ge=Oe||Pe.displayName||Pe.name||"Component";return{expose(pt){const Ht=Rt=>{const de=Ie(),{Progress:U}=de.getComponents(),he=re==null?void 0:re["core.mountPoint"];return(0,h.jsx)(F.Suspense,{fallback:(0,h.jsx)(U,{}),children:(0,h.jsx)(On,{app:de,plugin:pt,children:(0,h.jsx)(y,{attributes:{pluginId:pt.getId(),...Oe&&{extension:Oe},...he&&{routeRef:he.id}},children:(0,h.jsx)(_n.o,{plugin:pt,children:(0,h.jsx)(Pe,{...Rt})})})})})};Ne(Ht,"core.plugin",pt);for(const[Rt,de]of Object.entries(re))Ne(Ht,Rt,de);return Ht.displayName=`Extension(${Ge})`,Ht}}}function cn(ve,re,Oe,Pe){return F.Children.toArray(ve).flatMap(Ge=>{if(!(0,F.isValidElement)(Ge))return[];if(Ge.type===F.Fragment)return cn(Ge.props.children,re,Oe,Pe);if(nt(Ge,"core.featureFlagged")){const pt=Ge.props;return("with"in pt?re.isActive(pt.with):!re.isActive(pt.without))?cn(Ge.props.children,re,Oe,Pe):[]}if(Oe===void 0||Oe(Ge))return[Ge];if(Pe)throw new Error(Pe);return cn(Ge.props.children,re,Oe,Pe)})}class $n{selectByComponentData(re){const Oe=cn(this.node,this.featureFlagsApi,Pe=>nt(Pe,re.key)!==void 0,re.withStrictError);return new $n(Oe,this.featureFlagsApi)}findComponentData(re){return cn(this.node,this.featureFlagsApi,Pe=>nt(Pe,re.key)!==void 0).map(Pe=>nt(Pe,re.key)).filter(Pe=>Pe!==void 0)}getElements(){return cn(this.node,this.featureFlagsApi)}constructor(re,Oe){this.node=re,this.featureFlagsApi=Oe}}function Wn(ve,re,Oe=[]){const Pe=xe(je),Ge=new $n(ve,Pe);return(0,F.useMemo)(()=>re(Ge),[ve,...Oe])}class jn{getId(){return this.config.id}getApis(){var re;return(re=this.config.apis)!==null&&re!==void 0?re:[]}getFeatureFlags(){var re,Oe;return(Oe=(re=this.config.featureFlags)===null||re===void 0?void 0:re.slice())!==null&&Oe!==void 0?Oe:[]}get routes(){var re;return(re=this.config.routes)!==null&&re!==void 0?re:{}}get externalRoutes(){var re;return(re=this.config.externalRoutes)!==null&&re!==void 0?re:{}}provide(re){return re.expose(this)}__experimentalReconfigure(re){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(re))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var re;return(re=this.options)!==null&&re!==void 0?re:{}}toString(){return`plugin{${this.config.id}}`}constructor(re){this.config=re,this.options=void 0}}function Gn(ve){return new jn(ve)}},64355:function(Ct,Be,n){"use strict";n.d(Be,{o:function(){return m},y:function(){return y}});var h=n(52322),r=n(51837),F=n(2784);const P="plugin-context",m=l=>{const{children:M,plugin:xe}=l,{Provider:V}=(0,r.CT)(P);return(0,h.jsx)(V,{value:(0,r.EI)({1:{plugin:xe}}),children:M})};function y(){const l=(0,r.Vt)(P);if(!l)throw new Error("Plugin Options context is not available");const M=l.atVersion(1);if(!M)throw new Error("Plugin Options v1 is not available");return M.plugin.getPluginOptions()}},23054:function(Ct,Be,n){"use strict";n.d(Be,{SP:function(){return ce},dR:function(){return K},VL:function(){return X},BD:function(){return r}});function h(w){if(typeof w!="object"||w===null||Array.isArray(w))return!1;const O=w;return!(typeof O.name!="string"||O.name===""||typeof O.message!="string")}function r(w){if(typeof w!="object"||w===null||Array.isArray(w))throw new Error(`Encountered invalid error, not an object, got '${w}'`);const O=w;if(typeof O.name!="string"||O.name==="")throw new Error(`Encountered error object without a name, got '${w}'`);if(typeof O.message!="string")throw new Error(`Encountered error object without a message, got '${w}'`)}var F=n(24852);function P(w,O){const T={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(w)};return O!=null&&O.includeStack||delete T.stack,T}function m(w){const O=(0,F.deserializeError)(w);return w.stack||(O.stack=void 0),O}function y(w){if(h(w)){const O=String(w);return O!=="[object Object]"?O:`${w.name}: ${w.message}`}return`unknown error '${w}'`}class l extends Error{constructor(O,$){var T;let ne=O;if($!==void 0){const Te=y($);ne?ne+=`; caused by ${Te}`:ne=`caused by ${Te}`}super(ne),(T=Error.captureStackTrace)===null||T===void 0||T.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class M extends null{}class xe extends null{}class V extends null{}class K extends l{}class S extends null{}class B extends null{}class Y extends null{}class ce extends l{constructor(O,$){super(O,$),this.name=h($)?$.name:"Error"}}async function ee(w){try{const $=await w.text();if($){var O;if(!((O=w.headers.get("content-type"))===null||O===void 0)&&O.startsWith("application/json"))try{const T=JSON.parse($);if(T.error&&T.response)return T}catch{}return{error:{name:"Error",message:`Request failed with status ${w.status} ${w.statusText}, ${$}`},response:{statusCode:w.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${w.status} ${w.statusText}`},response:{statusCode:w.status}}}class X extends Error{static async fromResponse(O){const $=await ee(O),T=$.response.statusCode||O.status,ne=$.error.name||O.statusText,Te=`Request failed with ${T} ${ne}`,qe=m($.error);return new X({message:Te,response:O,data:$,cause:qe})}constructor(O){super(O.message),this.name="ResponseError",this.response=O.response,this.body=O.data,this.cause=O.cause}}},32838:function(Ct,Be,n){"use strict";n.d(Be,{nW:function(){return ee},ae:function(){return K},q3:function(){return S}});var h=n(60871);const r=(0,h.T0)({id:"core.scmauth"});var F=new WeakMap;class P{async getCredentials(w){const O=new URL(w.url),$=_class_private_field_get(this,F).find(T=>T.isUrlSupported(O));if(!$)throw new Error(`No auth provider available for '${w.url}', see https://backstage.io/link?scm-auth`);return $.getCredentials(w)}constructor(w){_class_private_field_init(this,F,{writable:!0,value:void 0}),_class_private_field_set(this,F,w)}}var m=new WeakMap,y=new WeakMap,l=new WeakMap,M=new WeakMap;class xe{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:w,gitlab:O,azure:$,bitbucket:T})=>xe.merge(xe.forGithub(w),xe.forGitlab(O),xe.forAzure($),xe.forBitbucket(T))})}static forAuthApi(w,O){return new xe("generic",w,O.host,O.scopeMapping)}static forGithub(w,O){var $;const T=($=O==null?void 0:O.host)!==null&&$!==void 0?$:"github.com";return new xe("github",w,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(w,O){var $;const T=($=O==null?void 0:O.host)!==null&&$!==void 0?$:"gitlab.com";return new xe("gitlab",w,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(w,O){var $;const T=($=O==null?void 0:O.host)!==null&&$!==void 0?$:"dev.azure.com";return new xe("azure",w,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(w,O){var $;const T=($=O==null?void 0:O.host)!==null&&$!==void 0?$:"bitbucket.org";return new xe("bitbucket",w,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...w){return new P(w)}isUrlSupported(w){return w.host===_class_private_field_get(this,y)}getAdditionalScopesForProvider(w){var O;if(!(w!=null&&w.customScopes)||_class_private_field_get(this,M)==="generic")return[];var $;return($=(O=w.customScopes)===null||O===void 0?void 0:O[_class_private_field_get(this,M)])!==null&&$!==void 0?$:[]}async getCredentials(w){const{url:O,additionalScope:$,...T}=w,ne=_class_private_field_get(this,l).default.slice();$!=null&&$.repoWrite&&ne.push(..._class_private_field_get(this,l).repoWrite);const Te=this.getAdditionalScopesForProvider($);Te.length&&ne.push(...Te);const qe=[...new Set(ne)],Qe=await _class_private_field_get(this,m).getAccessToken(qe,T);return{token:Qe,headers:{Authorization:`Bearer ${Qe}`}}}constructor(w,O,$,T){_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,l,{writable:!0,value:void 0}),_class_private_field_init(this,M,{writable:!0,value:void 0}),_class_private_field_set(this,m,O),_class_private_field_set(this,y,$),_class_private_field_set(this,l,T),_class_private_field_set(this,M,w)}}var V=n(79158);class K{static fromConfig(w){return V.Lx.fromConfig(w)}}const S=(0,h.T0)({id:"integration.scmintegrations"});var B=n(52322),Y=n(73250),ce=n(2784);const ee=X=>{const{type:w}=X,O=(0,h.qD)(),$=Y.Z;var T;const ne=w&&(T=O.getSystemIcon(w))!==null&&T!==void 0?T:$;return(0,B.jsx)(ne,{})}},79158:function(Ct,Be,n){"use strict";n.d(Be,{Lx:function(){return xn},BT:function(){return _e}});var h=n(82717),r=n.n(h),F=n(76635);function P(C){const u=new URL("http://example.com");return u.host=C,u.host===C}function m(C){try{return new URL(C),!0}catch{return!1}}function y(C,u){return{list(){return C},byUrl(x){try{const E=typeof x=="string"?new URL(x):x;return C.find(Q=>u(Q)===E.host)}catch{return}},byHost(x){return C.find(E=>u(E)===x)}}}function l(C){const{url:u,base:x,lineNumber:E}=C;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:pe}=r()(x);Q=new URL(x);const Ce=(0,F.trimEnd)(Q.pathname.substring(0,Q.pathname.length-pe.length),"/");Q.pathname=`${Ce}${u}`}else Q=new URL(u,x);return Q.search=new URL(x).search,E&&(Q.hash=`L${E}`),Q.toString()}const M="amazonaws.com";function xe(C){const u=C.getOptionalString("endpoint");var x;const E=(x=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let Q,pe;if(u){try{const un=new URL(u);Q=un.host,pe=un.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(pe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=M;const Ce=C.getOptionalString("accessKeyId"),be=C.getOptionalString("secretAccessKey"),ct=C.getOptionalString("roleArn"),Vt=C.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:E,accessKeyId:Ce,secretAccessKey:be,roleArn:ct,externalId:Vt}}function V(C){const u=C.map(xe);return u.some(x=>x.host===M)||u.push({host:M}),u}class K{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}K.factory=({config:C})=>{var u;const x=V((u=C.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new K(E)),E=>E.config.host)};var S=n(90383),B=n(22504),Y=n(69866);const ce="GB";var ee=new WeakMap,X=new WeakMap,w=new WeakMap,O=new WeakMap,$=new WeakMap,T=new WeakMap,ne=new WeakMap;class Te{static fromRepoUrl(u){const x=new URL(u);let E,Q,pe;const Ce=x.pathname.split("/").map(Yn=>decodeURIComponent(Yn));if(Ce[2]==="_git"?(E=Ce[1],Q=pe=Ce[3]):Ce[3]==="_git"?(E=Ce[1],Q=Ce[2],pe=Ce[4]):Ce[4]==="_git"&&(E=`${Ce[1]}/${Ce[2]}`,Q=Ce[3],pe=Ce[5]),!E||!Q||!pe)throw new Error("Azure URL must point to a git repository");var be;const ct=(be=x.searchParams.get("path"))!==null&&be!==void 0?be:void 0;let Vt;const un=x.searchParams.get("version");if(un){if(un.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Vt=un.slice(2)}return new Te(x.origin,E,Q,pe,ct,Vt)}toRepoUrl(){let u;return(0,S.Z)(this,w)===(0,S.Z)(this,O)?u=(0,S.Z)(this,ne).call(this,(0,S.Z)(this,X),"_git",(0,S.Z)(this,O)):u=(0,S.Z)(this,ne).call(this,(0,S.Z)(this,X),(0,S.Z)(this,w),"_git",(0,S.Z)(this,O)),(0,S.Z)(this,$)&&u.searchParams.set("path",(0,S.Z)(this,$)),(0,S.Z)(this,T)&&u.searchParams.set("version",ce+(0,S.Z)(this,T)),u.toString()}toFileUrl(){if(!(0,S.Z)(this,$))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,S.Z)(this,ne).call(this,(0,S.Z)(this,X),(0,S.Z)(this,w),"_apis","git","repositories",(0,S.Z)(this,O),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,S.Z)(this,$)),(0,S.Z)(this,T)&&u.searchParams.set("version",(0,S.Z)(this,T)),u.toString()}toArchiveUrl(){const u=(0,S.Z)(this,ne).call(this,(0,S.Z)(this,X),(0,S.Z)(this,w),"_apis","git","repositories",(0,S.Z)(this,O),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,S.Z)(this,$)&&u.searchParams.set("scopePath",(0,S.Z)(this,$)),(0,S.Z)(this,T)&&u.searchParams.set("version",(0,S.Z)(this,T)),u.toString()}toCommitsUrl(){const u=(0,S.Z)(this,ne).call(this,(0,S.Z)(this,X),(0,S.Z)(this,w),"_apis","git","repositories",(0,S.Z)(this,O),"commits");return u.searchParams.set("api-version","6.0"),(0,S.Z)(this,T)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,S.Z)(this,T)),u.toString()}getOwner(){return(0,S.Z)(this,X)}getProject(){return(0,S.Z)(this,w)}getRepo(){return(0,S.Z)(this,O)}getPath(){return(0,S.Z)(this,$)}getRef(){return(0,S.Z)(this,T)}constructor(u,x,E,Q,pe,Ce){(0,B.Z)(this,ee,{writable:!0,value:void 0}),(0,B.Z)(this,X,{writable:!0,value:void 0}),(0,B.Z)(this,w,{writable:!0,value:void 0}),(0,B.Z)(this,O,{writable:!0,value:void 0}),(0,B.Z)(this,$,{writable:!0,value:void 0}),(0,B.Z)(this,T,{writable:!0,value:void 0}),(0,B.Z)(this,ne,{writable:!0,value:(...be)=>{const ct=new URL((0,S.Z)(this,ee));return ct.pathname=be.map(Vt=>encodeURIComponent(Vt)).join("/"),ct}}),(0,Y.Z)(this,ee,u),(0,Y.Z)(this,X,x),(0,Y.Z)(this,w,E),(0,Y.Z)(this,O,Q),(0,Y.Z)(this,$,pe),(0,Y.Z)(this,T,Ce)}}const qe="dev.azure.com";function Qe(C){var u;const x=(u=C.getOptionalString("host"))!==null&&u!==void 0?u:qe,E=C.getOptionalString("token");if(!P(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:E}}function it(C){const u=C.map(Qe);return u.some(x=>x.host===qe)||u.push({host:qe}),u}class Ue{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E}=u;if(m(x))return x;try{const pe=Te.fromRepoUrl(E),Ce=new URL(E);var Q;const be=new URL(`https://a.com${(Q=pe.getPath())!==null&&Q!==void 0?Q:""}`),ct=new URL(x,be).pathname;return Ce.searchParams.set("path",ct),u.lineNumber&&(Ce.searchParams.set("line",String(u.lineNumber)),Ce.searchParams.set("lineEnd",String(u.lineNumber+1)),Ce.searchParams.set("lineStartColumn","1"),Ce.searchParams.set("lineEndColumn","1")),Ce.toString()}catch{return new URL(x,E).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Ue.factory=({config:C})=>{var u;const x=it((u=C.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new Ue(E)),E=>E.config.host)};var Et=n(48834).lW;function He(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function st(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function je(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function At(C,u){const x=u?{...u}:{};if(C.token){const E=Et.from(`:${C.token}`,"utf8");x.Authorization=`Basic ${E.toString("base64")}`}return{headers:x}}const wt="bitbucket.org",gt="https://api.bitbucket.org/2.0";function xt(C){var u;const x=(u=C.getOptionalString("host"))!==null&&u!==void 0?u:wt;let E=C.getOptionalString("apiBaseUrl");const Q=C.getOptionalString("token"),pe=C.getOptionalString("username"),Ce=C.getOptionalString("appPassword");if(!P(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return E?E=(0,F.trimEnd)(E,"/"):x===wt?E=gt:E=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:E,token:Q,username:pe,appPassword:Ce}}function Tt(C){const u=C.map(xt);return u.some(x=>x.host===wt)||u.push({host:wt,apiBaseUrl:gt}),u}class Lt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(!u.lineNumber)return x;const E=new URL(x);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${u.lineNumber}`:E.hash=`${u.lineNumber}`,E.toString()}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:C})=>{var u,x,E;const Q=Tt((E=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(u=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return y(Q.map(pe=>new Lt(pe)),pe=>pe.config.host)};var ze=n(96279),Ie=n(48834).lW;async function we(C,u){const{name:x,owner:E,resource:Q}=parseGitUrl(C),pe=Q==="bitbucket.org";let Ce=pe?`${u.apiBaseUrl}/repositories/${E}/${x}`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,be=await fetch(Ce,nt(u));if(be.status===404&&!pe&&(Ce=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,be=await fetch(Ce,nt(u))),!be.ok){const Vt=`Failed to retrieve default branch from ${Ce}, ${be.status} ${be.statusText}`;throw new Error(Vt)}let ct;if(pe)ct=(await be.json()).mainbranch.name;else{const{displayId:Vt}=await be.json();ct=Vt}if(!ct)throw new Error(`Failed to read default branch from ${Ce}. Response ${be.status} ${be.json()}`);return ct}async function Ee(C,u){const{name:x,owner:E,ref:Q,protocol:pe,resource:Ce,filepath:be}=parseGitUrl(C),ct=Ce==="bitbucket.org";let Vt=Q;Vt||(Vt=await we(C,u));const un=be?`&path=${encodeURIComponent(decodeURIComponent(be))}`:"";return ct?`${pe}://${Ce}/${E}/${x}/get/${Vt}.tar.gz`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Vt}&prefix=${E}-${x}${un}`}function Ne(C,u){try{const{owner:x,name:E,ref:Q,filepathtype:pe,filepath:Ce}=parseGitUrl(C);if(!x||!E||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket URL or file path");const be=Ce.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${Q}/${be}`}return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${be}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function nt(C){const u={};if(C.token)u.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const x=Ie.from(`${C.username}:${C.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const zt="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Nt(C){const u=zt,x=ht,E=C.getString("username"),Q=C.getString("appPassword");return{host:u,apiBaseUrl:x,username:E,appPassword:Q}}function vt(C){const u=C.map(Nt);return u.length===0&&u.push({host:zt,apiBaseUrl:ht}),u}class jt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(u.lineNumber){const E=new URL(x);return E.hash=`lines-${u.lineNumber}`,E.toString()}return x}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}jt.factory=({config:C})=>{var u;const x=vt((u=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new jt(E)),E=>E.config.host)};var en=n(48834).lW;async function on(C,u){const{name:x,owner:E}=parseGitUrl(C),Q=`${u.apiBaseUrl}/repositories/${E}/${x}`,pe=await fetch(Q,an(u));if(!pe.ok){const ct=`Failed to retrieve default branch from ${Q}, ${pe.status} ${pe.statusText}`;throw new Error(ct)}const be=(await pe.json()).mainbranch.name;if(!be)throw new Error(`Failed to read default branch from ${Q}. Response ${pe.status} ${pe.json()}`);return be}async function Sn(C,u){const{name:x,owner:E,ref:Q,protocol:pe,resource:Ce}=parseGitUrl(C);let be=Q;return be||(be=await on(C,u)),`${pe}://${Ce}/${E}/${x}/get/${be}.tar.gz`}function Pt(C,u){try{const{owner:x,name:E,ref:Q,filepathtype:pe,filepath:Ce}=parseGitUrl(C);if(!x||!E||pe!=="src"&&pe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const be=Ce.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${Q}/${be}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function an(C){const u={};if(C.username&&C.appPassword){const x=en.from(`${C.username}:${C.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function Cn(C){const u=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token"),Q=C.getOptionalString("username"),pe=C.getOptionalString("password");if(!P(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:E,username:Q,password:pe}}function Tn(C){return C.map(Cn)}class ln{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=l(u);if(u.lineNumber){const E=new URL(x);return E.hash=u.lineNumber.toString(),E.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}ln.factory=({config:C})=>{var u;const x=Tn((u=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new ln(E)),E=>E.config.host)};var qn=n(48834).lW;async function On(C,u){const{name:x,owner:E}=parseGitUrl(C);let Q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,pe=await fetch(Q,Bn(u));if(pe.status===404&&(Q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,pe=await fetch(Q,Bn(u))),!pe.ok){const ct=`Failed to retrieve default branch from ${Q}, ${pe.status} ${pe.statusText}`;throw new Error(ct)}const{displayId:Ce}=await pe.json(),be=Ce;if(!be)throw new Error(`Failed to read default branch from ${Q}. Response ${pe.status} ${pe.json()}`);return be}async function _n(C,u){const{name:x,owner:E,ref:Q,filepath:pe}=parseGitUrl(C);let Ce=Q;Ce||(Ce=await On(C,u));const be=pe?`&path=${encodeURIComponent(decodeURIComponent(pe))}`:"";return`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Ce}&prefix=${E}-${x}${be}`}function lt(C,u){try{const{owner:x,name:E,ref:Q,filepathtype:pe,filepath:Ce}=parseGitUrl(C);if(!x||!E||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const be=Ce.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${be}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function Bn(C){const u={};if(C.token)u.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const x=qn.from(`${C.username}:${C.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function wn(C){const u=C.getString("host");let x=C.getOptionalString("baseUrl"),E=C.getOptionalString("cloneUrl"),Q=C.getOptionalString("gitilesBaseUrl");const pe=C.getOptionalString("username"),Ce=C.getOptionalString("password");if(P(u)){if(x&&!m(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(Q&&!m(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}`,Q?Q=(0,F.trimEnd)(Q,"/"):Q=`https://${u}`,E?E=(0,F.trimEnd)(E,"/"):E=x,{host:u,baseUrl:x,cloneUrl:E,gitilesBaseUrl:Q,username:pe,password:Ce}}function cn(C){return C.map(wn)}var $n=n(48834).lW;const Wn=")]}'";function jn(C,u){const E=u.replace(C.gitilesBaseUrl,"").split("/").filter(Vt=>!!Vt),Q=E.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const pe=(0,F.trimStart)(E.slice(0,Q).join("/"),"/"),Ce=E.indexOf("heads");if(Ce<=0)throw new Error(`Unable to parse branch from url: ${u}`);const be=E[Ce+1],ct=E.slice(Ce+2).join("/");return{branch:be,filePath:ct===""?"/":ct,project:pe}}function Gn(C,u,x,E){return`${C.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,F.trimStart)(E,"/")}`}function ve(C){return C.password?"/a/":"/"}function re(C,u){const{branch:x,project:E}=jn(C,u);return`${C.baseUrl}${ve(C)}projects/${encodeURIComponent(E)}/branches/${x}`}function Oe(C,u){const{project:x}=jn(C,u);return`${C.cloneUrl}${ve(C)}${x}`}function Pe(C,u){const{branch:x,filePath:E,project:Q}=jn(C,u);return`${C.baseUrl}${ve(C)}projects/${encodeURIComponent(Q)}/branches/${x}/files/${encodeURIComponent(E)}/content`}function Ge(C){return`${C.baseUrl}${ve(C)}projects/`}function pt(C){const u={};if(!C.password)return u;const x=$n.from(`${C.username}:${C.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function Ht(C){const u=await C.text();if(u.startsWith(Wn))try{return JSON.parse(u.slice(Wn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class Rt{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E,lineNumber:Q}=u;let pe;if(x.startsWith("/")){const{branch:Ce,project:be}=jn(this.config,E);return Gn(this.config,be,Ce,x)}return x?pe=new URL(x,E):pe=new URL(E),Q&&(pe.hash=Q.toString()),pe.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Rt.factory=({config:C})=>{var u;const x=cn((u=C.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new Rt(E)),E=>E.config.host)};function de(C){const u=C.getString("host");let x=C.getOptionalString("baseUrl");const E=C.getOptionalString("username"),Q=C.getOptionalString("password");if(!P(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return x?x=(0,F.trimEnd)(x,"/"):x=`https://${u}`,{host:u,baseUrl:x,username:E,password:Q}}var U=n(48834).lW;function he(C,u){try{var x;const E=(x=C.baseUrl)!==null&&x!==void 0?x:`https://${C.host}`,[Q,pe,Ce,be,ct,Vt,...un]=u.replace(E,"").split("/"),Yn=un.join("/").replace(/^\//,"");return`${E}/${pe}/${Ce}/_edit/${Vt}/${Yn}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function Ke(C,u){try{var x;const E=(x=C.baseUrl)!==null&&x!==void 0?x:`https://${C.host}`,[Q,pe,Ce,be,ct,Vt,...un]=u.replace(E,"").split("/"),Yn=un.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${pe}/${Ce}/contents/${Yn}?ref=${Vt}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function Ve(C){const u={},{username:x,password:E}=C;return E?(x?u.Authorization=`basic ${U.from(`${x}:${E}`).toString("base64")}`:u.Authorization=`token ${E}`,{headers:u}):u}class at{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return l(u)}resolveEditUrl(u){return he(this.config,u)}constructor(u){this.config=u}}at.factory=({config:C})=>{var u;const E=((u=C.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(Q=>de(Q));return y(E.map(Q=>new at(Q)),Q=>Q.config.host)};const It="github.com",tn="https://api.github.com",Xt="https://raw.githubusercontent.com";function sn(C){var u,x;const E=(x=C.getOptionalString("host"))!==null&&x!==void 0?x:It;let Q=C.getOptionalString("apiBaseUrl"),pe=C.getOptionalString("rawBaseUrl");const Ce=C.getOptionalString("token"),be=(u=C.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(ct=>({appId:ct.getNumber("appId"),clientId:ct.getString("clientId"),clientSecret:ct.getString("clientSecret"),webhookSecret:ct.getString("webhookSecret"),privateKey:ct.getString("privateKey"),allowedInstallationOwners:ct.getOptionalStringArray("allowedInstallationOwners")}));if(!P(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return Q?Q=(0,F.trimEnd)(Q,"/"):E===It&&(Q=tn),pe?pe=(0,F.trimEnd)(pe,"/"):E===It&&(pe=Xt),{host:E,apiBaseUrl:Q,rawBaseUrl:pe,token:Ce,apps:be}}function q(C){const u=C.map(sn);return u.some(x=>x.host===It)||u.push({host:It,apiBaseUrl:tn,rawBaseUrl:Xt}),u}function W(C,u,x){try{const{owner:E,name:Q,ref:pe,filepathtype:Ce,filepath:be}=parseGitUrl(C);if(!E||!Q||!pe||Ce!=="blob"&&Ce!=="raw"&&Ce!=="tree")throw new Error("Invalid GitHub URL or file path");const ct=be.replace(/^\//,"");return g(u,x)==="api"?`${u.apiBaseUrl}/repos/${E}/${Q}/contents/${ct}?ref=${pe}`:`${u.rawBaseUrl}/${E}/${Q}/${pe}/${ct}`}catch(E){throw new Error(`Incorrect URL: ${C}, ${E}`)}}function le(C,u){const x={};return g(C,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function g(C,u){return C.apiBaseUrl&&(u.token||!C.rawBaseUrl)?"api":"raw"}var R=n(42822),J=n(89393),G=n(26228);class ae{async getOrCreateToken(u,x,E){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await E(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,x))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${x}`);return{accessToken:Q.token}}appliesToRepo(u,x){return x===void 0?!0:u.repositories!==void 0?u.repositories.includes(x):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>G.ou.local()>u}}const me={Accept:"application/vnd.github.machine-man-preview+json"};class Fe{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:Q,suspended:pe}=await this.getInstallationData(u);if(pe)throw new Error(`The GitHub application for ${u} is suspended`);const Ce=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:me});let be;if(Ce.data.repository_selection==="selected"){const Vt=new J.v({baseUrl:this.baseUrl,auth:Ce.data.token}),un=await Vt.paginate(Vt.apps.listReposAccessibleToInstallation);var ct;be=((ct=un.repositories)!==null&&ct!==void 0?ct:un).map(nr=>nr.name)}return{token:Ce.data.token,expiresAt:G.ou.fromISO(Ce.data.expires_at),repositories:be}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const E=(await this.getInstallations()).find(pe=>{var Ce,be;return((Ce=pe.account)===null||Ce===void 0||(be=Ce.login)===null||be===void 0?void 0:be.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,x){this.cache=new ae,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new J.v({baseUrl:x,headers:me,authStrategy:R.i,auth:this.baseAuthConfig})}}class Ye{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(u,x){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(be=>be.getInstallationCredentials(u,x).then(ct=>({credentials:ct,error:void 0}),ct=>({credentials:void 0,error:ct})))),Q=E.find(be=>be.credentials);if(Q)return Q.credentials.accessToken;const Ce=E.map(be=>be.error).find(be=>be.name!=="NotFoundError");if(Ce)throw Ce}constructor(u){var x,E;this.apps=(E=(x=u.apps)===null||x===void 0?void 0:x.map(Q=>new Fe(Q,u.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class dt{async getCredentials(u){const x=r()(u.url),E=x.owner||x.name,Q=x.owner?x.name:void 0;let pe="app",Ce=await this.githubAppCredentialsMux.getAppToken(E,Q);return Ce||(pe="token",Ce=this.token),{headers:Ce?{Authorization:`Bearer ${Ce}`}:void 0,token:Ce,type:pe}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}dt.create=C=>new dt(new Ye(C),C.token);class yt{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(E=>{const Q=SingleInstanceGithubCredentialsProvider.create(E.config);x.set(E.config.host,Q)}),new yt(x)}async getCredentials(u){const x=new URL(u.url),E=this.providers.get(x.host);if(!E)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return E.getCredentials(u)}constructor(u){this.providers=u}}class rt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return _e(l(u),"tree")}resolveEditUrl(u){return _e(u,"edit")}constructor(u){this.integrationConfig=u}}rt.factory=({config:C})=>{var u;const x=q((u=C.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new rt(E)),E=>E.config.host)};function _e(C,u){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,E,Q,pe)=>`//${E}/${Q}/${pe}/${u}/`)}const De=null;class $t extends rt{get config(){return super.config}constructor(u){super(u)}}$t.factory=rt.factory;const Kt=null,kt=null,Zt=null,Wt="gitlab.com",Gt="https://gitlab.com/api/v4";function ut(C){const u=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token");let Q=C.getOptionalString("baseUrl");if(x?x=(0,F.trimEnd)(x,"/"):u===Wt&&(x=Gt),Q?Q=(0,F.trimEnd)(Q,"/"):Q=`https://${u}`,P(u)){if(!x||!m(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!m(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:E,apiBaseUrl:x,baseUrl:Q}}function We(C){const u=C.map(ut);return u.some(x=>x.host===Wt)||u.push({host:Wt,apiBaseUrl:Gt,baseUrl:`https://${Wt}`}),u}function Ft(C){let u="";return C.host!==Wt&&(u=new URL(C.baseUrl).pathname),trimEnd(u,"/")}async function dn(C,u){const x=await Zn(C,u);return In(C,x,u).toString()}function vn(C){const{token:u=""}=C;return{headers:{"PRIVATE-TOKEN":u}}}function In(C,u,x){try{const E=new URL(C),Q=E.pathname.split("/blob/").slice(1).join("/blob/"),[pe,...Ce]=Q.split("/"),be=getGitLabIntegrationRelativePath(x);return E.pathname=[...be?[be]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(Ce.join("/"))),"raw"].join("/"),E.search=`?ref=${pe}`,E}catch(E){throw new Error(`Incorrect url: ${C}, ${E}`)}}async function Zn(C,u){const x=new URL(C);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 Q=getGitLabIntegrationRelativePath(u);Q&&(E=E.replace(Q,""));const pe=new URL(`${x.origin}${Q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),Ce=await fetch(pe.toString(),vn(u)),be=await Ce.json();if(!Ce.ok)throw new Error(`GitLab Error '${be.error}', ${be.error_description}`);return Number(be.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${C}, ${E}`)}}class yn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return Kn(u,"edit")}constructor(u){this.integrationConfig=u}}yn.factory=({config:C})=>{var u;const x=We((u=C.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return y(x.map(E=>new yn(E)),E=>E.config.host)};function Kn(C,u){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class xn{static fromConfig(u){return new xn({awsS3:K.factory({config:u}),azure:Ue.factory({config:u}),bitbucket:Lt.factory({config:u}),bitbucketCloud:jt.factory({config:u}),bitbucketServer:ln.factory({config:u}),gerrit:Rt.factory({config:u}),github:rt.factory({config:u}),gitlab:yn.factory({config:u}),gitea:at.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(E=>E.byUrl(u)).filter(Boolean);if(x.length>1){const E=x.filter(Q=>!(Q instanceof Lt));E.length!==0&&(x=E)}return x[0]}byHost(u){return Object.values(this.byType).map(x=>x.byHost(u)).find(Boolean)}resolveUrl(u){const x=this.byUrl(u.base);return x?x.resolveUrl(u):l(u)}resolveEditUrl(u){const x=this.byUrl(u);return x?x.resolveEditUrl(u):u}constructor(u){this.byType=u}}},6290:function(Ct,Be,n){"use strict";var h={};n.r(h),n.d(h,{TechDocsPlugin:function(){return T.s4}});var r=n(52322),F=n(2784),P=n(28316),m=n(79635),y=n(60871);const l=(0,y.T0)({id:"plugin.techdocs.storageservice"}),M=(0,y.T0)({id:"plugin.techdocs.service"});var xe=n(92077),V=n(95481),K=n(7476),S=n(93225),B=n(67896),Y=n(65124),ce=n(22478),ee=n(85478),X=n(68435),w=n(3482),O=n(42081),$=n(48431),T=n(89258),ne=n(52943),Te=n(61886),qe=n(13980),Qe=n.n(qe);class it{get(t){for(const s of this.holders){const c=s.get(t);if(c)return c}}constructor(...t){this.holders=t}}var Ue=n(51837);const Et=(0,Ue.CT)("api-context"),He=i=>{var t;const{apis:s,children:c}=i,f=(t=(0,F.useContext)(Et))===null||t===void 0?void 0:t.atVersion(1),I=f?new it(s,f):s;return(0,r.jsx)(Et.Provider,{value:(0,Ue.EI)({1:I}),children:c})};He.propTypes={apis:Qe().shape({get:Qe().func.isRequired}).isRequired,children:Qe().node};class st{static validateFactories(t,s){for(const c of s){const f=[c],I=new Set;for(;f.length;){const k=f.shift(),z=t.get(k);if(z)for(const te of Object.values(z.deps)){if(te.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);I.has(te)||(I.add(te),f.push(te))}}}}get(t){return this.load(t)}load(t,s=[]){const c=this.apis.get(t.id);if(c)return c;const f=this.factories.get(t);if(!f)return;if(s.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const I=this.loadDeps(t,f.deps,[...s,f.api]),k=f.factory(I);return this.apis.set(t.id,k),k}loadDeps(t,s,c){const f={};for(const I in s)if(s.hasOwnProperty(I)){const k=s[I],z=this.load(k,c);if(!z)throw new Error(`No API factory available for dependency ${k} of dependent ${t}`);f[I]=z}return f}constructor(t){this.factories=t,this.apis=new Map}}var je;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(je||(je={}));class At{register(t,s){const c=je[t],f=this.factories.get(s.api.id);return f&&f.priority>=c?!1:(this.factories.set(s.api.id,{priority:c,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){this.factories=new Map}}function wt(i){return new Promise((t,s)=>{const c=i.width||500,f=i.height||700,I=window.screen.width/2-c/2,k=window.screen.height/2-f/2,z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${k},left=${I}`);let te="";if(!z||typeof z.closed=="undefined"||z.closed){const ft=new Error("Failed to open auth popup.");ft.name="PopupRejectedError",s(ft);return}const Ze=ft=>{if(ft.source!==z||ft.origin!==i.origin)return;const{data:bt}=ft;if(bt.type==="config_info"){te=bt.targetOrigin;return}if(bt.type!=="authorization_response")return;const St=bt;if("error"in St){const Ut=new Error(St.error.message);Ut.name=St.error.name,s(Ut)}else t(St.response);tt()},Ae=setInterval(()=>{if(z.closed){const ft=`Login failed, ${te&&te!==window.location.origin?`Incorrect app origin, expected ${te}`:"popup was closed"}`,bt=new Error(ft);bt.name="PopupClosedError",s(bt),tt()}},100);function tt(){window.removeEventListener("message",Ze),clearInterval(Ae)}window.addEventListener("message",Ze)})}function gt(i){return[...i].join(" ")}class xt{async createSession(t){return t.instantPopup?this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(){const t=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!t.ok){const c=new Error(`Auth refresh request failed, ${t.statusText}`);throw c.status=t.status,c}const s=await t.json();if(s.error){const c=new Error(s.error.message);throw s.error.name&&(c.name=s.error.name),c}return await this.sessionTransform(s)}async removeSession(){const t=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(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),c=await this.buildUrl("/start",{scope:s,origin:window.location.origin}),f=await wt({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(t,s){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...s,env:this.environment});return`${c}/${this.provider.id}${t}${f}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){const{discoveryApi:s,environment:c,provider:f,joinScopes:I=gt,oauthRequestApi:k,sessionTransform:z=te=>te}=t;this.authRequester=k.createAuthRequester({provider:f,onAuthRequest:te=>this.showPopup(te)}),this.discoveryApi=s,this.environment=c,this.provider=f,this.joinScopesFunc=I,this.sessionTransform=z}}function Tt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Lt{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(t);return Tt(c,s)}getExtendedScope(t,s){const c=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(t);for(const I of f)c.add(I)}if(s)for(const f of s)c.add(f);return c}constructor(t){this.options=t}}var ze=n(82394),Ie=n.n(ze);let we=Symbol.observable;class Ee{[we](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,c){const f=typeof t=="function"?{next:t,error:s,complete:c}:t;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(Ie())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)})),this.subscribers=new Set}}let Ne=Symbol.observable;class nt{[Ne](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,c){const f=typeof t=="function"?{next:t,error:s,complete:c}:t;return this.observable.subscribe(f)}constructor(t){this.subscribers=new Set,this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Ie())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class zt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?y.sM.SignedIn:y.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new nt(y.sM.SignedOut),this.signedIn=!1}}class ht{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),I=this.sessionScopesFunc(c);return Tt(I,f)&&(this.currentSession=c),c}catch(c){if(t.optional)return;throw c}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh();return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const t=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),t}finally{delete this.refreshPromise}}constructor(t){this.stateTracker=new zt;const{connector:s,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:I}=t;this.connector=s,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=I,this.helper=new Lt({sessionScopes:f,defaultScopes:c})}}class Nt{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){this.stateTracker=new SessionStateTracker;const{connector:s,defaultScopes:c=new Set,sessionScopes:f}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const vt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class jt{static create(t){const{discoveryApi:s,environment:c="development",provider:f=vt,oauthRequestApi:I,defaultScopes:k=[],scopeTransform:z=Ae=>Ae}=t,te=new xt({discoveryApi:s,environment:c,provider:f,oauthRequestApi:I,sessionTransform(Ae){return{...Ae,providerInfo:{idToken:Ae.providerInfo.idToken,accessToken:Ae.providerInfo.accessToken,scopes:jt.normalizeScopes(z,Ae.providerInfo.scope),expiresAt:new Date(Date.now()+Ae.providerInfo.expiresInSeconds*1e3)}}}}),Ze=new ht({connector:te,defaultScopes:new Set(k),sessionScopes:Ae=>Ae.providerInfo.scopes,sessionShouldRefresh:Ae=>(Ae.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new jt({sessionManager:Ze,scopeTransform:z})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const c=jt.normalizeScopes(this.scopeTransform,t),f=await this.sessionManager.getSession({...s,scopes:c});var I;return(I=f==null?void 0:f.providerInfo.accessToken)!==null&&I!==void 0?I:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var c;return(c=s==null?void 0:s.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const c=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(c))}constructor(t){this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class on{static create(t){const{discoveryApi:s,environment:c="development",provider:f=en,oauthRequestApi:I,defaultScopes:k=["read:user"]}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const Sn={id:"gitlab",title:"GitLab",icon:()=>null};class Pt{static create(t){const{discoveryApi:s,environment:c="development",provider:f=Sn,oauthRequestApi:I,defaultScopes:k=["read_user"]}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const an={id:"google",title:"Google",icon:()=>null},Cn="https://www.googleapis.com/auth/";class Tn{static create(t){const{discoveryApi:s,oauthRequestApi:c,environment:f="development",provider:I=an,defaultScopes:k=["openid",`${Cn}userinfo.email`,`${Cn}userinfo.profile`]}=t;return jt.create({discoveryApi:s,oauthRequestApi:c,provider:I,environment:f,defaultScopes:k,scopeTransform(z){return z.map(te=>te==="openid"?te:te==="profile"||te==="email"?`${Cn}userinfo.${te}`:te.startsWith(Cn)?te:`${Cn}${te}`)}})}}const ln={id:"okta",title:"Okta",icon:()=>null},qn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),On="okta.";class _n{static create(t){const{discoveryApi:s,environment:c="development",provider:f=ln,oauthRequestApi:I,defaultScopes:k=["openid","email","profile","offline_access"]}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k,scopeTransform(z){return z.map(te=>qn.has(te)||te.startsWith(On)?te:`${On}${te}`)}})}}var lt=n(30195);const Bn=lt.z.object({profile:lt.z.object({email:lt.z.string().optional(),displayName:lt.z.string().optional(),picture:lt.z.string().optional()}),backstageIdentity:lt.z.object({token:lt.z.string(),identity:lt.z.object({type:lt.z.literal("user"),userEntityRef:lt.z.string(),ownershipEntityRefs:lt.z.array(lt.z.string())})})}),wn={id:"saml",title:"SAML",icon:()=>null};class cn{static create(t){const{discoveryApi:s,environment:c="development",provider:f=wn}=t,I=new DirectAuthConnector({discoveryApi:s,environment:c,provider:f}),k=new StaticAuthSessionManager({connector:I}),z=new AuthSessionStore({manager:k,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new cn(z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){this.sessionManager=t}}const $n={id:"microsoft",title:"Microsoft",icon:()=>null};class Wn{static create(t){const{environment:s="development",provider:c=$n,oauthRequestApi:f,discoveryApi:I,defaultScopes:k=["openid","offline_access","profile","email","User.Read"]}=t;return jt.create({discoveryApi:I,oauthRequestApi:f,provider:c,environment:s,defaultScopes:k})}}const jn={id:"onelogin",title:"onelogin",icon:()=>null},Gn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ve="onelogin.";class re{static create(t){const{discoveryApi:s,environment:c="development",provider:f=jn,oauthRequestApi:I}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(k){return k.map(z=>Gn.has(z)||z.startsWith(ve)?z:`${ve}${z}`)}})}}const Oe={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Pe{static create(t){const{discoveryApi:s,environment:c="development",provider:f=Oe,oauthRequestApi:I,defaultScopes:k=["team"]}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const Ge={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pt{static create(t){const{discoveryApi:s,environment:c="development",provider:f=Ge,oauthRequestApi:I,defaultScopes:k=["PROJECT_ADMIN"]}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c,defaultScopes:k})}}const Ht={id:"atlassian",title:"Atlassian",icon:()=>null};class Rt{static create(t){const{discoveryApi:s,environment:c="development",provider:f=Ht,oauthRequestApi:I}=t;return jt.create({discoveryApi:s,oauthRequestApi:I,provider:f,environment:c})}}class de{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){this.subject=new Ee}}class U{captureEvent(t){}}const he="theme";class Ke{static createWithStorage(t){const s=new Ke(t);if(!window.localStorage)return s;var c;const f=(c=window.localStorage.getItem(he))!==null&&c!==void 0?c:void 0;return s.setActiveThemeId(f),s.activeThemeId$().subscribe(I=>{I?window.localStorage.setItem(he,I):window.localStorage.removeItem(he)}),window.addEventListener("storage",I=>{if(I.key===he){var k;const z=(k=localStorage.getItem(he))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(z)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){this.themes=t,this.subject=new nt(void 0)}}var Ve=n(9850),at=n.n(Ve),It=n(12782),tn=n.n(It);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function sn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function q(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const W={type(i,t,s,c){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${c}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class le{static fromConfigs(t){return t.length===0?new le(void 0):t.reduce((s,{data:c,context:f,filteredKeys:I,deprecatedKeys:k})=>{const z=new le(c,f,s);if(z.filteredKeys=I,k)for(const{key:te,description:Ze}of k)console.warn(`The configuration key '${te}' of ${f} is deprecated and may be removed soon. ${Ze||""}`);return z},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var f;return(f=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&f!==void 0?f:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var c;const f=(c=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&c!==void 0?c:[];return[...new Set([...s,...f])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const c=at()(this.readValue(t)),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(c===void 0){if(!1)var I;return f}else if(f===void 0)return c;return tn()({},{value:f},{value:c},(k,z)=>!sn(z)||!sn(k)?z:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const c=this.readValue(t),f=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(sn(c))return this.copy(c,t,f);if(c!==void 0)throw new TypeError(W.type(this.fullKey(t),this.context,q(c),"object"));return f}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[I,k]of f.entries())if(!sn(k))return{expected:"object-array",value:k,key:`${t}[${I}]`};return!0});if(!s){if(!1)var c;return}return s.map((f,I)=>this.copy(f,`${t}[${I}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const c=Number(s);if(!Number.isFinite(c))throw new Error(W.convert(this.fullKey(t),this.context,"number"));return c}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const c=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(c))return!0;if(/^(?:n|no|false|0|off)$/i.test(c))return!1;throw new Error(W.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(W.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[c,f]of s.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${t}[${c}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,c){const f=new le(t,this.context,c,this.fullKey(s));return f.filteredKeys=this.filteredKeys,f}readConfigValue(t,s){const c=this.readValue(t);if(c===void 0){var f;if(!1)var I;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(t,s)}const k=s(c);if(k!==!0){const{key:z=t,value:te=c,expected:Ze}=k;throw new TypeError(W.type(this.fullKey(z),this.context,q(te),Ze))}return c}readValue(t){const s=t?t.split("."):[];for(const f of s)if(!Xt.test(f))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let c=this.data;for(const[f,I]of s.entries())if(sn(c))c=c[I];else if(c!==void 0){const k=this.fullKey(s.slice(0,f).join("."));throw new TypeError(W.type(k,this.context,q(c),"object"))}return c}constructor(t,s="mock-config",c,f=""){this.data=t,this.context=s,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const g="Invalid discovery URL pattern,";class R{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),c=s.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${g} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${g} URL must not have a hash`);if(f.search)throw new Error(`${g} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${g} URL must not end with a slash`);return new R(s)}async getBaseUrl(t){return this.parts.join(t)}constructor(t){this.parts=t}}class J{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){this.alertApi=t,this.errorApi=s}}class G{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){this.subject=new Ee}}class ae{static forward(t,s){window.addEventListener("unhandledrejection",c=>{t.post(c.reason,s)})}}function me(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 Fe{registerFlag(t){me(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===y.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[c,f]of Object.entries(t.states))this.flags.set(c,f);const s=Array.from(this.flags.entries()).filter(([,c])=>c===y.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const c=Object.entries(s).filter(([f,I])=>(me(f),I===y.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ye(i){let t=i.baseImplementation||n.g.fetch;var s;const c=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const f of c)t=f.apply(t);return{fetch:t}}class dt{static create(t){var s,c;const f=yt(t),I=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",k=((c=t.header)===null||c===void 0?void 0:c.value)||(z=>`Bearer ${z}`);return new dt(t.identityApi,f,I,k)}apply(t){return async(s,c)=>{const f=new Request(s,c),{token:I}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(f.url)?t(s,c):(f.headers.set(this.headerName,this.headerValue(I)),t(f))}}constructor(t,s,c,f){this.identityApi=t,this.allowUrl=s,this.headerName=c,this.headerValue=f}}function yt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?rt(i.urlPrefixAllowlist):i.config?rt([i.config.getString("backend.baseUrl")]):()=>!1}function rt(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(c=>s===c||s.startsWith(`${c}/`))}function _e(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class De{apply(t){return async(s,c)=>{const f=new Request(s,c),I="plugin://";if(!f.url.startsWith(I))return t(s,c);const{hostname:k,pathname:z,search:te,hash:Ze,username:Ae,password:tt}=new URL(`http://${f.url.substring(I.length)}`);let ft=await this.discoveryApi.getBaseUrl(k);if(Ae||tt){const St=new URL(ft),Ut=`${Ae}${tt?`:${tt}`:""}@`;ft=`${St.protocol}//${Ut}${St.host}${St.pathname}`}const bt=`${_e(ft,z)}${te}${Ze}`;return t(bt,typeof s=="string"||$t(s)?c:s)}}constructor(t){this.discoveryApi=t}}function $t(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Kt{static resolvePluginProtocol(t){return new De(t.discoveryApi)}static injectIdentityAuth(t){return dt.create(t)}constructor(){}}function kt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Zt(i,...t){const s=new Set(i);for(const c of t)for(const f of c)s.add(f);return s}class Wt{request(t){return new Promise((s,c)=>{this.requests.push({scopes:t,resolve:s,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(c=>kt(t,c.scopes)?(c.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,c)=>Zt(s,c.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){this.requests=[],this.subject=new nt(this.getCurrentPending())}}class Gt{createAuthRequester(t){const s=new Wt,c=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:f=>{const I=this.currentRequests.slice(),k=this.makeAuthRequest(f,t);k?I[c]=k:delete I[c],this.currentRequests=I,this.subject.next(I.filter(Boolean))}}),f=>s.request(f)}makeAuthRequest(t,s){const{scopes:c}=t;if(c)return{provider:s.provider,trigger:async()=>{const f=await s.onAuthRequest(c);t.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",t.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new nt([]),this.currentRequests=[],this.handlerCount=0}}const ut=new Map;class We{static create(t){var s;return new We((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[c,f]of ut.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(c)&&f.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,c="absent";try{const f=localStorage.getItem(this.getKeyName(t));f&&(s=JSON.parse(f,(I,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:c}}forBucket(t){const s=`${this.namespace}/${t}`;return ut.has(s)||ut.set(s,new We(s,this.errorApi)),ut.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return We.hasSubscribed||(We.addStorageEventListener(),We.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const c of this.subscribers)c.next(s)}constructor(t,s){this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(Ie())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}We.hasSubscribed=!1;const Ft=(0,F.createContext)(void 0);function dn(){const[i]=(0,m.is)((0,r.jsx)(m.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var vn=n(16060);const In=(i,t)=>{try{var s,c;const f=(0,vn.fp)(t,{pathname:i}),I=(s=f==null?void 0:f.filter(z=>{var te;return((te=z==null?void 0:z.route.routeRefs)===null||te===void 0?void 0:te.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!I)return{};let k;return I.routeRefs.size===1&&(k=I.routeRefs.values().next().value),{extension:"App",pluginId:((c=I.plugin)===null||c===void 0?void 0:c.getId())||"root",...k?{routeRef:k.id}:{}}}catch{return{}}},Zn=({pathname:i,search:t,hash:s})=>{const c=(0,y.z$)();return(0,F.useEffect)(()=>{c.captureEvent("navigate",`${i}${t}${s}`)},[c,i,t,s]),null},yn=({routeObjects:i})=>{const{pathname:t,search:s,hash:c}=(0,m.TH)();return(0,r.jsx)(y.fC,{attributes:In(t,i),children:(0,r.jsx)(Zn,{pathname:t,search:s,hash:c})})};function Kn(i){return dn()?xn(i):""}function xn(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function C({component:i,appIdentityProxy:t,children:s}){const[c,f]=(0,F.useState)(),I=(0,y.h_)(y.Ds),k=Kn(I);return c?(t.setTarget(c,{signOutTargetUrl:k||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(i,{onSignInSuccess:f})}function u(i){const{Router:t,SignInPage:s}=(0,y.qD)().getComponents(),c=(0,y.h_)(y.Ds),f=xn(c),I=`${f}/*`,k=(0,F.useContext)(Ft);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:z,appIdentityProxy:te}=k;return s?dn()?(0,r.jsxs)(t,{children:[(0,r.jsx)(yn,{routeObjects:z}),(0,r.jsx)(C,{component:s,appIdentityProxy:te,children:(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:I,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(t,{basename:f,children:[(0,r.jsx)(yn,{routeObjects:z}),(0,r.jsx)(C,{component:s,appIdentityProxy:te,children:i.children})]}):(te.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||"/"}),dn()?(0,r.jsxs)(t,{children:[(0,r.jsx)(yn,{routeObjects:z}),(0,r.jsx)(m.Z5,{children:(0,r.jsx)(m.AW,{path:I,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(t,{basename:f,children:[(0,r.jsx)(yn,{routeObjects:z}),i.children]}))}var x=n(90383),E=n(22504),Q=n(69866),pe=n(64279);function Ce(i){const t={};for(const c in i.collectors)i.collectors.hasOwnProperty(c)&&(t[c]=i.collectors[c]());const s=[{node:F.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:c,parent:f,contexts:I}=s.shift();F.Children.forEach(c,k=>{if(!(0,F.isValidElement)(k))return;const z={};for(const te in t)if(t.hasOwnProperty(te)){const Ze=t[te];z[te]=Ze.visit(Ze.accumulator,k,f,I[te])}for(const te of i.discoverers){const Ze=te(k);Ze&&s.push({node:Ze,parent:k,contexts:z})}})}return Object.fromEntries(Object.entries(t).map(([c,f])=>[c,f.accumulator]))}function be(i,t){return()=>({accumulator:i(),visit:t})}function ct(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function Vt(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var c;return(c=i.props)===null||c===void 0?void 0:c.element}}const un=be(()=>new Set,(i,t)=>{const s=(0,y.IY)(t,"core.plugin");s&&i.add(s)}),Yn=i=>{const{children:t}=i,s=(0,y.h_)(y.W0),c="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:c?t:null})};(0,y.R5)(Yn,"core.featureFlagged",!0);const nr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function zr(i){const t=i;if(t!=null&&t.type){var s,c;return(c=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&c!==void 0?c:String(t.type)}return String(t)}function oo(i,t=new Array){return F.Children.forEach(i,s=>{if(!(0,F.isValidElement)(s))return;const c=(0,y.IY)(s,"core.mountPoint");if(c){const f=(0,y.IY)(s,"core.plugin");t.push({routeRef:c,plugin:f})}oo(s.props.children,t)}),t}const yo=be(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,c)=>{var f,I;if(c!=null&&c.isElementAncestor)return c;if((s==null?void 0:s.props.element)===t)return{...c,isElementAncestor:!0};const k=(f=t.props)===null||f===void 0?void 0:f.path,z=(0,y.IY)(t,"core.mountPoint");if(z&&k)throw new Error(`Path property may not be set directly on a routable extension "${zr(t)}"`);var te;const Ze=(te=c==null||(I=c.obj)===null||I===void 0?void 0:I.children)!==null&&te!==void 0?te:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${zr(t)}"`);const bt=k.startsWith("/")?k.slice(1):k,St=t.props.element;if((0,y.IY)(t,"core.gatherMountPoints")){var Ae;if(St)throw new Error(`Mount point gatherers may not have an element prop "${zr(t)}"`);const Ut={path:bt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ae=t.props)===null||Ae===void 0?void 0:Ae.caseSensitive),children:[nr],plugin:void 0};return Ze.push(Ut),{obj:Ut,gatherPath:bt,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(St){var tt;const[Ut,...Mt]=oo(St);if(Mt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Ut)return c;const{routeRef:Un,plugin:tr}=Ut,ur={path:bt,element:"mounted",routeRefs:new Set([Un]),caseSensitive:Boolean((tt=t.props)===null||tt===void 0?void 0:tt.caseSensitive),children:[nr],plugin:tr};return Ze.push(ur),i.paths.set(Un,bt),i.parents.set(Un,c==null?void 0:c.routeRef),{obj:ur,routeRef:Un!=null?Un:c==null?void 0:c.routeRef,gatherPath:bt,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(z){var ft;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${zr(t)}" with mount point "${z}" must be assigned a path`);return c==null||(ft=c.obj)===null||ft===void 0||ft.routeRefs.add(z),i.paths.set(z,c.gatherPath),i.parents.set(z,c==null?void 0:c.gatherRouteRef),{...c,routeRef:z}}return c}),xo=be(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,c)=>{var f,I,k;if((s==null?void 0:s.props.element)===t)return c;let z=c==null?void 0:c.obj,te=c==null?void 0:c.routeRef,Ze=c==null?void 0:c.sticky;const Ae=(f=t.props)===null||f===void 0?void 0:f.path;var tt;const ft=(tt=z==null?void 0:z.children)!==null&&tt!==void 0?tt:i.objects,bt=Boolean((I=t.props)===null||I===void 0?void 0:I.caseSensitive);let St=c==null?void 0:c.path;if((0,y.IY)(t,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");St=Ae}const Ut=(k=t.props)===null||k===void 0?void 0:k.element;let Mt=(0,y.IY)(t,"core.mountPoint");if(!Mt&&(0,F.isValidElement)(Ut)&&(Mt=(0,y.IY)(Ut,"core.mountPoint")),Mt){let ur=Ae;if(St&&(ur?St=void 0:ur=St),!ur)throw new Error("Mounted routable extension must have a path");i.paths.set(Mt,ur),te&&Ze?(i.parents.set(Mt,te),Ae&&(te=Mt,Ze=!1)):(i.parents.set(Mt,te),te=Mt),Ae?(z={caseSensitive:bt,path:Ae,element:"mounted",routeRefs:new Set([Mt]),children:[nr],plugin:(0,y.IY)(t.props.element,"core.plugin")},ft.push(z)):z==null||z.routeRefs.add(Mt)}if((0,y.IY)(t,"core.gatherMountPoints")&&(Ze=!0),(0,y.IY)(t,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");if(!Mt){var tr;z={caseSensitive:bt,path:Ae,element:"gathered",routeRefs:new Set,children:[nr],plugin:c==null||(tr=c.obj)===null||tr===void 0?void 0:tr.plugin},ft.push(z)}}return{obj:z,path:St,routeRef:te,sticky:Ze}}),or=be(()=>new Set,(i,t)=>{if(t.type===Yn){const s=t.props;i.add("with"in s?s.with:s.without)}}),Rn=(0,Ue.uW)("route-ref-type",()=>Symbol("route-ref-type"));function sr(i){return i[Rn]==="absolute"}function yr(i){return i[Rn]==="sub"}function Tr(i){return i[Rn]==="external"}function Ir(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Wr(i,t,s){let c,f="";if(sr(i))c=i;else if(yr(i))c=i.parent,f=i.path;else if(Tr(i)){const z=s.get(i);if(!z)return[void 0,""];if(sr(z))c=z;else if(yr(z))c=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}else throw i[Rn]?new Error(`Unknown or invalid route ref type, ${i[Rn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!c)return[void 0,""];const I=t.get(c);if(I===void 0)return[void 0,""];const k=Ir(I,f);return[c,k]}function bo(i,t,s,c,f){var I;const k=(I=(0,vn.fp)(f,t))!==null&&I!==void 0?I:[],z=Array();let te=-1;for(let tt=i;tt&&(te=k.findIndex(ft=>ft.route.routeRefs.has(tt)),te===-1);tt=c.get(tt))z.unshift(tt);z.length===0&&(te-=1);const Ze=te===-1?"":k[te].pathname,Ae=z.slice(0,-1).map(tt=>{const ft=s.get(tt);if(ft===void 0)throw new Error(`No path for ${tt}`);if(ft.includes(":"))throw new Error(`Cannot route to ${i} with parent ${tt} as it has parameters`);return ft});return`${Ir(Ze,...Ae)}/`}class Qo{resolve(t,s){const[c,f]=Wr(t,this.routePaths,this.routeBindings);if(!c)return;let I;typeof s=="string"?I=this.trimPath(s):s.pathname?I={...s,pathname:this.trimPath(s.pathname)}:I=s;const k=this.appBasePath+bo(c,I,this.routePaths,this.routeParents,this.routeObjects);return(...[te])=>Ir(k,(0,vn.Gn)(f,te))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,c,f,I){this.routePaths=t,this.routeParents=s,this.routeObjects=c,this.routeBindings=f,this.appBasePath=I}}const Vr=(0,Ue.CT)("routing-context"),rr=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:c,basePath:f="",children:I})=>{const k=new Qo(i,t,s,c,f),z=(0,Ue.EI)({1:k});return(0,r.jsx)(Vr.Provider,{value:z,children:I})};function Rr(i,t){const s=new Set(t.values());s.delete(void 0);for(const c of t.keys()){if(s.has(c))continue;let f=c,I="";for(;f;){const z=i.get(f);if(z===void 0)throw new Error(`No path for ${f}`);I=Ir(z,I),f=t.get(f)}const k=I.match(/:(\w+)/g);if(k){for(let z=0;z<k.length;z++)for(let te=z+1;te<k.length;te++)if(k[te]===k[z])throw new Error(`Parameter ${k[te]} is duplicated in path ${I}`)}}}function Lr(i,t){for(const s of t)if(s.externalRoutes){for(const[c,f]of Object.entries(s.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${c}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const So=(0,Ue.CT)("app-context"),Hr=({appContext:i,children:t})=>{const s=(0,Ue.EI)({1:i});return(0,r.jsx)(So.Provider,{value:s,children:t})};function Gr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class fr{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw Gr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Gr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Kr=n(72164);function Co(i,t,s){if(i!==void 0){const f=s.find(I=>I.id===i);if(f)return f}if(t){const f=s.find(I=>I.variant==="dark");if(f)return f}const c=s.find(f=>f.variant==="light");return c||s[0]}const wo=()=>{const i=(0,F.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,F.useState)(i.matches);return(0,F.useEffect)(()=>{const c=f=>{s(f.matches)};return i.addListener(c),()=>{i.removeListener(c)}},[i]),t};function Yr({children:i}){const t=(0,y.h_)(y.hg),s=(0,Kr.Z)(t.activeThemeId$(),t.getActiveThemeId()),c=Boolean(window.matchMedia)?wo():!1,f=Co(s,c,t.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const jo=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.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 c=window.__APP_CONFIG__;return c&&s.push({context:"window",data:c}),s};class Xo{add(t,s){return this.apis.push([t.id,s]),s}build(){return new gr(new Map(this.apis))}constructor(){this.apis=[]}}class gr{static builder(){return new Xo}static from(t){return new gr(new Map(t.map(([s,c])=>[s.id,c])))}static with(t,s){return new gr(new Map([[t.id,s]]))}with(t,s){return new gr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){this.apis=t}}function qo(i){const t=new Map;return i&&i({bind:(c,f)=>{for(const[I,k]of Object.entries(f)){const z=c[I];if(!z)throw new Error(`Key ${I} is not an existing external route`);if(!k&&!z.optional)throw new Error(`External route ${I} is required but was undefined`);k&&t.set(z,k)}}}),t}function so(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Eo(i,t,s){var c;const f=Boolean(i),I=(0,pe.default)(i||(()=>Promise.resolve([])));let k;if(f&&I.loading){const{Progress:Ze}=t;k=(0,r.jsx)(Ze,{})}else if(I.error){const{BootErrorPage:Ze}=t;k=(0,r.jsx)(Ze,{step:"load-config",error:I.error})}const{ThemeProvider:z=Yr}=t;if(k)return{node:(0,r.jsx)(He,{apis:gr.with(y.hg,s),children:(0,r.jsx)(z,{children:k})})};let te;if(!((c=I.value)===null||c===void 0)&&c.length){const Ze=le.fromConfigs(I.value),Ae=Ze.getOptionalString("app.baseUrl"),tt=Ze.getOptionalString("backend.baseUrl");let ft=I.value;const bt={data:{},context:"relative-resolver"};if(Ae&&tt){const St=new URL(Ae).origin,Ut=new URL(tt).origin;if(St===Ut){const Mt=so(tt);tt!==Mt&&(bt.data.backend={baseUrl:Mt})}}if(Ae){const St=so(Ae);Ae!==St&&(bt.data.app={baseUrl:St})}Object.keys(bt.data).length&&(ft=ft.concat([bt])),te=le.fromConfigs(ft)}else te=le.fromConfigs([]);return{api:te}}class Ao{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){this.app=t}}var kr=new WeakMap;class xr{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,r.jsx)(s,{children:t})}getProvider(){if((0,x.Z)(this,kr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q.Z)(this,kr,!0);const t=new Ao(this);let s=!1;return({children:f})=>{const I=(0,F.useRef)(!0),k=(0,F.useMemo)(()=>Ke.createWithStorage(this.themes),[]),{routing:z,featureFlags:te,routeBindings:Ze}=(0,F.useMemo)(()=>{const bt=Ce({root:f,discoverers:[ct,Vt],collectors:{routing:dn()?xo:yo,collectedPlugins:un,featureFlags:or}});return bt.collectedPlugins.forEach(St=>this.plugins.add(St)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...bt,routeBindings:qo(this.bindRoutes)}},[f]);s||(s=!0,Rr(z.paths,z.parents),Lr(Ze,this.plugins));const Ae=Eo(this.configLoader,this.components,k),tt="api"in Ae;if(tt){const{api:bt}=Ae;this.configApi=bt}if("node"in Ae)return Ae.node;if(tt&&I.current){I.current=!1;const bt=this.getApiHolder().get(y.W0);if(bt){for(const Mt of this.featureFlags)bt.registerFlag({...Mt,pluginId:""});for(const Mt of this.plugins.values())if("getFeatureFlags"in Mt)for(const Un of Mt.getFeatureFlags())bt.registerFlag({name:Un.name,pluginId:Mt.getId()});else for(const Un of Mt.output())Un.type==="feature-flag"&&bt.registerFlag({name:Un.name,pluginId:Mt.getId()});const St=bt.getRegisteredFlags(),Ut=new Set(St.map(Mt=>Mt.name));for(const Mt of te)Ut.has(Mt)||bt.registerFlag({name:Mt,pluginId:""})}}const{ThemeProvider:ft=Yr}=this.components;return(0,r.jsx)(He,{apis:this.getApiHolder(),children:(0,r.jsx)(Hr,{appContext:t,children:(0,r.jsx)(ft,{children:(0,r.jsx)(rr,{routePaths:z.paths,routeParents:z.parents,routeObjects:z.objects,routeBindings:Ze,basePath:Kn(Ae.api),children:(0,r.jsx)(Ft.Provider,{value:{routeObjects:z.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return u}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return st.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:y.hg,deps:{},factory:()=>Ke.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 Fe});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return st.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new st(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const c of t){const f=c.getId();if(s.has(f))throw new Error(`Duplicate plugin found '${f}'`);s.add(f)}}constructor(t){this.appIdentityProxy=new fr,(0,E.Z)(this,kr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var c;this.plugins=new Set((c=t.plugins)!==null&&c!==void 0?c:[]);var f;this.featureFlags=(f=t.featureFlags)!==null&&f!==void 0?f:[],this.components=t.components,this.themes=t.themes;var I;this.configLoader=(I=t.configLoader)!==null&&I!==void 0?I:jo;var k;this.defaultApis=(k=t.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new At}}function br(i){return new xr(i)}let io=!1;const To=i=>{const t=(0,y.qD)(),{NotFoundErrorPage:s}=t.getComponents(),c=(0,F.useMemo)(()=>dn(),[]),I=[...(0,y.vJ)(i.children,k=>k.getElements().flatMap(z=>{let te=z.props.path;if(te==="")return[];var Ze;te=(Ze=te==null?void 0:te.replace(/\/\*$/,""))!==null&&Ze!==void 0?Ze:"/";let Ae=c?z:z.props.element;return!c&&!Ae&&(Ae=z,io||(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] />} />."),io=!0)),[{path:te,element:Ae,children:z.props.children?[{path:te==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,te)=>te.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,m.V$)(I)},Jr=(0,y.T0)({id:"plugin.permission.api"});var Vn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Vn||(Vn={}));function Io(i,t){return i.name===t.name}function Ln(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function _o(i){return i.attributes.action==="create"}function es(i){return i.attributes.action==="read"}function ts(i){return i.attributes.action==="update"}function ns(i){return i.attributes.action==="delete"}function rs(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const c=t;return i.authorize(c,s)}}}function ir({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var Ro=n(23054),ao=n(96279),Or=n.n(ao),os=n(9571);const Br=lt.z.lazy(()=>lt.z.object({rule:lt.z.string(),resourceType:lt.z.string(),params:lt.z.record(lt.z.any()).optional()}).or(lt.z.object({anyOf:lt.z.array(Br).nonempty()})).or(lt.z.object({allOf:lt.z.array(Br).nonempty()})).or(lt.z.object({not:Br}))),Lo=lt.z.object({result:lt.z.literal(Vn.ALLOW).or(lt.z.literal(Vn.DENY))}),b=lt.z.union([lt.z.object({result:lt.z.literal(Vn.ALLOW).or(lt.z.literal(Vn.DENY))}),lt.z.object({result:lt.z.literal(Vn.CONDITIONAL),pluginId:lt.z.string(),resourceType:lt.z.string(),conditions:Br})]),A=(i,t)=>lt.z.object({items:lt.z.array(lt.z.intersection(lt.z.object({id:lt.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:c})=>t.has(c)),{message:"Items in response do not match request"})});class L{async authorize(t,s){return this.makeRequest(t,Lo,s)}async authorizeConditional(t,s){return this.makeRequest(t,b,s)}async makeRequest(t,s,c){if(!this.enabled)return t.map(Ae=>({result:Vn.ALLOW}));const f={items:t.map(Ae=>({id:os.Z(),...Ae}))},I=await this.discovery.getBaseUrl("permission"),k=await Or()(`${I}/authorize`,{method:"POST",body:JSON.stringify(f),headers:{...this.getAuthorizationHeader(c==null?void 0:c.token),"content-type":"application/json"}});if(!k.ok)throw await Ro.VL.fromResponse(k);const z=await k.json(),Ze=A(s,new Set(f.items.map(({id:Ae})=>Ae))).parse(z).items.reduce((Ae,tt)=>(Ae[tt.id]=tt,Ae),{});return f.items.map(Ae=>Ze[Ae.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class D{static create(t){const{config:s,discovery:c,identity:f}=t,I=new L({discovery:c,config:s});return new D(I,f)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){this.permissionClient=t,this.identityApi=s}}var _=n(69984);function se(i){const t=(0,y.h_)(Jr),{data:s,error:c}=(0,_.ZP)(i,async f=>{if(Ln(f.permission)&&!f.resourceRef)return Vn.DENY;const{result:I}=await t.authorize(f);return I});return c?{error:c,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Vn.ALLOW}}const oe=i=>{const{permission:t,resourceRef:s,errorComponent:c,...f}=i,I=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),k=useApp(),{NotFoundErrorPage:z}=k.getComponents();let te=c===void 0?_jsx(z,{}):c;return I.loading?te=null:I.allowed&&(te=i.element),_jsx(Route,{...f,element:te})};function fe(i){const{permission:t,resourceRef:s}=i,c=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),f=useApp();if(c.loading)return null;if(c.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:I}=f.getComponents();return _jsx(I,{})}const Se=[(0,y.ni)({api:y.NW,deps:{configApi:y.Ds},factory:({configApi:i})=>R.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,y.ni)({api:y.$v,deps:{},factory:()=>new de}),(0,y.ni)({api:y.v_,deps:{},factory:()=>new U}),(0,y.ni)({api:y.VE,deps:{alertApi:y.$v},factory:({alertApi:i})=>{const t=new J(i,new G);return ae.forward(t,{hidden:!1}),t}}),(0,y.ni)({api:y.E6,deps:{errorApi:y.VE},factory:({errorApi:i})=>We.create({errorApi:i})}),(0,y.ni)({api:y.gP,deps:{configApi:y.Ds,identityApi:y.$4,discoveryApi:y.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>Ye({middleware:[Kt.resolvePluginProtocol({discoveryApi:s}),Kt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,y.ni)({api:y.ZM,deps:{},factory:()=>new Gt}),(0,y.ni)({api:y.Kp,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Tn.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Wn.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>on.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>_n.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Pt.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>re.create({discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Pe.create({discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:y.Km,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM},factory:({discoveryApi:i,oauthRequestApi:t})=>pt.create({discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,y.ni)({api:y.uB,deps:{discoveryApi:y.NW,oauthRequestApi:y.ZM,configApi:y.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Rt.create({discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,y.ni)({api:Jr,deps:{discovery:y.NW,identity:y.$4,config:y.Ds},factory:({config:i,discovery:t,identity:s})=>D.create({config:i,discovery:t,identity:s})})];var Re=n(77277),ge=n(23196),ke=n(39857);function et({children:i}){return(0,m.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(m.VA,{children:i})}const Xe=()=>(0,r.jsx)(ge.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),ot=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,r.jsx)(et,{children:(0,r.jsx)(ge.mf,{status:"501",statusMessage:s})})},$e=({error:i,resetError:t,plugin:s})=>(0,r.jsx)(ge.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(Re.Z,{variant:"outlined",onClick:t,children:"Retry"})}),mt={Progress:ge.Ex,Router:ke.VK,NotFoundErrorPage:Xe,BootErrorPage:ot,ErrorBoundaryFallback:$e};var Dt=n(43642),fn=n(80079),qt=n(90941),Pn=n(32915),gn=n(40562),En=n(21853),An=n(60744),mr=n(66569),$r=n(30254),lo=n(13384),kn=n(15933),Dn=n(58838),Sr=n(86737),Ps=n(4989),ks=n(44407),Oi=n(18628),ss=n(84219),Os=n(98685),Zr=n(39781);const Bi={brokenImage:fn.Z,catalog:Oi.Z,scaffolder:Pn.Z,techdocs:gn.Z,search:En.Z,chat:An.Z,dashboard:mr.Z,docs:$r.Z,email:lo.Z,github:Dn.Z,group:ss.Z,help:Sr.Z,"kind:api":kn.Z,"kind:component":ks.Z,"kind:domain":Dt.Z,"kind:group":ss.Z,"kind:location":Ps.Z,"kind:system":qt.Z,"kind:user":Os.Z,user:Os.Z,warning:Zr.Z};var $i=n(73689),Bs=n(48032);const ar={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")`},lr={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 cr(i){const{colors:t,shape:s,options:c}=i,I=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,k=`${s}, ${I}`;var z;const te=(z=c==null?void 0:c.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:t,shape:s,backgroundImage:k,fontColor:te}}const is={home:cr({colors:lr.teal,shape:ar.wave}),documentation:cr({colors:lr.pinkSea,shape:ar.wave2}),tool:cr({colors:lr.purpleSky,shape:ar.round}),service:cr({colors:lr.marineBlue,shape:ar.wave}),website:cr({colors:lr.veryBlue,shape:ar.wave}),library:cr({colors:lr.rubyRed,shape:ar.wave}),other:cr({colors:lr.darkGrey,shape:ar.wave}),app:cr({colors:lr.toastyOrange,shape:ar.wave}),apis:cr({colors:lr.teal,shape:ar.wave2}),card:cr({colors:lr.greens,shape:ar.wave})},as=16,$s='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Zs(i){const{palette:t,htmlFontSize:s=as,fontFamily:c=$s,defaultPageTheme:f,pageTheme:I=is}=i;if(!I[f])throw new Error(`${f} is not defined in pageTheme.`);var k;return{palette:t,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:I[f],getPageTheme:({themeId:z})=>(k=I[z])!==null&&k!==void 0?k:I[f]}}function Ds(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,Bs.darken)(i.palette.link,.3),background:(0,Bs.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 t=Zs(i),s=(0,$i.Z)(t),c=Ds(s);return{...s,overrides:c}}var cs=n(34505);const Ns=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:cs.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:is}),Zi=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:cs.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:is});var Di=n(98192),ds=n(15222),Fs=n(41547),Po=n(87561);const Us=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(ds.Z,{}),Provider:({children:i})=>(0,r.jsx)(Fs.Z,{theme:Ns,children:(0,r.jsx)(Po.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Di.Z,{}),Provider:({children:i})=>(0,r.jsx)(Fs.Z,{theme:Zi,children:(0,r.jsx)(Po.ZP,{children:i})})}];function us(i){var t,s,c,f;return br({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...mt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Se,icons:{...Bi,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(c=i==null?void 0:i.featureFlags)!==null&&c!==void 0?c:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:Us})}var Qr=n(25271),hs=n(76635);async function Ms({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),c=t.snapshot("starredEntities").value;if(!(0,hs.isArray)(c))return;var f;const I=new Set((f=s.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(hs.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,z,te,Ze])=>(0,Qr.eE)({kind:z,namespace:te,name:Ze})).forEach(k=>I.add(k)),await s.set("entityRefs",Array.from(I)),await t.remove("starredEntities")}class ko{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){this.subscribers=new Set,this.observable=new(Ie())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Ms(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Ni=n(33414),Dr=n(79692),zs=n(12420),Hn=n(40303),Fi=n(19928);function Ui(){const i=useApi(catalogApiRef),{error:t,loading:s,value:c}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(I=>{var k;return((k=I.facets.kind)===null||k===void 0?void 0:k.map(z=>z.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:c!=null?c:[]}}function Ws(i,t,s){let c=i;return t&&(c=c.filter(I=>t.some(k=>k.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US")))),s&&!i.some(I=>I.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(c=c.concat([s])),c.sort().reduce((I,k)=>(I[k.toLocaleLowerCase("en-US")]=k,I),{})}const Vs=(0,Dr.Z)(i=>(0,zs.Z)({root:{...i.typography.h4}}));function Hs(i){var t;const{initialFilter:s="component",allowedKinds:c}=i,f=Vs(),{allKinds:I}=useAllKinds(),{filters:k,updateFilters:z,queryParameters:{kind:te}}=useEntityList(),Ze=useMemo(()=>[te].flat()[0],[te]);var Ae;const[tt,ft]=useState((Ae=Ze!=null?Ze:(t=k.kind)===null||t===void 0?void 0:t.value)!==null&&Ae!==void 0?Ae:s);useEffect(()=>{Ze&&ft(Ze)},[Ze]),useEffect(()=>{var St;if(!((St=k.kind)===null||St===void 0)&&St.value){var Ut;ft((Ut=k.kind)===null||Ut===void 0?void 0:Ut.value)}},[k.kind]),useEffect(()=>{z({kind:tt?new EntityKindFilter(tt):void 0})},[tt,z]);const bt=filterKinds(I,c,tt);return _jsx(Select,{input:_jsx(InputBase,{}),value:tt.toLocaleLowerCase("en-US"),onChange:St=>ft(St.target.value),classes:f,children:Object.keys(bt).map(St=>_jsx(MenuItem,{value:St,children:`${pluralize(bt[St])}`},St))})}var Mi=n(86359),co=n(95544),ps=n(99688),uo=n(12231),Oo=n(86136),ho=n(49378),fs=n(85256),gs=n(80030),Jn=n(61837),zi=n(79784),Wi=n(50758),Vi=n(31654),Hi=n(43054),Gi=n(65759),ka=n(49280),Ki=n(96641);function Yi(i){const{entity:t,loading:s,error:c}=(0,Ki.ce)(),{allowed:f,loading:I,error:k}=se({permission:i,resourceRef:t?(0,Qr.eE)(t):void 0});return s||I?{loading:!0,allowed:!1}:c?{loading:!1,allowed:!1,error:c}:{loading:!1,allowed:f,error:k}}const Nr="catalog-entity",Ji=ir({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Nr}),Qi=ir({name:"catalog.entity.create",attributes:{action:"create"}}),ms=ir({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Nr}),Gs=ir({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Nr}),Bo=ir({name:"catalog.location.read",attributes:{action:"read"}}),Ks=ir({name:"catalog.location.create",attributes:{action:"create"}}),Ys=ir({name:"catalog.location.delete",attributes:{action:"delete"}}),Xi=[Ji,Qi,ms,Gs,Bo,Ks,Ys];var $o=n(49166);function Zo(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:c,onClose:f}=i,I=typeof(t==null?void 0:t.disableUnregister)=="boolean";var k;const z=(k=!s||(I?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let te=(0,r.jsx)(r.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(te=(0,r.jsxs)(uo.Z,{onClick:()=>{f(),c()},disabled:z,children:[(0,r.jsx)(Oo.Z,{children:(0,r.jsx)($o.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:te})}const po=(0,Dr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function vs(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:c,onInspectEntity:f}=i,[I,k]=(0,F.useState)(),z=po(),Ze=Yi(ms).allowed,Ae=Ut=>{k(Ut.currentTarget)},tt=()=>{k(void 0)},ft=(0,y.h_)(y.$v),bt=(0,F.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ft.post({message:"Copied!",severity:"info"}))},[ft]),St=t&&[...t.map(Ut=>(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),Ut.onClick()},children:[(0,r.jsx)(Oo.Z,{children:(0,r.jsx)(Ut.Icon,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:Ut.title})]},Ut.title)),(0,r.jsx)(fs.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(gs.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(Jn.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!I,role:"button",onClick:Ae,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,r.jsx)(Hi.Z,{})})}),(0,r.jsx)(zi.ZP,{open:Boolean(I),onClose:tt,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Wi.Z,{children:[St,(0,r.jsx)(Zo,{unregisterEntityOptions:s,isUnregisterAllowed:Ze,onUnregisterEntity:c,onClose:tt}),(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),f()},children:[(0,r.jsx)(Oo.Z,{children:(0,r.jsx)(Vi.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(uo.Z,{onClick:()=>{tt(),bt()},children:[(0,r.jsx)(Oo.Z,{children:(0,r.jsx)(Gi.Z,{fontSize:"small"})}),(0,r.jsx)(ho.Z,{primary:"Copy entity URL"})]})]})})]})}const Do="plugin.catalog.entityLayoutRoute",er=()=>null;(0,y.R5)(er,Do,!0),(0,y.R5)(er,"core.gatherMountPoints",!0);function Js(i){const{entity:t,title:s}=i;return(0,r.jsxs)(co.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(co.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,r.jsx)(Hn.LH,{entity:t})]})}function ys(i,t,s,c){var f;const I=(f=i!=null?i:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var k;const z=(k=t!=null?t:c==null?void 0:c.metadata.namespace)!==null&&k!==void 0?k:"";var te,Ze,Ae;return{headerTitle:`${(Ae=(Ze=(te=c==null?void 0:c.metadata.title)!==null&&te!==void 0?te:s)!==null&&Ze!==void 0?Ze:c==null?void 0:c.metadata.name)!==null&&Ae!==void 0?Ae:""}${z&&z!==Qr.zG?` in ${z}`:""}`,headerType:(()=>{let ft=I.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(ft+=" \u2014 ",ft+=c.spec.type.toLocaleLowerCase("en-US")),ft})()}}function Qs(i){var t;const{entity:s}=i,c=(0,Hn.hF)(s,Qr.S4);return(0,r.jsxs)(r.Fragment,{children:[c.length>0&&(0,r.jsx)(ge.i9,{label:"Owner",value:(0,r.jsx)(Hn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,r.jsx)(ge.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const qi=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:I,NotFoundComponent:k}=i,{kind:z,namespace:te,name:Ze}=(0,y.Oi)(Hn.wi),{entity:Ae,loading:tt,error:ft}=(0,Hn.ce)(),bt=(0,m.TH)(),St=(0,y.vJ)(I,ji=>ji.selectByComponentData({key:Do,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Fr})=>{if(Ae){if(Fr.if&&!Fr.if(Ae))return[]}else return[];return[{path:Fr.path,title:Fr.title,children:Fr.children,tabProps:Fr.tabProps}]}),[Ae]),{headerTitle:Ut,headerType:Mt}=ys(z,te,Ze,Ae),[Un,tr]=(0,F.useState)(!1),[ur,eo]=(0,F.useState)(!1),Ho=(0,m.s0)(),As=async()=>{tr(!1),eo(!1),Ho("/")};(0,F.useEffect)(()=>{tr(!1),eo(!1)},[bt.pathname]);var Go;return(0,r.jsxs)(ge.T3,{themeId:(Go=Ae==null||(t=Ae.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&Go!==void 0?Go:"home",children:[(0,r.jsx)(ge.h4,{title:(0,r.jsx)(Js,{title:Ut,entity:Ae}),pageTitleOverride:Ut,type:Mt,children:Ae&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Qs,{entity:Ae}),(0,r.jsx)(vs,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>eo(!0)})]})}),tt&&(0,r.jsx)(ge.Ex,{}),Ae&&(0,r.jsx)(ge.tn,{routes:St}),ft&&(0,r.jsx)(ge.VY,{children:(0,r.jsx)(ps.Z,{severity:"error",children:ft.toString()})}),!tt&&!ft&&!Ae&&(0,r.jsx)(ge.VY,{children:k||(0,r.jsxs)(ge.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,r.jsx)(ge.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Hn.pp,{open:Un,entity:Ae,onConfirm:As,onClose:()=>tr(!1)}),(0,r.jsx)(Hn.U_,{open:ur,entity:Ae,onClose:()=>eo(!1)})]})};qi.Route=er;function dr(i){const{open:t,onClose:s,onConfirm:c,entity:f}=i,[I,k]=useState(!1),z=useApi(catalogApiRef),te=useApi(alertApiRef),Ze=async()=>{k(!0);try{const Ae=f.metadata.uid;await z.removeEntityByUid(Ae),c()}catch(Ae){assertError(Ae),te.post({message:Ae.message})}finally{k(!1)}};return _jsxs(Dialog,{open:t,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:I,onClick:Ze,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Xr=n(19625);function _i(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function ea(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,c]=useState(!1),{entity:f}=useEntity(),I=async()=>{c(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:f,onConfirm:I,onClose:()=>c(!1)})]})}var Xs=n(4791);const _s=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function qr(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(f=>{var I,k;return{errors:((k=(I=f.entity.status)===null||I===void 0?void 0:I.items)!==null&&k!==void 0?k:[]).filter(_s).map(Ze=>Ze.error).filter(Ze=>Boolean(Ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ei(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await qr(stringifyEntityRef(i),s)).items.length>0}function ti(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:c,error:f,value:I}=useAsync(async()=>qr(t,s),[t,s]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!I?null:_jsx(_Fragment,{children:I.items.map((k,z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((te,Ze)=>_jsx(ResponseErrorPanel,{error:te},Ze))]},z))})}const No="core.backstage.entitySwitch",Fo=i=>null;(0,y.R5)(Fo,No,!0);const Uo=i=>{var t;const{entity:s,loading:c}=(0,Hn.ce)(),f=(0,y.I_)(),I=(0,y.vJ)(i.children,te=>te.selectByComponentData({key:No,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ze=>{if(c)return[];const{if:Ae,children:tt}=Ze.props;return s?[{if:Ae==null?void 0:Ae(s,{apis:f}),children:tt}]:[{if:Ae===void 0,children:tt}]}),[f,s,c]);if(I.some(te=>typeof te.if=="object"&&"then"in te.if))return(0,r.jsx)(ni,{results:I,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const te=I.filter(Ze=>Ze.if).map(Ze=>Ze.children);return te.length===0?_r(I):(0,r.jsx)(r.Fragment,{children:te})}var z;return(z=(t=I.find(te=>te.if))===null||t===void 0?void 0:t.children)!==null&&z!==void 0?z:_r(I)};function ni({results:i,renderMultipleMatches:t}){const{loading:s,value:c}=(0,pe.default)(async()=>{const f=i.map(async({if:k,children:z})=>{try{if(await k)return z}catch{}return null});if(t==="all"){const k=(await Promise.all(f)).filter(Boolean);return k.length===0?_r(i):(0,r.jsx)(r.Fragment,{children:k})}var I;return(I=(await Promise.all(f)).find(Boolean))!==null&&I!==void 0?I:_r(i)},[i]);return s||!c?null:c}function _r(i){var t;return(t=i.filter(s=>s.if===void 0)[0].children)!==null&&t!==void 0?t:null}Uo.Case=Fo;const ri=null,oi=Hn._i.Filters,ta=Hn._i.Content;var Mo=n(85877),si=n(15096);const Nn=(0,y.rx)({id:"catalog",apis:[(0,y.ni)({api:Hn.Ah,deps:{discoveryApi:y.NW,fetchApi:y.gP},factory:({discoveryApi:i,fetchApi:t})=>new Xs.MS({discoveryApi:i,fetchApi:t})}),(0,y.ni)({api:Hn.p3,deps:{storageApi:y.E6},factory:({storageApi:i})=>new ko({storageApi:i})})],routes:{catalogIndex:Xr._Z,catalogEntity:Hn.wi},externalRoutes:{createComponent:Xr.yw,viewTechDoc:Xr.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ii=Nn.provide((0,y.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:Xr._Z})),xs=Nn.provide((0,y.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Hn.wi})),na=Nn.provide((0,y.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,33414)).then(i=>i.AboutCard)}})),ra=Nn.provide((0,y.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),oa=Nn.provide((0,y.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),ai=Nn.provide((0,y.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),sa=Nn.provide((0,y.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),zo=Nn.provide((0,y.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),li=Nn.provide((0,y.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),ia=Nn.provide((0,y.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),ci=Nn.provide((0,y.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),aa=Nn.provide((0,y.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),di=Nn.provide((0,y.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),ui=Nn.provide((0,si.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Fn=n(32838);class hi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const f=`${await this.getApiOrigin()}/${s}`,I=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(I.status===404)throw new Error("Page not found");return I.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,c){const f=await this.getApiOrigin();return new URL(t,`${f}/${c}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:c}){this.configApi=t,this.discoveryApi=s,this.identityApi=c}}class pi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:c}){this.configApi=t,this.discoveryApi=s,this.identityApi=c}}const fi=[(0,y.ni)({api:Te.Dl,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new hi({configApi:i,discoveryApi:t,identityApi:s})}),(0,y.ni)({api:Te.gT,deps:{configApi:y.Ds,discoveryApi:y.NW,identityApi:y.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new pi({configApi:i,discoveryApi:t,identityApi:s})}),(0,y.ni)({api:Fn.q3,deps:{configApi:y.Ds},factory:({configApi:i})=>Fn.ae.fromConfig(i)})],bs={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},gi={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function la(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Wo(){const i=await jo(),t=await la();return[...i,{context:"detected",data:t?bs:gi}]}var mi=n(58845);const vi=(0,Dr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var fo=()=>{const i=vi();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 yi=(0,Dr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ss=()=>{const i=yi();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 xi=(0,Dr.Z)({root:{width:ge.po.drawerWidthClosed,height:3*ge.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:ge.po.drawerWidthClosed,marginLeft:24}}),ua=()=>{const i=xi(),{isOpen:t}=(0,ge.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(ge.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,r.jsx)(fo,{}):(0,r.jsx)(Ss,{})})})},ha=({children:i})=>(0,r.jsxs)(ge.tR,{children:[(0,r.jsxs)(ge.YE,{children:[(0,r.jsx)(ua,{}),(0,r.jsx)(ge.v7,{}),(0,r.jsx)(ge.R6,{icon:mi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var bi=n(32388),pa=n(4142);const fa=(0,Dr.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 Qn;(function(i){i.LIGHT="light",i.DARK="dark"})(Qn||(Qn={}));const Vo=()=>{const i=(0,y.h_)(y.hg),t=fa(),[s,c]=(0,F.useState)(i.getActiveThemeId()===Qn.DARK?Qn.DARK:Qn.LIGHT),f={[Qn.LIGHT]:{icon:pa.Z,title:"Dark theme"},[Qn.DARK]:{icon:bi.Z,title:"Light theme"}},{title:I,icon:k}=f[s],z=()=>{c(te=>{const Ze=te===Qn.LIGHT?Qn.DARK:Qn.LIGHT;return i.setActiveThemeId(Ze),Ze})};return(0,r.jsx)(co.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(gs.ZP,{title:I,arrow:!0,children:(0,r.jsx)(Jn.Z,{size:"small",onClick:z,children:(0,r.jsx)(k,{className:t.headerIcon})})})})},Si=()=>(0,r.jsxs)(T.I6,{children:[(0,r.jsx)(S.S,{}),(0,r.jsx)(B.F,{withSearch:!1})]}),go=(0,r.jsx)(Si,{}),Cs=us({apis:fi,configLoader:Wo,plugins:Object.values(h)}),ws=Cs.getProvider(),Ci=Cs.getRouter(),wi=T.s4.provide((0,Te.KY)({name:"ThemeToggleAddon",component:Vo,location:Te.oZ.Header})),js=(0,r.jsxs)(To,{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)(xs,{})}),(0,r.jsx)(m.AW,{path:"/docs",element:(0,r.jsx)(T.Jl,{}),children:(0,r.jsx)(w.u,{})}),(0,r.jsxs)(m.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(T.I6,{}),children:[go,(0,r.jsx)(Te.DR,{children:(0,r.jsx)(wi,{})})]})]});var Es=()=>(0,r.jsx)(ws,{children:(0,r.jsx)(Ci,{children:(0,r.jsx)(ha,{children:js})})});P.render((0,r.jsx)(Es,{}),document.getElementById("root"))},51837:function(Ct,Be,n){"use strict";n.d(Be,{CT:function(){return y},EI:function(){return xe},uW:function(){return P},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=h(),F=V=>`__@backstage/${V}__`;function P(V,K){const S=F(V);let B=r[S];return B||(B=K(),r[S]=B,B)}var m=n(2784);function y(V){return P(V,()=>(0,m.createContext)(void 0))}function l(V){return(0,m.useContext)(y(V))}function M(V){return{set(K){globalThis[`__@backstage/${V}__`]=createContext(createVersionedValueMap(K))},reset(){delete globalThis[`__@backstage/${V}__`]}}}function xe(V){Object.freeze(V);const K={atVersion(S){return V[S]}};return Object.defineProperty(K,"$map",{configurable:!0,enumerable:!0,get(){return V}}),K}},96641:function(Ct,Be,n){"use strict";n.d(Be,{X2:function(){return xe},ce:function(){return V},h$:function(){return l}});var h=n(52322),r=n(25271),F=n(60871),P=n(51837),m=n(2784);const y=(0,P.CT)("entity-context"),l=K=>{const{children:S,entity:B,loading:Y,error:ce,refresh:ee}=K,X={entity:B,loading:Y,error:ce,refresh:ee};return(0,h.jsx)(y.Provider,{value:(0,P.EI)({1:X}),children:(0,h.jsx)(F.fC,{attributes:{...B?{entityRef:(0,r.eE)(B)}:void 0},children:S})})},M=K=>_jsx(l,{entity:K.entity,loading:!Boolean(K.entity),error:void 0,refresh:void 0,children:K.children});function xe(){const K=(0,P.Vt)("entity-context");if(!K)throw new Error("Entity context is not available");const S=K.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");if(!S.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:S.entity}}function V(){const K=(0,P.Vt)("entity-context");if(!K)throw new Error("Entity context is not available");const S=K.atVersion(1);if(!S)throw new Error("EntityContext v1 not available");const{entity:B,loading:Y,error:ce,refresh:ee}=S;return{entity:B,loading:Y,error:ce,refresh:ee}}},40303:function(Ct,Be,n){"use strict";n.d(Be,{h$:function(){return Ee.h$},n3:function(){return h.n3},_i:function(){return O},tW:function(){return Oe},df:function(){return It},UO:function(){return Sn},dq:function(){return q},nl:function(){return Br},dx:function(){return Ue},rI:function(){return st},u3:function(){return _e},xE:function(){return dn},sL:function(){return vn},LH:function(){return C},U_:function(){return io},pp:function(){return _o},EW:function(){return Ro},Ah:function(){return F},wi:function(){return Te},hF:function(){return je.hF},CV:function(){return je.CV},$3:function(){return Qe},p3:function(){return P},ce:function(){return Ee.ce},X2:function(){return Ee.X2},wp:function(){return Pt},ZW:function(){return jn},eK:function(){return _n},CR:function(){return wn}});var h=n(4791),r=n(60871);const F=(0,r.T0)({id:"plugin.catalog.service"}),P=(0,r.T0)({id:"catalog-react.starred-entities"});var m=n(82394);class y{async toggleStarred(A){this.starredEntities.delete(A)||this.starredEntities.add(A);for(const L of this.subscribers)L.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(A=>(A.next(new Set(this.starredEntities)),this.subscribers.add(A),()=>{this.subscribers.delete(A)}))}}var l=n(52322),M=n(2784),xe=n(41156),V=n(60364),K=n(77277),S=n(4190),B=n(95544),Y=n(90436),ce=n(60905),ee=n(36444);const X=b=>{const A=(0,xe.Z)(se=>se.breakpoints.down("md")),L=(0,V.Z)(),[D,_]=(0,M.useState)(!1);return A?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>_(!0),startIcon:(0,l.jsx)(ee.Z,{}),children:"Filters"}),(0,l.jsx)(S.ZP,{open:D,onClose:()=>_(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(B.Z,{m:2,children:[(0,l.jsx)(Y.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),b.children]})})]}):(0,l.jsx)(ce.Z,{item:!0,lg:2,children:b.children})},w=b=>(0,l.jsx)(ce.Z,{item:!0,xs:12,lg:10,children:b.children}),O=b=>(0,l.jsx)(ce.Z,{container:!0,style:{position:"relative"},children:b.children});O.Filters=X,O.Content=w;var $=n(23196),T=n(25271),ne=n(51837);const Te=(0,ne.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function qe(b){var A,L;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(L=(A=b.metadata.namespace)===null||A===void 0?void 0:A.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:b.metadata.name}}function Qe(b,A){const L=A==null?void 0:A.defaultKind;let D,_,se;return"metadata"in b?(D=b.kind,_=b.metadata.namespace,se=b.metadata.name):(D=b.kind,_=b.namespace,se=b.name),(_===void 0||_==="")&&(_=T.zG),(A==null?void 0:A.defaultNamespace)!==void 0?(A==null?void 0:A.defaultNamespace)===_&&(_=void 0):_===T.zG&&(_=void 0),D=D.toLocaleLowerCase("en-US"),D=L&&L.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${_?`${_}/`:""}${se}`}var it=n(80030);const Ue=(0,M.forwardRef)((b,A)=>{const{entityRef:L,defaultKind:D,title:_,children:se,...oe}=b,fe=(0,r.tg)(Te);let Se,Re,ge;if(typeof L=="string"){const $e=(0,T.of)(L);Se=$e.kind,Re=$e.namespace,ge=$e.name}else"metadata"in L?(Se=L.kind,Re=L.metadata.namespace,ge=L.metadata.name):(Se=L.kind,Re=L.namespace,ge=L.name);Se=Se.toLocaleLowerCase("en-US");var ke;Re=(ke=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&ke!==void 0?ke:T.zG;const et={kind:Se,namespace:Re,name:ge},Xe=Qe({kind:Se,namespace:Re,name:ge},{defaultKind:D}),ot=(0,l.jsxs)($.rU,{...oe,ref:A,to:fe(et),children:[se,!se&&(_!=null?_:Xe)]});return _?(0,l.jsx)(it.ZP,{title:Xe,children:ot}):ot});var Et=n(64279);function He(b){const{entityRefs:A,defaultKind:L,getTitle:D,..._}=b,se=(0,r.h_)(F),{value:oe=new Array,loading:fe,error:Se}=(0,Et.default)(async()=>{const Re=A.reduce((ke,et)=>"metadata"in et?ke:[...ke,(0,T.of)(et)],new Array),ge=A.filter(ke=>"metadata"in ke);return Re.length>0?[...(await se.getEntities({filter:Re.map(ke=>({kind:ke.kind,"metadata.namespace":ke.namespace,"metadata.name":ke.name}))})).items,...ge]:ge},[A]);return fe?(0,l.jsx)($.Ex,{}):Se?(0,l.jsx)($.yu,{error:Se}):(0,l.jsx)(l.Fragment,{children:oe.map((Re,ge)=>(0,l.jsxs)(M.Fragment,{children:[ge>0&&", ",(0,l.jsx)(Ue,{..._,defaultKind:L,entityRef:Re,title:D(Re)})]},ge))})}function st(b){const{entityRefs:A,defaultKind:L,fetchEntities:D,getTitle:_,...se}=b;return D?(0,l.jsx)(He,{...se,defaultKind:L,entityRefs:A,getTitle:_}):(0,l.jsx)(l.Fragment,{children:A.map((oe,fe)=>(0,l.jsxs)(M.Fragment,{children:[fe>0&&", ",(0,l.jsx)(Ue,{...se,defaultKind:L,entityRef:oe,title:_?_(oe):void 0})]},fe))})}var je=n(49280);class At{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(A){this.value=A}}class wt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(A){this.value=A}}class gt{filterEntity(A){var L;return this.values.every(D=>((L=A.metadata.tags)!==null&&L!==void 0?L:[]).includes(D))}toQueryValue(){return this.values}constructor(A){this.values=A}}class xt{filterEntity(A){const L=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([A.metadata.tags]),_=this.toUpperArray([A.metadata.name,A.metadata.title]);for(const se of L)if(D.every(oe=>oe!==se)&&_.every(oe=>!oe.includes(se)))return!1;return!0}toUpperArray(A){return A.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(A){this.value=A}}class Tt{filterEntity(A){return this.values.some(L=>(0,je.hF)(A,T.S4).some(D=>Qe(D,{defaultKind:"group"})===L))}toQueryValue(){return this.values}constructor(A){this.values=A}}class Lt{filterEntity(A){return this.values.some(L=>{var D;return((D=A.spec)===null||D===void 0?void 0:D.lifecycle)===L})}toQueryValue(){return this.values}constructor(A){this.values=A}}class ze{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,L,D){this.value=A,this.isOwnedEntity=L,this.isStarredEntity=D}}class Ie{filterEntity(A){var L;const D=(L=A.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(A){this.value=A}}class we{filterEntity(A){var L,D;const _=(A==null||(L=A.status)===null||L===void 0||(D=L.items)===null||D===void 0?void 0:D.length)>0;return _!==void 0&&this.value===_}constructor(A){this.value=A}}var Ee=n(96641),Ne=n(76635),nt=n.n(Ne),zt=n(19126),ht=n.n(zt),Nt=n(79635),vt=n(69294),jt=n(48760),en=n(90736);const on=(0,M.createContext)(void 0),Sn=b=>{const A=(0,en.default)(),L=(0,r.h_)(F),[D,_]=(0,M.useState)({}),se=(0,Nt.TH)();var oe;const fe=(0,M.useMemo)(()=>(oe=ht().parse(se.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[se]),[Se,Re]=(0,M.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ge,error:ke},et]=(0,vt.default)(async()=>{const $e=(0,Ne.compact)(Object.values(D)),mt=(0,je.Gz)($e),Dt=(0,je.wq)($e),fn=(0,je.wq)((0,Ne.compact)(Object.values(Se.appliedFilters))),qt=Object.keys(D).reduce((gn,En)=>{const An=D[En];return An!=null&&An.toQueryValue&&(gn[En]=An.toQueryValue()),gn},{});if((0,Ne.isEqual)(fn,Dt))Re({appliedFilters:D,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(mt)});else{const gn=await L.getEntities({filter:Dt});Re({appliedFilters:D,backendEntities:gn.items,entities:gn.items.filter(mt)})}if(A()){var Pn;const gn=ht().parse(se.search,{ignoreQueryPrefix:!0}),En=ht().stringify({...gn,filters:qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),An=`${window.location.pathname}${En}`;(Pn=window.history)===null||Pn===void 0||Pn.replaceState(null,document.title,An)}},[L,fe,D,Se],{loading:!0});(0,jt.Z)(et,10,[D]);const Xe=(0,M.useCallback)($e=>{_(mt=>{const Dt=typeof $e=="function"?$e(mt):$e;return{...mt,...Dt}})},[]),ot=(0,M.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:Xe,queryParameters:fe,loading:ge,error:ke}),[Se,Xe,fe,ge,ke]);return(0,l.jsx)(on.Provider,{value:ot,children:b.children})};function Pt(){const b=(0,M.useContext)(on);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var an=n(18149),Cn=n.n(an),Tn=n(829),ln=n.n(Tn);function qn(){const b=(0,r.h_)(F),{filters:{kind:A,type:L},queryParameters:{type:D},updateFilters:_}=Pt(),se=(0,M.useMemo)(()=>[D].flat().filter(Boolean),[D]);var oe;const[fe,Se]=(0,M.useState)(se.length?se:(oe=L==null?void 0:L.getTypes())!==null&&oe!==void 0?oe:[]);(0,M.useEffect)(()=>{se.length&&Se(se)},[se]);const[Re,ge]=(0,M.useState)([]),ke=(0,M.useMemo)(()=>A==null?void 0:A.value,[A]),{error:et,loading:Xe,value:ot}=(0,Et.default)(async()=>ke?await b.getEntityFacets({filter:{kind:ke},facets:["spec.type"]}).then(Dt=>Dt.facets["spec.type"]||[]):[],[ke,b]),$e=(0,M.useRef)(ot);return(0,M.useEffect)(()=>{const mt=$e.current;if($e.current=ot,Xe||!ke||mt===ot||!ot)return;const Dt=[...new Set(ln()(ot,qt=>-qt.count).map(qt=>qt.value.toLocaleLowerCase("en-US")))];ge(Dt);const fn=fe.filter(qt=>Dt.includes(qt));Cn()(fe,fn)||Se(fn)},[Xe,ke,fe,Se,ot]),(0,M.useEffect)(()=>{_({type:fe.length?new wt(fe):void 0})},[fe,_]),{loading:Xe,error:et,availableTypes:Re,selectedTypes:fe,setSelectedTypes:Se}}const On=20;function _n(b,A){var L,D;const _=A==null||(L=A.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),se=A==null||(D=A.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),oe=(0,r.h_)(F),{loading:fe,value:Se,error:Re}=(0,Et.default)(async()=>{var ge;const ke=(ge=b.relations)===null||ge===void 0?void 0:ge.map($e=>({type:$e.type,target:(0,T.of)($e.targetRef)})).filter($e=>(!_||$e.type.toLocaleLowerCase("en-US")===_)&&(!se||$e.target.kind===se));if(!ke)return[];const et=Object.values((0,Ne.groupBy)(ke,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),Xe=[];for(const $e of et)Xe.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,Ne.chunk)($e.map(mt=>mt.target.name),On)});return(await Promise.all(Xe.flatMap($e=>$e.nameBatches.map(mt=>oe.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":mt}}))))).flatMap($e=>$e.items)},[b,_,se]);return{entities:Se,loading:fe,error:Re}}var lt=n(72164);function Bn(b){return typeof b=="string"?b:(0,T.eE)(b)}function wn(){const b=(0,r.h_)(P),A=(0,lt.Z)(b.starredEntitie$(),new Set),L=(0,M.useCallback)(_=>A.has(Bn(_)),[A]),D=(0,M.useCallback)(_=>b.toggleStarred(Bn(_)).then(),[b]);return{starredEntities:A,toggleStarredEntity:D,isStarredEntity:L}}function cn(b){return typeof b=="string"?b:(0,T.eE)(b)}function $n(b){const A=(0,r.h_)(P),[L,D]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{const se=A.starredEntitie$().subscribe({next(oe){D(oe.has(cn(b)))}});return()=>{se.unsubscribe()}},[b,A]),{toggleStarredEntity:(0,M.useCallback)(()=>A.toggleStarred(cn(b)).then(),[b,A]),isStarredEntity:L}}var Wn=n(75435);function jn(){const b=(0,r.h_)(r.$4),{loading:A,value:L}=(0,Et.default)(async()=>{const{ownershipEntityRefs:_}=await b.getBackstageIdentity();return _},[]),D=(0,M.useMemo)(()=>{const _=new Set(L!=null?L:[]);return se=>{const oe=(0,Wn.h)(se,T.S4).map(T.eE);for(const fe of oe)if(_.has(fe))return!0;return!1}},[L]);return(0,M.useMemo)(()=>({loading:A,isOwnedEntity:D}),[A,D])}function Gn(){const b=(0,r.h_)(F),{error:A,loading:L,value:D}=(0,Et.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(se=>{var oe;return((oe=se.facets.kind)===null||oe===void 0?void 0:oe.map(fe=>fe.value).sort())||[]}),[b]);return{loading:L,error:A,allKinds:D!=null?D:[]}}function ve(b,A,L){let D=b;return A&&(D=D.filter(se=>A.some(oe=>oe.toLocaleLowerCase("en-US")===se.toLocaleLowerCase("en-US")))),L&&!b.some(se=>se.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(D=D.concat([L])),D.sort().reduce((se,oe)=>(se[oe.toLocaleLowerCase("en-US")]=oe,se),{})}function re(b){var A;const{filters:L,queryParameters:{kind:D},updateFilters:_}=Pt(),se=(0,M.useMemo)(()=>[D].flat()[0],[D]);var oe;const[fe,Se]=(0,M.useState)((oe=se!=null?se:(A=L.kind)===null||A===void 0?void 0:A.value)!==null&&oe!==void 0?oe:b.initialFilter);(0,M.useEffect)(()=>{se&&Se(se)},[se]),(0,M.useEffect)(()=>{var et;if(!((et=L.kind)===null||et===void 0)&&et.value){var Xe;Se((Xe=L.kind)===null||Xe===void 0?void 0:Xe.value)}},[L.kind]),(0,M.useEffect)(()=>{_({kind:fe?new At(fe):void 0})},[fe,_]);const{allKinds:Re,loading:ge,error:ke}=Gn();return{loading:ge,error:ke,allKinds:Re!=null?Re:[],selectedKind:fe,setSelectedKind:Se}}const Oe=b=>{const{allowedKinds:A,hidden:L,initialFilter:D="component"}=b,_=(0,r.h_)(r.$v),{error:se,allKinds:oe,selectedKind:fe,setSelectedKind:Se}=re({initialFilter:D});if((0,M.useEffect)(()=>{se&&_.post({message:"Failed to load entity kinds",severity:"error"})},[se,_]),se)return null;const Re=ve(oe,A,fe),ge=Object.keys(Re).map(ke=>({value:ke,label:Re[ke]}));return L?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsx)($.Ph,{label:"Kind",items:ge,selected:fe.toLocaleLowerCase("en-US"),onChange:ke=>Se(String(ke))})})};var Pe=n(79692),Ge=n(5806),pt=n(21324),Ht=n(86619),Rt=n(19996),de=n(25505),U=n(38016),he=n(88013);const Ke=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ve=(0,l.jsx)(de.Z,{fontSize:"small"}),at=(0,l.jsx)(Rt.Z,{fontSize:"small"}),It=b=>{var A;const{initialFilter:L=[]}=b,D=Ke(),{updateFilters:_,backendEntities:se,filters:oe,queryParameters:{lifecycles:fe}}=Pt(),Se=(0,M.useMemo)(()=>[fe].flat().filter(Boolean),[fe]);var Re;const[ge,ke]=(0,M.useState)(Se.length?Se:(Re=(A=oe.lifecycles)===null||A===void 0?void 0:A.values)!==null&&Re!==void 0?Re:L);(0,M.useEffect)(()=>{Se.length&&ke(Se)},[Se]);const et=(0,M.useMemo)(()=>[...new Set(se.map(Xe=>{var ot;return(ot=Xe.spec)===null||ot===void 0?void 0:ot.lifecycle}).filter(Boolean))].sort(),[se]);return(0,M.useEffect)(()=>{_({lifecycles:ge.length&&et.length?new Lt(ge):void 0})},[ge,_,et]),et.length?(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:et,value:ge,onChange:(Xe,ot)=>ke(ot),renderOption:(Xe,{selected:ot})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(pt.Z,{icon:Ve,checkedIcon:at,checked:ot}),label:Xe}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Xe=>(0,l.jsx)(Ht.Z,{...Xe,className:D.input,variant:"outlined"})})]})}):null},tn=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Xt=(0,l.jsx)(de.Z,{fontSize:"small"}),sn=(0,l.jsx)(Rt.Z,{fontSize:"small"}),q=()=>{var b;const A=tn(),{updateFilters:L,backendEntities:D,filters:_,queryParameters:{owners:se}}=Pt(),oe=(0,M.useMemo)(()=>[se].flat().filter(Boolean),[se]);var fe;const[Se,Re]=(0,M.useState)(oe.length?oe:(fe=(b=_.owners)===null||b===void 0?void 0:b.values)!==null&&fe!==void 0?fe:[]);(0,M.useEffect)(()=>{oe.length&&Re(oe)},[oe]);const ge=(0,M.useMemo)(()=>[...new Set(D.flatMap(ke=>(0,je.hF)(ke,T.S4).map(et=>Qe(et,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return(0,M.useEffect)(()=>{L({owners:Se.length&&ge.length?new Tt(Se):void 0})},[Se,L,ge]),ge.length?(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ge,value:Se,onChange:(ke,et)=>Re(et),renderOption:(ke,{selected:et})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(pt.Z,{icon:Xt,checkedIcon:sn,checked:et}),label:ke}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"owner-picker-expand"}),renderInput:ke=>(0,l.jsx)(Ht.Z,{...ke,className:A.input,variant:"outlined"})})]})}):null},W=b=>{const A=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:A(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},le=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),g=b=>{var A;const L=(A=b.entity.spec.profile)===null||A===void 0?void 0:A.email;return L?_jsx(EmailCardAction,{email:L}):null},R=b=>{var A;const L=(A=b.entity.spec.profile)===null||A===void 0?void 0:A.email;return L?_jsx(EmailCardAction,{email:L}):null},J=(0,Pe.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),G=4,ae=b=>{var A,L,D;const{entityRef:_,children:se,delayTime:oe=500}=b,fe=J(),Se=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ge,ke]=useState(!1),et=useMemo(()=>debounce(()=>ke(!0),oe),[oe]),[{loading:Xe,error:ot,value:$e},mt]=useAsyncFn(async()=>{const fn=Se.get(catalogApiRef);if(fn){const qt=await fn.getEntityByRef(_);if(!qt)throw new Error(`${_} not found`);return qt}},[Se,_]),Dt=()=>{ke(!1),et.cancel()};return useEffect(()=>{Re.isOpen&&!$e&&!ot&&!Xe&&mt()},[Re.isOpen,mt,$e,ot,Xe]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:et,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:se})}),ge&&_jsx(HoverPopover,{PaperProps:{className:fe.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Dt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[ot&&_jsx(ResponseErrorPanel,{error:ot}),Xe&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:fe.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(A=$e.spec)===null||A===void 0?void 0:A.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,G).map(fn=>_jsx(Chip,{size:"small",label:fn},fn)),((L=$e.metadata.tags)===null||L===void 0?void 0:L.length)&&((D=$e.metadata.tags)===null||D===void 0?void 0:D.length)>G&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!ot&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},me=(0,Pe.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Fe=()=>{var b;const A=me(),{filters:L,updateFilters:D}=useEntityList();var _;const[se,oe]=useState((_=(b=L.text)===null||b===void 0?void 0:b.value)!==null&&_!==void 0?_:"");return useDebounce(()=>{D({text:se.length?new EntityTextFilter(se):void 0})},250,[se,D]),_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:fe=>oe(fe.target.value),value:se,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:se.length===0,children:_jsx(Clear,{})})})})})})},Ye=Object.freeze({createEntityRefColumn(b){const{defaultKind:A}=b;function L(D){var _;return((_=D.metadata)===null||_===void 0?void 0:_.title)||Qe(D,{defaultKind:A})}return{title:"Name",highlight:!0,customFilterAndSearch(D,_){return L(_).includes(D)},customSort(D,_){return L(D).localeCompare(L(_))},render:D=>{var _;return(0,l.jsx)(Ue,{entityRef:D,defaultKind:A,title:(_=D.metadata)===null||_===void 0?void 0:_.title})}}},createEntityRelationColumn(b){const{title:A,relation:L,defaultKind:D,filter:_}=b;function se(fe){return(0,je.hF)(fe,L,_)}function oe(fe){return se(fe).map(Se=>Qe(Se,{defaultKind:D})).join(", ")}return{title:A,customFilterAndSearch(fe,Se){return oe(Se).includes(fe)},customSort(fe,Se){return oe(fe).localeCompare(oe(Se))},render:fe=>(0,l.jsx)(st,{entityRefs:se(fe),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:T.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:T.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:T.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,l.jsx)($.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),dt=[Ye.createEntityRefColumn({defaultKind:"system"}),Ye.createDomainColumn(),Ye.createOwnerColumn(),Ye.createMetadataDescriptionColumn()],yt=[Ye.createEntityRefColumn({defaultKind:"component"}),Ye.createSystemColumn(),Ye.createOwnerColumn(),Ye.createSpecTypeColumn(),Ye.createSpecLifecycleColumn(),Ye.createMetadataDescriptionColumn()],rt=(0,Pe.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),_e=b=>{const{entities:A,title:L,emptyContent:D,variant:_="gridItem",columns:se}=b,oe=rt(),fe={minWidth:"0",width:"100%"};return _==="gridItem"&&(fe.height="calc(100% - 10px)"),(0,l.jsx)($.iA,{columns:se,title:L,style:fe,emptyContent:D&&(0,l.jsx)("div",{className:oe.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:A})};_e.columns=Ye,_e.systemEntityColumns=dt,_e.componentEntityColumns=yt;const De=(0,l.jsx)(de.Z,{fontSize:"small"}),$t=(0,l.jsx)(Rt.Z,{fontSize:"small"});function Kt({selected:b}){return(0,l.jsx)(pt.Z,{icon:De,checkedIcon:$t,checked:b})}const kt=(0,M.memo)(b=>{const{selected:A,value:L,availableOptions:D,showCounts:_}=b,se=_?`${L} (${D==null?void 0:D[L]})`:L;return(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(Kt,{selected:A}),label:se})});var Zt=n(72779),Wt=n.n(Zt);const Gt=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function ut(b){const A=Gt();return(0,l.jsx)(Ht.Z,{variant:"outlined",...b,className:Wt()(A.input,b.className)})}function We(b){var A;const{label:L,name:D,path:_,showCounts:se,Filter:oe,InputProps:fe}=b,{updateFilters:Se,filters:Re,queryParameters:{[D]:ge}}=Pt(),ke=(0,r.h_)(F),{value:et}=(0,Et.default)(async()=>{var qt;const Pn=_,{facets:gn}=await ke.getEntityFacets({facets:[Pn],filter:(qt=Re.kind)===null||qt===void 0?void 0:qt.getCatalogFilters()});return Object.fromEntries(gn[Pn].map(({value:En,count:An})=>[En,An]))},[Re.kind]),Xe=(0,M.useMemo)(()=>[ge].flat().filter(Boolean),[ge]);var ot;const[$e,mt]=(0,M.useState)(Xe.length?Xe:(ot=(A=Re[D])===null||A===void 0?void 0:A.values)!==null&&ot!==void 0?ot:[]);(0,M.useEffect)(()=>{Xe.length&&!nt().isEqual($e,Xe)&&mt(Xe)},[$e,Xe]);const Dt=Object.keys(et!=null?et:{}),fn=$e.length&&Dt.length;return(0,M.useEffect)(()=>{Se({[D]:fn?new oe($e):void 0})},[D,fn,$e,oe,Se]),Re[D]&&!("values"in Re[D])||!Dt.length?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:[L,(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Dt,value:$e,onChange:(qt,Pn)=>mt(Pn),renderOption:(qt,{selected:Pn})=>(0,l.jsx)(kt,{selected:Pn,value:qt,availableOptions:et,showCounts:!!se}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:qt=>(0,l.jsx)(ut,{...qt,...fe})})]})})}const Ft=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),dn=b=>{const A=Ft();return(0,l.jsx)(We,{label:"Tags",name:"tags",path:"metadata.tags",Filter:gt,showCounts:b.showCounts,InputProps:{className:A.input}})},vn=b=>{const{hidden:A,initialFilter:L}=b,D=(0,r.h_)(r.$v),{error:_,availableTypes:se,selectedTypes:oe,setSelectedTypes:fe}=qn();if((0,M.useEffect)(()=>{_&&D.post({message:"Failed to load entity types",severity:"error"}),L&&fe([L])},[_,D,L,fe]),se.length===0||_)return null;const Se=[{value:"all",label:"all"},...se.map(ge=>({value:ge,label:ge}))];var Re;return A?null:(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsx)($.Ph,{label:"Type",items:Se,selected:(Re=Se.length>1?oe[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:ge=>fe(ge==="all"?[]:[String(ge)])})})};var In=n(15459),Zn=n(61837),yn=n(11640),Kn=n(28347);const xn=(0,In.Z)({root:{color:"#f3ba37"}})(yn.Z),C=b=>{const{toggleStarredEntity:A,isStarredEntity:L}=$n(b.entity);return(0,l.jsx)(Zn.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>A(),children:(0,l.jsx)(it.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,l.jsx)(xn,{}):(0,l.jsx)(Kn.Z,{})})})};var u=n(8629),x=n(79249),E=n(38724),Q=n(99152),pe=n(6487),Ce=n(49429),be=n(55999),ct=n(39412);const Vt=ct.Z;function un(b,A){if(b)return b.toLocaleLowerCase("en-US");if(A)try{return(0,T.of)(A).kind.toLocaleLowerCase("en-US")}catch{return}}function Yn(b,A){const L=(0,r.qD)(),D=un(b,A);return D&&L.getSystemIcon(`kind:${D}`)||Vt}function nr(b){const{kind:A,entityRef:L,...D}=b,_=Yn(A,L);return(0,l.jsx)(_,{...D})}const zr=(0,Pe.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 oo(b){const A=(0,r.h_)(F),L=(0,T.eE)(b),{loading:D,error:_,value:se}=(0,Et.default)(async()=>{const oe=await A.getEntityAncestors({entityRef:L}),fe=new Array,Se=new Array;for(const Re of oe.items){const ge=(0,T.eE)(Re.entity),ke=ge===oe.rootEntityRef;fe.push({id:ge,root:ke,...Re.entity});for(const et of Re.parentEntityRefs)Se.push({from:ge,to:et})}return{nodes:fe,edges:Se}},[L]);return{loading:D,error:_,nodes:(se==null?void 0:se.nodes)||[],edges:(se==null?void 0:se.edges)||[]}}function yo({node:b}){const A=zr(),L=(0,Nt.s0)(),D=(0,r.tg)(Te),[_,se]=(0,M.useState)(0),[oe,fe]=(0,M.useState)(0),Se=(0,M.useRef)(null);(0,M.useLayoutEffect)(()=>{if(Se.current){let{height:mt,width:Dt}=Se.current.getBBox();mt=Math.round(mt),Dt=Math.round(Dt),(mt!==oe||Dt!==_)&&(se(Dt),fe(mt))}},[_,oe]);const Re=10,ge=oe,ke=ge+Re,et=ke+_+Re*2,Xe=oe+Re*2,ot=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?Qe({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),$e=()=>{L(D({kind:b.kind,namespace:b.metadata.namespace||T.zG,name:b.metadata.name}))};return(0,l.jsxs)("g",{onClick:$e,className:A.clickable,children:[(0,l.jsx)("rect",{className:Wt()(A.node,b.root?"secondary":"primary"),width:et,height:Xe,rx:10}),(0,l.jsx)(nr,{kind:b.kind,y:Re,x:Re,width:ge,height:ge,className:Wt()(A.text,b.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:Se,className:Wt()(A.text,b.root?"secondary":"primary"),y:Xe/2,x:ke+(_+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:ot})]})}function xo(b){const{loading:A,error:L,nodes:D,edges:_}=oo(b.entity);return A?(0,l.jsx)($.Ex,{}):L?(0,l.jsx)($.Gk,{error:L}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(be.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)($.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(B.Z,{mt:4,children:(0,l.jsx)($.mn,{nodes:D,edges:_,renderNode:yo,direction:$.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=n(11776),Rn=n(38402),sr=n(86136),yr=n(99688),Tr=n(49378),Ir=n(54506),Wr=n(94339),bo=n(24579),Qo=n(27685);const Vr=(0,Pe.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 rr(b){const A=Vr();return(0,l.jsx)(Tr.Z,{...b,primaryTypographyProps:{className:A.monospace},secondaryTypographyProps:{className:A.monospace}})}function Rr(b){const A=Vr();return(0,l.jsx)(Ir.Z,{className:A.monospace,children:b.children})}function Lr(b){return(0,l.jsx)(B.Z,{mt:2,children:(0,l.jsx)(Wr.Z,{variant:"outlined",children:(0,l.jsxs)(bo.Z,{children:[(0,l.jsxs)(Y.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,l.jsx)(Gr,{to:b.helpLink})]}),b.children]})})})}function So(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function Hr(b){const[A,L]=b.entry,D=So(L);return(0,l.jsxs)(Rn.Z,{children:[b.indent&&(0,l.jsx)(sr.Z,{}),(0,l.jsx)(rr,{primary:A,secondary:D?(0,l.jsx)($.rU,{to:D,children:L}):L})]})}function Gr(b){const A=Vr();return(0,l.jsx)($.rU,{to:b.to,className:A.helpIcon,children:(0,l.jsx)(Qo.Z,{fontSize:"inherit"})})}const Pr=(0,Pe.Z)({root:{display:"flex",flexDirection:"column"}});function fr(b){var A,L;const D=(0,r.h_)(F),_=(0,T.eE)(b),se=(A=b.metadata.annotations)===null||A===void 0?void 0:A[T.P1],oe=(L=b.metadata.annotations)===null||L===void 0?void 0:L[T.q1],{loading:fe,error:Se,value:Re}=(0,Et.default)(async()=>!se&&!oe?[]:(await D.getEntities({filter:[...se?[{[`metadata.annotations.${T.P1}`]:se}]:[],...oe?[{[`metadata.annotations.${T.q1}`]:oe}]:[]]})).items,[se,oe]);return{loading:fe,error:Se,location:se,originLocation:oe,colocatedEntities:Re==null?void 0:Re.filter(ge=>(0,T.eE)(ge)!==_)}}function Kr(b){return(0,l.jsxs)(or.Z,{dense:!0,children:[b.header&&(0,l.jsx)(Hr,{entry:b.header},"header"),b.entities.map(A=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{children:(0,l.jsx)(nr,{kind:A.kind})}),(0,l.jsx)(rr,{primary:(0,l.jsx)(Ue,{entityRef:A})})]},(0,T.eE)(A)))]})}function Co(b){const{entity:A}=b,{loading:L,error:D,location:_,originLocation:se,colocatedEntities:oe}=fr(A);if(L)return(0,l.jsx)($.Ex,{});if(D)return(0,l.jsx)($.Gk,{error:D});if(!_&&!se)return(0,l.jsx)(yr.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,l.jsx)(yr.Z,{severity:"info",children:"There were no other entities on this location."});if(_===se)return(0,l.jsx)(Kr,{entities:oe});const fe=oe.filter(Re=>{var ge;return((ge=Re.metadata.annotations)===null||ge===void 0?void 0:ge[T.P1])===_}),Se=oe.filter(Re=>{var ge;return((ge=Re.metadata.annotations)===null||ge===void 0?void 0:ge[T.q1])===se});return(0,l.jsxs)(l.Fragment,{children:[fe.length>0&&(0,l.jsx)(Kr,{entities:fe,header:["At the same location",_]}),Se.length>0&&(0,l.jsx)(Kr,{entities:Se,header:["At the same origin",se]})]})}function wo(b){const A=Pr();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(be.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:A.root,children:(0,l.jsx)(Co,{entity:b.entity})})]})}function Yr(b){return Object.fromEntries([...Object.entries(b)].sort((A,L)=>A[0]<L[0]?-1:1))}function jo(b){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(be.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(be.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)($.Oi,{text:JSON.stringify(Yr(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Xo=n(3440),gr=n.n(Xo);const qo=(0,Pe.Z)({root:{display:"flex",flexDirection:"column"}});function so(b){var A,L;const D=qo(),{apiVersion:_,kind:se,metadata:oe,spec:fe,relations:Se=[],status:Re={}}=b.entity,ge=gr()(ln()(Se,ke=>ke.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:D.root,children:[(0,l.jsx)(Lr,{title:"Identity",children:(0,l.jsxs)(or.Z,{dense:!0,children:[(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(rr,{primary:"apiVersion",secondary:_})}),(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(rr,{primary:"kind",secondary:se})}),(fe==null?void 0:fe.type)&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(rr,{primary:"spec.type",secondary:fe.type})}),oe.uid&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(rr,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,l.jsx)(Rn.Z,{children:(0,l.jsx)(rr,{primary:"etag",secondary:oe.etag})})]})}),(0,l.jsxs)(Lr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsxs)(Rr,{children:["Annotations",(0,l.jsx)(Gr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(ke=>(0,l.jsx)(Hr,{indent:!0,entry:ke},ke[0]))}),!!Object.keys(oe.labels||{}).length&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:"Labels"}),children:Object.entries(oe.labels).map(ke=>(0,l.jsx)(Hr,{indent:!0,entry:ke},ke[0]))}),!!(!((A=oe.tags)===null||A===void 0)&&A.length)&&(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:"Tags"}),children:oe.tags.map((ke,et)=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{}),(0,l.jsx)(rr,{primary:ke})]},`${ke}-${et}`))})]}),!!Se.length&&(0,l.jsx)(Lr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(ge).map(([ke,et],Xe)=>(0,l.jsx)("div",{children:(0,l.jsx)(or.Z,{dense:!0,subheader:(0,l.jsx)(Rr,{children:ke}),children:et.map(ot=>(0,l.jsxs)(Rn.Z,{children:[(0,l.jsx)(sr.Z,{children:(0,l.jsx)(nr,{entityRef:ot.targetRef})}),(0,l.jsx)(rr,{primary:(0,l.jsx)(Ue,{entityRef:ot.targetRef})})]},ot.targetRef))})},Xe))}),!!(!((L=Re.items)===null||L===void 0)&&L.length)&&(0,l.jsx)(Lr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((ke,et)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y.Z,{children:[ke.level,": ",ke.type]}),(0,l.jsx)(B.Z,{ml:2,children:ke.message})]},et))})]})]})}var Eo=n(72847);function Ao(b){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(be.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(be.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)($.Oi,{text:Eo.ZP.stringify(Yr(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const kr=(0,Pe.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 xr(b){const{children:A,value:L,index:D,..._}=b,se=kr();return(0,l.jsx)("div",{role:"tabpanel",hidden:L!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:se.tabContents,..._,children:L===D&&(0,l.jsx)(B.Z,{pl:3,pr:3,children:A})})}function br(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function io(b){const A=kr(),[L,D]=M.useState(0);return(0,M.useEffect)(()=>{D(0)},[b.open]),b.entity?(0,l.jsxs)(u.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:A.fullHeightDialog},children:[(0,l.jsx)(x.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(E.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:A.root,children:[(0,l.jsxs)(Q.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(_,se)=>D(se),"aria-label":"Inspector options",className:A.tabs,children:[(0,l.jsx)(pe.Z,{label:"Overview",...br(0)}),(0,l.jsx)(pe.Z,{label:"Ancestry",...br(1)}),(0,l.jsx)(pe.Z,{label:"Colocated",...br(2)}),(0,l.jsx)(pe.Z,{label:"Raw JSON",...br(3)}),(0,l.jsx)(pe.Z,{label:"Raw YAML",...br(4)})]}),(0,l.jsx)(xr,{value:L,index:0,children:(0,l.jsx)(so,{entity:b.entity})}),(0,l.jsx)(xr,{value:L,index:1,children:(0,l.jsx)(xo,{entity:b.entity})}),(0,l.jsx)(xr,{value:L,index:2,children:(0,l.jsx)(wo,{entity:b.entity})}),(0,l.jsx)(xr,{value:L,index:3,children:(0,l.jsx)(jo,{entity:b.entity})}),(0,l.jsx)(xr,{value:L,index:4,children:(0,l.jsx)(Ao,{entity:b.entity})})]})}),(0,l.jsx)(Ce.Z,{children:(0,l.jsx)(K.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var To=n(85256);function Jr(b){var A;const L=(0,r.h_)(F),D=(A=b.metadata.annotations)===null||A===void 0?void 0:A[T.q1],_=b.metadata.uid,se=D==="bootstrap:bootstrap",oe=(0,Et.default)(async()=>{const ot=L.getLocationByRef(D);let $e;if(!D)$e=Promise.resolve([]);else{const mt=`metadata.annotations.${T.q1}`;$e=L.getEntities({filter:{[mt]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Dt=>Dt.items)}return Promise.all([ot,$e]).then(([mt,Dt])=>({location:mt,colocatedEntities:Dt}))},[L,b]),fe=(0,M.useCallback)(async function(){const{location:$e}=oe.value;await L.removeLocationById($e.id)},[L,oe]),Se=(0,M.useCallback)(async function(){await L.removeEntityByUid(_)},[L,_]);if(se)return{type:"bootstrap",location:D,deleteEntity:Se};const{loading:Re,error:ge,value:ke}=oe;if(Re)return{type:"loading"};if(ge)return{type:"error",error:ge};const{location:et,colocatedEntities:Xe}=ke;return et?{type:"unregister",location:D,colocatedEntities:Xe.map(T.iB),unregisterLocation:fe,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Vn=n(23054);const Io=(0,Pe.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Ln=({entity:b,onConfirm:A,onClose:L})=>{const D=(0,r.h_)(r.$v),_=(0,r.h_)(r.Ds),se=Io(),oe=Jr(b),[fe,Se]=(0,M.useState)(!1),[Re,ge]=(0,M.useState)(!1);var ke;const et=(ke=_.getOptionalString("app.title"))!==null&&ke!==void 0?ke:"Backstage",Xe=(0,M.useCallback)(async function(){if("unregisterLocation"in oe){ge(!0);try{await oe.unregisterLocation(),A()}catch(Dt){(0,Vn.BD)(Dt),D.post({message:Dt.message})}finally{ge(!1)}}},[D,A,oe]),ot=(0,M.useCallback)(async function(){if("deleteEntity"in oe){ge(!0);try{await oe.deleteEntity(),A()}catch(Dt){(0,Vn.BD)(Dt),D.post({message:Dt.message})}finally{ge(!1)}}},[D,A,oe]),$e=()=>(0,l.jsx)(Ce.Z,{className:se.dialogActions,children:(0,l.jsx)(K.Z,{onClick:L,color:"primary",children:"Cancel"})});return oe.type==="loading"?(0,l.jsx)($.Ex,{}):oe.type==="error"?(0,l.jsx)($.Gk,{error:oe.error}):oe.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(yr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',oe.location,'"). If you believe this is in error, please contact the ',et," ","integrator."]}),(0,l.jsxs)(B.Z,{marginTop:2,children:[!fe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z,{variant:"text",size:"small",color:"primary",className:se.advancedButton,onClick:()=>Se(!0),children:"Advanced Options"}),(0,l.jsx)($e,{})]}),fe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:ot,children:"Delete Entity"}),(0,l.jsx)($e,{})]})]})]}):oe.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:ot,children:"Delete Entity"}),(0,l.jsx)($e,{})]}):oe.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(be.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(be.Z,{component:"ul",children:oe.colocatedEntities.map(mt=>(0,l.jsx)("li",{children:(0,l.jsx)(Ue,{entityRef:mt})},`${mt.kind}:${mt.namespace}/${mt.name}`))}),(0,l.jsx)(be.Z,{children:"Located at the following location:"}),(0,l.jsx)(be.Z,{component:"ul",children:(0,l.jsx)("li",{children:oe.location})}),(0,l.jsxs)(be.Z,{children:["To undo, just re-register the entity in ",et,"."]}),(0,l.jsxs)(B.Z,{marginTop:2,children:[(0,l.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Xe,children:"Unregister Location"}),!fe&&(0,l.jsx)(B.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(K.Z,{variant:"text",size:"small",color:"primary",className:se.advancedButton,onClick:()=>Se(!0),children:"Advanced Options"})})]}),fe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(To.Z,{})}),(0,l.jsx)(be.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(K.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:ot,children:"Delete Entity"})]})]}):(0,l.jsx)(yr.Z,{severity:"error",children:"Internal error: Unknown state"})},_o=b=>{const{open:A,onConfirm:L,onClose:D,entity:_}=b;return(0,l.jsxs)(u.Z,{open:A,onClose:D,children:[(0,l.jsx)(x.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(E.Z,{children:(0,l.jsx)(Ln,{entity:_,onConfirm:L,onClose:D})})]})};var es=n(12231),ts=n(9520),ns=n(47603);const rs=(0,Pe.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 ir(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ns.Z},{id:"starred",label:"Starred",icon:yn.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const Ro=b=>{const{initialFilter:A,availableFilters:L}=b,D=rs(),_=(0,r.h_)(r.Ds);var se;const oe=(se=_.getOptionalString("organization.name"))!==null&&se!==void 0?se:"Company",{filters:fe,updateFilters:Se,backendEntities:Re,queryParameters:{kind:ge,user:ke},loading:et}=Pt(),Xe=["starred","all"],ot=ir(oe).map(kn=>({...kn,items:kn.items.filter(({id:Dn})=>["group","user"].some(Sr=>Sr===ge)?Xe.includes(Dn):!L||L.includes(Dn))})).filter(({items:kn})=>!!kn.length),{isStarredEntity:$e}=wn(),{isOwnedEntity:mt,loading:Dt}=jn(),fn=et||Dt,qt=(0,M.useMemo)(()=>new ze("owned",mt,$e),[mt,$e]),Pn=(0,M.useMemo)(()=>new ze("starred",mt,$e),[mt,$e]),gn=(0,M.useMemo)(()=>[ke].flat()[0],[ke]),[En,An]=(0,M.useState)(gn!=null?gn:A),mr=(0,M.useMemo)(()=>Re.filter((0,je.Gz)((0,Ne.compact)(Object.values({...fe,user:void 0})))),[fe,Re]),$r=(0,M.useMemo)(()=>({all:mr.length,starred:mr.filter(kn=>Pn.filterEntity(kn)).length,owned:mr.filter(kn=>qt.filterEntity(kn)).length}),[mr,Pn,qt]);(0,M.useEffect)(()=>{gn&&An(gn)},[gn]),(0,M.useEffect)(()=>{!fn&&En&&En!=="all"&&$r[En]===0&&An("all")},[fn,$r,En,An]),(0,M.useEffect)(()=>{Se({user:En?new ze(En,mt,$e):void 0})},[En,mt,$e,Se]);var lo;return(0,l.jsx)(Wr.Z,{className:D.root,children:ot.map(kn=>(0,l.jsxs)(M.Fragment,{children:[(0,l.jsx)(Y.Z,{variant:"subtitle2",component:"span",className:D.title,children:kn.name}),(0,l.jsx)(Wr.Z,{className:D.groupWrapper,children:(0,l.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":kn.name,children:kn.items.map(Dn=>{var Sr;return(0,l.jsxs)(es.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>An(Dn.id),selected:Dn.id===((Sr=fe.user)===null||Sr===void 0?void 0:Sr.value),className:D.menuItem,disabled:$r[Dn.id]===0,"data-testid":`user-picker-${Dn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Dn.icon&&(0,l.jsx)(sr.Z,{className:D.listIcon,children:(0,l.jsx)(Dn.icon,{fontSize:"small"})}),(0,l.jsx)(Tr.Z,{children:(0,l.jsxs)(Y.Z,{variant:"body1",children:[Dn.label," "]})}),(0,l.jsx)(ts.Z,{children:(lo=$r[Dn.id])!==null&&lo!==void 0?lo:"-"})]},Dn.id)})})})]},kn.name))})},ao=(0,Pe.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Or=(0,l.jsx)(de.Z,{fontSize:"small"}),os=(0,l.jsx)(Rt.Z,{fontSize:"small"}),Br=()=>{const b=ao(),{updateFilters:A}=Pt(),[L,D]=(0,M.useState)([]);function _(fe){A({orphan:fe?new Ie(fe):void 0})}function se(fe){A({error:fe?new we(fe):void 0})}const oe=["Is Orphan","Has Error"];return(0,l.jsx)(B.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(he.ZP,{multiple:!0,disableCloseOnSelect:!0,options:oe,value:L,onChange:(fe,Se)=>{D(Se),_(Se.includes("Is Orphan")),se(Se.includes("Has Error"))},renderOption:(fe,{selected:Se})=>(0,l.jsx)(Ge.Z,{control:(0,l.jsx)(pt.Z,{icon:Or,checkedIcon:os,checked:Se}),label:fe}),size:"small",popupIcon:(0,l.jsx)(U.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:fe=>(0,l.jsx)(Ht.Z,{...fe,className:b.input,variant:"outlined"})})]})})};function Lo(b){const{children:A,value:L}=b;var D;const[_,se]=useState((D=L==null?void 0:L.filters)!==null&&D!==void 0?D:{}),oe=useCallback(ot=>{se($e=>{const mt=typeof ot=="function"?ot($e):ot;return{...$e,...mt}})},[]),fe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Se,Re,ge,ke,et;const Xe=useMemo(()=>({entities:(Se=L==null?void 0:L.entities)!==null&&Se!==void 0?Se:fe.entities,backendEntities:(Re=L==null?void 0:L.backendEntities)!==null&&Re!==void 0?Re:fe.backendEntities,updateFilters:(ge=L==null?void 0:L.updateFilters)!==null&&ge!==void 0?ge:oe,filters:_,loading:(ke=L==null?void 0:L.loading)!==null&&ke!==void 0?ke:!1,queryParameters:(et=L==null?void 0:L.queryParameters)!==null&&et!==void 0?et:fe.queryParameters,error:L==null?void 0:L.error}),[L,fe,_,oe]);return _jsx(EntityListContext.Provider,{value:Xe,children:A})}},75435:function(Ct,Be,n){"use strict";n.d(Be,{h:function(){return r}});var h=n(25271);function r(F,P,m){var y;let l=(F==null||(y=F.relations)===null||y===void 0?void 0:y.filter(M=>M.type===P).map(M=>(0,h.of)(M.targetRef)))||[];return m!=null&&m.kind&&(l=l.filter(M=>M.kind.toLocaleLowerCase("en-US")===m.kind.toLocaleLowerCase("en-US"))),l}},49280:function(Ct,Be,n){"use strict";n.d(Be,{hF:function(){return F.h},CV:function(){return m},wq:function(){return h},Gz:function(){return r}});function h(l){return l.reduce((M,xe)=>({...M,...xe.getCatalogFilters?xe.getCatalogFilters():{}}),{})}function r(l){return M=>l.every(xe=>!xe.filterEntity||xe.filterEntity(M))}var F=n(75435),P=n(25271);function m(l,M){var xe;const V=(xe=l.metadata.annotations)===null||xe===void 0?void 0:xe[P.M6];if(V)try{const K=(0,P.Ou)(V),S=M.byUrl(K.target);return{locationTargetUrl:K.target,integrationType:S==null?void 0:S.type}}catch{return}}function y(l,M){const xe=new Set([...getEntityRelations(l,RELATION_MEMBER_OF,{kind:"group"}),...l?[getCompoundEntityRef(l)]:[]].map(stringifyEntityRef)),V=getEntityRelations(M,RELATION_OWNED_BY).map(stringifyEntityRef);for(const K of V)if(xe.has(K))return!0;return!1}},33414:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{AboutCard:function(){return Et},AboutContent:function(){return it},AboutField:function(){return ne}});var h=n(52322),r=n(25271),F=n(23196),P=n(60871),m=n(32838),y=n(40303),l=n(79692),M=n(94339),xe=n(32552),V=n(61837),K=n(85256),S=n(24579),B=n(52866),Y=n(30254),ce=n(27604),ee=n(2784),X=n(19625),w=n(60905),O=n(7089),$=n(90436);const T=(0,l.Z)(He=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:He.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ne(He){const{label:st,value:je,gridSizes:At,children:wt}=He,gt=T(),xt=(0,P.vJ)(wt,Lt=>Lt.getElements()),Tt=xt.length>0?xt:(0,h.jsx)($.Z,{variant:"body2",className:gt.value,children:je||"unknown"});return(0,h.jsxs)(w.Z,{item:!0,...At,children:[(0,h.jsx)($.Z,{variant:"h2",className:gt.label,children:st}),Tt]})}var Te=n(24851);const qe=(0,l.Z)({description:{wordBreak:"break-word"}});function Qe(He,st,je){if(st==="url"||He.includes("://"))return He;const At=je.type==="file"?`file://${je.target}`:je.target;return st==="file"||je.type==="file"?new URL(He,At).href:At}function it(He){var st,je,At,wt,gt,xt,Tt,Lt;const{entity:ze}=He,Ie=qe(),we=ze.kind.toLocaleLowerCase("en-US")==="system",Ee=ze.kind.toLocaleLowerCase("en-US")==="resource",Ne=ze.kind.toLocaleLowerCase("en-US")==="component",nt=ze.kind.toLocaleLowerCase("en-US")==="api",zt=ze.kind.toLocaleLowerCase("en-US")==="template",ht=ze.kind.toLocaleLowerCase("en-US")==="location",Nt=ze.kind.toLocaleLowerCase("en-US")==="group",vt=(0,y.hF)(ze,r.cz,{kind:"system"}),jt=(0,y.hF)(ze,r.cz,{kind:"component"}),en=(0,y.hF)(ze,r.cz,{kind:"domain"}),on=(0,y.hF)(ze,r.S4);let Sn;try{Sn=(0,r.CV)(ze)}catch{Sn=void 0}return(0,h.jsxs)(w.Z,{container:!0,children:[(0,h.jsx)(ne,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(F.SA,{className:Ie.description,content:(ze==null||(st=ze.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,h.jsx)(ne,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:on.length>0&&(0,h.jsx)(y.rI,{entityRefs:on,defaultKind:"group"})}),(we||en.length>0)&&(0,h.jsx)(ne,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(y.rI,{entityRefs:en,defaultKind:"domain"})}),(nt||Ne||Ee||vt.length>0)&&(0,h.jsx)(ne,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:vt.length>0&&(0,h.jsx)(y.rI,{entityRefs:vt,defaultKind:"system"})}),Ne&&jt.length>0&&(0,h.jsx)(ne,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(y.rI,{entityRefs:jt,defaultKind:"component"})}),(nt||Ne||Ee||zt||Nt||ht||typeof(ze==null||(je=ze.spec)===null||je===void 0?void 0:je.type)=="string")&&(0,h.jsx)(ne,{label:"Type",value:ze==null||(At=ze.spec)===null||At===void 0?void 0:At.type,gridSizes:{xs:12,sm:6,lg:4}}),(nt||Ne||typeof(ze==null||(wt=ze.spec)===null||wt===void 0?void 0:wt.lifecycle)=="string")&&(0,h.jsx)(ne,{label:"Lifecycle",value:ze==null||(gt=ze.spec)===null||gt===void 0?void 0:gt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(ne,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((ze==null||(xt=ze.metadata)===null||xt===void 0?void 0:xt.tags)||[]).map(Pt=>(0,h.jsx)(O.Z,{size:"small",label:Pt},Pt))}),ht&&((ze==null||(Tt=ze.spec)===null||Tt===void 0?void 0:Tt.targets)||(ze==null||(Lt=ze.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(ne,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Te.s,{cols:1,items:(ze.spec.targets||[ze.spec.target]).map(Pt=>Pt).map(Pt=>{var an;return{text:Pt,href:Qe(Pt,(ze==null||(an=ze.spec)===null||an===void 0?void 0:an.type)||"unknown",Sn)}})})})]})}const Ue=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Et(He){var st,je,At;const{variant:wt}=He,gt=Ue(),{entity:xt}=(0,y.X2)(),Tt=(0,P.h_)(m.q3),Lt=(0,P.h_)(y.Ah),ze=(0,P.h_)(P.$v),Ie=(0,P.h_)(P.VE),we=(0,P.tg)(X.jU),Ee=(0,y.CV)(xt,Tt),Ne=(st=xt.metadata.annotations)===null||st===void 0?void 0:st[r.Tf],nt={label:"View Source",disabled:!Ee,icon:(0,h.jsx)(m.nW,{type:Ee==null?void 0:Ee.integrationType}),href:Ee==null?void 0:Ee.locationTargetUrl},zt={label:"View TechDocs",disabled:!(!((je=xt.metadata.annotations)===null||je===void 0)&&je["backstage.io/techdocs-ref"])||!we,icon:(0,h.jsx)(Y.Z,{}),href:we&&we({namespace:xt.metadata.namespace||r.zG,kind:xt.kind,name:xt.metadata.name})};let ht="";wt==="gridItem"?ht=gt.gridItemCard:wt==="fullHeight"&&(ht=gt.fullHeightCard);let Nt="";wt==="gridItem"?Nt=gt.gridItemCardContent:wt==="fullHeight"&&(Nt=gt.fullHeightCardContent);const vt=(At=xt.metadata.annotations)===null||At===void 0?void 0:At[r.P1],jt=(vt==null?void 0:vt.startsWith("url:"))||(vt==null?void 0:vt.startsWith("file:")),en=(0,ee.useCallback)(async()=>{try{await Lt.refreshEntity((0,r.eE)(xt)),ze.post({message:"Refresh scheduled",severity:"info"})}catch(on){Ie.post(on)}},[Lt,ze,Ie,xt]);return(0,h.jsxs)(M.Z,{className:ht,children:[(0,h.jsx)(xe.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[jt&&(0,h.jsx)(V.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:en,children:(0,h.jsx)(B.Z,{})}),(0,h.jsx)(V.Z,{component:F.rU,"aria-label":"Edit",disabled:!Ne,title:"Edit Metadata",to:Ne!=null?Ne:"#",children:(0,h.jsx)(ce.Z,{})})]}),subheader:(0,h.jsx)(F.M6,{links:[nt,zt]})}),(0,h.jsx)(K.Z,{}),(0,h.jsx)(S.Z,{className:Nt,children:(0,h.jsx)(it,{entity:xt})})]})}},86359:function(Ct,Be,n){"use strict";n.d(Be,{E:function(){return X}});var h=n(52322),r=n(25271),F=n(23196),P=n(40303),m=n(90436),y=n(15459),l=n(27604),M=n(2997),xe=n(11640),V=n(28347),K=n(76635),S=n(2784),B=n(7089);const Y=Object.freeze({createNameColumn(w){function O($){var T;return((T=$.metadata)===null||T===void 0?void 0:T.title)||(0,P.$3)($,{defaultKind:w==null?void 0:w.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:T}){return O($).localeCompare(O(T))},render:({entity:$})=>{var T;return(0,h.jsx)(P.dx,{entityRef:$,defaultKind:(w==null?void 0:w.defaultKind)||"Component",title:(T=$.metadata)===null||T===void 0?void 0:T.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:w})=>(0,h.jsx)(P.rI,{entityRefs:w.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,h.jsx)(P.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:w})=>{var O,$;return(0,h.jsx)(h.Fragment,{children:((w==null||(O=w.spec)===null||O===void 0?void 0:O.targets)||(w==null||($=w.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(F.Or,{text:(w.spec.targets||[w.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:w})=>(0,h.jsx)(F.Or,{text:w.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:w})=>(0,h.jsx)(h.Fragment,{children:w.metadata.tags&&w.metadata.tags.map(O=>(0,h.jsx)(B.Z,{label:O,size:"small",variant:"outlined",style:{marginBottom:"0px"}},O))}),width:"auto"}},createTitleColumn(w){return{title:"Title",field:"entity.metadata.title",hidden:w==null?void 0:w.hidden,searchable:!0}},createLabelColumn(w,O){return{title:(O==null?void 0:O.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var T;const ne=(T=$.metadata)===null||T===void 0?void 0:T.labels,Te=ne&&ne[w]||(O==null?void 0:O.defaultValue);return(0,h.jsx)(h.Fragment,{children:Te&&(0,h.jsx)(B.Z,{label:Te,size:"small",variant:"outlined"},Te)})},width:"auto"}}}),ce=(0,y.Z)({root:{color:"#f3ba37"}})(xe.Z),ee=(w,O)=>{const $=T=>T.metadata.title||(0,P.$3)(T,{defaultKind:"Component"});return $(w).localeCompare($(O))},X=w=>{var O,$;const{columns:T,actions:ne,tableOptions:Te,subtitle:qe,emptyContent:Qe}=w,{isStarredEntity:it,toggleStarredEntity:Ue}=(0,P.CR)(),{loading:Et,error:He,entities:st,filters:je}=(0,P.wp)(),At=(0,S.useMemo)(()=>{var we;return[Y.createTitleColumn({hidden:!0}),Y.createNameColumn({defaultKind:(we=je.kind)===null||we===void 0?void 0:we.value}),...Ee(),Y.createMetadataDescriptionColumn(),Y.createTagsColumn()];function Ee(){var Ne;switch((Ne=je.kind)===null||Ne===void 0?void 0:Ne.value){case"user":return[];case"domain":case"system":return[Y.createOwnerColumn()];case"group":case"template":return[Y.createSpecTypeColumn()];case"location":return[Y.createSpecTypeColumn(),Y.createSpecTargetsColumn()];default:return[Y.createSystemColumn(),Y.createOwnerColumn(),Y.createSpecTypeColumn(),Y.createSpecLifecycleColumn()]}}},[(O=je.kind)===null||O===void 0?void 0:O.value]),wt=je.type===void 0;var gt;const xt=(0,K.capitalize)((gt=($=je.user)===null||$===void 0?void 0:$.value)!==null&>!==void 0?gt:"all");if(He)return(0,h.jsx)("div",{children:(0,h.jsx)(F.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(F.Oi,{language:"text",text:He.toString()})})});const Tt=[({entity:we})=>{var Ee;const Ne=(Ee=we.metadata.annotations)===null||Ee===void 0?void 0:Ee[r.l2],nt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:nt}),(0,h.jsx)(M.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:we})=>{var Ee;const Ne=(Ee=we.metadata.annotations)===null||Ee===void 0?void 0:Ee[r.Tf],nt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:nt}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:we})=>{const Ee=it(we),Ne=Ee?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{variant:"srOnly",children:Ne}),Ee?(0,h.jsx)(ce,{}):(0,h.jsx)(V.Z,{})]}),tooltip:Ne,onClick:()=>Ue(we)}}],Lt=st.sort(ee).map(we=>{const Ee=(0,P.hF)(we,r.cz,{kind:"system"}),Ne=(0,P.hF)(we,r.S4);return{entity:we,resolved:{name:(0,P.$3)(we,{defaultKind:"Component"}),ownedByRelationsTitle:Ne.map(nt=>(0,P.$3)(nt,{defaultKind:"group"})).join(", "),ownedByRelations:Ne,partOfSystemRelationTitle:Ee.map(nt=>(0,P.$3)(nt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ee}}}),ze=(T||At).find(we=>we.title==="Type");ze&&(ze.hidden=!wt);const Ie=Lt.length>20;return(0,h.jsx)(F.iA,{isLoading:Et,columns:T||At,options:{paging:Ie,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Et,padding:"dense",pageSizeOptions:[20,50,100],...Te},title:`${xt} (${st.length})`,data:Lt,actions:ne||Tt,subtitle:qe,emptyContent:Qe})};X.columns=Y},85877:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{EntityLabelsCard:function(){return S},hasLabels:function(){return B}});var h=n(52322),r=n(40303),F=n(2784),P=n(23196),m=n(79692),y=n(90436),l=n(77277);const M=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,xe=(0,m.Z)(Y=>({code:{borderRadius:6,margin:`${Y.spacing(2)}px 0px`,background:Y.palette.type==="dark"?"#444":Y.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function V(){const Y=xe();return(0,h.jsxs)(h.Fragment,{children:[(0,h.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,h.jsx)("div",{className:Y.code,children:(0,h.jsx)(P.Oi,{text:M,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(l.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const K=(0,m.Z)(Y=>({key:{fontWeight:"bold"}})),S=Y=>{var ce;const{variant:ee,title:X}=Y,{entity:w}=(0,r.X2)(),O=K(),$=[{render:ne=>(0,h.jsx)(y.Z,{className:O.key,variant:"body2",children:ne.key})},{field:"value"}],T=w==null||(ce=w.metadata)===null||ce===void 0?void 0:ce.labels;return(0,h.jsx)(P.rJ,{title:X||"Labels",variant:ee,children:!T||Object.keys(T).length===0?(0,h.jsx)(V,{}):(0,h.jsx)(P.iA,{columns:$,data:Object.keys(T).map(ne=>({key:ne,value:T[ne]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(T).length>5}})})};function B(Y){var ce,ee;return!(Y==null||(ce=Y.metadata)===null||ce===void 0)&&ce.labels?Object.keys(Y==null||(ee=Y.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(Ct,Be,n){"use strict";n.d(Be,{s:function(){return ce}});var h=n(52322),r=n(90348),F=n(11861),P=n(2784),m=n(79692),y=n(95544),l=n(90436),M=n(52160),xe=n(23196);const V=(0,m.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function K(ee){const{href:X,text:w,Icon:O}=ee,$=V();return(0,h.jsxs)(y.Z,{display:"flex",children:[(0,h.jsx)(y.Z,{mr:1,className:$.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:O?(0,h.jsx)(O,{}):(0,h.jsx)(M.Z,{})})}),(0,h.jsx)(y.Z,{flexGrow:"1",children:(0,h.jsx)(xe.rU,{to:X,target:"_blank",rel:"noopener",children:w||X})})]})}var S=n(41156);const B={xs:1,sm:1,md:1,lg:2,xl:3};function Y(ee){const X=[(0,S.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,S.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,S.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,S.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,S.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let w=1;if(typeof ee=="number")w=ee;else{var O;const T=(O=X.find(ne=>ne!==null))!==null&&O!==void 0?O:"xs";var $;w=($=ee==null?void 0:ee[T])!==null&&$!==void 0?$:B[T]}return w}function ce(ee){const{items:X,cols:w=void 0}=ee,O=Y(w);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:O,children:X.map(({text:$,href:T,Icon:ne},Te)=>(0,h.jsx)(F.Z,{children:(0,h.jsx)(K,{href:T,text:$!=null?$:T,Icon:ne})},Te))})}},19625:function(Ct,Be,n){"use strict";n.d(Be,{_Z:function(){return P},jU:function(){return F},yw:function(){return r}});var h=n(60871);const r=(0,h.x8)({id:"create-component",optional:!0}),F=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),P=(0,h.NT)({id:"catalog"})},15096:function(Ct,Be,n){"use strict";n.d(Be,{FA:function(){return xe},qO:function(){return gt},Nd:function(){return it},E5:function(){return tn},Rx:function(){return T}});var h=n(60871);const r=(0,h.T0)({id:"plugin.search.queryservice"});class F{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(W){this.mockedResults=W}}var P=n(52322),m=n(2784),y=n(38402),l=n(79692);const M=(0,l.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),xe=q=>{const{text:W,preTag:le,postTag:g}=q,R=M(),J=(0,m.useMemo)(()=>W.split(new RegExp(`(${le}.+?${g})`)),[g,le,W]);return(0,P.jsx)(P.Fragment,{children:J.map((G,ae)=>G.includes(le)?(0,P.jsx)("mark",{className:R.highlight,children:G.replace(new RegExp(`${le}|${g}`,"g"),"")},ae):G)})};var V=n(48760),K=n(50581),S=n(61837),B=n(74603),Y=n(21853),ce=n(33375),ee=n(76635),X=n(64279),w=n(1849),O=n(51837);const $=(0,O.CT)("search-context"),T=()=>{const q=(0,m.useContext)($);if(!q)throw new Error("useSearch must be used within a SearchContextProvider");const W=q.atVersion(1);if(!W)throw new Error("No SearchContext v1 found");return W},ne=()=>(0,m.useContext)($)!==void 0,Te={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},qe=(q=Te)=>{var W,le,g,R;const J=(0,h.h_)(r),[G,ae]=(0,m.useState)(q.term),[me,Fe]=(0,m.useState)(q.types),[Ye,dt]=(0,m.useState)(q.filters),[yt,rt]=(0,m.useState)(q.pageLimit),[_e,De]=(0,m.useState)(q.pageCursor),$t=(0,w.Z)(G),Kt=(0,w.Z)(Ye),kt=(0,X.default)(()=>J.query({term:G,types:me,filters:Ye,pageLimit:yt,pageCursor:_e}),[G,me,Ye,yt,_e]),Zt=!kt.loading&&!kt.error&&((W=kt.value)===null||W===void 0?void 0:W.nextPageCursor),Wt=!kt.loading&&!kt.error&&((le=kt.value)===null||le===void 0?void 0:le.previousPageCursor),Gt=(0,m.useCallback)(()=>{var Ft;De((Ft=kt.value)===null||Ft===void 0?void 0:Ft.nextPageCursor)},[(g=kt.value)===null||g===void 0?void 0:g.nextPageCursor]),ut=(0,m.useCallback)(()=>{var Ft;De((Ft=kt.value)===null||Ft===void 0?void 0:Ft.previousPageCursor)},[(R=kt.value)===null||R===void 0?void 0:R.previousPageCursor]);return(0,m.useEffect)(()=>{$t!==void 0&&G!==$t&&De(void 0)},[G,$t,De]),(0,m.useEffect)(()=>{Kt!==void 0&&!(0,ee.isEqual)(Ye,Kt)&&De(void 0)},[Ye,Kt,De]),{result:kt,term:G,setTerm:ae,types:me,setTypes:Fe,filters:Ye,setFilters:dt,pageLimit:yt,setPageLimit:rt,pageCursor:_e,setPageCursor:De,fetchNextPage:Zt?Gt:void 0,fetchPreviousPage:Wt?ut:void 0}},Qe=q=>{const{initialState:W,children:le}=q,g=qe(W);return(0,P.jsx)(h.fC,{attributes:{searchTypes:g.types.sort().join(",")},children:(0,P.jsx)($.Provider,{value:(0,O.EI)({1:g}),children:le})})},it=q=>{const{initialState:W,inheritParentContextIfAvailable:le,children:g}=q;return ne()&&le?(0,P.jsx)(P.Fragment,{children:g}):(0,P.jsx)(Qe,{initialState:W,children:g})},Ue=({children:q})=>{var W;const le=Ye=>(0,w.Z)(Ye)!==Ye,g=(0,h.z$)(),{term:R,result:J}=T();var G;const ae=(G=(W=J.value)===null||W===void 0?void 0:W.numberOfResults)!==null&&G!==void 0?G:void 0,Fe=le(J.loading)&&!J.loading;return(0,m.useEffect)(()=>{R&&Fe&&g.captureEvent("search",R,{value:ae})},[g,R,ae,Fe]),(0,P.jsx)(P.Fragment,{children:q})};function Et(q){return(0,m.forwardRef)((W,le)=>(0,P.jsx)(it,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(q,{...W,ref:le})}))}const He=Et((0,m.forwardRef)((q,W)=>{const{onChange:le,onKeyDown:g=()=>{},onClear:R=()=>{},onSubmit:J=()=>{},debounceTime:G=200,clearButton:ae=!0,fullWidth:me=!0,value:Fe,placeholder:Ye,inputProps:dt={},endAdornment:yt,...rt}=q,_e=(0,h.h_)(h.Ds),[De,$t]=(0,m.useState)("");(0,m.useEffect)(()=>{$t(We=>We!==Fe?String(Fe):We)},[Fe]),(0,V.Z)(()=>le(De),G,[De]);const Kt=(0,m.useCallback)(We=>{$t(We.target.value)},[$t]),kt=(0,m.useCallback)(We=>{g&&g(We),J&&We.key==="Enter"&&J()},[g,J]),Zt=(0,m.useCallback)(()=>{le(""),R&&R()},[le,R]),Wt=Ye!=null?Ye:`Search in ${_e.getOptionalString("app.title")||"Backstage"}`,Gt=(0,P.jsx)(K.Z,{position:"start",children:(0,P.jsx)(S.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,P.jsx)(Y.Z,{})})}),ut=(0,P.jsx)(K.Z,{position:"end",children:(0,P.jsx)(S.Z,{"aria-label":"Clear",size:"small",onClick:Zt,children:(0,P.jsx)(ce.Z,{})})});return(0,P.jsx)(Ue,{children:(0,P.jsx)(B.Z,{"data-testid":"search-bar-next",ref:W,value:De,placeholder:Wt,startAdornment:Gt,endAdornment:ae?ut:yt,inputProps:{"aria-label":"Search",...dt},fullWidth:me,onChange:Kt,onKeyDown:kt,...rt})})})),st=Et((0,m.forwardRef)((q,W)=>{const{value:le="",onChange:g,...R}=q,{term:J,setTerm:G}=T();(0,m.useEffect)(()=>{le&&G(String(le))},[le,G]);const ae=(0,m.useCallback)(me=>{g?g(me):G(me)},[g,G]);return(0,P.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,P.jsx)(He,{...R,ref:W,value:J,onChange:ae})})}));var je=n(4614),At=n(88013);const gt=(q=>W=>(0,P.jsx)(it,{inheritParentContextIfAvailable:!0,children:(0,P.jsx)(q,{...W})}))(function(W){const{loading:le,value:g,onChange:R=()=>{},options:J=[],getOptionLabel:G=Zt=>String(Zt),inputPlaceholder:ae,inputDebounceTime:me,freeSolo:Fe=!0,fullWidth:Ye=!0,clearOnBlur:dt=!1,"data-testid":yt="search-autocomplete",...rt}=W,{setTerm:_e}=T(),De=(0,m.useCallback)(Zt=>Zt?typeof Zt=="string"?Zt:G(Zt):"",[G]),$t=(0,m.useMemo)(()=>De(g),[g,De]),Kt=(0,m.useCallback)((Zt,Wt,Gt,ut)=>{_e(De(Wt)),R(Zt,Wt,Gt,ut)},[De,_e,R]),kt=(0,m.useCallback)(({InputProps:{ref:Zt,endAdornment:Wt},InputLabelProps:Gt,...ut})=>(0,P.jsx)(st,{...ut,ref:Zt,clearButton:!1,value:$t,placeholder:ae,debounceTime:me,endAdornment:le?(0,P.jsx)(je.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Wt}),[le,$t,ae,me]);return(0,P.jsx)(At.ZP,{...rt,"data-testid":yt,value:g,onChange:Kt,options:J,getOptionLabel:G,renderInput:kt,freeSolo:Fe,fullWidth:Ye,clearOnBlur:dt})}),xt=q=>{const{icon:W,primaryText:le,primaryTextTypographyProps:g,secondaryText:R,secondaryTextTypographyProps:J,disableTextTypography:G}=q;return _jsxs(_Fragment,{children:[W?_jsx(ListItemIcon,{children:W}):null,_jsx(ListItemText,{primary:le,primaryTypographyProps:g,secondary:R,secondaryTypographyProps:J,disableTypography:G})]})};var Tt=n(42494),Lt=n(84899),ze=n(5806),Ie=n(21324),we=n(56939),Ee=n(73698),Ne=n(12231),nt=n(86619),zt=n(7089),ht=n(69294);const Nt=(q,W,le=[],g=250)=>{const R=(0,m.useRef)({}),J=q||(()=>Promise.resolve([])),[G,ae]=(0,ht.default)(J,[W],{loading:!0});if((0,V.Z)(()=>{R.current[W]===void 0&&(R.current[W]=ae(W).then(Fe=>(R.current[W]=Fe,Fe)))},g,[ae,W]),le.length)return{loading:!1,value:le};const me=R.current[W];return Array.isArray(me)?{loading:!1,value:me}:G},vt=(q,W)=>{const{setFilters:le}=T();(0,m.useEffect)(()=>{W&&[W].flat().length>0&&le(g=>({...g,[q]:W}))},[])},jt=q=>{const{className:W,defaultValue:le,name:g,values:R,valuesDebounceMs:J,label:G,filterSelectedOptions:ae,limitTags:me,multiple:Fe}=q,[Ye,dt]=(0,m.useState)("");vt(g,le);const yt=typeof R=="function"?R:void 0,rt=typeof R=="function"?void 0:R,{value:_e,loading:De}=Nt(yt,Ye,rt,J),{filters:$t,setFilters:Kt}=T(),kt=$t[g]||(Fe?[]:null),Zt=(ut,We)=>{Kt(Ft=>{const{[g]:dn,...vn}=Ft;return We?{...vn,[g]:We}:{...vn}})},Wt=ut=>(0,P.jsx)(nt.Z,{...ut,name:"search",variant:"outlined",label:G,fullWidth:!0}),Gt=(ut,We)=>ut.map((Ft,dn)=>(0,P.jsx)(zt.Z,{label:Ft,color:"primary",...We({index:dn})}));return(0,P.jsx)(At.ZP,{filterSelectedOptions:ae,limitTags:me,multiple:Fe,className:W,id:`${Fe?"multi-":""}select-filter-${g}--select`,options:_e||[],loading:De,value:kt,onChange:Zt,onInputChange:(ut,We)=>dt(We),renderInput:Wt,renderTags:Gt})},en=(0,l.Z)({label:{textTransform:"capitalize"}}),on=q=>{const{className:W,defaultValue:le,label:g,name:R,values:J=[],valuesDebounceMs:G}=q,ae=en(),{filters:me,setFilters:Fe}=T();vt(R,le);const Ye=typeof J=="function"?J:void 0,dt=typeof J=="function"?void 0:J,{value:yt=[],loading:rt}=Nt(Ye,"",dt,G),_e=$t=>{const{target:{value:Kt,checked:kt}}=$t;Fe(Zt=>{const{[R]:Wt,...Gt}=Zt,ut=(Wt||[]).filter(Ft=>Ft!==Kt),We=kt?[...ut,Kt]:ut;return We.length?{...Gt,[R]:We}:Gt})};var De;return(0,P.jsxs)(Tt.Z,{className:W,disabled:rt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[g?(0,P.jsx)(Lt.Z,{className:ae.label,children:g}):null,yt.map($t=>(0,P.jsx)(ze.Z,{control:(0,P.jsx)(Ie.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":$t},value:$t,name:$t,onChange:_e,checked:((De=me[R])!==null&&De!==void 0?De:[]).includes($t)}),label:$t},$t))]})},Sn=q=>{const{className:W,defaultValue:le,label:g,name:R,values:J,valuesDebounceMs:G}=q,ae=en();vt(R,le);const me=typeof J=="function"?J:void 0,Fe=typeof J=="function"?void 0:J,{value:Ye=[],loading:dt}=Nt(me,"",Fe,G),{filters:yt,setFilters:rt}=T(),_e=De=>{const{target:{value:$t}}=De;rt(Kt=>{const{[R]:kt,...Zt}=Kt;return $t?{...Zt,[R]:$t}:Zt})};return(0,P.jsxs)(Tt.Z,{disabled:dt,className:W,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[g?(0,P.jsx)(we.Z,{className:ae.label,margin:"dense",children:g}):null,(0,P.jsxs)(Ee.Z,{variant:"outlined",value:yt[R]||"",onChange:_e,children:[(0,P.jsx)(Ne.Z,{value:"",children:(0,P.jsx)("em",{children:"All"})}),Ye.map(De=>(0,P.jsx)(Ne.Z,{value:De,children:De},De))]})]})},Pt=q=>{const{component:W,...le}=q;return(0,P.jsx)(W,{...le})};Pt.Checkbox=q=>(0,P.jsx)(Pt,{...q,component:on}),Pt.Select=q=>(0,P.jsx)(Pt,{...q,component:Sn}),Pt.Autocomplete=q=>(0,P.jsx)(Pt,{...q,component:jt});var an=n(48834).lW;const Cn=q=>an.from(q.toString(),"utf-8").toString("base64"),Tn=q=>q?Number(an.from(q,"base64").toString("utf-8")):0,ln=q=>{const{total:W=-1,cursor:le,hasNextPage:g,onCursorChange:R,limit:J=25,limitLabel:G="Results per page:",limitText:ae=({from:_e,to:De})=>W>0?`of ${W}`:`${_e}-${De}`,limitOptions:me,onLimitChange:Fe,...Ye}=q,dt=useMemo(()=>Tn(le),[le]),yt=useCallback((_e,De)=>{R==null||R(Cn(De))},[R]),rt=useCallback(_e=>{const De=_e.target.value;Fe==null||Fe(parseInt(De,10))},[Fe]);return _jsx(TablePagination,{...Ye,component:"div",count:W,page:dt,nextIconButtonProps:{...g!==void 0&&{disabled:!g}},onPageChange:yt,rowsPerPage:J,labelRowsPerPage:G,labelDisplayedRows:ae,rowsPerPageOptions:me,onRowsPerPageChange:rt})},qn=q=>{const{pageLimit:W,setPageLimit:le,pageCursor:g,setPageCursor:R,fetchNextPage:J}=useSearch();return _jsx(ln,{...q,hasNextPage:!!J,limit:W,onLimitChange:le,cursor:g,onCursorChange:R})};var On=n(23196);const _n=q=>{const{children:W}=q,le=useSearch(),{result:g,...R}=le;return W(g,R)},lt=q=>{const{query:W,children:le}=q,g=useApi(searchApiRef),R=useAsync(()=>{const{term:J="",types:G=[],filters:ae={},...me}=W;return g.query({...me,term:J,types:G,filters:ae})},[W]);return le(R,W)},Bn=q=>{const{query:W,children:le}=q;return W?_jsx(lt,{query:W,children:le}):_jsx(_n,{children:le})},wn=q=>{const{query:W,children:le,noResultsComponent:g=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...R}=q;return _jsx(Bn,{query:W,children:({loading:J,error:G,value:ae})=>J?_jsx(Progress,{}):G?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G}):ae!=null&&ae.results.length?isFunction(le)?le(ae):_jsx(SearchResultListItemExtensions,{...R,results:ae.results,children:le}):g})},cn=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(wn,{...q})}),$n=({result:q,highlight:W,icon:le,secondaryAction:g,lineClamp:R=5})=>q?_jsxs(_Fragment,{children:[le&&_jsx(ListItemIcon,{children:le}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:q.location,children:W!=null&&W.fields.title?_jsx(HighlightedSearchResultText,{text:(W==null?void 0:W.fields.title)||"",preTag:(W==null?void 0:W.preTag)||"",postTag:(W==null?void 0:W.postTag)||""}):q.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:R,overflow:"hidden"},children:W!=null&&W.fields.text?_jsx(HighlightedSearchResultText,{text:W.fields.text,preTag:W.preTag,postTag:W.postTag}):q.text})}),g&&_jsx(Box,{alignItems:"flex-end",children:g})]}):null,Wn=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx($n,{...q})}),jn=q=>{const{error:W,loading:le,resultItems:g,renderResultItem:R=me=>_jsx(DefaultResultListItem,{result:me.document},me.document.location),disableRenderingWithNoResults:J,noResultsComponent:G=J?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ae}=q;return le?_jsx(Progress,{}):W?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:W}):g!=null&&g.length?_jsx(List,{...ae,children:g.map(R)}):_jsx(_Fragment,{children:G})},Gn=q=>{const{query:W,renderResultItem:le,children:g,...R}=q,J=useSearchResultListItemExtensions(g);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:W,children:({loading:G,error:ae,value:me})=>_jsx(jn,{...R,error:ae,loading:G,resultItems:me==null?void 0:me.results,renderResultItem:le!=null?le:J})})})};var ve=n(19126);const re=(0,l.Z)(q=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:q.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:q.spacing(.5)}})),Oe=q=>{const W=re(),{label:le,children:g,...R}=q;return _jsx(Chip,{...R,className:W.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[le,": ",g]})})},Pe=()=>null,Ge=(0,l.Z)(q=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:q.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),pt=q=>{const W=Ge(),{label:le,value:g="None",onChange:R,onDelete:J}=q,G=useCallback(ae=>{R(ae.target.value)},[R]);return _jsx(Oe,{label:le,onDelete:J,children:_jsx(Typography,{role:"textbox",component:"span",className:W.root,onChange:G,contentEditable:!0,suppressContentEditableWarning:!0,children:g})})},Ht=(0,l.Z)(q=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Rt=q=>{const W=Ht(),{label:le,value:g="none",onChange:R,onDelete:J,children:G}=q,ae=useCallback(me=>{R(me.target.value)},[R]);return _jsx(Oe,{label:le,onDelete:J,children:_jsxs(Select,{className:W.root,value:g,onChange:ae,input:_jsx(InputBase,{}),IconComponent:Pe,children:[_jsx(MenuItem,{value:"none",children:"None"}),G]})})};function de(q){const W=re(),[le,g]=useState(null),{error:R,loading:J,icon:G,title:ae,titleProps:me={},link:Fe=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:W.listSubheaderLinkIcon})]}),linkProps:Ye={},filterOptions:dt,renderFilterOption:yt=We=>_jsx(MenuItem,{value:String(We),children:We},String(We)),filterFields:rt,renderFilterField:_e,resultItems:De,renderResultItem:$t=We=>_jsx(DefaultResultListItem,{result:We.document},We.document.location),disableRenderingWithNoResults:Kt,noResultsComponent:kt=Kt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Zt}=q,Wt=useCallback(We=>{g(We.currentTarget)},[]),Gt=useCallback(()=>{g(null)},[]);if(J)return _jsx(Progress,{});if(R)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:R});if(!(De!=null&&De.length))return _jsx(_Fragment,{children:kt});var ut;return _jsxs(List,{...Zt,children:[_jsxs(ListSubheader,{className:W.listSubheader,children:[G,_jsx(Typography,{className:W.listSubheaderName,component:"strong",...me,children:ae}),dt?_jsx(Chip,{className:W.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Wt}):null,dt?_jsx(Menu,{id:"filters-menu",anchorEl:le,open:Boolean(le),onClose:Gt,onClick:Gt,keepMounted:!0,children:dt.map(yt)}):null,rt==null?void 0:rt.map(We=>(ut=_e==null?void 0:_e(We))!==null&&ut!==void 0?ut:null),_jsx(Link,{className:W.listSubheaderLink,to:"/search",...Ye,children:Fe})]}),De.map($t)]})}function U(q){const{query:W,children:le,renderResultItem:g,linkProps:R={},...J}=q,G=useSearchResultListItemExtensions(le);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:W,children:({loading:ae,error:me,value:Fe},{term:Ye,types:dt,pageCursor:yt,filters:rt={}})=>{const _e=`/search?${qs.stringify({term:Ye,types:dt,filters:rt,pageCursor:yt,query:Ye},{arrayFormat:"brackets"})}`;return _jsx(de,{...J,error:me,loading:ae,linkProps:{to:_e,...R},filterFields:Object.keys(rt),resultItems:Fe==null?void 0:Fe.results,renderResultItem:g!=null?g:G})}})})}const he=(0,l.Z)(q=>({root:{display:"flex",justifyContent:"space-between",gap:q.spacing(2),margin:q.spacing(2,0)}})),Ke=()=>{const{fetchNextPage:q,fetchPreviousPage:W}=useSearch(),le=he();return!q&&!W?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:le.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!W,onClick:W,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!q,onClick:q,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Ve="search.results.list.items.extensions.v1",at=(q,W)=>{for(const le of q){if(!isValidElement(le))continue;const g=getComponentData(le,Ve);if(g!=null&&g(W))return cloneElement(le,{rank:W.rank,highlight:W.highlight,result:W.document,...le.props})}return null},It=q=>{const{rank:W,result:le,noTrack:g,children:R,alignItems:J="flex-start",...G}=q,ae=(0,h.z$)(),me=(0,m.useCallback)(()=>{g||le&&ae.captureEvent("discover",le.title,{attributes:{to:le.location},value:W})},[W,le,g,ae]);return(0,P.jsx)(y.Z,{divider:!0,alignItems:J,onClickCapture:me,...G,children:R})},tn=q=>{const{name:W,component:le,predicate:g=()=>!0}=q;return(0,h.YO)({name:W,component:{lazy:()=>le().then(R=>J=>(0,P.jsx)(It,{rank:J.rank,result:J.result,noTrack:J.noTrack,children:(0,m.createElement)(R,J)}))},data:{[Ve]:g}})},Xt=q=>{const W=useElementFilter(q,le=>le.selectByComponentData({key:Ve}).getElements(),[q]);return useCallback((le,g)=>{const R=at(W,le);return _jsx(Fragment,{children:R!=null?R:_jsx(It,{rank:le.rank,result:le.document,children:_jsx(DefaultResultListItem,{rank:le.rank,highlight:le.highlight,result:le.document})})},g)},[W])},sn=q=>{const{results:W,children:le,...g}=q,R=Xt(le);return _jsx(List,{...g,children:W.map(R)})}},61886:function(Ct,Be,n){"use strict";n.d(Be,{Ox:function(){return st},jM:function(){return m},Zz:function(){return y},oZ:function(){return Qe},DR:function(){return l},ZS:function(){return Te},VA:function(){return wt},KY:function(){return xe},gT:function(){return Y},Dl:function(){return ce},ux:function(){return At},$L:function(){return B},x1:function(){return qe}});var h=n(52322),r=n(2784),F=n(79635),P=n(60871);const m="techdocs.addons.addon.v1",y="techdocs.addons.wrapper.v1",l=()=>null;(0,P.R5)(l,y,!0);const M=Ie=>`${m}.${Ie.toLocaleLowerCase("en-US")}`;function xe(Ie){const{name:we,component:Ee}=Ie;return(0,P.YO)({name:we,component:{sync:Ne=>(0,h.jsx)(Ee,{...Ne})},data:{[m]:Ie,[M(we)]:!0}})}const V=(Ie,we)=>Ie.selectByComponentData({key:we}).getElements()[0],K=Ie=>Ie.selectByComponentData({key:y}).selectByComponentData({key:m}),S=Ie=>Ie.selectByComponentData({key:y}).findComponentData({key:m}),B=()=>{const Ie=(0,F.pC)(),we=(0,P.vJ)(Ie,K),Ee=(0,P.vJ)(Ie,S),Ne=(0,r.useCallback)(ht=>{if(!we||!ht)return null;const Nt=M(ht.name);var vt;return(vt=V(we,Nt))!==null&&vt!==void 0?vt:null},[we]),nt=(0,r.useCallback)(ht=>{const Nt=Ee.find(vt=>vt.name===ht);return Nt?Ne(Nt):null},[Ee,Ne]),zt=(0,r.useCallback)(ht=>{const Nt=Ee.filter(vt=>vt.location===ht);return Nt.length?Nt.map(Ne):null},[Ee,Ne]);return{renderComponentByName:nt,renderComponentsByLocation:zt}},Y=(0,P.T0)({id:"plugin.techdocs.service"}),ce=(0,P.T0)({id:"plugin.techdocs.storageservice"});var ee=n(64279),X=n(25271),w=n(51837);function O(Ie,we){return we.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(Ie.kind=Ie.kind.toLocaleLowerCase(),Ie.name=Ie.name.toLocaleLowerCase(),Ie.namespace=Ie.namespace.toLocaleLowerCase()),Ie}const $=(Ie,we)=>(0,X.eE)(Ie)===(0,X.eE)(we),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ne=(0,w.CT)("techdocs-reader-page-context"),Te=(0,r.memo)(Ie=>{const{entityRef:we,children:Ee}=Ie,Ne=(0,P.h_)(Y),nt=(0,P.h_)(P.Ds),zt=(0,ee.default)(async()=>Ne.getTechDocsMetadata(we),[we]),ht=(0,ee.default)(async()=>Ne.getEntityMetadata(we),[we]),[Nt,vt]=(0,r.useState)(T.title),[jt,en]=(0,r.useState)(T.subtitle),[on,Sn]=(0,r.useState)(T.shadowRoot),Pt={metadata:zt,entityRef:O(we,nt),entityMetadata:ht,shadowRoot:on,setShadowRoot:Sn,title:Nt,setTitle:vt,subtitle:jt,setSubtitle:en},an=(0,w.EI)({1:Pt});return(0,h.jsx)(P.fC,{attributes:{entityRef:(0,X.eE)(we)},children:(0,h.jsx)(ne.Provider,{value:an,children:Ee instanceof Function?Ee(Pt):Ee})})},(Ie,we)=>$(Ie.entityRef,we.entityRef)),qe=()=>{const Ie=(0,r.useContext)(ne);if(Ie===void 0)return T;const we=Ie.atVersion(1);if(we===void 0)throw new Error("No context found for version 1.");return we},Qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var it=n(70882),Ue=n(50236),Et=n(19219),He=n(23196);const st="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",je=Ie=>{(0,r.useEffect)(()=>{if(!Ie)return()=>{};const we=Ie.querySelectorAll('head > link[rel="stylesheet"]');var Ee;let Ne=(Ee=we==null?void 0:we.length)!==null&&Ee!==void 0?Ee:0;const nt=new CustomEvent(st);if(!Ne)return Ie.dispatchEvent(nt),()=>{};const zt=()=>{--Ne===0&&Ie.dispatchEvent(nt)};return we==null||we.forEach(ht=>{ht.addEventListener("load",zt)}),()=>{we==null||we.forEach(ht=>{ht.removeEventListener("load",zt)})}},[Ie])},At=Ie=>{const[we,Ee]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!Ie)return()=>{};Ee(!0);const Ne=Ie.style;Ne.setProperty("opacity","0");const nt=()=>{Ee(!1),Ne.setProperty("opacity","1")};return Ie.addEventListener(st,nt),()=>{Ie.removeEventListener(st,nt)}},[Ie]),we},wt=Ie=>{const{element:we,onAppend:Ee,children:Ne}=Ie,[nt,zt]=(0,r.useState)((0,it.Ue)({...(0,Ue.Z)(),insertionPoint:void 0}));je(we);const ht=At(we),Nt=(0,r.useCallback)(vt=>{if(!we||!vt)return;zt((0,it.Ue)({...(0,Ue.Z)(),insertionPoint:we.querySelector("head")||void 0}));let jt=vt.shadowRoot;jt||(jt=vt.attachShadow({mode:"open"})),jt.replaceChildren(we),typeof Ee=="function"&&Ee(jt)},[we,Ee]);return(0,h.jsxs)(h.Fragment,{children:[ht&&(0,h.jsx)(He.Ex,{}),(0,h.jsxs)(Et.ZP,{jss:nt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:Nt,"data-testid":"techdocs-native-shadowroot"}),Ne]})]})};var gt=n(54073);const xt=()=>{const{shadowRoot:Ie}=useTechDocsReaderPage();return Ie},Tt=Ie=>{const we=xt();return we?Ie.map(Ee=>we==null?void 0:we.querySelectorAll(Ee)).filter(Ee=>Ee.length).map(Ee=>Array.from(Ee)).flat():[]},Lt=Ie=>Ie.toString()&&Ie.rangeCount&&Ie.getRangeAt(0).getBoundingClientRect().top,ze=(Ie=0)=>{const we=xt(),[Ee,Ne]=useState(null),nt=useMemo(()=>debounce(()=>{const zt=we,ht=zt.getSelection?zt.getSelection():document.getSelection();ht&&Lt(ht)?Ne(ht):Ne(null)},Ie),[we,Ne,Ie]);return useEffect(()=>(window.document.addEventListener("selectionchange",nt),()=>window.document.removeEventListener("selectionchange",nt)),[nt]),Ee}},52943:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{EmbeddedDocsRouter:function(){return ee},Router:function(){return ce},isTechDocsAvailable:function(){return Y}});var h=n(52322),r=n(2784),F=n(79635),P=n(40303),m=n(23196),y=n(25271),l=n(89258),M=n(65124),xe=n(67896);const V=({entity:X})=>{const w=(0,y.iB)(X);return(0,h.jsxs)(l.I6,{entityRef:w,children:[(0,h.jsx)(M.b,{}),(0,h.jsx)(xe.F,{withSearch:!1})]})};var K=n(18662),S=n(7476);const B="backstage.io/techdocs-ref",Y=X=>{var w,O;return Boolean(X==null||(w=X.metadata)===null||w===void 0||(O=w.annotations)===null||O===void 0?void 0:O[B])},ce=()=>(0,h.jsxs)(F.Z5,{children:[(0,h.jsx)(F.AW,{path:"/",element:(0,h.jsx)(K.TechDocsIndexPage,{})}),(0,h.jsx)(F.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(S.TechDocsReaderPage,{})})]}),ee=X=>{var w;const{children:O}=X,{entity:$}=(0,P.X2)(),T=(0,F.V$)([{path:"/*",element:(0,h.jsx)(V,{entity:$}),children:[{path:"*",element:O}]}]);return((w=$.metadata.annotations)===null||w===void 0?void 0:w[B])?T:(0,h.jsx)(m.sk,{annotation:B})}},92077:function(Ct,Be,n){"use strict";n.d(Be,{k:function(){return m},p:function(){return P}});var h=n(23054),r=n(76372),F=n.n(r);class P{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:M,namespace:xe,name:V}=l,S=`${await this.getApiOrigin()}/metadata/techdocs/${xe}/${M}/${V}`,B=await this.fetchApi.fetch(`${S}`);if(!B.ok)throw await h.VL.fromResponse(B);return await B.json()}async getEntityMetadata(l){const{kind:M,namespace:xe,name:V}=l,S=`${await this.getApiOrigin()}/metadata/entity/${xe}/${M}/${V}`,B=await this.fetchApi.fetch(`${S}`);if(!B.ok)throw await h.VL.fromResponse(B);return await B.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,M){const{kind:xe,namespace:V,name:K}=l,B=`${await this.getStorageUrl()}/${V}/${xe}/${K}/${M}`,Y=await this.fetchApi.fetch(`${B.endsWith("/")?B:`${B}/`}index.html`);let ce="";switch(Y.status){case 404:throw ce="Page not found. ",M||(ce+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ce);case 500:throw ce="Could not generate documentation or an error in the TechDocs backend. ",new Error(ce);default:break}return Y.text()}async syncEntityDocs(l,M=()=>{}){const{kind:xe,namespace:V,name:K}=l,B=`${await this.getApiOrigin()}/sync/${V}/${xe}/${K}`,{token:Y}=await this.identityApi.getCredentials();return new Promise((ce,ee)=>{const X=new r.EventSourcePolyfill(B,{withCredentials:!0,headers:Y?{Authorization:`Bearer ${Y}`}:{}});X.addEventListener("log",w=>{w.data&&M(JSON.parse(w.data))}),X.addEventListener("finish",w=>{let O=!1;w.data&&({updated:O}=JSON.parse(w.data)),ce(O?"updated":"cached")}),X.onerror=w=>{switch(X.close(),w.status){case 404:ee(new h.dR(w.message));return;default:ee(new Error(w.data));return}}})}async getBaseUrl(l,M,xe){const{kind:V,namespace:K,name:S}=M,Y=`${await this.getApiOrigin()}/static/docs/${K}/${V}/${S}/${xe}`;return new URL(l,Y.endsWith("/")?Y:`${Y}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(Ct,Be,n){"use strict";n.d(Be,{D:function(){return h}});function h(r,F){return F.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(Ct,Be,n){"use strict";n.d(Be,{u:function(){return M}});var h=n(52322),r=n(2784),F=n(23196),P=n(40303),m=n(42081),y=n(48431),l=n(68435);const M=xe=>{const{initialFilter:V="owned",columns:K,actions:S}=xe;return(0,h.jsx)(m.j,{children:(0,h.jsxs)(F.VY,{children:[(0,h.jsx)(F.yW,{title:"",children:(0,h.jsx)(F.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(P.UO,{children:(0,h.jsxs)(P._i,{children:[(0,h.jsxs)(P._i.Filters,{children:[(0,h.jsx)(y.f,{}),(0,h.jsx)(P.EW,{initialFilter:V}),(0,h.jsx)(P.dq,{}),(0,h.jsx)(P.xE,{})]}),(0,h.jsx)(P._i.Content,{children:(0,h.jsx)(l.n,{actions:S,columns:K})})]})})]})})}},85478:function(Ct,Be,n){"use strict";n.d(Be,{f:function(){return K}});var h=n(52322),r=n(95573),F=n(51953),P=n(60871),m=n(23196),y=n(94339),l=n(16111),M=n(24579),xe=n(14503),V=n(2784);const K=ee=>{const{entities:X}=ee,w=(0,P.tg)(r.Fw),O=(0,P.h_)(P.Ds);if(!X)return null;var $,T;return(0,h.jsx)(m.Oh,{"data-testid":"docs-explore",children:X!=null&&X.length?X.map((ne,Te)=>(0,h.jsxs)(y.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(m.hu,{title:($=ne.metadata.title)!==null&&$!==void 0?$:ne.metadata.name})}),(0,h.jsx)(M.Z,{children:ne.metadata.description}),(0,h.jsx)(xe.Z,{children:(0,h.jsx)(m.Qj,{to:w({namespace:(0,F.D)((T=ne.metadata.namespace)!==null&&T!==void 0?T:"default",O),kind:(0,F.D)(ne.kind,O),name:(0,F.D)(ne.metadata.name,O)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Te)):null})};var S=n(40303);const B={title:"All Documentation",filterPredicate:()=>!0},Y=ee=>{const{entities:X,group:w}=ee,{loading:O,isOwnedEntity:$}=useEntityOwnership(),T=X.filter(Te=>w.filterPredicate==="ownedByUser"?O?!1:$(Te):typeof w.filterPredicate=="function"&&w.filterPredicate(Te)),ne=(()=>typeof w.title=="string"?_jsx(ContentHeader,{title:w.title}):w.title)();return T.length===0?null:_jsxs(Content,{children:[ne,_jsx(DocsCardGrid,{entities:T})]})},ce=ee=>{const{loading:X,error:w,entities:O}=useEntityList();if(w)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:w.toString()})});if(X)return _jsx(Progress,{});if(O.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 $,T;return O.sort((ne,Te)=>(($=ne.metadata.title)!==null&&$!==void 0?$:ne.metadata.name).localeCompare((T=Te.metadata.title)!==null&&T!==void 0?T:Te.metadata.name)),_jsx(Content,{children:(ee.groups||[B]).map((ne,Te)=>_jsx(Y,{entities:O,group:ne},`${ne.title}-${Te}`))})}},68435:function(Ct,Be,n){"use strict";n.d(Be,{H:function(){return O},n:function(){return $}});var h=n(52322),r=n(2784),F=n(95074),P=n(76635),m=n(23196),y=n(40303),l=n(60871),M=n(25271),xe=n(95573),V=n(39981),K=n(2337),S=n(11640),B=n(28347);const Y=(0,K.Z)({root:{color:"#f3ba37"}})(S.Z),ce={createCopyDocsUrlAction(T){return ne=>({icon:()=>(0,h.jsx)(V.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${ne.resolved.docsUrl}`)})},createStarEntityAction(T,ne){return Te=>{const qe=Te.entity,Qe=T(qe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Qe?(0,h.jsx)(Y,{}):(0,h.jsx)(B.Z,{}),tooltip:Qe?"Remove from favorites":"Add to favorites",onClick:()=>ne(qe)}}}};function ee(T){return T.metadata.title||T.metadata.name}const X={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(m.uw,{value:(0,h.jsx)(m.rU,{to:T.resolved.docsUrl,children:ee(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(y.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var w=n(51953);const O=T=>{const{entities:ne,title:Te,loading:qe,columns:Qe,actions:it,options:Ue}=T,[,Et]=(0,F.Z)(),He=(0,l.tg)(xe.Fw),st=(0,l.h_)(l.Ds);if(!ne)return null;const je=ne.map(gt=>{const xt=(0,y.hF)(gt,M.S4);var Tt;return{entity:gt,resolved:{docsUrl:He({namespace:(0,w.D)((Tt=gt.metadata.namespace)!==null&&Tt!==void 0?Tt:"default",st),kind:(0,w.D)(gt.kind,st),name:(0,w.D)(gt.metadata.name,st)}),ownedByRelations:xt,ownedByRelationsTitle:xt.map(Lt=>(0,y.$3)(Lt,{defaultKind:"group"})).join(", ")}}}),At=[X.createNameColumn(),X.createOwnerColumn(),X.createTypeColumn()],wt=[ce.createCopyDocsUrlAction(Et)];return(0,h.jsx)(h.Fragment,{children:qe||je&&je.length>0?(0,h.jsx)(m.iA,{isLoading:qe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Ue},data:je,columns:Qe||At,actions:it||wt,title:Te?`${Te} (${je.length})`:`All (${je.length})`}):(0,h.jsx)(m.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(m.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};O.columns=X,O.actions=ce;const $=T=>{var ne;const{columns:Te,actions:qe,options:Qe}=T,{loading:it,error:Ue,entities:Et,filters:He}=(0,y.wp)(),{isStarredEntity:st,toggleStarredEntity:je}=(0,y.CR)(),[,At]=(0,F.Z)();var wt;const gt=(0,P.capitalize)((wt=(ne=He.user)===null||ne===void 0?void 0:ne.value)!==null&&wt!==void 0?wt:"all"),xt=[ce.createCopyDocsUrlAction(At),ce.createStarEntityAction(st,je)];return Ue?(0,h.jsx)(m.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(m.Oi,{language:"text",text:Ue.toString()})}):(0,h.jsx)(O,{title:gt,entities:Et,loading:it,actions:qe||xt,columns:Te,options:Qe})};$.columns=X,$.actions=ce},18662:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsIndexPage:function(){return m}});var h=n(52322),r=n(2784),F=n(79635),P=n(3482);const m=y=>(0,F.pC)()||(0,h.jsx)(P.u,{...y})},42081:function(Ct,Be,n){"use strict";n.d(Be,{j:function(){return m}});var h=n(52322),r=n(2784),F=n(23196),P=n(60871);const m=y=>{const{children:l}=y,M=(0,P.h_)(P.Ds);var xe;const V=`Documentation available in ${(xe=M.getOptionalString("organization.name"))!==null&&xe!==void 0?xe:"Backstage"}`;return(0,h.jsx)(F.g9,{title:"Documentation",subtitle:V,themeId:"documentation",children:l})}},48431:function(Ct,Be,n){"use strict";n.d(Be,{f:function(){return P}});var h=n(2784),r=n(40303);class F{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const P=()=>{const{updateFilters:m}=(0,r.wp)();return(0,h.useEffect)(()=>{m({techdocs:new F})},[m]),null}},89258:function(Ct,Be,n){"use strict";n.d(Be,{I6:function(){return K},Jl:function(){return V},s4:function(){return y}});var h=n(61886),r=n(92077),F=n(95573),P=n(60871),m=n(15096);const y=(0,P.rx)({id:"techdocs",apis:[(0,P.ni)({api:h.Dl,deps:{configApi:P.Ds,discoveryApi:P.NW,identityApi:P.$4,fetchApi:P.gP},factory:({configApi:B,discoveryApi:Y,identityApi:ce,fetchApi:ee})=>new r.k({configApi:B,discoveryApi:Y,identityApi:ce,fetchApi:ee})}),(0,P.ni)({api:h.gT,deps:{configApi:P.Ds,discoveryApi:P.NW,fetchApi:P.gP},factory:({configApi:B,discoveryApi:Y,fetchApi:ce})=>new r.p({configApi:B,discoveryApi:Y,fetchApi:ce})})],routes:{root:F._Z,docRoot:F.Fw,entityContent:F.pd}}),l=y.provide((0,P.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(B=>B.Router),mountPoint:F._Z})),M=y.provide((0,P.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(B=>B.EmbeddedDocsRouter),mountPoint:F.pd})),xe=y.provide((0,P.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(B=>B.TechDocsCustomHome),mountPoint:F._Z})),V=y.provide((0,P.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(B=>B.TechDocsIndexPage),mountPoint:F._Z})),K=y.provide((0,P.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(B=>B.TechDocsReaderPage),mountPoint:F.Fw})),S=y.provide((0,m.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(B=>B.TechDocsSearchResultListItem),predicate:B=>B.type==="techdocs"}))},7476:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsReaderLayout:function(){return K},TechDocsReaderPage:function(){return S}});var h=n(52322),r=n(2784),F=n(79635),P=n(23196),m=n(61886),y=n(67896),l=n(93225),M=n(65124),xe=n(95573),V=n(60871);const K=B=>{const{withSearch:Y,withHeader:ce=!0}=B;return(0,h.jsxs)(P.T3,{themeId:"documentation",children:[ce&&(0,h.jsx)(l.S,{}),(0,h.jsx)(M.b,{}),(0,h.jsx)(y.F,{withSearch:Y})]})},S=B=>{const{kind:Y,name:ce,namespace:ee}=(0,V.Oi)(xe.Fw),{children:X,entityRef:w={kind:Y,name:ce,namespace:ee}}=B,O=(0,F.pC)();if(!X){const T=O?r.Children.toArray(O.props.children):[];var $;const Te=T.flatMap(qe=>{var Qe;return($=qe==null||(Qe=qe.props)===null||Qe===void 0?void 0:Qe.children)!==null&&$!==void 0?$:[]}).find(qe=>!(0,V.IY)(qe,m.Zz)&&!(0,V.IY)(qe,m.jM));return(0,h.jsx)(m.ZS,{entityRef:w,children:Te||(0,h.jsx)(K,{})})}return(0,h.jsx)(m.ZS,{entityRef:w,children:({metadata:T,entityMetadata:ne,onReady:Te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(P.T3,{themeId:"documentation",children:X instanceof Function?X({entityRef:w,techdocsMetadataValue:T.value,entityMetadataValue:ne.value,onReady:Te}):X})})})}},67896:function(Ct,Be,n){"use strict";n.d(Be,{F:function(){return W}});var h=n(52322),r=n(2784),F=n(79692),P=n(60905),m=n(61886),y=n(23196),l=n(22478),M=n(4614),xe=n(77277),V=n(99688),K=n(12420),S=n(90436),B=n(61837),Y=n(4190),ce=n(87685);const ee=(0,F.Z)(g=>(0,K.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}})),X=({buildLog:g,onClose:R})=>{const J=ee(),G=g.length===0?"Waiting for logs...":g.join(`
|
|
37
|
-
`);return(0,h.jsxs)(P.Z,{container:!0,direction:"column",className:J.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(P.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(S.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(B.Z,{title:"Close the drawer",onClick:R,color:"inherit",children:(0,h.jsx)(ce.Z,{})},"dismiss")]}),(0,h.jsx)(P.Z,{item:!0,xs:!0,children:(0,h.jsx)(y.nU,{text:G,classes:{root:J.logs}})})]})},w=({buildLog:g})=>{const R=ee(),[J,G]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xe.Z,{color:"inherit",onClick:()=>G(!0),children:"Show Build Logs"}),(0,h.jsx)(Y.ZP,{classes:{paper:R.paper},anchor:"right",open:J,onClose:()=>G(!1),children:(0,h.jsx)(X,{buildLog:g,onClose:()=>G(!1)})})]})};var O=n(60871);const $=({errorMessage:g})=>{const R=(0,O.h_)(O.Ds).getOptionalString("techdocs.builder");let J="";return R!=="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,h.jsx)(y.mf,{status:"404",statusMessage:g||"Documentation not found",additionalInfo:J})};var T=n(95481);const ne=(0,F.Z)(g=>({root:{marginBottom:g.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Te=()=>{let g=null;const R=ne(),{state:J,contentReload:G,contentErrorMessage:ae,syncErrorMessage:me,buildLog:Fe}=(0,T.DK)();return J==="INITIAL_BUILD"&&(g=(0,h.jsx)(V.Z,{classes:{root:R.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(M.Z,{size:"24px"}),action:(0,h.jsx)(w,{buildLog:Fe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),J==="CONTENT_STALE_REFRESHING"&&(g=(0,h.jsx)(V.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(M.Z,{size:"24px"}),action:(0,h.jsx)(w,{buildLog:Fe}),classes:{root:R.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),J==="CONTENT_STALE_READY"&&(g=(0,h.jsx)(V.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(xe.Z,{color:"inherit",onClick:()=>G(),children:"Refresh"}),classes:{root:R.root},children:"A newer version of this documentation is now available, please refresh to view."})),J==="CONTENT_STALE_ERROR"&&(g=(0,h.jsxs)(V.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(w,{buildLog:Fe}),classes:{root:R.root,message:R.message},children:["Building a newer version of this documentation failed."," ",me]})),J==="CONTENT_NOT_FOUND"&&(g=(0,h.jsxs)(h.Fragment,{children:[me&&(0,h.jsxs)(V.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(w,{buildLog:Fe}),classes:{root:R.root,message:R.message},children:["Building a newer version of this documentation failed."," ",me]}),(0,h.jsx)($,{errorMessage:ae})]})),g};var qe=n(79635),Qe=n(60364),it=n(41156),Ue=n(32838),Et=n(35368),He=n.n(Et);const st=/main\.[A-Fa-f0-9]{8}\.min\.css$/,je=/^https:\/\/fonts\.googleapis\.com/,At=/^https:\/\/fonts\.gstatic\.com/,wt=g=>g.nodeName==="LINK",gt=g=>{const R=(g==null?void 0:g.getAttribute("href"))||"",J=R.match(st),G=R.match(je),ae=R.match(At);return J||G||ae},xt=g=>(wt(g)&&!gt(g)&&g.remove(),g),Tt=g=>g.nodeName==="IFRAME",Lt=(g,R)=>{const J=g.getAttribute("src")||"";try{const{host:G}=new URL(J);return R.includes(G)}catch{return!1}},ze=g=>R=>(Tt(R)&&!Lt(R,g)&&R.remove(),R),Ie=()=>{const g=(0,O.h_)(O.Ds);return(0,r.useMemo)(()=>g.getOptionalConfig("techdocs.sanitizer"),[g])},we=()=>{const g=Ie();return(0,r.useCallback)(async R=>{const J=g==null?void 0:g.getOptionalStringArray("allowedIframeHosts");He().addHook("beforeSanitizeElements",xt);const G=["link"];return J&&(G.push("iframe"),He().addHook("beforeSanitizeElements",ze(J))),He().sanitize(R.outerHTML,{ADD_TAGS:G,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[g])};var Ee=n(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,Ee.$n)(g.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,Ee.$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,Ee.$n)(g.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,Ee.$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,Ee.$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,Ee.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,Ee.Fq)(g.palette.error.dark,.5):(0,Ee.Fq)(g.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${g.palette.type==="dark"?(0,Ee.Fq)(g.palette.success.dark,.5):(0,Ee.Fq)(g.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${g.palette.type==="dark"?(0,Ee.Fq)(g.palette.warning.dark,.5):(0,Ee.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
|
-
`,nt=({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 zt="224px";var ht=({theme:g,sidebar:R})=>`
|
|
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: ${R.isPinned?`calc(-12.1rem + ${zt})`:"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 Nt=["h1","h2","h3","h4","h5","h6"];var vt=({theme:g})=>`
|
|
356
|
-
/*================== Typeset ==================*/
|
|
357
|
-
|
|
358
|
-
.md-typeset {
|
|
359
|
-
font-size: var(--md-typeset-font-size);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
${Nt.reduce((R,J)=>{var G;const ae=(G=g.typography.htmlFontSize)!==null&&G!==void 0?G:16,me=g.typography[J],{lineHeight:Fe,fontFamily:Ye,fontWeight:dt,fontSize:yt}=me,rt=_e=>{let De=1;return typeof _e=="number"&&(De=_e/ae*.6),typeof _e=="string"&&(De=_e.replace("rem","")),`calc(${De} * var(--md-typeset-font-size))`};return R.concat(`
|
|
363
|
-
.md-typeset ${J} {
|
|
364
|
-
color: var(--md-default-fg-color);
|
|
365
|
-
line-height: ${Fe};
|
|
366
|
-
font-family: ${Ye};
|
|
367
|
-
font-weight: ${dt};
|
|
368
|
-
font-size: ${rt(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
|
-
`,jt=()=>`
|
|
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
|
-
`,en=({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 on=[Ne,nt,ht,vt,jt,en],Sn=()=>(0,y.Pf)(),Pt=()=>{const g=Sn(),R=(0,Qe.Z)();return(0,r.useMemo)(()=>{const J={theme:R,sidebar:g};return on.reduce((G,ae)=>G+ae(J),"")},[R,g])},an=()=>{const g=Pt();return(0,r.useCallback)(R=>(R.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${g}</style>`),R),[g])},Cn=(g,R,J)=>{const G=g==="src"&&R.endsWith(".svg"),ae=!R.match(/^([a-z]*:)?\/\//i),me=R.startsWith(J);return G&&(ae||me)},Tn=({techdocsStorageApi:g,entityId:R,path:J})=>async G=>{const ae=await g.getApiOrigin(),me=async(Fe,Ye)=>{for(const dt of Fe)if(dt.hasAttribute(Ye)){const yt=dt.getAttribute(Ye);if(!yt)return;const rt=await g.getBaseUrl(yt,R,J);if(Cn(Ye,yt,ae))try{const De=await(await fetch(rt,{credentials:"include"})).text();dt.setAttribute(Ye,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(De)))}`)}catch{dt.setAttribute("alt",`Error: ${yt}`)}else dt.setAttribute(Ye,rt)}};return await Promise.all([me(G.querySelectorAll("img"),"src"),me(G.querySelectorAll("script"),"src"),me(G.querySelectorAll("source"),"src"),me(G.querySelectorAll("link"),"href"),me(G.querySelectorAll("a[download]"),"href")]),G};var ln=n(79158),qn=n(67097),On=n(28316),_n=n(82717),lt=n.n(_n);const Bn=g=>R=>{var J;const G=R.querySelector('[title="Edit this page"]');if(!G||!G.href)return R;const ae=new URL(G.href),me=g.byUrl(ae);if((me==null?void 0:me.type)!=="github"&&(me==null?void 0:me.type)!=="gitlab")return R;const Fe=((J=R.querySelector("article>h1"))===null||J===void 0?void 0:J.childNodes[0].textContent)||"",Ye=encodeURIComponent(`Documentation Feedback: ${Fe}`),dt=encodeURIComponent(`Page source:
|
|
499
|
-
${G.href}
|
|
500
|
-
|
|
501
|
-
Feedback:`),yt=(me==null?void 0:me.type)==="github"?(0,ln.BT)(ae.href,"blob"):ae.href,rt=lt()(yt),_e=`/${rt.organization}/${rt.name}`,De=G.cloneNode();switch(me==null?void 0:me.type){case"gitlab":De.href=`${ae.origin}${_e}/issues/new?issue[title]=${Ye}&issue[description]=${dt}`;break;case"github":De.href=`${ae.origin}${_e}/issues/new?title=${Ye}&body=${dt}`;break;default:return R}return On.render(r.createElement(qn.Z),De),De.style.paddingLeft="5px",De.title="Leave feedback for this page",De.id="git-feedback-link",G==null||G.insertAdjacentElement("beforebegin",De),R};var wn=n(44882);const cn=()=>g=>{const R=g.querySelector('.md-header label[for="__drawer"]'),J=g.querySelector("article");if(!R||!J)return g;const G=R.cloneNode();return On.render(r.createElement(wn.Z),G),G.id="toggle-sidebar",G.title="Toggle Sidebar",G.classList.add("md-content__button"),G.style.setProperty("padding","0 0 0 5px"),G.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(G),g},$n=()=>g=>(((J,G)=>{Array.from(J).filter(ae=>ae.hasAttribute(G)).forEach(ae=>{const me=ae.getAttribute(G);if(me){me.match(/^https?:\/\//i)&&ae.setAttribute("target","_blank");try{const Fe=Wn(window.location.href);ae.setAttribute(G,new URL(me,Fe).toString())}catch{ae.replaceWith(ae.textContent||me)}}})})(Array.from(g.getElementsByTagName("a")),"href"),g);function Wn(g){const R=new URL(g);return!R.pathname.endsWith("/")&&!R.pathname.endsWith(".html")&&(R.pathname+="/"),R.toString()}const jn=({baseUrl:g,onClick:R})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(G=>{G.addEventListener("click",ae=>{const Fe=G.getAttribute("href");Fe&&Fe.startsWith(g)&&!G.hasAttribute("download")&&(ae.preventDefault(),R(ae,Fe))})}),J);var Gn=n(15459),ve=n(80030),re=n(72379),Oe=n(41547),Pe=n(95074);const Ge=(0,Gn.Z)(g=>({tooltip:{fontSize:"inherit",color:g.palette.text.primary,margin:0,padding:g.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(ve.ZP),pt=()=>(0,h.jsx)(re.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Ht=({text:g})=>{const[R,J]=(0,r.useState)(!1),[,G]=(0,Pe.Z)(),ae=(0,r.useCallback)(()=>{G(g),J(!0)},[g,G]),me=(0,r.useCallback)(()=>{J(!1)},[J]);return(0,h.jsx)(Ge,{title:"Copied to clipboard",placement:"left",open:R,onClose:me,leaveDelay:1e3,children:(0,h.jsx)(xe.Z,{className:"md-clipboard md-icon",onClick:ae,children:(0,h.jsx)(pt,{})})})},Rt=g=>R=>{const J=R.querySelectorAll("pre > code");for(const ae of J){var G;const me=ae.textContent||"",Fe=document.createElement("div");ae==null||(G=ae.parentElement)===null||G===void 0||G.prepend(Fe),On.render((0,h.jsx)(Oe.Z,{theme:g,children:(0,h.jsx)(Ht,{text:me})}),Fe)}return R},de=()=>g=>{var R;return(R=g.querySelector(".md-header"))===null||R===void 0||R.remove(),g},U=()=>g=>{var R,J;return(R=g.querySelector(".md-footer .md-copyright"))===null||R===void 0||R.remove(),(J=g.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),g},he=({onLoading:g,onLoaded:R})=>J=>(g(),J.addEventListener(m.Ox,function G(){R(),J.removeEventListener(m.Ox,G)}),J),Ke=()=>g=>(g.addEventListener(m.Ox,function R(){if(window.location.hash){var J;const G=window.location.hash.slice(1);(J=g==null?void 0:g.querySelector(`[id="${G}"]`))===null||J===void 0||J.scrollIntoView()}g.removeEventListener(m.Ox,R)}),g),Ve=()=>g=>(setTimeout(()=>{const R=g==null?void 0:g.querySelectorAll("li.md-nav__item--active");R.length!==0&&(R.forEach(G=>{const ae=G==null?void 0:G.querySelector("input");ae!=null&&ae.checked||ae==null||ae.click()}),R[R.length-1].scrollIntoView())},200),g),at=async(g,R)=>{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 G of R)J=await G(J);return J},It="screen and (max-width: 76.1875em)",tn=g=>{const R=(0,qe.s0)(),J=(0,Qe.Z)(),G=(0,it.Z)(It),ae=we(),me=an(),Fe=(0,O.z$)(),Ye=(0,O.h_)(m.Dl),dt=(0,O.h_)(Ue.q3),{state:yt,path:rt,content:_e}=(0,T.DK)(),[De,$t]=(0,r.useState)(null),Kt=(0,m.ux)(De),kt=(0,r.useCallback)(()=>{if(!De)return;De.querySelectorAll(".md-sidebar").forEach(We=>{if(G)We.style.top="0px";else{const In=document==null?void 0:document.querySelector(".techdocs-reader-page");var Ft;const Zn=(Ft=In==null?void 0:In.getBoundingClientRect().top)!==null&&Ft!==void 0?Ft:0;var dn;let yn=(dn=De.getBoundingClientRect().top)!==null&&dn!==void 0?dn:0;const Kn=De.querySelector(".md-container > .md-tabs");var vn;const xn=(vn=Kn==null?void 0:Kn.getBoundingClientRect().height)!==null&&vn!==void 0?vn:0;yn<Zn&&(yn=Zn),We.style.top=`${Math.max(yn,0)+xn}px`}We.style.setProperty("opacity","1")})},[De,G]);(0,r.useEffect)(()=>(window.addEventListener("resize",kt),window.addEventListener("scroll",kt,!0),()=>{window.removeEventListener("resize",kt),window.removeEventListener("scroll",kt,!0)}),[De,kt]);const Zt=(0,r.useCallback)(()=>{if(!De)return;const ut=De.querySelector(".md-footer");ut&&(ut.style.width=`${De.getBoundingClientRect().width}px`)},[De]);(0,r.useEffect)(()=>(window.addEventListener("resize",Zt),()=>{window.removeEventListener("resize",Zt)}),[De,Zt]),(0,r.useEffect)(()=>{Kt||(Zt(),kt())},[yt,Kt,Zt,kt]);const Wt=(0,r.useCallback)((ut,We)=>at(ut,[ae,Tn({techdocsStorageApi:Ye,entityId:g,path:We}),$n(),cn(),de(),U(),Bn(dt),me]),[g,dt,Ye,ae,me]),Gt=(0,r.useCallback)(async ut=>at(ut,[Ke(),Ve(),Rt(J),jn({baseUrl:window.location.origin,onClick:(We,Ft)=>{var dn;const vn=We.ctrlKey||We.metaKey,In=new URL(Ft),Zn=`${In.pathname}${In.search}${In.hash}`,yn=((dn=We.target)===null||dn===void 0?void 0:dn.innerText)||Ft,Kn=Ft.replace(window.location.origin,"");if(Fe.captureEvent("click",yn,{attributes:{to:Kn}}),In.hash)if(vn)window.open(Zn,"_blank");else{var xn;R(Zn),(xn=ut==null?void 0:ut.querySelector(`[id="${In.hash.slice(1)}"]`))===null||xn===void 0||xn.scrollIntoView()}else vn?window.open(Zn,"_blank"):R(Zn)}}),he({onLoading:()=>{},onLoaded:()=>{var We;(We=ut.querySelector(".md-nav__title"))===null||We===void 0||We.removeAttribute("for")}}),he({onLoading:()=>{Array.from(ut.querySelectorAll(".md-sidebar")).forEach(Ft=>{Ft.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,R,Fe]);return(0,r.useEffect)(()=>{if(!_e)return()=>{};let ut=!0;return Wt(_e,rt).then(async We=>{if(!(We!=null&&We.innerHTML)||!ut)return;window.scroll({top:0});const Ft=await Gt(We);$t(Ft)}),()=>{ut=!1}},[_e,rt,Wt,Gt]),De};var Xt=n(8560);const sn=()=>{const g=(0,m.$L)(),{shadowRoot:R}=(0,m.x1)(),J=R==null?void 0:R.querySelector('[data-md-component="content"]'),G=R==null?void 0:R.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ae=G==null?void 0:G.querySelector('[data-techdocs-addons-location="primary sidebar"]');ae||(ae=document.createElement("div"),ae.setAttribute("data-techdocs-addons-location","primary sidebar"),G==null||G.prepend(ae));const me=R==null?void 0:R.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=me==null?void 0:me.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),me==null||me.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Xt.Z,{container:ae,children:g.renderComponentsByLocation(m.oZ.PrimarySidebar)}),(0,h.jsx)(Xt.Z,{container:J,children:g.renderComponentsByLocation(m.oZ.Content)}),(0,h.jsx)(Xt.Z,{container:Fe,children:g.renderComponentsByLocation(m.oZ.SecondarySidebar)})]})},q=(0,F.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),W=(0,T.m1)(g=>{var R;const{withSearch:J=!0,onReady:G}=g,ae=q(),{entityMetadata:{value:me,loading:Fe},entityRef:Ye,setShadowRoot:dt}=(0,m.x1)(),yt=tn(Ye),rt=(0,r.useCallback)(_e=>{dt(_e),G instanceof Function&&G()},[dt,G]);return Fe===!1&&!me?(0,h.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):yt?(0,h.jsx)(y.VY,{children:(0,h.jsxs)(P.Z,{container:!0,children:[(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})}),J&&(0,h.jsx)(P.Z,{className:ae.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:Ye,entityTitle:me==null||(R=me.metadata)===null||R===void 0?void 0:R.title})}),(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(m.VA,{element:yt,onAppend:rt,children:(0,h.jsx)(sn,{})})})]})}):(0,h.jsx)(y.VY,{children:(0,h.jsx)(P.Z,{container:!0,children:(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})})})})}),le=null},93225:function(Ct,Be,n){"use strict";n.d(Be,{S:function(){return ee}});var h=n(52322),r=n(2784),F=n(18671),P=n(60905),m=n(98069),y=n(60364),l=n(73250),M=n(61886),xe=n(40303),V=n(25271),K=n(23196),S=n(60871),B=n(76635),Y=n(95573);const ce=(0,h.jsx)(m.Z,{animation:"wave",variant:"text",height:40}),ee=X=>{const{palette:{common:{white:w}}}=(0,y.Z)(),{children:O}=X,$=(0,M.$L)(),T=(0,S.h_)(S.Ds),{title:ne,setTitle:Te,subtitle:qe,setSubtitle:Qe,entityRef:it,metadata:{value:Ue,loading:Et},entityMetadata:{value:He,loading:st}}=(0,M.x1)();(0,r.useEffect)(()=>{Ue&&(Te(Ue.site_name),Qe(()=>{let{site_description:Ee}=Ue;return(!Ee||Ee==="None")&&(Ee=""),Ee}))},[Ue,Te,Qe]);const je=T.getOptional("app.title")||"Backstage",At=[ne,qe,je].filter(Boolean).join(" | "),{locationMetadata:wt,spec:gt}=He||{},xt=gt==null?void 0:gt.lifecycle,Tt=He?(0,xe.hF)(He,V.S4):[],Lt=(0,S.tg)(Y._Z)(),ze=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(K.i9,{label:(0,B.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,h.jsx)(xe.dx,{color:"inherit",entityRef:it,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),Tt.length>0&&(0,h.jsx)(K.i9,{label:"Owner",value:(0,h.jsx)(xe.rI,{color:"inherit",entityRefs:Tt,defaultKind:"group"})}),xt?(0,h.jsx)(K.i9,{label:"Lifecycle",value:xt}):null,wt&&wt.type!=="dir"&&wt.type!=="file"?(0,h.jsx)(K.i9,{label:"",value:(0,h.jsxs)(P.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,h.jsx)(P.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(l.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(P.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:wt.target}):null]});return!st&&He===void 0||!Et&&Ue===void 0?null:(0,h.jsxs)(K.h4,{type:"Documentation",typeLink:Lt,title:ne||ce,subtitle:qe===""?void 0:qe||ce,children:[(0,h.jsx)(F.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:At})}),ze,O,$.renderComponentsByLocation(M.oZ.Header)]})}},65124:function(Ct,Be,n){"use strict";n.d(Be,{b:function(){return S}});var h=n(52322),r=n(2784),F=n(79692),P=n(15223),m=n(95544),y=n(80030),l=n(61837),M=n(48348),xe=n(47603),V=n(61886);const K=(0,F.Z)(B=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:B.spacing(3,3,0)}})),S=B=>{const Y=K(),[ce,ee]=(0,r.useState)(null),X=(0,r.useCallback)(qe=>{ee(qe.currentTarget)},[]),w=(0,r.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:O,loading:$}}=(0,V.x1)(),T=(0,V.$L)(),ne=T.renderComponentsByLocation(V.oZ.Subheader),Te=T.renderComponentsByLocation(V.oZ.Settings);return!ne&&!Te||$===!1&&!O?null:(0,h.jsx)(P.Z,{classes:Y,...B.toolbarProps,children:(0,h.jsxs)(m.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ne,Te?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:X,children:(0,h.jsx)(xe.Z,{})})}),(0,h.jsx)(M.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ce,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ce),onClose:w,keepMounted:!0,children:Te})]}):null]})})}},95481:function(Ct,Be,n){"use strict";n.d(Be,{DK:function(){return S},m1:function(){return Y}});var h=n(52322),r=n(2784),F=n(79635),P=n(61886),m=n(60871),y=n(64279),l=n(77446);function M({contentLoading:ce,content:ee,activeSyncState:X}){return ce||X==="BUILD_READY_RELOAD"||!ee&&X==="CHECKING"?"CHECKING":!ee&&X==="BUILDING"?"INITIAL_BUILD":ee?X==="BUILDING"?"CONTENT_STALE_REFRESHING":X==="BUILD_READY"?"CONTENT_STALE_READY":X==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function xe(ce,ee){const X={...ce};switch(ee.type){case"sync":ee.state==="CHECKING"&&(X.buildLog=[]),X.activeSyncState=ee.state,X.syncError=ee.syncError;break;case"contentLoading":X.contentLoading=!0,X.contentError=void 0;break;case"content":typeof ee.path=="string"&&(X.path=ee.path),X.contentLoading=!1,X.content=ee.content,X.contentError=ee.contentError;break;case"buildLog":X.buildLog=X.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(X.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(X.activeSyncState="UP_TO_DATE",X.buildLog=[]),X}function V(ce,ee,X,w){var O,$;const[T,ne]=(0,r.useReducer)(xe,{activeSyncState:"CHECKING",path:w,contentLoading:!0,buildLog:[]}),Te=(0,m.h_)(P.Dl),{retry:qe}=(0,l.Z)(async()=>{ne({type:"contentLoading"});try{const Ue=await Te.getEntityDocs({kind:ce,namespace:ee,name:X},w);return ne({type:"content",content:Ue,path:w}),Ue}catch(Ue){ne({type:"content",contentError:Ue,path:w})}},[Te,ce,ee,X,w]),Qe=(0,r.useRef)({content:void 0,reload:()=>{}});return Qe.current={content:T.content,reload:qe},(0,y.default)(async()=>{ne({type:"sync",state:"CHECKING"});const Ue=setTimeout(()=>{ne({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:ce,namespace:ee,name:X},He=>{ne({type:"buildLog",log:He})})){case"updated":Qe.current.content?ne({type:"sync",state:"BUILD_READY"}):(Qe.current.reload(),ne({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ne({type:"sync",state:"UP_TO_DATE"});break;default:ne({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(Et){ne({type:"sync",state:"ERROR",syncError:Et})}finally{clearTimeout(Ue)}},[ce,X,ee,Te,ne,Qe]),{state:(0,r.useMemo)(()=>M({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:qe,path:T.path,content:T.content,contentErrorMessage:(O=T.contentError)===null||O===void 0?void 0:O.toString(),syncErrorMessage:($=T.syncError)===null||$===void 0?void 0:$.toString(),buildLog:T.buildLog}}const K=(0,r.createContext)({}),S=()=>(0,r.useContext)(K),B=ce=>{const{children:ee}=ce,{"*":X=""}=(0,F.UO)(),{entityRef:w}=(0,P.x1)(),{kind:O,namespace:$,name:T}=w,ne=V(O,$,T,X);return(0,h.jsx)(K.Provider,{value:ne,children:ee instanceof Function?ee(ne):ee})},Y=ce=>ee=>(0,h.jsx)(B,{children:(0,h.jsx)(ce,{...ee})})},95573:function(Ct,Be,n){"use strict";n.d(Be,{Fw:function(){return F},_Z:function(){return r},pd:function(){return P}});var h=n(60871);const r=(0,h.NT)({id:"techdocs:index-page"}),F=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),P=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsSearchResultListItem:function(){return V}});var h=n(52322),r=n(2784),F=n(79692),P=n(49378),m=n(86136),y=n(90436),l=n(23196),M=n(15096);const xe=(0,F.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),V=K=>{const{result:S,highlight:B,lineClamp:Y=5,asListItem:ce=!0,asLink:ee=!0,title:X,icon:w}=K,O=xe(),$=({children:Te})=>ee?(0,h.jsx)(l.rU,{noTrack:!0,to:S.location,children:Te}):(0,h.jsx)(h.Fragment,{children:Te}),T=()=>{const Te=B!=null&&B.fields.title?(0,h.jsx)(M.FA,{text:B.fields.title,preTag:B.preTag,postTag:B.postTag}):S.title,qe=B!=null&&B.fields.entityTitle?(0,h.jsx)(M.FA,{text:B.fields.entityTitle,preTag:B.preTag,postTag:B.postTag}):S.entityTitle,Qe=B!=null&&B.fields.name?(0,h.jsx)(M.FA,{text:B.fields.name,preTag:B.preTag,postTag:B.postTag}):S.name;return S?(0,h.jsx)(P.Z,{className:O.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)($,{children:X||(0,h.jsxs)(h.Fragment,{children:[Te," | ",qe!=null?qe:Qe," docs"]})}),secondary:(0,h.jsx)(y.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Y,overflow:"hidden"},children:B!=null&&B.fields.text?(0,h.jsx)(M.FA,{text:B.fields.text,preTag:B.preTag,postTag:B.postTag}):S.text})}):null},ne=({children:Te})=>ce?(0,h.jsxs)(h.Fragment,{children:[w&&(0,h.jsx)(m.Z,{children:typeof w=="function"?w(S):w}),(0,h.jsx)("div",{className:O.flexContainer,children:Te})]}):(0,h.jsx)(h.Fragment,{children:Te});return(0,h.jsx)(ne,{children:(0,h.jsx)(T,{})})}},22478:function(Ct,Be,n){"use strict";n.d(Be,{S:function(){return K}});var h=n(52322),r=n(15096),F=n(79692),P=n(27556),m=n(2784),y=n(79635),l=n(55511);const M=(0,F.Z)(S=>({root:{width:"100%"},bar:{padding:S.spacing(1)}})),xe=S=>S==null?void 0:S.document,V=S=>{const{entityId:B,entityTitle:Y,debounceTime:ce=150}=S,[ee,X]=(0,m.useState)(!1),w=(0,y.s0)(),{setFilters:O,result:{loading:$,value:T}}=(0,r.Rx)(),ne=M(),[Te,qe]=(0,m.useState)([]);(0,m.useEffect)(()=>{let He=!0;if(He&&T){const st=T.results.slice(0,10);qe(st)}return()=>{He=!1}},[$,T]);const{kind:Qe,name:it,namespace:Ue}=B;(0,m.useEffect)(()=>{O(He=>({...He,kind:Qe,namespace:Ue,name:it}))},[Qe,Ue,it,O]);const Et=(He,st)=>{if(xe(st)){const{location:je}=st.document;w(je)}};return(0,h.jsx)(P.Z,{className:ne.bar,variant:"outlined",children:(0,h.jsx)(r.qO,{classes:{root:ne.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:He=>He,onClose:()=>{X(!1)},onFocus:()=>{X(!0)},onChange:Et,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Te,renderOption:({document:He,highlight:st})=>(0,h.jsx)(l.TechDocsSearchResultListItem,{result:He,lineClamp:3,asListItem:!1,asLink:!1,title:He.title,highlight:st}),loading:$,inputDebounceTime:ce,inputPlaceholder:`Search ${Y||B.name} docs`,freeSolo:!1})})},K=S=>{const B={term:"",types:["techdocs"],pageCursor:"",filters:S.entityId};return(0,h.jsx)(r.Nd,{initialState:B,children:(0,h.jsx)(V,{...S})})}},53260:function(){}},function(Ct){var Be=function(h){return Ct(Ct.s=h)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Be(6290)});var n=Ct.O()}]);})();
|
|
502
|
-
|
|
503
|
-
//# sourceMappingURL=main.e99a7512.js.map
|