@finos/legend-application-pure-ide-deployment 9.25.0 → 9.26.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/dist/ide/index.html +1 -1
- package/dist/ide/static/{index.e7daf3f0.js → index.c97923cb.js} +2 -2
- package/dist/ide/static/{index.e7daf3f0.js.map → index.c97923cb.js.map} +1 -1
- package/dist/ide/static/{index.c0d6b37e.css → index.fa98096b.css} +3 -3
- package/dist/ide/static/{index.c0d6b37e.css.map → index.fa98096b.css.map} +1 -1
- package/dist/ide/version.json +1 -1
- package/package.json +2 -2
@@ -1,2 +1,2 @@
|
|
1
|
-
(()=>{"use strict";var e,t,s,i,n,a={15411:(e,t,s)=>{const i=JSON.parse('{"i8":"10.0.0","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:m,info:_,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T=s(52322),C=s(17029),S=s(85928),x=s(21112);const N=e=>e.constructor,v=()=>()=>{},A=e=>e.length?e[0]:void 0,I=e=>e.length?e[e.length-1]:void 0,O=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),y=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),R=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},w=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class L extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class P extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class b extends P{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class D extends P{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,S.Z)(i,(e=>void 0!==e)));var i;return(0,x.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function M(e){if(!(e instanceof Error))throw new b("Expected error to be thrown")}const F=e=>{try{return e()}catch{return}};class k extends P{constructor(e,t){super("Assertion Error",e,t)}}const j=e=>null!=e;function U(e,t=""){if(null==e)throw new k(t||"Value is nullable")}const G=(e,t="")=>(U(e,t),e),V=e=>t=>((e,t)=>e instanceof t)(t,e);function $(e,t,s=""){if(!(e instanceof t))throw new k(s||`Value is expected to be of type '${t.name}'`)}const B=(e,t,s="")=>($(e,t,s),e);function z(e,t=""){if(""===G(e,t))throw new k(t||"Expected string value to be non-empty")}function H(e,t=""){return z(e,t),e}function Y(e,t=""){if(!e)throw new k(t||"Expected predicate to be truthy")}const W=e=>"string"==typeof e,K=e=>"number"==typeof e&&!isNaN(e),X=e=>"boolean"==typeof e,Z=e=>"object"==typeof e&&null!==e;var q=s(39391),J=s(33654),Q=s(18247),ee=s(72659);const te=q.W,se="charset=utf-8";var ie,ne,ae;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ie=ie||(ie={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(ne=ne||(ne={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ae=ae||(ae={}));const re={mode:"cors",credentials:"include",redirect:"manual"},oe=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class le extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Z(e))return W(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&W(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const ce=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new le(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===te.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ne.APPLICATION_JSON:return e.json();case ne.TEXT_PLAIN:return e.text();default:return Promise.reject(new le(e,`Can't process response for request with Content-Type '${i}'`))}},de=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME",i=document.getElementById(s);i?.remove();const n=document.createElement("iframe");n.id=s,n.src=e,n.style.display="none",n.addEventListener("load",(()=>{n.remove(),t()})),document.body.appendChild(n)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>ce(e,t,s))):fetch(e,t).then((e=>ce(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ne.APPLICATION_JSON,e!==ae.GET&&(s[ie.CONTENT_TYPE]=`${ne.APPLICATION_JSON};${se}`),oe(s,t)};class ue{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...re,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ae.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ae.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ae.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ae.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!F((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(j).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((W(s)||Z(s))&&r?.enableCompression&&(Y(e!==ae.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,J.Wt)(Z(e)?JSON.stringify(e):e)]))(s),n=oe(n,{[ie.CONTENT_TYPE]:`${ne.APPLICATION_ZLIB};${se}`})),void 0!==s)if(W(s)||s instanceof Blob)c=s;else{if(!Z(s))throw new k("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===te.UNAUTHORIZED)(e)?de(l,d,o):ce(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?de(l,d,o):Promise.reject(e)))}}const pe=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var me;!function(e){e.APPLICATION_SETUP__FAILURE="application.setup.failure",e.APPLICATION_LOAD__SUCCESS="application.load.success",e.APPLICATION_LOAD__FAILURE="application.load.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION__FAILURE="application.configuration.failure",e.IDENTITY_AUTO_FETCH__FAILURE="application.identity.auto-fetch.failure",e.DOCUMENTATION_FETCH__FAILURE="application.documentation.fetch.failure",e.DOCUMENTATION_LOAD__SKIP="application.documentation.load.skip",e.DOCUMENTATION_REQUIREMENT_CHECK__FAILURE="application.documentation.requirement-check.failure",e.CONTEXTUAL_DOCUMENTATION_LOAD__SKIP="application.virtual-assistant.contextual-documentation-load.skip",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS="application.virtual-assistant.documentation-entry.access",e.TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE="application.load.terminal-command.configuration-check.failure",e.COLOR_THEME_CONFIGURATION_CHECK__FAILURE="application.layout.color-theme.configuration-check.failure",e.SETTING_CONFIGURATION_CHECK__FAILURE="application.setting.configuration-check.failure",e.SETTING_RETRIVE_FAILURE="application.setting.retrieve.failure",e.COMMAND_CENTER_REGISTRATION__FAILURE="application.command.registration.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT__ACCESS="application.context.access",e.APPLICATION_USAGE__INTERRUPT="application.usage.interrupt"}(me=me||(me={}));var _e=s(79013);class ge{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,_e.qC)(this.schema,e)}fromJson(e){return(0,_e.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const Ee=e=>(0,_e.PG)((t=>void 0===t?_e.AM:(0,_e.qC)(e,t)),(t=>(0,_e.vB)(e,t))),fe=e=>(0,_e.PG)((()=>e),(()=>e)),Te=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?_e.AM:[],Ce=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?_e.AM:[]:_e.AM,Se=(e,t)=>(0,_e.PG)((s=>Ce(s,(t=>(0,_e.qC)(e,t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:t?.INTERNAL__forceReturnEmptyInTest})),(t=>Te(t,(t=>(0,_e.vB)(e,t)),{skipIfEmpty:!1}))),xe=(e,t,s)=>(0,_e.PG)((t=>Ce(t,(t=>e(t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:s?.INTERNAL__forceReturnEmptyInTest})),(e=>Te(e,(e=>t(e)),{skipIfEmpty:!1})));var Ne=s(4e4);class ve{key;markdownText;title;text;url;related;static serialization=new ge((0,_e.yu)(ve,{markdownText:(0,_e.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,_e.jt)((0,_e.pb)((0,_e.Ru)())),title:(0,_e.jt)((0,_e.Ru)()),text:(0,_e.jt)((0,_e.Ru)()),url:(0,_e.jt)((0,_e.Ru)())}));static create(e,t){const s=ve.serialization.fromJson(e);return s.key=t,s}}const Ae=e=>Object.entries(e).map((e=>({key:e[0],content:ve.create(e[1],e[0])})));class Ie{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.logService.warn(h.create(me.DOCUMENTATION_LOAD__SKIP),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Ne.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.logService.warn(h.create(me.DOCUMENTATION_REQUIREMENT_CHECK__FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.logService.warn(h.create(me.CONTEXTUAL_DOCUMENTATION_LOAD__SKIP),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=ve.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t.key})),e}}var Oe,ye,Re=s(80075);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(Oe||(Oe={}));class we{state;_message;_messageFormatter;constructor(){this.state=Oe.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=Oe.INITIAL,this}inProgress(){return this.state=Oe.IN_PROGRESS,this}fail(){return this.state=Oe.FAILED,this}pass(){return this.state=Oe.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}sync(e){const t=e.exportData();this.state=t.state,this._message=t.message}exportData(){return{state:this.state,message:this._message}}get isInInitialState(){return this.state===Oe.INITIAL}get isInProgress(){return this.state===Oe.IN_PROGRESS}get hasFailed(){return this.state===Oe.FAILED}get hasSucceeded(){return this.state===Oe.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,Re.rC)(new we,{state:Re.LO,_message:Re.LO,reset:Re.aD,inProgress:Re.aD,pass:Re.aD,fail:Re.aD,complete:Re.aD,setMessage:Re.aD,sync:Re.aD,isInInitialState:Re.Fl,isInProgress:Re.Fl,hasFailed:Re.Fl,hasSucceeded:Re.Fl,hasCompleted:Re.Fl,message:Re.Fl})}}!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ye=ye||(ye={}));class Le{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class Pe{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new Le;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}const be=s(81931).Fuse.default;var De,Me;!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(De=De||(De={}));class Fe{currentMode=De.STANDARD;onSearchModeChange;constructor(e){(0,Re.rC)(this,{currentMode:Re.LO,isAdvancedSearchActive:Re.Fl,setCurrentMode:Re.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==De.STANDARD}generateSearchText(e){switch(this.currentMode){case De.INCLUDE:return`'"${e}"`;case De.EXACT:return`="${e}"`;case De.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(Me=Me||(Me={}));class ke{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,Re.rC)(this,{isOpen:Re.LO,setIsOpen:Re.aD}),this.documentationKey=e.key,this.title=H(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class je{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Ue=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Ge{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!0;isOpen=!1;selectedTab=Me.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=we.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,Re.rC)(this,{isHidden:Re.LO,isOpen:Re.LO,panelRenderingKey:Re.LO,isOverSearchLimit:Re.LO,selectedTab:Re.LO,searchText:Re.LO,searchResults:Re.LO,currentDocumentationEntry:Re.LO,showSearchConfigurationMenu:Re.LO,currentContextualDocumentationEntry:Re.Fl,setIsHidden:Re.aD,setIsOpen:Re.aD,setSelectedTab:Re.aD,setSearchText:Re.aD,resetSearch:Re.aD,search:Re.aD,openDocumentationEntry:Re.aD,refreshPanelRendering:Re.aD,setShowSearchConfigurationMenu:Re.aD}),this.applicationStore=e,this.searchEngine=new be(this.applicationStore.documentationService.getAllDocEntries().filter(Ue),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Fe((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new je(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(j).filter(Ue).map((e=>new ke(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getDocEntry(e);t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new ke(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}openDocumentationEntryLink(e){const t=this.applicationStore.documentationService.getDocEntry(e);t&&((e=>Ue(e)&&Boolean(e.text??e.markdownText))(t)?this.openDocumentationEntry(t.key):t.url&&this.applicationStore.navigationService.navigator.visitAddress(t.url))}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new ke(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Ve{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class $e{static logEvent_ApplicationInitializationSucceeded(e,t){e.logEvent(me.APPLICATION_LOAD__SUCCESS,{application:{name:t.config.appName,version:t.config.appVersion,env:t.config.env},browser:{userAgent:navigator.userAgent},screen:{height:window.screen.height,width:window.screen.width}})}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(me.APPLICATION_CONTEXT__ACCESS,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(me.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(me.APPLICATION_USAGE__INTERRUPT,{})}}class Be{applicationStore;contextStack=[];constructor(e){(0,Re.rC)(this,{contextStack:Re.LO,currentContext:Re.Fl,push:Re.aD,pop:Re.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new b(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&$e.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class ze{applicationStore;commandRegistry=new Map;constructor(e){(0,Re.rC)(this,{commandRegistry:Re.LO,registerCommand:Re.aD,deregisterCommand:Re.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(me.COMMAND_CENTER_REGISTRATION__FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class He{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,Re.rC)(this,{keyMap:Re.LO,commandKeyMap:Re.LO,isHotkeysBlocked:Re.LO,addHotkey:Re.aD,blockGlobalHotkeys:Re.aD,unblockGlobalHotkeys:Re.aD}),this.applicationStore=e,this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{const t=[e.content.defaultKeyboardShortcut,...e.content.additionalKeyboardShortcuts??[]].filter(j);t.length?t.forEach((t=>this.addHotkey(e.key,t))):this.commandKeyMap.has(e.key)||this.commandKeyMap.set(e.key,[])}))}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}addHotkey(e,t){this.commandKeyMap.set(e,[...this.commandKeyMap.get(e)??[],t]),this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandService.runCommand(e))return}}var Ye=s(77289),We=s(73678),Ke=s(78440),Xe=s(51919),Ze=s(85399),qe=s(89358);const Je="Roboto Mono",Qe="yyyy-MM-dd'T'HH:mm:ss";var et;!function(e){e.RESET="[0m",e.BOLD="[1m",e.DIM="[2m",e.ITALIC="[3m",e.UNDERLINE="[4m",e.BLINKING="[5m",e.STRIKETHROUGH="[9m",e.BLACK="[30m",e.RED="[31m",e.GREEN="[32m",e.YELLOW="[33m",e.BLUE="[34m",e.MAGENTA="[35m",e.CYAN="[36m",e.WHITE="[37m",e.BRIGHT_BLACK="[1;30m",e.BRIGHT_RED="[1;31m",e.BRIGHT_GREEN="[1;32m",e.BRIGHT_YELLOW="[1;33m",e.BRIGHT_BLUE="[1;34m",e.BRIGHT_MAGENTA="[1;35m",e.BRIGHT_CYAN="[1;36m",e.BRIGHT_WHITE="[1;37m",e.DIMMED_BLACK="[2;30m",e.DIMMED_RED="[2;31m",e.DIMMED_GREEN="[2;32m",e.DIMMED_YELLOW="[2;33m",e.DIMMED_BLUE="[2;34m",e.DIMMED_MAGENTA="[2;35m",e.DIMMED_CYAN="[2;36m",e.DIMMED_WHITE="[2;37m",e.BLACK_BG="[40m",e.RED_BG="[41m",e.GREEN_BG="[42m",e.YELLOW_BG="[43m",e.BLUE_BG="[44m",e.MAGENTA_BG="[45m",e.CYAN_BG="[46m",e.WHITE_BG="[47m",e.BRIGHT_BLACK_BG="[1;40m",e.BRIGHT_RED_BG="[1;41m",e.BRIGHT_GREEN_BG="[1;42m",e.BRIGHT_YELLOW_BG="[1;43m",e.BRIGHT_BLUE_BG="[1;44m",e.BRIGHT_MAGENTA_BG="[1;45m",e.BRIGHT_CYAN_BG="[1;46m",e.BRIGHT_WHITE_BG="[1;47m",e.DIMMED_BLACK_BG="[2;40m",e.DIMMED_RED_BG="[2;41m",e.DIMMED_GREEN_BG="[2;42m",e.DIMMED_YELLOW_BG="[2;43m",e.DIMMED_BLUE_BG="[2;44m",e.DIMMED_MAGENTA_BG="[2;45m",e.DIMMED_CYAN_BG="[2;46m",e.DIMMED_WHITE_BG="[2;47m"}(et=et||(et={}));const tt=(e,t)=>`[${e};${t}H`;class st{searchInput;searchText="";useRegex=!1;matchWholeWord=!1;matchCaseSensitive=!1;resultCount;currentResultIndex;constructor(){(0,Re.rC)(this,{searchText:Re.LO,useRegex:Re.LO,matchWholeWord:Re.LO,matchCaseSensitive:Re.LO,resultCount:Re.LO,currentResultIndex:Re.LO})}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}}class it{applicationStore;searchConfig=new st;constructor(e){(0,Re.rC)(this,{setSearchText:Re.aD,setSearchRegex:Re.aD,setSearchWholeWord:Re.aD,setSearchCaseSensitive:Re.aD,setSearchResultCount:Re.aD,setSearchCurrentResultIndex:Re.aD}),this.applicationStore=e}setSearchText(e){this.searchConfig.searchText=e}setSearchRegex(e){this.searchConfig.useRegex=e}setSearchWholeWord(e){this.searchConfig.matchWholeWord=e}setSearchCaseSensitive(e){this.searchConfig.matchCaseSensitive=e}setSearchResultCount(e){this.searchConfig.resultCount=e}setSearchCurrentResultIndex(e){this.searchConfig.currentResultIndex=e}}class nt extends it{preserveLog=!1;commandRegistry=new Map;constructor(e){super(e),(0,Re.rC)(this,{preserveLog:Re.LO,setPreserveLog:Re.aD})}setPreserveLog(e){this.preserveLog=e}showHelp(){}showCommonANSIEscapeSequences(){}}var at=s(1367),rt=s(67295),ot=s(72531);s(90286);const lt=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ct=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],dt=e=>(e??"").trim().replace(/\b(?:\w+)\b/gu,(e=>ct.includes(e.toLowerCase())?e.toLowerCase():lt(e))).replace(/^(?:\w+)\b/u,(e=>lt(e))).replace(/\b(?:\w+)$/u,(e=>lt(e))),ht=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,rt.P)(e,void 0,s);return U(i,"Can't stringify lossless JSON value"),i})((0,ot.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var ut;function pt(e){return e.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=G(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}))}!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace",e.BACKQUOTE="Backquote"}(ut=ut||(ut={}));const mt=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ut.SHIFT,ut.META,ut.ALT,ut.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),_t=(e,t)=>mt(e,G(pt(t)[0]));var gt=s(4707),Et=s(3493),ft=s(76919);const Tt=(0,gt.Z)({transitions:{create:()=>"none"}}),Ct=e=>{const{children:t}=e;return(0,T.jsx)(Et.Z,{injectFirst:!0,children:(0,T.jsx)(ft.Z,{theme:Tt,children:t})})};var St=s(83820),xt=s(96242),Nt=s(34309),vt=s(12238),At=s(78683),It=s(81934),Ot=s(6277);const yt=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)(t,i),children:s})};return s.displayName=e,s},Rt=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)("modal",{"modal--dark":s},i),children:t})},wt=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("modal__title",i),children:[s&&(0,T.jsx)("div",{className:"modal__title__icon",children:s}),(0,T.jsx)("div",{className:"modal__title__label",children:dt(t)})]})},Lt=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,Ot.clsx)("modal__header",i),children:(0,T.jsx)(wt,{title:t})}):(0,T.jsx)("div",{className:(0,Ot.clsx)("modal__header",i),children:s})},Pt=(yt("ModalHeaderActions","modal__header__actions"),yt("ModalBody","modal__body")),bt=yt("ModalFooter","modal__footer");var Dt,Mt;yt("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Dt=Dt||(Dt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Mt=Mt||(Mt={}));class Ft{applicationStore;blockingAlertInfo;actionAlertInfo;constructor(e){(0,Re.rC)(this,{blockingAlertInfo:Re.LO,actionAlertInfo:Re.LO,setBlockingAlert:Re.aD,setActionAlertInfo:Re.aD}),this.applicationStore=e}setBlockingAlert(e){e?this.applicationStore.keyboardShortcutsService.blockGlobalHotkeys():this.applicationStore.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.applicationStore.notificationService.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.applicationStore.keyboardShortcutsService.blockGlobalHotkeys():this.applicationStore.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}}var kt=s(2784);const jt=(0,kt.createContext)(void 0),Ut=()=>G((0,kt.useContext)(jt),"Can't find application store in context"),Gt=({children:e,store:t})=>{const s=(0,Nt.fv)((()=>t));return(0,T.jsx)(jt.Provider,{value:s,children:e})},Vt=e=>{switch(e){case Mt.PROCEED_WITH_CAUTION:return"btn--caution";case Mt.PROCEED:case Mt.STANDARD:default:return"btn--dark"}},$t=(0,Nt.Pi)((e=>{const{info:t}=e,s=Ut(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.alertService.setActionAlertInfo(void 0)};return(0,T.jsx)(It.Z,{open:Boolean(s.alertService.actionAlertInfo),onClose:v,TransitionProps:{onEnter:()=>l?.()},children:(0,T.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??Dt.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(Lt,{title:i}),(0,T.jsxs)(Pt,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,T.jsxs)(bt,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Vt(e.type??Mt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},t))),!c.length&&(0,T.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Bt=(0,Nt.Pi)((()=>{const e=Ut().alertService.actionAlertInfo;return e?(0,T.jsx)($t,{info:e}):null})),zt=e=>{const{isLoading:t}=e,s=(0,kt.useRef)(null);return(0,kt.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,T.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Ht=(0,Nt.Pi)((()=>{const e=Ut().alertService.blockingAlertInfo;return e?(0,T.jsx)(It.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(Rt,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(zt,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(Pt,{children:[(0,T.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,T.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Yt=s(44524);const Wt=Yt.FA,Kt=Wt.FaHistory,Xt=Wt.FaCrosshairs,Zt=(Wt.FaLayerGroup,Wt.FaGhost,Wt.FaLock),qt=(Wt.FaMask,Wt.FaFile,Wt.FaLongArrowAltRight,Wt.FaTimes),Jt=Wt.FaTimesCircle,Qt=Wt.FaPlus,es=Wt.FaCog,ts=(Wt.FaEye,Wt.FaCaretUp,Wt.FaCaretDown),ss=(Wt.FaFire,Wt.FaSave,Wt.FaSquare,Wt.FaRegSquare,Wt.FaCheckSquare,Wt.FaMinusSquare,Wt.FaHashtag,Wt.FaHammer),is=(Wt.FaClock,Wt.FaRegClock,Wt.FaToggleOn,Wt.FaQuestion),ns=Wt.FaQuestionCircle,as=Wt.FaInfoCircle,rs=Wt.FaCompress,os=Wt.FaMap,ls=Wt.FaPlay,cs=(Wt.FaGripVertical,Wt.FaRobot,Wt.FaArrowLeft,Wt.FaArrowRight,Wt.FaArrowAltCircleDown,Wt.FaArrowAltCircleRight),ds=(Wt.FaArrowCircleRight,Wt.FaUser,Wt.FaShapes),hs=(Wt.FaEnvelope,Wt.FaSkull,Wt.FaDollarSign,Wt.FaSearch),us=(Wt.FaStar,Wt.FaKey,Wt.FaExternalLinkAlt,Wt.FaExternalLinkSquareAlt,Wt.FaLightbulb,Wt.FaRegLightbulb,Wt.FaList),ps=Wt.FaCircle,ms=Wt.FaTrash,_s=(Wt.FaRegCircle,Wt.FaShieldAlt,Wt.FaTag,Wt.FaTags,Wt.FaBolt,Wt.FaCheckCircle),gs=Wt.FaExclamationTriangle,Es=Wt.FaBug,fs=Wt.FaCircleNotch,Ts=(Wt.FaRegKeyboard,Wt.FaUserSecret,Wt.FaBuffer,Wt.FaSitemap,Wt.FaExpand),Cs=(Wt.FaExpandArrowsAlt,Wt.FaSortAlphaDown,Wt.FaSort,Wt.FaSortAlphaDownAlt,Wt.FaFolderPlus,Wt.FaCaretRight,Wt.FaCaretLeft,Wt.FaWrench),Ss=Wt.FaArrowDown,xs=Wt.FaArrowUp,Ns=Wt.FaTerminal,vs=(Wt.FaTruckLoading,Wt.FaFolderOpen),As=Wt.FaFolder,Is=(Wt.FaFileCode,Wt.FaCodeBranch,Wt.FaArrowAltCircleUp,Wt.FaArrowAltCircleLeft,Wt.FaRegStopCircle,Wt.FaAsterisk,Wt.FaFilter,Wt.FaExclamationCircle),Os=(Wt.FaRocket,Wt.FaCheck,Wt.FaBan),ys=(Wt.FaFileImport,Wt.FaUserFriends,Wt.FaDownload,Wt.FaUpload,Wt.FaRegWindowRestore,Wt.FaPauseCircle,Wt.FaShare,Wt.FaRegCopy),Rs=Wt.FaFileAlt,ws=(Wt.FaEdit,Wt.FaArrowsAltH,Wt.FaRegWindowMaximize,Wt.FaWindowMaximize,Wt.FaLongArrowAltDown,Wt.FaLongArrowAltUp,Wt.FaMeteor,Wt.FaPiedPiperSquare,Wt.FaPuzzlePiece,Wt.FaToggleOn,Wt.FaToggleOff,Wt.FaMapMarkerAlt),Ls=Wt.FaHatWizard,Ps=Wt.FaRegLaughWink,bs=Wt.FaRegSadTear,Ds=(Wt.FaBusinessTime,Wt.FaDatabase),Ms=(Wt.FaServer,Wt.FaTable,Wt.FaArchive,Wt.FaBrain,Wt.FaBookOpen,Wt.FaLevelDownAlt,Yt.GI),Fs=(Ms.GiWaterDrop,Ms.GiBeard),ks=Ms.GiSunglasses,js=(Ms.GiHouseKeys,Yt.MD),Us=(js.MdManageSearch,js.MdModeEdit,js.MdTextFields,js.MdMoreVert,js.MdMoreHoriz,js.MdWrapText,js.MdVerticalAlignBottom,js.MdRefresh),Gs=(js.MdFunctions,js.MdCompareArrows,js.MdPlaylistAddCheck,js.MdAdd,js.MdEdit,js.MdSubject),Vs=js.MdViewHeadline,$s=js.MdAssistant,Bs=(js.MdSettingsEthernet,js.MdLink,js.MdWindow,js.MdReviews,js.MdCalculate,js.MdRocketLaunch,js.MdOutlineDataset,js.MdVerified,js.MdQueryStats,Yt.VSC),zs=(Bs.VscError,Bs.VscWarning,Bs.VscWordWrap),Hs=Bs.VscGoToFile,Ys=Bs.VscClose,Ws=(Bs.VscRunAll,Bs.VscRunErrors,Bs.VscOpenPreview,Bs.VscDiff,Bs.VscRegex),Ks=(Bs.VscVersions,Bs.VscCaseSensitive),Xs=Bs.VscWholeWord,Zs=Bs.VscReferences,qs=Bs.VscWand,Js=Bs.VscCollapseAll,Qs=Bs.VscExpandAll,ei=(Bs.VscJson,Yt.GO),ti=ei.GoChevronDown,si=ei.GoChevronUp,ii=(ei.GoChevronLeft,ei.GoChevronRight),ni=(ei.GoFileBinary,ei.GoGitPullRequest,ei.GoGitMerge,ei.GoCloudDownload,ei.GoCloudUpload,ei.GoSync,ei.GoGitBranch,ei.GoX),ai=(ei.GoPlug,Yt.SI.SiSwagger,Yt.IO5),ri=(ai.IoResize,ai.IoFileTrayFullOutline,ai.IoMenuOutline,ai.IoBeaker,ai.IoFlaskSharp),oi=(ai.IoSyncCircleSharp,Yt.BS),li=(oi.BsDisplayFill,oi.BsFillTriangleFill,oi.BsFillFileEarmarkSpreadsheetFill,oi.BsBoxSeam,oi.BsGripVertical),ci=oi.BsAlignTop,di=oi.BsAlignMiddle,hi=oi.BsAlignBottom,ui=oi.BsAlignStart,pi=oi.BsAlignCenter,mi=oi.BsAlignEnd,_i=oi.BsDistributeHorizontal,gi=oi.BsDistributeVertical,Ei=(oi.BsDatabaseFillLock,oi.BsDatabaseFillCheck,oi.BsChevronDown,oi.BsChevronRight,oi.BsChevronLeft,Yt.BI),fi=(Ei.BiShapeTriangle,Ei.BiAtom),Ti=(Yt.CG.CgOptions,Yt.FI),Ci=Ti.FiPackage,Si=(Ti.FiMinus,Ti.FiMousePointer),xi=Ti.FiMove,Ni=(Ti.FiPlusCircle,Ti.FiSidebar,Ti.FiTriangle,Ti.FiZoomIn),vi=Ti.FiZoomOut,Ai=(Ti.FiGitMerge,Ti.FiLink,Yt.RI),Ii=(Ai.RiShapeLine,Ai.RiTestTubeFill,Ai.RiRobotFill,Ai.RiGovernmentFill,Ai.RiMoneyDollarCircleFill,Yt.TB),Oi=(Ii.TbArrowsJoin2,Ii.TbArrowsSplit2,Ii.TbMathFunction),yi=(Ii.TbBook,Yt.HI);yi.HiCode,yi.HiHome;var Ri=s(73882),wi=s(53083);const Li=6e3;var Pi;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Pi=Pi||(Pi={}));class bi{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Di{notification;constructor(){(0,Re.rC)(this,{notification:Re.LO,setNotification:Re.aD,notify:Re.aD,notifySuccess:Re.aD,notifyWarning:Re.aD,notifyIllegalState:Re.aD,notifyError:Re.aD})}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new bi(Pi.INFO,e,t??[],null===s?void 0:s??Li))}notifySuccess(e,t,s){this.setNotification(new bi(Pi.SUCCESS,e,t??[],null===s?void 0:s??Li))}notifyWarning(e,t,s){this.setNotification(new bi(Pi.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Li))}notifyError(e,t){let s;e instanceof L?s=e.detail:e instanceof Error?s=e.message:(Y(W(e),"Can't display error"),s=e),s&&this.setNotification(new bi(Pi.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new bi(Pi.ILEGAL_STATE,W(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Li))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return M(e),this.notifyIllegalState(e.message),t}}}const Mi=(0,Nt.Pi)((()=>{const e=Ut(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Pi.INFO,[a,r]=(0,kt.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(as,{})});switch(n){case Pi.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Es,{})});break;case Pi.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Jt,{})});break;case Pi.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(gs,{})});break;case Pi.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(_s,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(Ri.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Li,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(wi.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,T.jsxs)("div",{className:"notification__message__content",children:[o,(0,T.jsx)("div",{className:(0,Ot.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,T.jsx)(ti,{}):(0,T.jsx)(si,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(qt,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Fi=s(17954);const ki=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(Fi.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},ji=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,kt.useRef)(null),[c,d]=(0,kt.useState)(!1),[h,u]=(0,kt.useState)(),[p,m]=(0,kt.useState)(0),[_,g]=(0,kt.useState)(0),E=()=>{u(void 0),d(!1),g(0),m(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),m(n)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(ki,{open:c,anchorPosition:{left:p,top:_},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${_}`)]})},Ui=(0,kt.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,T.jsx)("div",{ref:t,className:(0,Ot.clsx)("menu",s),...n,children:i})})),Gi=e=>{const{className:t,onClick:s,title:i,disabled:n,children:a,...r}=e;return(0,T.jsx)("button",{className:(0,Ot.clsx)("menu__item",t),disabled:Boolean(n),title:i,onClick:s,...r,children:a})},Vi=yt("MenuContentDivider","menu__divider");yt("MenuContentItemIcon","menu__item__icon"),yt("MenuContentItemLabel","menu__item__label");var $i=s(95081),Bi=s(53019);const zi=e=>(0,T.jsx)($i.D,{className:(0,Ot.clsx)("markdown-content",e.className),remarkPlugins:[Bi.Z],components:e.components??{},children:e.value.value});var Hi=s(62515);const Yi=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,Hi.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,kt.useState)(!1),{ref:o,width:l,height:c}=(0,Hi.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,kt.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,Ot.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var Wi=s(85688),Ki=s(28019),Xi=s(8978);const Zi=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,T.jsxs)("div",{className:(0,Ot.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Wi.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,T.jsx)(Ki.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Xi.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,T.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var qi=s(33207);const Ji=e=>{const{children:t,...s}=e;return(0,T.jsx)(qi.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var Qi,en=s(41327),tn=s(13474),sn=s(65068);!function(e){e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax"}(Qi=Qi||(Qi={}));const nn=(0,Nt.Pi)((e=>{const{entry:t}=e,s=Ut(),i=()=>{t.isOpen||$e.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(ji,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(Ui,{children:(0,T.jsx)(Gi,{onClick:n,children:"Copy Documentation Key"})}),children:(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),t.url?(0,T.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{$e.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:W(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,T.jsx)(zi,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),an=(0,Nt.Pi)((()=>{const e=Ut(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(ji,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Gi,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Gi,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,T.jsx)(T.Fragment,{children:W(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(zi,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,T.jsx)(nn,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Yi,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Ps,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),rn=(0,Nt.Pi)((()=>{const e=Ut(),t=(0,kt.useRef)(null),s=e.assistantService,i=s.searchText,n=(0,kt.useMemo)((()=>(0,tn.Z)((()=>s.search()),100)),[s]);return(0,kt.useEffect)((()=>{t.current?.focus()}),[]),(0,T.jsxs)("div",{className:"virtual-assistant__search",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,T.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&s.refreshPanelRendering()},className:(0,Ot.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":i}),spellCheck:!1,onChange:e=>{s.setSearchText(e.target.value),n()},value:i,placeholder:"Ask me a question"}),i&&(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:s.searchResults.length+(s.isOverSearchLimit?"+":"")}),(0,T.jsx)("button",{className:(0,Ot.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":s.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":s.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>s.setShowSearchConfigurationMenu(!s.showSearchConfigurationMenu),title:(s.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,T.jsx)(es,{})}),i?(0,T.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{s.resetSearch(),s.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,T.jsx)(qt,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(hs,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(zt,{isLoading:s.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":s.showSearchConfigurationMenu}),children:(0,T.jsxs)("div",{className:"virtual-assistant__search__input__advanced-config__panel",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__input__advanced-config__panel__header__label",children:["search config",e.documentationService.hasDocEntry(Qi.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX)&&(0,T.jsx)("div",{onClick:()=>s.openDocumentationEntryLink(Qi.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see documentation",className:"virtual-assistant__search__input__advanced-config__panel__header__label__hint",children:(0,T.jsx)(ns,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(Zi,{value:s.searchConfigurationState.currentMode,onChange:e=>{const t=e.target.value;s.searchConfigurationState.setCurrentMode(t)},row:!1,options:[De.STANDARD,De.INCLUDE,De.EXACT,De.INVERSE],size:1})})]})}),s.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(nn,{entry:s.currentDocumentationEntry},s.currentDocumentationEntry.uuid)}),!s.currentDocumentationEntry&&(0,T.jsxs)(T.Fragment,{children:[Boolean(s.searchResults.length)&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:s.searchResults.map((e=>(0,T.jsx)(nn,{entry:e},e.uuid)))}),i&&!s.searchResults.length&&(0,T.jsx)(Yi,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(bs,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!i&&!s.searchResults.length&&(0,T.jsx)(ji,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>{pe(`documentation-registry_${(0,sn.Z)(new Date(Date.now()),Qe)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ne.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(Gi,{onClick:()=>{pe(`documentation-registry_${(0,sn.Z)(new Date(Date.now()),Qe)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ne.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,T.jsxs)("div",{className:"virtual-assistant__character",children:[(0,T.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,T.jsx)(Ls,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(ks,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Fs,{className:"virtual-assistant__character__beard"})]}),(0,T.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,T.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),on=(0,Nt.Pi)((e=>{const{triggerElement:t}=e,s=Ut().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,T.jsx)(Ji,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,T.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===Me.SEARCH}),onClick:()=>s.setSelectedTab(Me.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(hs,{})})}),(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===Me.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(Me.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(ws,{}),i&&(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,T.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,T.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,T.jsx)(Ys,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===Me.SEARCH&&(0,T.jsx)(rn,{}),n===Me.CONTEXTUAL_SUPPORT&&(0,T.jsx)(an,{})]})]})},s.panelRenderingKey)})),ln=(0,Nt.Pi)((()=>{const[e,t]=(0,kt.useState)(!1),[s,i]=(0,kt.useState)((0,a.Z)()),n=Ut(),r=(0,kt.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,kt.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,T.jsx)(en,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,T.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,T.jsxs)("div",{className:(0,Ot.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,T.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(Me.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,T.jsx)(Ys,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(ps,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(ji,{className:(0,Ot.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,T.jsx)(Gi,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,T.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,T.jsx)(li,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(on,{triggerElement:r.current})]})},s)}));var cn;!function(e){e.TOP_LEVEL_CONTAINER="application.top-level-container",e.BACKDROP_CONTAINER="application.backdrop-container"}(cn||(cn={}));const dn=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Backquote","Control+Shift+KeyN","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB","Alt+KeyZ"],hn=e=>(0,T.jsx)("div",{className:"backdrop__container","data-elementid":e.elementId}),un=(0,Nt.Pi)((e=>{const{children:t}=e,s=Ut(),i=((e,t)=>{const s={};return e.forEach(((e,i)=>{e.length&&(s[i]={combinations:e,handler:t})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:dn,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{dn.includes(e)&&t.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,kt.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&((0,at.Z)(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)),(e=>e.combination)).forEach((e=>{const s=e.combination,n=pt(e.combination);if(!n.length)return;const a=t.get(s)??n,r=G(a[0]);mt(i,r)?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(s,i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(i);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[i]),(0,kt.useEffect)((()=>{const e=()=>{document.hidden&&($e.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(Ct,{children:[(0,T.jsx)(Ht,{}),(0,T.jsx)(Bt,{}),(0,T.jsx)(Mi,{}),(0,T.jsx)(ln,{}),s.layoutService.showBackdrop&&(0,T.jsx)(St.Z,{container:s.layoutService.getElementByID(s.layoutService.backdropContainerElementID??cn.BACKDROP_CONTAINER)??null,children:(0,T.jsx)(xt.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(vt.W,{backend:At.PD,children:(0,T.jsxs)("div",{className:"app__container","data-elementid":cn.TOP_LEVEL_CONTAINER,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(hn,{elementId:cn.BACKDROP_CONTAINER}),t]})})]})})),pn={foreground:"#cccccc",background:"#1e1e1e",cursor:"#cccccc",selectionBackground:"#264f78",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#e5e5e5"},mn={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},_n=`\n${et.BOLD}${et.BRIGHT_BLUE}$purist${et.RESET}\n${et.BOLD}${et.MAGENTA}❯${et.RESET} `,gn="❯ ";class En extends nt{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=we.create();constructor(e){super(e),this.instance=new Ye.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${Je}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:pn,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new Ke.FitAddon,this.searcher=new Xe.SearchAddon,this.renderer=new qe.WebglAddon}setup(e){if(this.setupState.hasCompleted)throw new b("Terminal is already set up");this.setupState.complete(),this.renderer.onContextLoss((()=>{this.renderer.dispose()})),this.instance.loadAddon(this.resizer),this.instance.loadAddon(this.searcher),this.instance.loadAddon(this.renderer),this.instance.loadAddon(new Ze.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>_t(e,"Control+KeyF")||_t(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(_t(e,"Control+KeyC")&&this.instance.hasSelection()||_t(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new We.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new We.WebLinksAddon,this.instance.loadAddon(this.webLinkProvider),(e?.commands??[]).forEach((e=>{[e.command,...e.aliases??[]].forEach((t=>{this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(me.TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE),`Found multiple duplicated terminal commands '${t}'`):this.commandRegistry.set(t,e)}))})),this.searcher.onDidChangeResults((e=>{e?(this.setSearchResultCount(e.resultCount),this.setSearchCurrentResultIndex(e.resultIndex)):(this.setSearchResultCount(void 0),this.setSearchCurrentResultIndex(void 0))})),this._TEMPORARY__onKeyListener=this.instance.onKey((({key:e,domEvent:t})=>{var s,i;if("ArrowUp"!==t.code)if("ArrowDown"!==t.code)if(this.commandHistoryNavigationIdx=void 0,"Enter"===t.code){if(this.command.trim()){const e=this.command,[t,...s]=e.replaceAll(/\s+/g," ").split(" ");if(this.addCommandToHistory(this.command),!t)return;const i=this.commandRegistry.get(t);if(!i)return void this.fail(`command not found: ${t}`);if(this.isRunningCommand)return;this.isRunningCommand=!0,i.handler(s.map((e=>e.trim())),t,e).finally((()=>{this.isRunningCommand=!1,this.isFlushed||this.abort()}))}}else if(_t(t,"Control+KeyD")||_t(t,"Control+KeyC")&&!this.instance.hasSelection())this.abort();else if("Backspace"===t.code)this.deleteFromCommand(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!0):-1);else if("Delete"===t.code)this.deleteFromCommand(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!1):1);else if("ArrowLeft"===t.code){const e=this.computeCursorMovement(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!0):-1);this.instance.scrollLines(e.scroll),this.instance.write(e.seq)}else if("ArrowRight"===t.code){const e=this.computeCursorMovement(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!1):1);this.instance.scrollLines(e.scroll),this.instance.write(e.seq)}else e.match(/^[A-Za-z0-9!@#$%^&*()\-_=+"':;,.<>/?[\]{}|\\~` ]$/)?this.writeToCommand(e):(s=t,i=this.applicationStore,i.layoutService.getElementByID(cn.TOP_LEVEL_CONTAINER)?.dispatchEvent(new KeyboardEvent(s.type,s)));else void 0!==this.commandHistoryNavigationIdx&&this.setCommandFromHistory(0===this.commandHistoryNavigationIdx?void 0:this.commandHistoryNavigationIdx-1);else this.setCommandFromHistory(void 0!==this.commandHistoryNavigationIdx?this.commandHistoryNavigationIdx+1:0)})),this._TEMPORARY__onDataListener=this.instance.onData((e=>{e.length>1&&!e.startsWith("")&&this.writeToCommand(e.replaceAll(/[^A-Za-z0-9!@#$%^&*()\-_=+"':;,.<>/?[\]{}|\\~` ]/g,"").trimEnd())}))}getCommandRange(){const e=this.instance.buffer.active,t=this.instance.cols,s=`${gn}${this.command}`,i=`${gn}${this.command.substring(0,t-2)}${this.command.length<t-2?" ".repeat(t-this.command.length-2):""}`;let n=0,a=0;for(let s=e.baseY+e.cursorY;s>-1;--s){if(G(e.getLine(s)).translateToString()===i){n=s,a+=(s===e.baseY+e.cursorY?e.cursorX:t)-2;break}a+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:n,startX:2,endY:n+(s.length-s.length%t)/t,endX:s.length%t,cursorIdx:a}}computeCursorJumpMovement(e){const t=this.getCommandRange();let s,i=!1;if(e){for(let e=t.cursorIdx-1;e>-1;--e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=t.cursorIdx-e-1;break}}else for(let e=t.cursorIdx+1;e<this.command.length;++e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=e-t.cursorIdx-1;break}return void 0===s&&(s=e?t.cursorIdx:this.command.length-t.cursorIdx),e?-s:s}computeCursorMovement(e,t=!0){const s=this.instance.buffer.active,i=this.instance.cols,n=this.instance.rows,a=this.getCommandRange(),r=t?e<0?a.cursorIdx:this.command.length-a.cursorIdx:e,o=Math.min(Math.abs(e),r);let l=s.cursorX,c=s.cursorY,d=s.baseY+s.cursorY;e<0?(l=(i+(s.cursorX-o)%i)%i,c=s.cursorY-(o>s.cursorX?Math.ceil(o/i):0),d=c+s.baseY,c=Math.max(c,-1)):e>0&&(l=(s.cursorX+o)%i,c=s.cursorY+(s.cursorX+o>=i?Math.floor((s.cursorX+o)/i):0),d=c+s.baseY,c=Math.min(c,n-1));const h=d>s.viewportY+n?d-(s.viewportY+n):d<s.viewportY?d-s.viewportY:0;return{seq:tt(c+1,l+1),scroll:h}}writeToCommand(e){const t=this.getCommandRange(),s=this.command.slice(0,t.cursorIdx),i=this.command.slice(t.cursorIdx),n=this.computeCursorMovement(e.length,!1);this.instance.scrollLines(n.scroll),this.instance.write(e+i+n.seq),this.setCommand(s+e+i)}deleteFromCommand(e){const t=this.getCommandRange(),s=e<0?t.cursorIdx:this.command.length-t.cursorIdx,i=Math.min(Math.abs(e),s);let n,a,r;if(0===e)return;e<0?(n=this.command.slice(0,t.cursorIdx-i),a=this.command.slice(t.cursorIdx,this.command.length),r=-i):(n=this.command.slice(0,t.cursorIdx),a=this.command.slice(t.cursorIdx+i,this.command.length),r=0);const o=this.computeCursorMovement(r);this.instance.scrollLines(o.scroll),this.instance.write(tt(t.startY+1,t.startX+1)+n+a+" ".repeat(i)+o.seq),this.setCommand(n+a)}get isSetup(){return this.setupState.hasCompleted}isFocused(){return document.activeElement===this.instance.textarea}mount(e){if(!this.setupState.hasCompleted)throw new b("XTerm terminal has not been set up yet");this.instance.open(e)}dispose(){this.searcher.dispose(),this.resizer.dispose(),this.renderer.dispose(),this.webLinkProvider?.dispose(),this._TEMPORARY__onKeyListener?.dispose(),this._TEMPORARY__onDataListener?.dispose(),this.instance.dispose()}autoResize(){this.resizer.fit()}focus(){this.instance.focus()}addCommandToHistory(e){e!==this.commandHistory.at(0)&&this.commandHistory.unshift(e)}setCommandFromHistory(e){const t=void 0===e?this.currentCommandSearchString:this.commandHistory.filter((e=>e.startsWith(this.currentCommandSearchString))).at(e);if(void 0!==t){let s=this.getCommandRange();this.instance.write(tt(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(tt(s.endY+1,s.endX+1)),this.commandHistoryNavigationIdx=e}}setCommand(e){this.command=e,this.currentCommandSearchString=e,this.commandHistoryNavigationIdx=void 0}newCommand(){this.instance.write(_n),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${et.DIM}(system: ${e})\n${et.RESET}`))}flushScreen(){this.instance.write("c"),this.instance.reset()}get isFlushed(){const e=this.instance.buffer.active;let t=!0;for(let s=e.baseY+e.cursorY;s>-1;--s){const i=G(e.getLine(s)).translateToString();if(i.trim()){t=i!==gn;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(et.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${et.BRIGHT_BLACK}+-------------------------------------------------------+${et.RESET}\n${et.BRIGHT_BLACK}|${et.RESET} ${et.BRIGHT_GREEN}[@@]${et.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${et.BRIGHT_BLACK}|${et.RESET}\n${et.BRIGHT_BLACK}|${et.RESET} ${et.BRIGHT_GREEN}/|__|\\${et.RESET} ${et.BRIGHT_BLACK}|${et.RESET}\n${et.BRIGHT_BLACK}+--${et.RESET} ${et.BRIGHT_GREEN}d b${et.RESET} ${et.BRIGHT_BLACK}-----------------------------------------------+${et.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,at.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${et.BRIGHT_GREEN}${e.command.padEnd(30)}${et.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${et.DIM}${e.usage}${et.RESET}`)).join("\n")}`)),this.abort()}showCommonANSIEscapeSequences(){this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write(`\nCommon ANSI Escape Sequences for Styling:\n\n${Object.entries(et).map((([e,t])=>`${t}${(e=>e?e.trim().match(/^[A-Z_]+$/)?dt(e.trim().replace(/_+/gu," ").toLowerCase()):lt(e.trim()).split(/(?<chunk>[A-Z][a-z]+|[0-9]+)/).map((e=>e.toUpperCase()===e?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).filter(Boolean).join(" ").replace(/_+/gu," ").replace(/\s+/gu," "):"")(e).padEnd(20)}${et.RESET} ${t.replace("","\\u001b")}`)).join("\n")}`),this.abort()}abort(){this.resetANSIStyling(),this.instance.write("\n"),this.newCommand(),this.instance.scrollToBottom(),this.isRunningCommand=!1}fail(e,t){t?.systemCommand&&this.newSystemCommand(t.systemCommand),this.instance.write(`\n${et.RED}${e}${et.RED}`),this.abort()}output(e,t){this.resetANSIStyling(),t?.clear&&!this.preserveLog||!t?.systemCommand||this.newSystemCommand(t.systemCommand),!this.preserveLog&&t?.clear?this.flushScreen():(this.preserveLog||this.isRunningCommand)&&this.instance.write("\n"),this.instance.write(e),this.resetANSIStyling(),this.instance.write("\n"),this.instance.scrollToBottom(),this.newCommand()}search(e){this.searcher.findNext(e,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive,incremental:!0})}clearSearch(){this.searcher.clearDecorations(),this.instance.clearSelection(),this.setSearchText(""),this.setSearchResultCount(void 0),this.setSearchCurrentResultIndex(void 0)}findPrevious(){this.searcher.findPrevious(this.searchConfig.searchText,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}getContent(){const e=this.instance.buffer.active,t=[];for(let s=0;s<e.length;++s){const i=G(e.getLine(s));t.push(i.translateToString())}return t.join("\n").trimEnd()}copy(){this.instance.hasSelection()?this.applicationStore.clipboardService.copyTextToClipboard(this.instance.getSelection()).catch(this.applicationStore.alertUnhandledError):this.applicationStore.notificationService.notifyWarning("Ther terminal has no selection to copy")}copyAll(){this.applicationStore.clipboardService.copyTextToClipboard(this.getContent()).catch(this.applicationStore.alertUnhandledError)}}class fn{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new En(e)}}const Tn="(unknown)";class Cn{applicationStore;currentUser=Tn;constructor(e){(0,Re.rC)(this,{currentUser:Re.LO,setCurrentUser:Re.aD}),this.applicationStore=e}get isAnonymous(){return this.currentUser===Tn}setCurrentUser(e){this.currentUser=e}}var Sn,xn=s(7279);class Nn{get localStorage(){return G(window.localStorage,"'window.localStorage' object is not available in non-web environment")}setItem(e,t){this.localStorage.setItem(e,t)}getItem(e){return this.localStorage.getItem(e)}removeItem(e){this.localStorage.removeItem(e)}clear(){this.localStorage.clear()}hasItem(e){return this.localStorage.hasItem(e)}}class vn{storeIndex;storageService;data;constructor(e,t){this.storageService=e,this.storeIndex=t,this.data=this.storageService.getIndex(this.storeIndex)??{}}getValue(e){return this.data[e]}getNumericValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!K(e))throw new k(t||"Value is expected to be a number")}(e,t),e))(t):void 0}getStringValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!W(e))throw new k(t||"Value is expected to be a string")}(e,t),e))(t):void 0}getBooleanValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!X(e))throw new k(t||"Value is expected to be a boolean")}(e,t),e))(t):void 0}getObjectValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!Z(e))throw new k(t||"Value is expected to be a object")}(e,t),e))(t):void 0}hasValue(e){return j(this.data[e])}persistValue(e,t){void 0!==t?this.data[e]=t:delete this.data[e],this.storageService.updateIndex(this.storeIndex,this.data)}}class An{applicationStore;storage;data;constructor(e){this.applicationStore=e,this.storage=new Nn;const t=this.storage.getItem(e.config.applicationStorageKey);this.data=t?F((()=>JSON.parse(t)))??{}:{}}getIndex(e){return this.data[e]}updateIndex(e,t){(0,xn.Z)(t)?delete this.data[e]:this.data[e]=t,this.storage.setItem(this.applicationStore.config.applicationStorageKey,JSON.stringify(this.data))}}class In{applicationStore;plugins=[];constructor(e){this.applicationStore=e}registerPlugins(e){this.plugins=e}setup(){const e={userId:this.applicationStore.identityService.currentUser,appName:this.applicationStore.config.appName,appEnv:this.applicationStore.config.env,appVersion:this.applicationStore.config.appVersion,appSessionId:this.applicationStore.uuid,appStartTime:this.applicationStore.timeService.timestamp};this.plugins.forEach((t=>t.setup(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}class On{timestamp=Date.now();interruptions=[];recordUsageInterruption(){this.interruptions.push(Date.now())}finalizeTimingsRecord(e,t){const s=e.elapsed,i=e.startTime,n=i+s,a={...t??{},...Object.fromEntries(e.records),total:s};let r=0;for(const e of this.interruptions)if(e>=i&&e<=n)r++;else if(e>n)break;return r>0?{...a,__numberOfInteruptions:r}:a}}!function(e){e.DEFAULT_DARK="default-dark",e.LEGACY_LIGHT="legacy-light",e.HIGH_CONTRAST_LIGHT="hc-light"}(Sn=Sn||(Sn={}));const yn={name:"Default Dark (default)",key:Sn.DEFAULT_DARK,TEMPORARY__globalCSSClassName:"theme__default-dark"},Rn={name:"Legacy Light",key:Sn.LEGACY_LIGHT,TEMPORARY__globalCSSClassName:"theme__legacy-light"},wn={name:"High-Contrast Light",key:Sn.HIGH_CONTRAST_LIGHT,TEMPORARY__globalCSSClassName:"theme__hc-light"};var Ln;!function(e){e.COLOR_THEME="application.layout.colorTheme"}(Ln=Ln||(Ln={}));const Pn={[Ln.COLOR_THEME]:{defaultValue:Sn.DEFAULT_DARK}};class bn{applicationStore;backdropContainerElementID;showBackdrop=!1;colorThemeRegistry=new Map;currentColorTheme;constructor(e){(0,Re.rC)(this,{currentColorTheme:Re.LO.ref,TEMPORARY__isLightColorThemeEnabled:Re.Fl,backdropContainerElementID:Re.LO,showBackdrop:Re.LO,setBackdropContainerElementID:Re.aD,setShowBackdrop:Re.aD,setColorTheme:Re.aD}),this.applicationStore=e,this.colorThemeRegistry.set(Sn.DEFAULT_DARK,yn),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraColorThemes?.()??[])).forEach((e=>{this.colorThemeRegistry.has(e.key)?this.applicationStore.logService.warn(h.create(me.COLOR_THEME_CONFIGURATION_CHECK__FAILURE),`Found duplicated color themes with key '${e.key}'`):this.colorThemeRegistry.set(e.key,e)}));const t=this.applicationStore.settingService.getStringValue(Ln.COLOR_THEME)??Sn.DEFAULT_DARK;this.currentColorTheme=G(this.colorThemeRegistry.get(t)),this.TEMPORARY__syncGlobalCSSClassName(this.currentColorTheme,void 0)}getElementByID(e){return document.querySelector(`[data-elementid='${e}']`)??void 0}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}get TEMPORARY__isLightColorThemeEnabled(){return this.currentColorTheme.key!==Sn.DEFAULT_DARK}TEMPORARY__syncGlobalCSSClassName(e,t){t&&document.body.classList.remove(t.TEMPORARY__globalCSSClassName),document.body.classList.add(e.TEMPORARY__globalCSSClassName)}setColorTheme(e,t){const s=this.colorThemeRegistry.get(e);if(e===this.currentColorTheme.key||!s)return;const i=this.currentColorTheme;this.currentColorTheme=s,this.TEMPORARY__syncGlobalCSSClassName(s,i),t?.persist&&this.applicationStore.settingService.persistValue(Ln.COLOR_THEME,e)}}class Dn{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class Mn{navigator;constructor(e){this.navigator=e}}var Fn=s(65741);class kn{applicationStore;storage;registry=new Map;constructor(e){this.applicationStore=e,this.storage=new vn(this.applicationStore.storageService,"application-settings-storage"),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraSettingConfigurationEntries?.()??[])).forEach((e=>{this.registry.has(e.key)?this.applicationStore.logService.warn(h.create(me.SETTING_CONFIGURATION_CHECK__FAILURE),`Found duplicated setting with key '${e.key}'`):this.registry.set(e.key,e)}))}getNumericValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(K(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve numeric value for setting '${e}'`)}getStringValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(W(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve string value for setting '${e}'`)}getBooleanValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(X(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve boolean value for setting '${e}'`)}getObjectValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(Z(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve object value for setting '${e}'`)}persistValue(e,t){const s=this.registry.get(e)?.defaultValue;this.storage.persistValue(e,void 0!==s&&(0,Fn.Z)(s,t)?void 0:t)}}class jn{goToLocation(e,t){throw new D("Navigator does not support this operation")}reload(e){throw new D("Navigator does not support this operation")}goToAddress(e,t){throw new D("Navigator does not support this operation")}visitAddress(e){throw new D("Navigator does not support this operation")}generateAddress(e){throw new D("Navigator does not support this operation")}updateCurrentLocation(e){throw new D("Navigator does not support this operation")}updateCurrentZone(e){throw new D("Navigator does not support this operation")}resetZone(){throw new D("Navigator does not support this operation")}getCurrentBaseAddress(e){throw new D("Navigator does not support this operation")}getCurrentAddress(){throw new D("Navigator does not support this operation")}getCurrentLocation(){throw new D("Navigator does not support this operation")}getCurrentLocationParameters(){throw new D("Navigator does not support this operation")}getCurrentLocationParameterValue(e){throw new D("Navigator does not support this operation")}getCurrentZone(){throw new D("Navigator does not support this operation")}blockNavigation(e,t,s){throw new D("Navigator does not support this operation")}unblockNavigation(){throw new D("Navigator does not support this operation")}get isNavigationBlocked(){throw new D("Navigator does not support this operation")}INTERNAL__internalizeTransientParameter(e){throw new D("Navigator does not support this operation")}}class Un{uuid=(0,a.Z)();config;pluginManager;initState=we.create();platform;timeService;logService;storageService;settingService;alertService;notificationService;identityService;commandService;keyboardShortcutsService;layoutService;clipboardService;terminalService;navigationService;navigationContextService;documentationService;assistantService;eventService;telemetryService;tracerService;constructor(e,t){this.config=e,this.pluginManager=t,this.timeService=new On,this.logService=new p,this.logService.registerPlugins(t.getLoggerPlugins()),this.storageService=new An(this),this.settingService=new kn(this),this.alertService=new Ft(this),this.notificationService=new Di,this.identityService=new Cn(this),this.layoutService=new bn(this),this.clipboardService=new Dn(this),this.terminalService=new fn(this),this.commandService=new ze(this),this.keyboardShortcutsService=new He(this),this.navigationService=new Mn(new jn),this.navigationContextService=new Be(this),this.documentationService=new Ie(this),this.assistantService=new Ge(this),this.eventService=new Ve,this.eventService.registerEventNotifierPlugins(t.getEventNotifierPlugins()),this.telemetryService=new In(this),this.telemetryService.registerPlugins(t.getTelemetryServicePlugins()),this.telemetryService.setup(),this.tracerService=new Pe,this.tracerService.registerPlugins(t.getTracerServicePlugins())}async initialize(e){if(this.initState.isInInitialState){this.initState.inProgress();try{if(this.platform)throw new b("Platform is already configured");this.platform=e,this.navigationService=new Mn(e.getNavigator()),await e.initialize(),this.initState.pass()}catch(e){M(e),this.notificationService.notifyError(e),this.logService.error(h.create(me.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),this.initState.fail()}}else this.notificationService.notifyIllegalState("Application store is re-initialized")}alertUnhandledError=e=>{this.logService.error(h.create(me.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notificationService.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)}}class Gn{}class Vn extends Gn{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class $n{config;logger;pluginManager;basePresets=[];basePlugins=[];baseAddress;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Vn}setup(e){return this.baseAddress=H(e.baseAddress,"Can't setup application: 'baseAddress' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new ue;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){M(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION__FAILURE),e)}U(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){M(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION__FAILURE),e)}return U(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseAddress:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new ue(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(H(e.url,"Can't load documentation registry: 'url' field is missing or empty"));U(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){M(e),this.logger.warn(h.create(me.DOCUMENTATION_FETCH__FAILURE),e)}}))),e.keyedDocumentationEntries=[...Ae(t),...e.keyedDocumentationEntries]}async start(){U(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseAddress);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]);const s=new Un(this.config,this.pluginManager);await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(s)))),await this.loadApplication(s),this.logger.info(h.create(me.APPLICATION_LOAD__SUCCESS),"Legend application loaded")}catch(e){throw M(e),this.logger.error(h.create(me.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),e}}}const Bn="legend-application-root",zn=JSON.parse('{"i8":"15.0.2","Rw":{"j":"@finos/legend-application-plugin-core"}}');class Hn extends o{}class Yn extends Hn{static NAME=zn.Rw.j;constructor(){super(Yn.NAME,zn.i8)}install(e){e.registerApplicationPlugin(this)}getExtraApplicationSetups(){return[async e=>{(0,Re.jQ)({enforceActions:"observed"})}]}getExtraColorThemes(){return[Rn,wn]}getExtraSettingConfigurationEntries(){return e=Pn,Object.entries(e).map((e=>({key:e[0],...e[1]})));var e}}class Wn{appName;baseAddress;env;applicationStorageKey;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseAddress=e.baseAddress,this.appName=H(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=H(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.applicationStorageKey=e.configData.application?.storageKey??this.getDefaultApplicationStorageKey(),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Ae(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=G(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=G(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=G(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}static resolveAbsoluteUrl(e){return e.trim().startsWith("/")?window.location.origin+e:e}}class Kn extends Wn{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),U(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Wn.resolveAbsoluteUrl(H(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty")),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}getDefaultApplicationStorageKey(){return"legend-pure-ide"}}class Xn extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Zn extends Xn{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Zn}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const qn=JSON.parse('{"i8":"8.0.4","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class Jn extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Qn=e=>t=>(0,Re.bi)(t)?t:e(t),ea=e=>(t,s)=>(0,Re.bi)(t)?t:e(t,s),ta=e=>{(0,Re.rC)(e,{_isDeleted:Re.LO,_isDisposed:Re.LO,name:Re.LO,package:Re.LO,isDeleted:Re.Fl,path:Re.Fl,_elementHashCode:Re.Fl,hashCode:Re.Fl,setIsDeleted:Re.aD,dispose:Re.aD})},sa=Qn((e=>(0,Re.rC)(e,{value:Re.LO,valueForSerialization:Re.Fl})));var ia=s(34485),na=s(3096);const aa=e=>ia.sha1().update(e).digest("hex"),ra=e=>aa(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?aa(e):e.hashCode)).join(",")),oa="::",la="###",ca=["$implicit"];var da,ha,ua,pa,ma;(ma=da=da||(da={})).CORE="CORE",ma.MAIN="ROOT",ma.MODEL_GENERATION="MODEL_GENERATION_ROOT",ma.SYSTEM="SYSTEM_ROOT",ma.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(pa=ha=ha||(ha={})).STRING="String",pa.BOOLEAN="Boolean",pa.BINARY="Binary",pa.NUMBER="Number",pa.INTEGER="Integer",pa.FLOAT="Float",pa.DECIMAL="Decimal",pa.DATE="Date",pa.STRICTDATE="StrictDate",pa.DATETIME="DateTime",pa.STRICTTIME="StrictTime",pa.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(ua=ua||(ua={}));const _a=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var ga,Ea,fa,Ta,Ca,Sa,xa,Na,va,Aa,Ia;(Ea=ga=ga||(ga={})).ANY="meta::pure::metamodel::type::Any",Ea.NIL="meta::pure::metamodel::type::Nil",Ea.PROFILE_DOC="meta::pure::profiles::doc",Ea.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ea.PROFILE="meta::pure::metamodel::extension::Profile",Ea.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ea.MEASURE="meta::pure::metamodel::type::Measure",Ea.CLASS="meta::pure::metamodel::type::Class",Ea.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ea.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ea.FLAT_DATA="meta::flatData::metamodel::FlatData",Ea.DATABASE="meta::relational::metamodel::Database",Ea.MAPPING="meta::pure::mapping::Mapping",Ea.SERVICE="meta::legend::service::metamodel::Service",Ea.CONNECTION="meta::pure::runtime::PackageableConnection",Ea.RUNTIME="meta::pure::runtime::PackageableRuntime",Ea.EXECUTION_ENVIRONMENT="meta::legend::service::metamodel::ExecutionEnvironmentInstance",Ea.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ea.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ea.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ea.DATA_ELEMENT="meta::pure::data::DataElement",(Sa=fa=fa||(fa={})).BUSINESS_TEMPORAL="businesstemporal",Sa.PROCESSING_TEMPORAL="processingtemporal",Sa.BITEMPORAL="bitemporal",(Ca=Ta=Ta||(Ta={})).ALL_VERSIONS="AllVersions",Ca.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(va=xa=xa||(xa={})).CLASS="CLASS",va.STORE="STORE",va.MAPPING="MAPPING",va.RUNTIME="RUNTIME",va.FILE_GENERATION="FILE_GENERATION",va.SERVICE="SERVICE",function(e){e.LET="meta::pure::functions::lang::letFunction",e.NEW="meta::pure::functions::meta::new"}(Na=Na||(Na={})),(Ia=Aa=Aa||(Aa={})).PACKAGE="PACKAGE",Ia.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Ia.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Ia.PROFILE="PROFILE",Ia.TAG_POINTER="TAG_POINTER",Ia.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Ia.TAGGED_VALUE="TAGGED_VALUE",Ia.ENUMERATION="ENUMERATION",Ia.ENUM_VALUE="ENUM_VALUE",Ia.CLASS="CLASS",Ia.PROPERTY="PROPERTY",Ia.PROPERTY_POINTER="PROPERTY_POINTER",Ia.MULTIPLICITY="MULTIPLICITY",Ia.CONSTRAINT="CONSTRAINT",Ia.DERIVED_PROPERTY="DERIVED_PROPERTY",Ia.ASSOCIATION="ASSOCIATION",Ia.FUNCTION="FUNCTION",Ia.MEASURE="MEASURE",Ia.UNIT="UNIT",Ia.ASSERT_FAIL="ASSERT_FAIL",Ia.ASSERT_PASS="ASSERT_PASS",Ia.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Ia.EQUAL_TO="EQUAL_TO",Ia.EQUAL_TO_JSON="EQUAL_TO_JSON",Ia.EQUAL_TO_TDS="EQUAL_TO_TDS",Ia.TEST_RESULT="TEST_RESULT",Ia.TEST_ERROR="TEST_ERROR",Ia.TEST_FAILED="TEST_FAILED",Ia.TEST_PASSED="TEST_PASSED",Ia.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Ia.SECTION_INDEX="SECTION_INDEX",Ia.SECTION="SECTION",Ia.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Ia.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Ia.RAW_LAMBDA="RAW_LAMBDA",Ia.RAW_VARIABLE="RAW_VARIABLE",Ia.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Ia.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Ia.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Ia.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Ia.EXPRESSION="EXPRESSION",Ia.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Ia.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Ia.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Ia.INSTANCE_VALUE="INSTANCE_VALUE",Ia.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Ia.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Ia.KEY_EXPRESSION_INSTANCE_VALUE="KEY_EXPRESSION_INSTANCE_VALUE",Ia.KEY_EXPRESSION_VALUE="KEY_EXPRESSION_VALUE",Ia.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Ia.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Ia.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Ia.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Ia.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Ia.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Ia.FUNCTION_TYPE="FUNCTION_TYPE",Ia.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Ia.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Ia.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Ia.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Ia.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Ia.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Ia.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Ia.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE",Ia.MAPPING="MAPPING",Ia.MAPPING_INCLUDE="MAPPING_INCLUDE",Ia.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Ia.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Ia.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Ia.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Ia.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Ia.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Ia.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Ia.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Ia.PROPERTY_MAPPING="PROPERTY_MAPPING",Ia.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Ia.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Ia.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Ia.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Ia.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Ia.MAPPING_TEST="MAPPING_TEST",Ia.STORE_TEST_DATA="STORE_TEST_DATA",Ia.INPUT_DATA="INPUT_DATA",Ia.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Ia.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Ia.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Ia.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Ia.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Ia.FILTER_MAPPING="FILTER_MAPPING",Ia.COLUMN_MAPPING="COLUMN_MAPPING",Ia.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Ia.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Ia.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Ia.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Ia.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Ia.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Ia.RUNTIME="RUNTIME",Ia.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Ia.ENGINE_RUNTIME="ENGINE_RUNTIME",Ia.LEGACY_RUNTIME="LEGACY_RUNTIME",Ia.RUNTIME_POINTER="RUNTIME_POINTER",Ia.STORE_CONNECTIONS="STORE_CONNECTIONS",Ia.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Ia.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Ia.CONNECTION_POINTER="CONNECTION_POINTER",Ia.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Ia.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Ia.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Ia.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Ia.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Ia.GENERATION_TREE="GENERATION_TREE",Ia.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Ia.FILE_GENERATION="FILE_GENERATION",Ia.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Ia.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Ia.MODEL_STORE_DATA="MODEL_STORE_DATA",Ia.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Ia.DATA_ELEMENT="DATA_ELEMENT",Ia.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Ia.RELATIONAL_TDS="RELATIONAL_TDS",Ia.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Ia.BINDING="BINDING",Ia.SCHEMA_SET="SCHEMA_SET",Ia.SCHEMA="SCHEMA",Ia.MODEL_UNIT="MODEL_UNIT",Ia.URL_STREAM="URL_STREAM",Ia.EXTERNAL_FORMAT_CONNECTION="EXTERNAL_FORMAT_CONNECTION",Ia.SERVICE="SERVICE",Ia.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Ia.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Ia.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Ia.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Ia.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Ia.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Ia.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Ia.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Ia.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Ia.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Ia.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Ia.SERVICE_TEST="SERVICE_TEST",Ia.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Ia.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Ia.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Ia.EXECUTION_ENVIRONMENT_INSTANCE="EXECUTION_ENVIRONMENT_INSTANCE",Ia.SINGLE_EXECUTION_PARAMETER="SINGLE_EXECUTION_PARAMETER",Ia.MULTI_EXECUTION_PARAMETER="MULTI_EXECUTION_PARAMETER",Ia.DATABASE="DATABASE",Ia.DATABASE_SCHEMA="DATABASE_SCHEMA",Ia.DATABASE_JOIN="DATABASE_JOIN",Ia.DATABASE_FILTER="DATABASE_FILTER",Ia.DATBASE_VIEW="DATBASE_VIEW",Ia.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Ia.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Ia.RELATIONAL="RELATIONAL",Ia.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Ia.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Ia.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Ia.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Ia.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Ia.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Ia.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Ia.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Ia.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Ia.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Ia.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Ia.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Ia.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Ia.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Ia.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Ia.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Ia.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Ia.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Ia.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Ia.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Ia.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Ia.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Ia.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Ia.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Ia.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Ia.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Ia.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Ia.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Ia.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Ia.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Ia.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Ia.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Ia.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Ia.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Ia.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Ia.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Ia.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Ia.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Ia.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Ia.TRINO_DATASOURCE_SPECIFICATION="TRINO_DATASOURCE_SPECIFICATION",Ia.TRINO_SSL_SPECIFICATION="TRINO_SSL_SPECIFICATION",Ia.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Ia.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Ia.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Ia.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Ia.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Ia.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Ia.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Ia.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Ia.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Ia.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY="TRINO_KEREBEROS_AUTHENTICATION_STRATEGY",Ia.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Ia.SCHEMA_MAPPER="SCHEMA_MAPPER",Ia.TABLE_MAPPER="TABLE_MAPPER",Ia.FLAT_DATA="FLAT_DATA",Ia.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Ia.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Ia.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Ia.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Ia.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Ia.FLAT_DATA_STRING="FLAT_DATA_STRING",Ia.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Ia.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Ia.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Ia.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Ia.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Ia.FLAT_DATA_DATE="FLAT_DATA_DATE",Ia.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Ia.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Ia.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Ia.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Ia.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Ia.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Ia.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Ia.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER";const Oa=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},Y(Z(t=e),"Can't hash non-object value"),na(t,s);var t,s},ya=(e,t)=>ra([e?Oa(e):"",t?Oa(t):""]),Ra=(e,t)=>[Aa.PACKAGEABLE_ELEMENT_POINTER,e??"",t].map(aa).join(",");class wa{stereotypes=[];taggedValues=[]}class La extends wa{name}class Pa extends La{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}${oa}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return ra([Aa.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new b(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ba extends Pa{}class Da extends ba{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return ra([Aa.CLASS,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),ra(this.constraints),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class Ma extends ba{}class Fa extends Ma{values=[];get _elementHashCode(){return ra([Aa.ENUMERATION,this.path,ra(this.values),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ka extends Ma{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return ra([Aa.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new D}}class ja extends ba{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return ra([Aa.MEASURE,this.path,this.canonicalUnit??"",ra(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class Ua extends Pa{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class Ga{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return ra([Aa.SECTION,this.parserName,ra(this.elements.map((e=>e.valueForSerialization??"")))])}}class Va extends Ga{imports=[];get hashCode(){return ra([Aa.IMPORT_AWARE_CODE_SECTION,super.hashCode,ra(this.imports.map((e=>e.valueForSerialization??"")))])}}class $a extends Ga{get hashCode(){return ra([Aa.DEFAULT_CODE_SECTION,super.hashCode])}}class Ba{_UUID=(0,a.Z)()}class za extends Ba{ownerReference;constructor(e){super(),this.ownerReference=e}}class Ha extends Ba{value;constructor(e){super(),this.value=e}}class Ya extends Ha{constructor(e){super(e)}static create(e){return new Ya(e)}get valueForSerialization(){return this.value.path}}const Wa=Qn((e=>(0,Re.rC)(e,{name:Re.LO,value:Re.LO.ref,hashCode:Re.Fl}))),Ka=Qn((e=>(ta(e),(0,Re.rC)(e,{type:Re.LO,generationOutputPath:Re.LO,scopeElements:Re.LO,configurationProperties:Re.LO,_elementHashCode:Re.KG}),e.scopeElements.forEach((e=>{e instanceof Ha&&sa(e)})),e.configurationProperties.forEach(Wa),e))),Xa=Qn((e=>((0,Re.rC)(e,{id:Re.LO,hashCode:Re.Fl}),sa(e.generationElement),e))),Za=Qn((e=>(ta(e),(0,Re.rC)(e,{generationNodes:Re.LO,fileGenerations:Re.LO,_elementHashCode:Re.KG}),e.generationNodes.forEach(Xa),e.fileGenerations.forEach(sa),e)));class qa{}class Ja extends qa{expectedOutput;constructor(e){super(),this.expectedOutput=ht(e)}get hashCode(){return ra([Aa.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Qa{}class er extends Qa{mappings=[];connections=[];get hashCode(){return ra([Aa.ENGINE_RUNTIME,ra(this.mappings.map((e=>Ra(xa.MAPPING,e.valueForSerialization??"")))),ra(this.connections.filter((e=>e.storeConnections.length)))])}}class tr extends Qa{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return ra([Aa.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class sr{}class ir extends sr{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return ra([Aa.FLAT_DATA_INPUT_DATA,Ra(xa.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var nr,ar,rr;(rr=nr=nr||(nr={})).JSON="JSON",rr.XML="XML";class or extends sr{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===nr.JSON?ht(s):s}get hashCode(){return ra([Aa.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(ar=ar||(ar={}));class lr extends sr{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return ra([Aa.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const cr=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),sa(e.type),e))),dr=Qn((e=>(0,Re.rC)(e,{body:Re.LO.ref,parameters:Re.LO.ref,hashCode:Re.Fl}))),hr=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,hashCode:Re.Fl}),sa(e.type),e)));class ur{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){dr(e)}visit_RawVariableExpression(e){hr(e)}visit_RawPrimitiveInstanceValue(e){cr(e)}}ea(((e,t)=>(e.accept_RawValueSpecificationVisitor(new ur(t)),e)));class pr{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class mr extends pr{trueString;falseString;get hashCode(){return ra([Aa.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class _r extends pr{get hashCode(){return ra([Aa.FLAT_DATA_STRING])}}class gr extends pr{get hashCode(){return ra([Aa.FLAT_DATA_NUMBER])}}class Er extends pr{dateFormat;timeZone;get hashCode(){return ra([Aa.FLAT_DATA_DATE,this.dateFormat?ra(this.dateFormat):"",this.timeZone??""])}}class fr extends pr{fields=[];get hashCode(){return ra([Aa.FLAT_DATA_RECORD_TYPE,ra(this.fields)])}}const Tr=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{flatData:Re.LO,sectionName:Re.LO,hashCode:Re.Fl}),e))),Cr=Qn((e=>((0,Re.rC)(e,{label:Re.LO,flatDataDataType:Re.LO,optional:Re.LO,address:Re.LO,hashCode:Re.Fl}),(e=>{e instanceof mr?(0,Re.rC)(e,{trueString:Re.LO,falseString:Re.LO,hashCode:Re.Fl}):e instanceof _r||e instanceof gr?(0,Re.rC)(e,{hashCode:Re.Fl}):e instanceof Er?(0,Re.rC)(e,{dateFormat:Re.LO,timeZone:Re.LO,hashCode:Re.Fl}):e instanceof fr&&Qn(Sr)(e)})(e.flatDataDataType),e)));function Sr(e){return(0,Re.rC)(e,{fields:Re.LO,hashCode:Re.Fl}),e.fields.forEach(Cr),e}Qn(Sr);const xr=Qn(Sr),Nr=Qn((e=>((0,Re.rC)(e,{name:Re.LO,value:Re.LO,hashCode:Re.Fl}),e))),vr=Qn((e=>((0,Re.rC)(e,{driverId:Re.LO,name:Re.LO,sectionProperties:Re.LO,recordType:Re.LO,hashCode:Re.Fl}),e.sectionProperties.forEach(Nr),e.recordType&&xr(e.recordType),e))),Ar=(Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Qn((e=>(ta(e),(0,Re.rC)(e,{sections:Re.LO,_elementHashCode:Re.KG}),e.sections.forEach(vr),e)))),Ir=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),Or=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{filter:Re.LO,hashCode:Re.Fl}),Ir(e.sourceRootRecordType),e.filter&&dr(e.filter),e))),yr=ea(((e,t)=>(sd(e,t),dd(e,t),(0,Re.rC)(e,{rootInstanceSetImplementation:Re.LO,hashCode:Re.Fl}),e))),Rr=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,transform:Re.LO,hashCode:Re.Fl}),dr(e.transform),e))),wr=Qn((e=>((0,Re.rC)(e,{data:Re.LO,hashCode:Re.Fl}),sa(e.sourceFlatData),e))),Lr=Qn((e=>((0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),e)));class Pr{}class br extends Pr{serverPrincipal;get hashCode(){return ra([Aa.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class Dr extends Pr{get hashCode(){return ra([Aa.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class Mr extends Pr{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return ra([Aa.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class Fr extends Pr{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return ra([Aa.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class kr extends Pr{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return ra([Aa.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class jr extends Pr{get hashCode(){return ra([Aa.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class Ur extends Pr{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return ra([Aa.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,ra(this.additionalGcpScopes)])}}class Gr extends Pr{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return ra([Aa.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Vr extends Pr{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return ra([Aa.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class $r extends Pr{kerberosRemoteServiceName;kerberosUseCanonicalHostname;constructor(e,t){super(),this.kerberosRemoteServiceName=e,this.kerberosUseCanonicalHostname=t}get hashCode(){return ra([Aa.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY,this.kerberosRemoteServiceName,this.kerberosUseCanonicalHostname.toString()])}}class Br{}class zr extends Br{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return ra([Aa.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Hr extends Br{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return ra([Aa.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Yr extends Br{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return ra([Aa.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Wr extends Br{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return ra([Aa.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",ra(this.testDataSetupSqls)])}}class Kr extends Br{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return ra([Aa.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class Xr extends Br{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return ra([Aa.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Zr extends Br{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return ra([Aa.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class qr extends Br{projectId;instanceId;databaseId;proxyHost;proxyPort;constructor(e,t,s,i,n){super(),this.projectId=e,this.instanceId=t,this.databaseId=s,this.proxyHost=i,this.proxyPort=n}get hashCode(){return ra([Aa.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class Jr extends Br{host;port;sslSpecification;catalog;schema;clientTags;constructor(e,t,s){super(),this.host=e,this.port=t,this.sslSpecification=s}get hashCode(){return ra([Aa.TRINO_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.sslSpecification,this.catalog??"",this.schema??"",this.clientTags??""])}}class Qr{}class eo extends Qr{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return ra([this.from,this.to])}}class to extends eo{get hashCode(){return ra([super.hashCode,Aa.SCHEMA_MAPPER])}}class so extends eo{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return ra([super.hashCode,Aa.TABLE_MAPPER,this.schema])}}class io{_UUID=(0,a.Z)()}class no extends io{mappers=[];get hashCode(){return ra([Aa.MAPPER_POST_PROCESSOR,ra(this.mappers)])}}const ao="{target}",ro="default";class oo{}class lo extends oo{}class co extends lo{}class ho extends co{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return ra([Aa.RELATIONAL_OPERATION_DYNA_FUNC,this.name,ra(this.parameters)])}}var uo;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(uo=uo||(uo={}));const po=e=>[e].concat(e.children.length?po(e.children[0]):[]);class mo extends oo{relationalOperationElement;joinTreeNode;get hashCode(){return ra([Aa.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,ra(this.joinTreeNode?po(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class _o extends oo{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new D}}class go extends oo{alias;column;columnName;get hashCode(){return ra([Aa.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?ao:this.alias.name,this.column.value.name])}}class Eo extends oo{value;constructor(e){super(),this.value=e}get hashCode(){return ra([Aa.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class fo extends oo{values=[];get hashCode(){return ra([Aa.RELATIONAL_OPERATION_LITERAL_LIST,ra(this.values)])}}class To extends oo{owner;name;type;nullable;get hashCode(){return ra([Aa.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Co{}class So extends Co{infinityDate}class xo{}class No extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BIGINT])}}class vo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_SMALLINT])}}class Ao extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_TINYINT])}}class Io extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_INTEGER])}}class Oo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_FLOAT])}}class yo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_DOUBLE])}}class Ro extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class wo extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Lo extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Po extends xo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class bo extends xo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Do extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_TIMESTAMP])}}class Mo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARCHAR])}}class Fo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BIT])}}class ko extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class jo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_REAL])}}class Uo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class Go extends za{ownerReference;constructor(e){super(e),this.ownerReference=e}}class Vo extends Go{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(aa).join(",")}get selfJoinPointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",ro,ao].map(aa).join(",")}}class $o extends Go{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(aa).join(",")}get selfJoinPointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",ro,ao].map(aa).join(",")}}const Bo=Qn((e=>((0,Re.rC)(e,{packageableElementIncludes:Re.LO,packageableElementExcludes:Re.LO,hashCode:Re.Fl}),e.packageableElementIncludes.forEach(sa),e.packageableElementExcludes.forEach(sa),e))),zo=(Qn((e=>(Xc(e),(0,Re.rC)(e,{schemaSet:Re.LO,schemaId:Re.LO,contentType:Re.LO,modelUnit:Re.LO,_elementHashCode:Re.KG}),e.schemaSet&&sa(e.schemaSet),Bo(e.modelUnit),e))),Qn((e=>((0,Re.rC)(e,{binding:Re.LO,hashCode:Re.Fl}),sa(e.binding),e)))),Ho=Qn((e=>((0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),e))),Yo=(Qn((e=>(yd(e),(0,Re.rC)(e,{externalSource:Re.LO,hashCode:Re.Fl}),Ho(e.externalSource),e))),Qn((e=>(0,Re.rC)(e,{id:Re.LO,location:Re.LO,content:Re.LO,hashCode:Re.Fl})))),Wo=(Qn((e=>(ta(e),(0,Re.rC)(e,{format:Re.LO,schemas:Re.LO,_elementHashCode:Re.KG}),e.schemas.forEach(Yo),e))),Qn((e=>e instanceof No||e instanceof vo||e instanceof Ao||e instanceof Io||e instanceof Oo||e instanceof yo||e instanceof Do||e instanceof Date||e instanceof Mo||e instanceof Fo||e instanceof jo||e instanceof Uo?(0,Re.rC)(e,{hashCode:Re.Fl}):e instanceof Ro||e instanceof wo||e instanceof Lo||e instanceof ko?(0,Re.rC)(e,{size:Re.LO,hashCode:Re.Fl}):e instanceof Po||e instanceof bo?(0,Re.rC)(e,{precision:Re.LO,scale:Re.LO,hashCode:Re.Fl}):e))),Ko=Qn((e=>((0,Re.rC)(e,{name:Re.LO,type:Re.LO,nullable:Re.LO,hashCode:Re.Fl}),Wo(e.type),e))),Xo=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl,selfJoinPointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Zo=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl,selfJoinPointerHashCode:Re.Fl}),sa(e.ownerReference),e))),qo=Qn((e=>((0,Re.rC)(e,{relation:Re.LO,name:Re.LO,database:Re.LO,isSelfJoinTarget:Re.LO}),(e=>{e instanceof $o?Zo(e):e instanceof Vo&&Xo(e)})(e.relation),e))),Jo=Qn((e=>((0,Re.rC)(e,{name:Re.LO,parameters:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(rl),e))),Qo=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),el=Qn((e=>((0,Re.rC)(e,{alias:Re.LO,column:Re.LO,columnName:Re.LO,hashCode:Re.Fl}),qo(e.alias),Qo(e.column),e))),tl=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),sl=Qn((e=>((0,Re.rC)(e,{alias:Re.LO,children:Re.LO,joinType:Re.LO,hashCode:Re.Fl}),e.alias&&qo(e.alias),e.children.forEach(sl),tl(e.join),e))),il=Qn((e=>((0,Re.rC)(e,{relationalOperationElement:Re.LO,joinTreeNode:Re.LO,hashCode:Re.Fl}),e.relationalOperationElement&&rl(e.relationalOperationElement),e.joinTreeNode&&sl(e.joinTreeNode),e))),nl=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),e.value instanceof oo&&rl(e.value),e))),al=Qn((e=>((0,Re.rC)(e,{values:Re.LO,hashCode:Re.Fl}),e.values.forEach(nl),e)));function rl(e){return e instanceof ho?Jo(e):e instanceof _o?qo(e):e instanceof go?el(e):e instanceof To?Ko(e):e instanceof Eo?nl(e):e instanceof fo?al(e):e instanceof mo?il(e):e}const ol=Qn((e=>e)),ll=ea(((e,t)=>{if(e instanceof So)return ol(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),cl=Qn((e=>((0,Re.rC)(e,{columnName:Re.LO,relationalOperationElement:Re.LO,hashCode:Re.Fl}),rl(e.relationalOperationElement),e))),dl=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),hl=Qn((e=>((0,Re.rC)(e,{joinTreeNode:Re.LO,database:Re.LO,filterName:Re.LO,hashCode:Re.Fl}),e.joinTreeNode&&sl(e.joinTreeNode),dl(e.filter),e))),ul=Qn((e=>((0,Re.rC)(e,{columns:Re.LO}),e.columns.forEach(rl),e))),pl=e=>{(0,Re.rC)(e,{columns:Re.LO,name:Re.LO})},ml=ea(((e,t)=>(pl(e),(0,Re.rC)(e,{primaryKey:Re.LO,hashCode:Re.Fl}),e.primaryKey.forEach(Ko),e.milestoning.forEach((e=>ll(e,t))),e))),_l=ea(((e,t)=>(pl(e),(0,Re.rC)(e,{primaryKey:Re.LO,columnMappings:Re.LO,filter:Re.LO,distinct:Re.LO,groupBy:Re.LO,hashCode:Re.Fl}),e.primaryKey.forEach(Ko),e.columnMappings.forEach(cl),e.filter&&hl(e.filter),e.groupBy&&ul(e.groupBy),e))),gl=ea(((e,t)=>((0,Re.rC)(e,{name:Re.LO,tables:Re.LO,views:Re.LO,hashCode:Re.Fl}),e.tables.forEach((e=>ml(e,t))),e.views.forEach((e=>_l(e,t))),e))),El=Qn((e=>((0,Re.rC)(e,{name:Re.LO,operation:Re.LO,hashCode:Re.Fl}),rl(e.operation),e))),fl=Qn((e=>((0,Re.rC)(e,{name:Re.LO,target:Re.LO,aliases:Re.LO,operation:Re.LO,hashCode:Re.Fl}),e.target&&qo(e.target),rl(e.operation),e))),Tl=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{schemas:Re.LO,joins:Re.LO,filters:Re.LO,_elementHashCode:Re.KG}),e.schemas.forEach((e=>gl(e,t))),e.joins.forEach(fl),e.filters.forEach(El),e))),Cl=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,relationalOperation:Re.LO.ref,bindingTransformer:Re.LO,hashCode:Re.Fl}),e.bindingTransformer&&zo(e.bindingTransformer),e))),Sl=(e,t)=>(dd(e,t),sd(e,t),(0,Re.rC)(e,{id:Re.LO,rootInstanceSetImplementation:Re.LO,primaryKey:Re.LO}),e.primaryKey.forEach(rl),e),xl=ea(Sl),Nl=ea(((e,t)=>(Sl(e,t),(0,Re.rC)(e,{inlineSetImplementation:Re.LO}),Ed(e.inlineSetImplementation,t),e))),vl=ea(((e,t)=>(Sl(e,t),(0,Re.rC)(e,{otherwisePropertyMapping:Re.LO,hashCode:Re.Fl}),ad(e.otherwisePropertyMapping,t),e))),Al=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{primaryKey:Re.LO}),e.primaryKey.forEach(rl),e))),Il=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{columnMappings:Re.LO,filter:Re.LO,distinct:Re.LO,groupBy:Re.LO,mainTableAlias:Re.LO,superSetImplementationId:Re.LO,hashCode:Re.Fl}),e.columnMappings.forEach(cl),e.filter&&hl(e.filter),e.groupBy&&ul(e.groupBy),e.mainTableAlias&&qo(e.mainTableAlias),e))),Ol=Qn((e=>((0,Re.rC)(e,{data:Re.LO,inputType:Re.LO,hashCode:Re.Fl}),sa(e.database),e))),yl=Qn((e=>(0,Re.rC)(e,{host:Re.LO,port:Re.LO,databaseName:Re.LO,hashCode:Re.Fl}))),Rl=Qn((e=>(0,Re.rC)(e,{hostname:Re.LO,port:Re.LO,protocol:Re.LO,httpPath:Re.LO,hashCode:Re.Fl}))),wl=Qn((e=>(0,Re.rC)(e,{databaseName:Re.LO,directory:Re.LO,autoServerMode:Re.LO,hashCode:Re.Fl}))),Ll=Qn((e=>(0,Re.rC)(e,{testDataSetupCsv:Re.LO,testDataSetupSqls:Re.LO,hashCode:Re.Fl}))),Pl=Qn((e=>(0,Re.rC)(e,{accountName:Re.LO,region:Re.LO,warehouseName:Re.LO,databaseName:Re.LO,cloudType:Re.LO,quotedIdentifiersIgnoreCase:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,nonProxyHosts:Re.LO,organization:Re.LO,accountType:Re.LO,role:Re.LO,hashCode:Re.Fl}))),bl=Qn((e=>(0,Re.rC)(e,{databaseName:Re.LO,endpointURL:Re.LO,port:Re.LO,region:Re.LO,clusterID:Re.LO,host:Re.LO,hashCode:Re.Fl}))),Dl=Qn((e=>(0,Re.rC)(e,{projectId:Re.LO,defaultDataset:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,hashCode:Re.Fl}))),Ml=Qn((e=>(0,Re.rC)(e,{projectId:Re.LO,instanceId:Re.LO,databaseId:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,hashCode:Re.Fl}))),Fl=Qn((e=>(0,Re.rC)(e,{ssl:Re.LO,trustStorePathVaultReference:Re.LO,trustStorePasswordVaultReference:Re.LO,hashCode:Re.Fl}))),kl=Qn((e=>((0,Re.rC)(e,{host:Re.LO,port:Re.LO,catalog:Re.LO,schema:Re.LO,clientTags:Re.LO,hashCode:Re.Fl}),Fl(e.sslSpecification),e))),jl=Qn((e=>(0,Re.rC)(e,{serverPrincipal:Re.LO,hashCode:Re.Fl}))),Ul=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl}))),Gl=Qn((e=>(0,Re.rC)(e,{apiToken:Re.LO,hashCode:Re.Fl}))),Vl=Qn((e=>(0,Re.rC)(e,{oauthKey:Re.LO,scopeName:Re.LO,hashCode:Re.Fl}))),$l=Qn((e=>(0,Re.rC)(e,{privateKeyVaultReference:Re.LO,passPhraseVaultReference:Re.LO,publicUserName:Re.LO,hashCode:Re.Fl}))),Bl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl}))),zl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,userNameVaultReference:Re.LO,passwordVaultReference:Re.LO,baseVaultReference:Re.LO}))),Hl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,serviceAccountEmail:Re.LO,additionalGcpScopes:Re.LO}))),Yl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,vaultReference:Re.LO}))),Wl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,kerberosRemoteServiceName:Re.LO,kerberosUseCanonicalHostname:Re.LO}))),Kl=e=>{(0,Re.rC)(e,{from:Re.LO,to:Re.LO,hashCode:Re.Fl})},Xl=Qn((e=>(Kl(e),e))),Zl=Qn((e=>(Kl(e),(0,Re.rC)(e,{schema:Re.LO}),Xl(e.schema),e))),ql=ea(((e,t)=>((e=>{yd(e),(0,Re.rC)(e,{type:Re.LO,timeZone:Re.LO,quoteIdentifiers:Re.LO})})(e),(0,Re.rC)(e,{datasourceSpecification:Re.LO,authenticationStrategy:Re.LO,postProcessors:Re.LO,hashCode:Re.Fl}),((e,t)=>{if(e instanceof zr)return yl(e);if(e instanceof Hr)return Rl(e);if(e instanceof Yr)return wl(e);if(e instanceof Wr)return Ll(e);if(e instanceof Kr)return Pl(e);if(e instanceof Xr)return bl(e);if(e instanceof Zr)return Dl(e);if(e instanceof qr)return Ml(e);if(e instanceof Jr)return kl(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof br)return jl(e);if(e instanceof Dr)return Ul(e);if(e instanceof Mr)return Gl(e);if(e instanceof Fr)return Vl(e);if(e instanceof kr)return $l(e);if(e instanceof jr)return Bl(e);if(e instanceof Gr)return zl(e);if(e instanceof Ur)return Hl(e);if(e instanceof Vr)return Yl(e);if(e instanceof $r)return Wl(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof no)return(e=>((e=>{(0,Re.rC)(e,{hashCode:Re.Fl})})(e),(0,Re.rC)(e,{mappers:Re.LO}),e.mappers.forEach((e=>{(e=>{e instanceof to?Xl(e):e instanceof so&&Zl(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class Jl{id}class Ql extends Jl{__parent;assertions=[]}class ec extends Jl{__parent;tests=[]}class tc extends Ql{query;get hashCode(){return ra([Aa.MAPPING_TEST,this.query,this.id,ra(this.assertions)])}}class sc extends ec{mappingStoreTestDatas=[];get hashCode(){return ra([Aa.MAPPING_TEST_SUITE,ra(this.mappingStoreTestDatas),this.id,ra(this.tests)])}}class ic extends Ql{serializationFormat;parameters=[];keys=[];get hashCode(){return ra([Aa.SERVICE_TEST,this.id,ra(this.assertions),ra(this.parameters),ra(this.keys),this.serializationFormat??""])}}class nc extends ec{testData;get hashCode(){return ra([Aa.SERVICE_TEST_SUITE,this.id,ra(this.tests),this.testData])}}class ac{id;parentTest}class rc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO,this.id,Oa(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class oc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class lc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class cc{}class dc extends cc{dataElement;get hashCode(){return ra([Aa.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class hc extends cc{contentType;data;get hashCode(){return ra([Aa.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class uc extends cc{instances;get hashCode(){return ra([Aa.MODEL_STORE_DATA,ra(Array.from(this.instances.keys()).map((e=>e.path))),Oa(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class pc extends cc{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return ra([Aa.RELATIONAL_CSV_DATA_TABLE,ra(this.tables)])}}const mc=Qn((e=>((0,Re.rC)(e,{contentType:Re.LO,data:Re.LO,hashCode:Re.Fl}),e))),_c=Qn((e=>((0,Re.rC)(e,{dataElement:Re.LO,hashCode:Re.Fl}),e))),gc=Qn((e=>((0,Re.rC)(e,{instances:Re.LO,hashCode:Re.Fl}),e))),Ec=Qn((e=>((0,Re.rC)(e,{values:Re.LO,table:Re.LO,schema:Re.LO,hashCode:Re.Fl}),e))),fc=Qn((e=>((0,Re.rC)(e,{tables:Re.LO,hashCode:Re.Fl}),e.tables.forEach(Ec),e)));function Tc(e,t){if(e instanceof dc)return _c(e);if(e instanceof hc)return mc(e);if(e instanceof uc)return gc(e);if(e instanceof pc)return fc(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Cc=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{stereotypes:Re.LO,taggedValues:Re.LO,data:Re.LO,_elementHashCode:Re.KG}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),Tc(e.data,t),e)));class Sc{}class xc extends Sc{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return ra([Aa.SERVICE_PURE_EXECUTION,this.func])}}class Nc extends xc{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return ra([Aa.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class vc extends xc{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return ra([Aa.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,ra(this.executionParameters)])}}class Ac{_OWNER;constructor(e){this._OWNER=e}}class Ic extends Ac{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return ra([Aa.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,ra(this.asserts)])}}class Oc extends Ac{tests=[];get hashCode(){return ra([Aa.SERVICE_LEGACY_MULTI_EXECUTION_TEST,ra(this.tests)])}}const yc=ea(((e,t)=>((0,Re.rC)(e,{connectionId:Re.LO,testData:Re.LO,hashCode:Re.Fl}),Tc(e.testData,t),e))),Rc=Qn((e=>((0,Re.rC)(e,{name:Re.LO,value:Re.LO.ref,hashCode:Re.Fl}),e))),wc=Qn((e=>((0,Re.rC)(e,{assertion:Re.LO,hashCode:Re.Fl,id:Re.LO}),dr(e.assertion),e))),Lc=Qn((e=>((0,Re.rC)(e,{assertions:Re.LO,description:Re.LO,parameters:Re.LO,hashCode:Re.Fl}),e.assertions.forEach(wc),e.parameters.forEach(dr),e))),Pc=ea(((e,t)=>((0,Re.rC)(e,{connectionsTestData:Re.LO,hashCode:Re.Fl}),e.connectionsTestData.forEach((e=>yc(e,t))),e))),bc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,serializationFormat:Re.LO,assertions:Re.LO,parameters:Re.LO,keys:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(Rc),e.assertions.forEach(Kc),e))),Dc=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,tests:Re.LO,testData:Re.LO,hashCode:Re.Fl}),e.tests.forEach((e=>Wc(e,t))),Pc(e.testData,t),e))),Mc=Qn((e=>((0,Re.rC)(e,{parametersValues:Re.LO,assert:Re.LO,singleExecutionTestParent:Re.LO,hashCode:Re.Fl}),dr(e.assert),e))),Fc=Qn((e=>((0,Re.rC)(e,{data:Re.LO,asserts:Re.LO,hashCode:Re.Fl}),e.asserts.forEach(Mc),e))),kc=Qn((e=>(Fc(e),(0,Re.rC)(e,{key:Re.LO}),e))),jc=Qn((e=>((0,Re.rC)(e,{tests:Re.LO,hashCode:Re.Fl}),e.tests.forEach(kc),e))),Uc=e=>{(0,Re.rC)(e,{func:Re.LO}),dr(e.func)},Gc=ea(((e,t)=>(Uc(e),(0,Re.rC)(e,{runtime:Re.LO,hashCode:Re.Fl}),e.mapping&&sa(e.mapping),e.runtime&&Gd(e.runtime,t),e))),Vc=ea(((e,t)=>((0,Re.rC)(e,{key:Re.LO,runtime:Re.LO,hashCode:Re.Fl}),sa(e.mapping),Gd(e.runtime,t),e))),$c=ea(((e,t)=>(Uc(e),(0,Re.rC)(e,{executionKey:Re.LO,executionParameters:Re.LO,hashCode:Re.Fl}),e.executionParameters.forEach((e=>Vc(e,t))),e))),Bc=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{pattern:Re.LO,owners:Re.LO,documentation:Re.LO,autoActivateUpdates:Re.LO,execution:Re.LO,test:Re.LO,tests:Re.LO,postValidations:Re.LO,patternParameters:Re.Fl,_elementHashCode:Re.KG}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),((e,t)=>{e instanceof Nc?Gc(e,t):e instanceof vc&&$c(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Ic?Fc(e):e instanceof Oc&&jc(e)})(e.test),e.tests.forEach((e=>Dc(e,t))),e.postValidations.forEach((e=>Lc(e))),e))),zc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),e))),Hc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),mc(e.expected),e))),Yc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),mc(e.expected),e)));function Wc(e,t){if(e instanceof ic)return bc(e);if(e instanceof tc)return qc(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Kc(e){return e instanceof rc?zc(e):e instanceof oc?Yc(e):e instanceof lc?Hc(e):e}const Xc=e=>{ta(e),(0,Re.rC)(e,{includes:Re.LO}),e.includes.forEach(sa)},Zc=ea(((e,t)=>((0,Re.rC)(e,{store:Re.LO,data:Re.LO,hashCode:Re.Fl}),Tc(e.data,t),e))),qc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,query:Re.LO,assertions:Re.LO,hashCode:Re.Fl}),e.assertions.forEach(Kc),e))),Jc=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,tests:Re.LO,mappingStoreTestDatas:Re.LO,hashCode:Re.Fl}),e.tests.forEach((e=>Wc(e,t))),e.mappingStoreTestDatas.forEach((e=>Zc(e,t))),e))),Qc=Qn((e=>((0,Re.rC)(e,{value:Re.LO,valueForSerialization:Re.Fl}),sa(e.ownerReference),e))),ed=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),td=Qn((e=>((0,Re.rC)(e,{localMappingProperty:Re.LO,localMappingPropertyType:Re.LO,localMappingPropertyMultiplicity:Re.LO,hashCode:Re.Fl}),sa(e.localMappingPropertyType),e))),sd=(e,t)=>{(0,Re.rC)(e,{sourceSetImplementation:Re.LO,targetSetImplementation:Re.LO}),ch(e.property),ed(e.sourceSetImplementation),e.targetSetImplementation&&ed(e.targetSetImplementation),e.localMappingProperty&&td(e.localMappingProperty)},id=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,transform:Re.LO,explodeProperty:Re.LO,hashCode:Re.Fl}),e.transformer&&Qc(e.transformer),dr(e.transform),e)));class nd{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){id(e,this.observerContext)}visit_FlatDataPropertyMapping(e){Rr(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){yr(e,this.observerContext)}visit_RelationalPropertyMapping(e){Cl(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Tr(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){xl(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Nl(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){vl(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const ad=(e,t)=>(e.accept_PropertyMappingVisitor(new nd(t)),e),rd=Qn((e=>(0,Re.rC)(e,{isDefault:Re.Fl,valueForSerialization:Re.Fl}))),od=Qn((e=>(0,Re.rC)(e,{valueForSerialization:Re.Fl}))),ld=e=>{(0,Re.rC)(e,{root:Re.LO}),sa(e.class),rd(e.id),od(e.root)},cd=Qn((e=>((0,Re.rC)(e,{setImplementation:Re.LO,class:Re.LO,properties:Re.LO}),e))),dd=(e,t)=>{ld(e),(0,Re.rC)(e,{mappingClass:Re.LO,propertyMappings:Re.LO}),e.mappingClass&&cd(e.mappingClass),e.propertyMappings.forEach((e=>ad(e,t)))},hd=Qn((e=>((0,Re.rC)(e,{}),ed(e.setImplementation),e))),ud=e=>{ld(e),(0,Re.rC)(e,{parameters:Re.LO,operation:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(hd)},pd=Qn((e=>(ud(e),e))),md=Qn((e=>(ud(e),(0,Re.rC)(e,{validationFunction:Re.LO}),dr(e.validationFunction),e))),_d=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{filter:Re.LO,hashCode:Re.Fl}),e.srcClass&&sa(e.srcClass),e.filter&&dr(e.filter),e)));class gd{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){md(e)}visit_OperationSetImplementation(e){pd(e)}visit_PureInstanceSetImplementation(e){_d(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Or(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Al(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Il(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Ed=(e,t)=>(e.accept_SetImplementationVisitor(new gd(t)),e),fd=Qn((e=>((0,Re.rC)(e,{original:Re.LO,substitute:Re.LO}),sa(e.original),sa(e.substitute),e))),Td=Qn((e=>((0,Re.rC)(e,{included:Re.LO,storeSubstitutions:Re.LO}),sa(e.included),e.storeSubstitutions.forEach(fd),e))),Cd=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),Sd=Qn((e=>((0,Re.rC)(e,{sourceValues:Re.LO,hashCode:Re.Fl}),ih(e.enum),e.sourceValues.forEach(Cd),e))),xd=Qn((e=>((0,Re.rC)(e,{sourceType:Re.LO,enumValueMappings:Re.LO,hashCode:Re.Fl}),sa(e.enumeration),rd(e.id),e.sourceType&&sa(e.sourceType),e.enumValueMappings.forEach(Sd),e))),Nd=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,stores:Re.LO,propertyMappings:Re.LO,hashCode:Re.Fl}),sa(e.association),rd(e.id),e.stores.forEach(sa),e.propertyMappings.forEach((e=>ad(e,t))),e))),vd=Qn((e=>((0,Re.rC)(e,{inputType:Re.LO,data:Re.LO,hashCode:Re.Fl}),sa(e.sourceClass),e))),Ad=Qn((e=>(0,Re.rC)(e,{expectedOutput:Re.LO,hashCode:Re.Fl}))),Id=ea(((e,t)=>((0,Re.rC)(e,{name:Re.LO,query:Re.LO,inputData:Re.LO,assert:Re.LO,hashCode:Re.Fl}),dr(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof or)return vd(e);if(e instanceof ir)return wr(e);if(e instanceof lr)return Ol(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof Ja&&Ad(e)})(e.assert),e))),Od=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{includes:Re.LO,classMappings:Re.LO,enumerationMappings:Re.LO,associationMappings:Re.LO,test:Re.LO,tests:Re.LO,_elementHashCode:Re.KG}),e.includes.forEach(Td),e.classMappings.forEach((e=>Ed(e,t))),e.enumerationMappings.forEach(xd),e.associationMappings.forEach((e=>Nd(e,t))),e.test.forEach((e=>Id(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof nc?Dc(e,t):e instanceof sc?Jc(e,t):e}(e,t))),e))),yd=e=>{(0,Re.rC)(e,{store:Re.LO}),sa(e.store)},Rd=Qn((e=>(yd(e),(0,Re.rC)(e,{hashCode:Re.Fl}),e))),wd=Qn((e=>(yd(e),(0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),Ld=Qn((e=>(yd(e),(0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),Pd=Qn((e=>(yd(e),(0,Re.rC)(e,{mappings:Re.LO,hashCode:Re.Fl}),e.mappings.forEach(sa),e)));class bd{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){Rd(e)}visit_ModelChainConnection(e){Pd(e)}visit_JsonModelConnection(e){wd(e)}visit_XmlModelConnection(e){Ld(e)}visit_FlatDataConnection(e){Lr(e)}visit_RelationalDatabaseConnection(e){ql(e,this.observerContext)}}const Dd=(e,t)=>(e.accept_ConnectionVisitor(new bd(t)),e),Md=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{connectionValue:Re.LO,_elementHashCode:Re.KG}),Dd(e.connectionValue,t),e))),Fd=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,connection:Re.LO,hashCode:Re.Fl}),Dd(e.connection,t),e))),kd=ea(((e,t)=>((0,Re.rC)(e,{storeConnections:Re.LO,hashCode:Re.Fl}),sa(e.store),e.storeConnections.forEach((e=>Fd(e,t))),e))),jd=ea(((e,t)=>((0,Re.rC)(e,{mappings:Re.LO,connections:Re.LO,hashCode:Re.Fl}),e.mappings.forEach(sa),e.connections.forEach((e=>kd(e,t))),e))),Ud=Qn((e=>((0,Re.rC)(e,{hashCode:Re.Fl}),sa(e.packageableRuntime),e))),Gd=(e,t)=>e instanceof tr?Ud(e):e instanceof er?jd(e,t):e,Vd=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{runtimeValue:Re.LO,_elementHashCode:Re.KG}),jd(e.runtimeValue,t),e))),$d=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{_elementHashCode:Re.KG}),e)));class Bd{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){Hd(e,this.observerContext)}visit_SectionIndex(e){Jd(e)}visit_PrimitiveType(e){}visit_Profile(e){th(e)}visit_Enumeration(e){nh(e)}visit_Measure(e){rh(e)}visit_Class(e){hh(e)}visit_Association(e){uh(e)}visit_ConcreteFunctionDefinition(e){ph(e)}visit_FlatData(e){Ar(e)}visit_Database(e){Tl(e,this.observerContext)}visit_Mapping(e){Od(e,this.observerContext)}visit_Service(e){Bc(e,this.observerContext)}visit_ExecutionEnvironmentInstance(e){$d(e,this.observerContext)}visit_PackageableRuntime(e){Vd(e,this.observerContext)}visit_PackageableConnection(e){Md(e,this.observerContext)}visit_FileGenerationSpecification(e){Ka(e)}visit_GenerationSpecification(e){Za(e)}visit_DataElement(e){Cc(e,this.observerContext)}}const zd=ea(((e,t)=>(e.accept_PackageableElementVisitor(new Bd(t)),e))),Hd=ea(((e,t)=>((e=>{ta(e),(0,Re.rC)(e,{children:Re.LO,hashCode:Re.KG})})(e),e.children.forEach((e=>{e instanceof Ua?Hd(e,t):zd(e,t)})),e))),Yd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Wd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),e))),Kd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),Wd(e.tag),e))),Xd=Qn((e=>(0,Re.rC)(e,{rawType:Re.LO}))),Zd=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),Xd(e.value),sa(e.ownerReference),e))),qd=Qn((e=>((0,Re.rC)(e,{parserName:Re.LO,elements:Re.LO}),e instanceof Va?(0,Re.rC)(e,{imports:Re.LO,hashCode:Re.Fl}):e instanceof $a&&(0,Re.rC)(e,{hashCode:Re.Fl}),e))),Jd=Qn((e=>(ta(e),(0,Re.rC)(e,{sections:Re.LO,_elementHashCode:Re.KG}),e.sections.forEach(qd),e))),Qd=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),eh=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),th=Qn((e=>(ta(e),(0,Re.rC)(e,{p_stereotypes:Re.LO,p_tags:Re.LO,_elementHashCode:Re.KG}),e.p_stereotypes.forEach(Qd),e.p_tags.forEach(eh),e))),sh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,hashCode:Re.Fl}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ih=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),nh=Qn((e=>(ta(e),(0,Re.rC)(e,{values:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,_elementHashCode:Re.KG}),e.values.forEach(sh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ah=Qn((e=>((0,Re.rC)(e,{measure:Re.LO,conversionFunction:Re.LO,hashCode:Re.Fl}),e.conversionFunction&&dr(e.conversionFunction),e))),rh=Qn((e=>(ta(e),(0,Re.rC)(e,{canonicalUnit:Re.LO,nonCanonicalUnits:Re.LO,_elementHashCode:Re.KG}),e.canonicalUnit&&ah(e.canonicalUnit),e.nonCanonicalUnits.forEach(ah),e))),oh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,hashCode:Re.Fl}),Zd(e.genericType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),lh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,body:Re.LO.ref,parameters:Re.LO.ref,hashCode:Re.Fl}),Zd(e.genericType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ch=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),dh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,functionDefinition:Re.LO,externalId:Re.LO,enforcementLevel:Re.LO,messageFunction:Re.LO,hashCode:Re.Fl}),dr(e.functionDefinition),e.messageFunction&&dr(e.messageFunction),e))),hh=Qn((e=>(ta(e),(0,Re.rC)(e,{_subclasses:Re.LO,properties:Re.LO,propertiesFromAssociations:Re.LO,derivedProperties:Re.LO,generalizations:Re.LO,constraints:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,dispose:Re.KG,_elementHashCode:Re.KG}),e.properties.forEach(oh),e.propertiesFromAssociations.forEach(oh),e.derivedProperties.forEach(lh),e.generalizations.forEach(Zd),e.constraints.forEach(dh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),uh=Qn((e=>(ta(e),(0,Re.rC)(e,{properties:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,derivedProperties:Re.LO,dispose:Re.KG,_elementHashCode:Re.KG}),e.properties.forEach(oh),e.derivedProperties.forEach(lh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ph=Qn((e=>(ta(e),(0,Re.rC)(e,{functionName:Re.LO,returnMultiplicity:Re.LO,parameters:Re.LO.shallow,expressionSequence:Re.LO.ref,stereotypes:Re.LO,taggedValues:Re.LO,_elementHashCode:Re.KG}),e.parameters.forEach(hr),sa(e.returnType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),mh=Qn((e=>e instanceof Fa?nh(e):e instanceof ka?ah(e):e instanceof Da?hh(e):e instanceof ja?rh(e):e)),_h=(Qn((e=>e instanceof Fa?nh(e):e instanceof ka?ah(e):e)),Qn((e=>(0,Re.rC)(e,{_dummyObservable:Re.LO})))),gh=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),Eh=Qn((e=>(_h(e),(0,Re.rC)(e,{id:Re.LO,hideProperties:Re.LO,hideTaggedValues:Re.LO,hideStereotypes:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),fh=Qn((e=>(gh(e.classView),e))),Th=Qn((e=>((0,Re.rC)(e,{path:Re.LO,pathForSerialization:Re.Fl}),fh(e.from),fh(e.to),e))),Ch=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),e))),Sh=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),ch(e.property),sa(e.association),e))),xh=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),ch(e.property),e))),Nh=Qn((e=>(ta(e),(0,Re.rC)(e,{classViews:Re.LO,associationViews:Re.LO,generalizationViews:Re.LO,propertyViews:Re.LO,_elementHashCode:Re.KG}),e.classViews.forEach(Eh),e.associationViews.forEach(Sh),e.generalizationViews.forEach(Ch),e.propertyViews.forEach(xh),e)));var vh;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(vh=vh||(vh={}));class Ah extends Pa{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return ra([vh.DIAGRAM,this.path,ra(this.classViews),ra(this.generalizationViews),ra(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Ih extends Jn{constructor(){super(qn.Rw.LW,qn.i8)}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Ah)return Nh(e)}]}}class Oh{package;name;get path(){return`${this.package}${oa}${this.name}`}get hashCode(){return ra([Aa.PACKAGEABLE_ELEMENT,this.path])}}class yh extends Oh{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return ra([vh.DIAGRAM,this.path,ra(this.classViews),ra(this.generalizationViews),ra(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Rh{rectangle;position;get hashCode(){return ra([vh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class wh extends Rh{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return ra([vh.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Lh{x;y;get hashCode(){return ra([vh.POINT,this.x.toString(),this.y.toString()])}}class Ph{width;height;get hashCode(){return ra([vh.RECTANGLE,this.width.toString(),this.height.toString()])}}class bh{points=[]}class Dh{sourceView;targetView;line;get hashCode(){return ra([vh.RELATIONSHIP_VIEW,this.sourceView,this.targetView,ra(this.line.points)])}}class Mh extends Dh{property;get hashCode(){return ra([vh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class Fh extends Mh{get hashCode(){return ra([vh.PROPERTY_VIEW,super.hashCode])}}class kh extends Dh{get hashCode(){return ra([vh.GENERALIZATION_VIEW,super.hashCode])}}class jh{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return ra([Aa.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new jh(0,0);static ZERO_ONE=new jh(0,1);static ZERO_MANY=new jh(0,void 0);static ONE=new jh(1,1);static ONE_MANY=new jh(1,void 0)}new ge((0,_e.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)()})),(0,_e.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return ra([Aa.PACKAGEABLE_ELEMENT_POINTER,this.type??"",this.path])}},{path:(0,_e.Ru)(),type:(0,_e.jt)((0,_e.Ru)())});const Uh=(0,_e.yu)(jh,{lowerBound:(0,_e.Ru)(),upperBound:(0,_e.jt)((0,_e.Ru)())});class Gh{class;property;get hashCode(){return ra([Aa.PROPERTY_POINTER,this.property,this.class??""])}}class Vh{}class $h{queryTimeOutInSeconds=null;enableConstraints=!0}var Bh,zh;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(Bh||(Bh={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(zh=zh||(zh={})),(0,_e.yu)(class extends $h{},{_type:fe(Bh.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,_e.Ru)(),enableConstraints:(0,_e.Ru)()});const Hh=(0,_e.yu)(class extends Vh{body;parameters;get hashCode(){return ra([Aa.RAW_LAMBDA,ya(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:fe(zh.LAMBDA),body:(0,_e.LZ)(),parameters:(0,_e.LZ)()}),Yh=(0,_e.yu)(class extends Vh{class;name;multiplicity;get hashCode(){return ra([Aa.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:fe(zh.VARIABLE),class:(0,_e.Ru)(),multiplicity:Ee(Uh),name:(0,_e.Ru)()});(0,_e.yu)(class extends Vh{multiplicity=jh.ONE;type;value;get hashCode(){return ra([Aa.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,_e.bm)("_type",(0,_e.PG)((e=>{switch(e){case ha.INTEGER:return zh.CINTEGER;case ha.DECIMAL:return zh.CDECIMAL;case ha.STRING:return zh.CSTRING;case ha.BOOLEAN:return zh.CBOOLEAN;case ha.FLOAT:return zh.CFLOAT;case ha.DATETIME:return zh.CDATETIME;case ha.STRICTDATE:return zh.CSTRICTDATE;case ha.STRICTTIME:return zh.CSTRICTTIME;case ha.LATESTDATE:return zh.CLATESTDATE;default:throw new D(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case zh.CINTEGER:return ha.INTEGER;case zh.CDECIMAL:return ha.DECIMAL;case zh.CSTRING:return ha.STRING;case zh.CBOOLEAN:return ha.BOOLEAN;case zh.CFLOAT:return ha.FLOAT;case zh.CDATETIME:return ha.DATETIME;case zh.CSTRICTDATE:return ha.STRICTDATE;case zh.CSTRICTTIME:return ha.STRICTTIME;case zh.CLATESTDATE:return ha.LATESTDATE;default:throw new D(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,_e.jt)((0,_e.Ru)())});const Wh=(0,_e.yu)(Gh,{class:(0,_e.jt)((0,_e.Ru)()),property:(0,_e.Ru)()}),Kh=(0,_e.yu)(class{profile;value;get hashCode(){return ra([Aa.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,_e.Ru)(),value:(0,_e.Ru)()}),Xh=(0,_e.yu)(class{profile;value;get hashCode(){return ra([Aa.TAG_POINTER,this.value,this.profile])}},{profile:(0,_e.Ru)(),value:(0,_e.Ru)()}),Zh=(0,_e.yu)(class{tag;value;get hashCode(){return ra([Aa.TAGGED_VALUE,this.tag,this.value])}},{tag:Ee(Xh),value:(0,_e.Ru)()}),qh=((0,_e.yu)(class extends Oh{stereotypes=[];tags=[];get hashCode(){return ra([Aa.PROFILE,this.path,ra(this.stereotypes),ra(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:fe("profile"),name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ru)()),tags:(0,_e.pb)((0,_e.Ru)())}),(0,_e.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ENUM_VALUE,this.value,ra(this.stereotypes),ra(this.taggedValues)])}},{stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),value:(0,_e.Ru)()})),Jh=((0,_e.yu)(class extends Oh{values=[];stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ENUMERATION,this.path,ra(this.values),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:fe("Enumeration"),name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),values:(0,_e.pb)(Ee(qh))}),(0,_e.yu)(class extends Oh{measure;conversionFunction;get hashCode(){return ra([Aa.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new D}},{_type:fe("unit"),conversionFunction:(0,_e.jt)(Ee(Hh)),measure:(0,_e.Ru)(),name:(0,_e.Ru)(),package:(0,_e.Ru)()})),Qh=((0,_e.yu)(class extends Oh{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return ra([Aa.MEASURE,this.path,this.canonicalUnit??"",ra(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:fe("measure"),canonicalUnit:(0,_e.jt)(Ee(Jh)),name:(0,_e.Ru)(),nonCanonicalUnits:(0,_e.pb)(Ee(Jh)),package:(0,_e.Ru)()}),(0,_e.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",ra(this.stereotypes),ra(this.taggedValues)])}},{aggregation:(0,_e.jt)((0,_e.Ru)()),multiplicity:Ee(Uh),name:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),type:(0,_e.Ru)()})),eu=(0,_e.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return ra([Aa.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,ra(this.stereotypes),ra(this.taggedValues),ya(this.parameters,this.body)])}},{body:(0,_e.LZ)(),name:(0,_e.Ru)(),parameters:(0,_e.LZ)(),returnMultiplicity:Ee(Uh),returnType:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),tu=(0,_e.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return ra([Aa.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,_e.jt)((0,_e.Ru)()),externalId:(0,_e.jt)((0,_e.Ru)()),functionDefinition:Ee(Hh),messageFunction:(0,_e.jt)(Ee(Hh)),name:(0,_e.Ru)()});var su;(0,_e.yu)(class extends Oh{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return ra([Aa.CLASS,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.superTypes),ra(this.constraints),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:fe("class"),constraints:Se(tu,{INTERNAL__forceReturnEmptyInTest:!0}),name:(0,_e.Ru)(),originalMilestonedProperties:xe((()=>_e.AM),(()=>_e.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,_e.Ru)(),properties:Se(Qh,{INTERNAL__forceReturnEmptyInTest:!0}),derivedProperties:(0,_e.bm)("qualifiedProperties",Se(eu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),superTypes:(su={INTERNAL__forceReturnEmptyInTest:!0},xe((e=>e),(e=>e),su)),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,_e.yu)(class extends Oh{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ASSOCIATION,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:fe("association"),name:(0,_e.Ru)(),originalMilestonedProperties:xe((()=>_e.AM),(()=>_e.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,_e.Ru)(),properties:(0,_e.pb)(Ee(Qh)),derivedProperties:(0,_e.bm)("qualifiedProperties",Se(eu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,_e.yu)(class extends Oh{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return ra([Aa.FUNCTION,this.path,ra(this.parameters),this.returnType,ra(this.taggedValues),ra(this.stereotypes),ya(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:fe("function"),body:(0,_e.pb)((0,_e.LZ)()),name:(0,_e.Ru)(),package:(0,_e.Ru)(),parameters:(0,_e.pb)(Ee(Yh)),postConstraints:(0,_e.pb)((0,_e.Ru)()),preConstraints:(0,_e.pb)((0,_e.Ru)()),returnMultiplicity:Ee(Uh),returnType:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})});const iu="diagram",nu=(0,_e.yu)(Lh,{x:(0,_e.Ru)(),y:(0,_e.Ru)()}),au=(0,_e.yu)(Ph,{height:(0,_e.Ru)(),width:(0,_e.Ru)()}),ru=(0,_e.yu)(bh,{points:(0,_e.pb)(Ee(nu))}),ou=(0,_e.yu)(wh,{class:(0,_e.Ru)(),hideProperties:(0,_e.jt)((0,_e.Ru)()),hideStereotypes:(0,_e.jt)((0,_e.Ru)()),hideTaggedValues:(0,_e.jt)((0,_e.Ru)()),id:(0,_e.Ru)(),position:Ee(nu),rectangle:Ee(au)}),lu=(0,_e.yu)(Fh,{line:Ee(ru),property:Ee(Wh),sourceView:(0,_e.Ru)(),targetView:(0,_e.Ru)()}),cu=(0,_e.yu)(kh,{line:Ee(ru),sourceView:(0,_e.Ru)(),targetView:(0,_e.Ru)()}),du=(0,_e.yu)(yh,{_type:fe(iu),classViews:(0,_e.pb)(Ee(ou)),generalizationViews:(0,_e.pb)(Ee(cu)),name:(0,_e.Ru)(),package:(0,_e.Ru)(),propertyViews:(0,_e.pb)(Ee(lu))});class hu extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var uu=s(95903);const pu=e=>G((0,uu.Z)(e.split(oa))),mu=e=>{const t=e.lastIndexOf(oa);return-1===t?void 0:e.substring(0,t)},_u=(e,t)=>{const s=e.lastIndexOf(oa);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+2,e.length)]},gu=(e,t)=>`${e?`${e}${oa}`:""}${t}`,Eu=(e,t)=>{e.children.push(t),t.package=e},fu=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Tu=(e,t,s,i)=>{const n=t.indexOf(oa),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof Ua&&e.name===a)),!r){if(!s)throw new k(`Can't find child package '${a}' in package '${e.path}'`);Y(!ca.includes(a),`Can't create package with reserved name '${a}'`),r=new Ua(a),r.package=e,e.children.push(r)}return i&&i.set(gu(e.path,a),r),-1!==n?Tu(r,t.substring(n+2),s,i):r},Cu=(e,t,s,i)=>{if(i){const n=i.get(gu(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=gu(e.path,a),r=i.get(n);if(r)return Tu(r,t.substring(a.length+2,t.length),s,i);const o=a.lastIndexOf(oa);a=-1!==o?a.substring(0,o):""}}return Tu(e,t,s,i)},Su=(e,t,s)=>(z(t,"Package path is required"),Cu(e.root,t,!0,s)),xu=(e,t)=>B(e.rawType,t),Nu=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=xu(e.value,Da);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},vu=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Au=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Iu=(e,t)=>`${G(e,"Package path is required")}${oa}${G(t,"Name is required")}`;class Ou{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){z(e.package,"Element 'package' field is missing or empty"),z(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new k(`Element '${e}' already exists`);s.add(e)}else Y(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Iu(e.package,e.name),t,i);const n=this.firstPass(e,t);return Eu(Su(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const yu=e=>e.classView.value.id,Ru=e=>{const t=new Fh,s=new bh;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new Gh;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=yu(e.from),t.targetView=yu(e.to),t},wu=e=>{const t=new kh,s=new bh;return s.points=e.pathForSerialization,t.line=s,t.sourceView=yu(e.from),t.targetView=yu(e.to),t},Lu=e=>{const t=new wh;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new Lh;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Ph;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Pu{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return ra([vh.POINT,this.x.toString(),this.y.toString()])}}class bu{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return ra([vh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Du{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Pu(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new Du(new Pu(e.position.x+e.rectangle.width,e.position.y),new bu(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Du(new Pu(e.position.x,e.position.y+e.rectangle.height),new bu(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,ra([vh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Mu extends Du{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Pu(0,0),new bu(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return ra([vh.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Fu{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class ku extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ju extends ku{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ju(e)}}class Uu{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new Fu(ju.create(t)),this.to=new Fu(ju.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new Pu(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Pu(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{Y(Boolean(e.length),"Path requires at least 1 point");let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];const o=e.slice(i-1,a+2);return o.length<2?[n,r]:o};get pathForSerialization(){return Uu.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return ra([vh.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,ra(this.pathForSerialization)])}}class Gu extends Uu{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return ra([vh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class Vu extends Gu{get hashCode(){return ra([vh.PROPERTY_VIEW,super.hashCode])}}class $u extends Uu{get hashCode(){return ra([vh.GENERALIZATION_VIEW,super.hashCode])}}class Bu{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new Bu(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new Bu(this.x/e,this.y/e)}normal(e){return new Bu(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const zu=e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new Pu(t,s)},Hu=(e,t)=>e.classViews.find((e=>e.id===t)),Yu=(e,t)=>{e.path=t},Wu=e=>{const t=e.buildFullPath(),s=Uu.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=G(s[0],"Diagram path expected to have at least 2 points").x-t.x,e.from._offsetY=G(s[0],"Diagram path expected to have at least 2 points").y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=Bu.fromPoints(s[e+1],s[e]).unit(),n=Bu.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}Yu(e,i)},Ku=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),Xu=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Zu=e=>new Pu(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),qu=e=>{const t=Zu(e);return new Du(new Pu(t.x-5,t.y-5),new bu(10,10))},Ju=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Qu=e=>{const t=G(e.x,"Point 'x' coordinate is missing"),s=G(e.y,"Point 'y' coordinate is missing");return new Pu(t,s)};class ep extends hu{constructor(){super(qn.Rw.zE,qn.i8)}V1_getExtraElementBuilders(){return[new Ou({elementClassName:"Diagram",_class:yh,firstPass:(e,t)=>{$(e,yh);const s=new Ah(e.name),i=Iu(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Ah),s},secondPass:(e,t)=>{$(e,yh);const s=(i=Iu(e.package,e.name),n=t.currentSubGraph,G(n.getOwnNullableExtensionElement(i,Ah),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{z(e.class,"Class view 'class' field is missing or empty"),z(e.id,"Class view 'id' field is missing or empty"),U(e.rectangle,"Class view 'rectangle' field is missing"),U(e.position,"Class view 'position' field is missing");const i=new Mu(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=G(e.width,"Rectangle 'width' is missing"),s=G(e.height,"Rectangle 'height' is missing");return new bu(t,s)})(e.rectangle),i.position=Qu(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{U(e.property,"Property view 'property' field is missing"),U(e.line,"Property view 'line' field is missing");const i=G(Hu(s,G(e.sourceView)),"Property view 'sourceView' field is missing"),n=G(Hu(s,G(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new Vu(s,a,i,n);r.path=e.line.points.map((e=>Qu(e)));try{Wu(r)}catch(e){M(e),t.logService.warn(h.create(e.message))}return r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t,s)=>{U(e.line,"Generalization view 'line' field is missing");const i=G(Hu(t,G(e.sourceView)),"Generalization view 'sourceView' field is missing"),n=G(Hu(t,G(e.targetView)),"Generalization view 'targetView' field is missing"),a=new $u(t,i,n);a.path=e.line.points.map((e=>Qu(e)));try{Wu(a)}catch(e){M(e),s.logService.warn(h.create(e.message))}return a})(e,s,t)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof yh)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof yh)return(0,_e.qC)(du,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===iu)return(0,_e.vB)(du,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Ah)return(e=>{const t=new yh;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Lu),t.generalizationViews=e.generalizationViews.map(wu),t.propertyViews=e.propertyViews.map(Ru),t})(e)}]}}class tp extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class sp extends tp{constructor(){super(qn.Rw.f1,qn.i8)}getExtraPureGraphExtensionClasses(){return[Ah]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Ah).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Da?vu(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>w(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>w(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>w(e.generalizationViews,t)))})(t,e)))}]}}class ip extends c{constructor(){super(qn.Rw.NA,qn.i8,[new sp,new Ih,new ep])}}var np,ap=s(40979),rp=s(74926);class op{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,Re.rC)(this,{_isNavigationBlocked:Re.LO,isNavigationBlocked:Re.Fl,blockNavigation:Re.aD,unblockNavigation:Re.aD}),this.historyAPI=e}get window(){return G(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}updateCurrentLocation(e){this.historyAPI.push(e)}updateCurrentZone(e){this.window.location.hash="#"+e}resetZone(){this.updateCurrentLocation(this.getCurrentLocation())}getCurrentBaseAddress(e){return e?.withAppRoot?this.generateAddress(""):this.window.location.origin}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}getCurrentLocationParameters(){const e={},t=((e,t=!1)=>t?Q.Z.parseUrl(e).query:Q.Z.parse(e))((s=this.getCurrentAddress(),(0,ee.N)(s)),!0);var s;return Object.keys(t).forEach((s=>{e[s]=((e,t)=>{const s=t[e];return s?decodeURIComponent(s):void 0})(s,t)})),e}getCurrentLocationParameterValue(e){return this.getCurrentLocationParameters()[e]}getCurrentZone(){return this.window.location.hash.substring(1)}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}INTERNAL__internalizeTransientParameter(e){const t=this.getCurrentZone(),s=this.getCurrentLocationParameters();var i,n;delete s[e],this.updateCurrentLocation((i=this.getCurrentLocation(),n=(e=>{const t={};return Object.entries(e).forEach((([e,s])=>{s&&(t[e]=s.toString())})),Q.Z.stringify(t)})(s),n?`${i}?${n}`:i)),this.updateCurrentZone(t)}}class lp{applicationStore;constructor(e){this.applicationStore=e}async initialize(){}}!function(e){e.INITIAL_COLOR_THEME="initialColorTheme"}(np=np||(np={}));class cp extends lp{navigator;constructor(e,t){super(e),this.navigator=new op(t.historyAPI)}getNavigator(){return this.navigator}async initialize(){const e=this.applicationStore.navigationService.navigator.getCurrentLocationParameterValue(np.INITIAL_COLOR_THEME);e&&(this.applicationStore.layoutService.setColorTheme(e),this.applicationStore.navigationService.navigator.INTERNAL__internalizeTransientParameter(np.INITIAL_COLOR_THEME))}}const dp=(0,kt.createContext)(void 0),hp=({children:e})=>{const t=Ut(),s=(0,ap.k6)(),i=(0,Nt.fv)((()=>new cp(t,{historyAPI:s})));return(0,T.jsx)(dp.Provider,{value:i,children:e})},up=({children:e,baseUrl:t})=>(0,T.jsx)(rp.VK,{basename:t,children:(0,T.jsx)(hp,{children:e})}),pp="/welcome.pure",mp="/",_p="::";var gp,Ep,fp,Tp;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(gp=gp||(gp={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Ep=Ep||(Ep={})),function(e){e.LEGEND="legend",e.TEMPORARY__VSCODE_LIGHT="vs"}(fp=fp||(fp={})),function(e){e.TEXT="plaintext",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql",e.XML="xml",e.YAML="yaml",e.GRAPHQL="graphql"}(Tp=Tp||(Tp={}));var Cp=s(90361);const Sp=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},xp="dummy_problem_marker_owner";var Np;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.TAG="Tag",e.STEREOTYPE="Stereotype",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(Np=Np||(Np={}));class vp{pureId;pureType;pureName;get id(){return this.pureId}}class Ap extends vp{deprecated}(0,_e.yu)(Ap,{pureId:(0,_e.Ru)(),pureType:(0,_e.Ru)(),deprecated:(0,_e.Ru)()});class Ip extends vp{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,_e.yu)(Ip,{pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),pureType:(0,_e.Ru)(),RO:(0,_e.Ru)(),classPath:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class Op extends vp{RO;notpublic;user;file;line;column}(0,_e.yu)(Op,{pureId:(0,_e.Ru)(),pureName:(0,_e.jt)((0,_e.Ru)()),pureType:(0,_e.Ru)(),RO:(0,_e.Ru)(),notpublic:(0,_e.Ru)(),user:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class yp{li_attr;id;text;icon;children;state;getNodeAttribute(e){return B(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,_e.yu)(yp,{li_attr:(0,_e.PG)((()=>_e.AM),(e=>e.classPath?(0,_e.vB)(Ip,e):e.file?(0,_e.vB)(Op,e):(0,_e.vB)(Ap,e))),id:(0,_e.Ru)(),text:(0,_e.Ru)(),icon:(0,_e.Ru)(),children:(0,_e.Ru)(),state:(0,_e.Ru)()});const Rp=e=>e.startsWith("/")?e.substring(1,e.length):e;class wp{content;RO;constructor(){(0,Re.rC)(this,{content:Re.LO,hashCode:Re.Fl,setContent:Re.aD})}setContent(e){this.content=e}get hashCode(){return aa(this.content)}}(0,_e.yu)(wp,{content:(0,_e.Ru)(),RO:(0,_e.Ru)()});class Lp{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Pp extends Lp{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var bp;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(bp=bp||(bp={}));const Dp=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Mp{source;line;column;startLine;startColumn;endLine;endColumn}(0,_e.yu)(Mp,{source:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)()});class Fp{first;second}(0,_e.yu)(Fp,{first:(0,_e.Ru)(),second:(0,_e.pb)((0,_e.Ry)(Mp))});class kp{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class jp{currentTab;tabs=[];constructor(){(0,Re.rC)(this,{currentTab:Re.LO,tabs:Re.LO,setCurrentTab:Re.aD,closeTab:Re.aD,closeAllTabs:Re.aD,closeAllOtherTabs:Re.aD,openTab:Re.aD,swapTabs:Re.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){U(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){R(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(Y(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class Up extends kp{ideStore;constructor(e){super(),this.ideStore=e}}class Gp extends jp{ideStore;constructor(e){super(),this.ideStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof Zp&&e.hasChanged?this.ideStore.applicationStore.alertService.setActionAlertInfo({message:"Unsaved changes will be lost if you continue. Do you still want to proceed?",prompt:"To save changes, abort and compile",type:Dt.CAUTION,actions:[{label:"Proceed",type:Mt.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.ideStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.ideStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]}):super.closeTab(e)}}var Vp;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_TERMINAL_PANEL="editor.toggle-terminal-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests"}(Vp=Vp||(Vp={}));const $p={[Vp.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Vp.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Vp.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Vp.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Vp.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Vp.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Vp.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Vp.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Vp.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Bp;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(Bp=Bp||(Bp={}));const zp={[Bp.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Bp.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Bp.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Bp.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Hp;!function(e){e.TOGGLE_TEXT_WRAP="editor.file-editor.toggle-text-wrap",e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage",e.RENAME_CONCEPT="editor.file-editor.rename-concept",e.GO_TO_LINE="editor.file-editor.go-to-line",e.DELETE_LINE="editor.file-editor.delete-line"}(Hp=Hp||(Hp={}));const Yp={[Hp.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Hp.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Hp.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Hp.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Hp.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Hp.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Hp.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Hp.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var Wp;!function(e){e.GO="go",e.TEST="test",e.REMOVE="rm",e.MOVE="mv",e.NEW_DIRECTORY="mkdir",e.NEW_FILE="touch",e.OPEN_FILE="open",e.OPEN_DIRECTORY="cd",e.LIST_DIRECTORY="ls",e.WELCOME="welcome",e.ECHO="echo",e.CLEAR="clear",e.ANSI="ansi",e.HELP="help"}(Wp=Wp||(Wp={}));class Kp{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,Re.rC)(this,{viewState:Re.LO.ref,editor:Re.LO.ref,_dummyCursorObservable:Re.LO.ref,forcedCursorPosition:Re.LO.ref,wrapText:Re.LO,cursorObserver:Re.Fl,notifyCursorObserver:Re.aD,setViewState:Re.aD,setEditor:Re.aD,setForcedCursorPosition:Re.aD,setWrapText:Re.aD}),this.language=(e=>{switch(I(e.split("."))){case"pure":return Tp.PURE;case"java":return Tp.JAVA;case"md":return Tp.MARKDOWN;case"sql":return Tp.SQL;case"json":return Tp.JSON;case"xml":return Tp.XML;case"yml":case"yaml":return Tp.YAML;case"graphql":return Tp.GRAPHQL;default:return Tp.TEXT}})(e.filePath),this.model=Cp.editor.createModel(e.uuid,this.language),this.model.setValue(e.file.content)}notifyCursorObserver(){this._dummyCursorObservable={}}get cursorObserver(){return this._dummyCursorObservable,this.editor?{position:this.editor.getPosition()??void 0,selection:this.editor.getSelection()??void 0}:void 0}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class Xp{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class Zp extends Up{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,Re.rC)(this,{_currentHashCode:Re.LO,file:Re.LO,renameConceptState:Re.LO,showGoToLinePrompt:Re.LO,hasChanged:Re.Fl,resetChangeDetection:Re.aD,setFile:Re.aD,setShowGoToLinePrompt:Re.aD,setConceptToRenameState:Re.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new Kp(this)}get label(){return Rp(this.filePath)}get description(){return`File: ${Rp(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return G(I(this.filePath.split("/")))}match(e){return e instanceof Zp&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}get hasChanged(){return this._currentHashCode!==this.file.hashCode}resetChangeDetection(){this._currentHashCode=this.file.hashCode}setFile(e){this.file=e,this.textEditorState.model.setValue(e.content),this.resetChangeDetection()}setShowGoToLinePrompt(e){this.showGoToLinePrompt=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);if(this.hasChanged)return void this.ideStore.applicationStore.notificationService.notifyWarning("Can't rename concept: source is not compiled");const t=yield this.ideStore.getConceptInfo(e);this.renameConceptState=t?new Xp(this,t,e):void 0}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,Cp.editor.setModelMarkers(t,i??xp,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:Cp.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,Cp.editor.removeAllMarkers(e??xp)}registerCommands(){this.textEditorState.language===Tp.PURE&&(this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_TO_DEFINITION,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,Re.fl)(this.ideStore.executeNavigation(new Lp(this.filePath,e.lineNumber,e.column))).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_BACK,action:()=>{(0,Re.fl)(this.ideStore.navigateBack()).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.REVEAL_CONCEPT_IN_TREE,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.ideStore.revealConceptInTree(new Lp(this.filePath,e.lineNumber,e.column)).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.FIND_USAGES,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Lp(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.RENAME_CONCEPT,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){if(!this.textEditorState.model.getWordAtPosition(e))return;const t=new Lp(this.filePath,e.lineNumber,e.column);(0,Re.fl)(this.setConceptToRenameState(t)).catch(this.ideStore.applicationStore.alertUnhandledError)}}})),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.DELETE_LINE,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.textEditorState.model.pushEditOperations([],[{range:{startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber+1,endColumn:1},text:"",forceMoveMarkers:!0}],(()=>null))}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_TO_LINE,trigger:()=>this.ideStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.TOGGLE_TEXT_WRAP,trigger:()=>this.ideStore.tabManagerState.currentTab===this,action:()=>{this.textEditorState.setWrapText(!this.textEditorState.wrapText)}})}findConceptUsages(e){const t=()=>{(0,Re.fl)(this.ideStore.findUsagesFromCoordinate(e)).catch(this.ideStore.applicationStore.alertUnhandledError)};this.hasChanged?this.ideStore.applicationStore.alertService.setActionAlertInfo({message:"Source is not compiled, finding concept usages might be inaccurate. Do you want compile to proceed?",type:Dt.CAUTION,actions:[{label:"Compile and Proceed",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.ideStore.executeGo()).then(t).catch(this.ideStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]}):t()}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.ideStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.ideStore.findConceptUsages(t.pureType===Np.ENUM_VALUE?bp.ENUM:t.pureType===Np.PROPERTY||t.pureType===Np.QUALIFIED_PROPERTY?bp.PROPERTY:bp.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,Re.fl)(this.ideStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e)}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}}deregisterCommands(){this.textEditorState.language===Tp.PURE&&[Hp.GO_TO_DEFINITION,Hp.GO_BACK,Hp.REVEAL_CONCEPT_IN_TREE,Hp.FIND_USAGES,Hp.RENAME_CONCEPT].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e))),[Hp.GO_TO_LINE,Hp.TOGGLE_TEXT_WRAP].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e)))}}class qp{ideStore;treeData;selectedNode;loadInitialDataState=we.create();refreshDataState=we.create();constructor(e){(0,Re.rC)(this,{treeData:Re.LO.ref,loadInitialDataState:Re.LO,refreshDataState:Re.LO,initialize:Re.ls,expandNode:Re.ls,openNode:Re.ls,refreshTreeData:Re.ls,setTreeData:Re.aD,setSelectedNode:Re.aD}),this.ideStore=e}getTreeData(){return G(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.ideStore.applicationStore.notificationService.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...G(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){if(!this.treeData)return;const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return M(e),this.ideStore.applicationStore.notificationService.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>G(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(G(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,Re.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>G(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class Jp{id;path;RO}class Qp extends Jp{file;statusType}(0,_e.yu)(Qp,{id:(0,_e.Ru)(),path:(0,_e.Ru)(),file:(0,_e.Ru)(),statusType:(0,_e.Ru)(),RO:(0,_e.Ru)()});class em extends Jp{repo}(0,_e.yu)(em,{id:(0,_e.Ru)(),path:(0,_e.Ru)(),repo:(0,_e.Ru)(),RO:(0,_e.Ru)()});class tm{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof em}get isFileNode(){return this.li_attr instanceof Qp}get isRepoNode(){return this.li_attr instanceof em&&Boolean(this.li_attr.repo)}getNodeAttribute(e){return B(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,_e.yu)(tm,{li_attr:(0,_e.PG)((()=>_e.AM),(e=>e.file?(0,_e.vB)(Qp,e):(0,_e.vB)(em,e))),text:(0,_e.Ru)(),icon:(0,_e.Ru)(),children:(0,_e.Ru)(),state:(0,_e.Ru)()});const sm=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},im=e=>`file_${e}`;class nm extends qp{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,Re.rC)(this,{nodeForCreateNewFile:Re.LO,nodeForCreateNewDirectory:Re.LO,nodeForRenameFile:Re.LO,setNodeForCreateNewFile:Re.aD,setNodeForCreateNewDirectory:Re.aD,setNodeForRenameFile:Re.aD,revealPath:Re.ls})}setNodeForCreateNewFile=e=>{Y(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{Y(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{Y(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.ideStore.client.getDirectoryChildren()).map((e=>(0,_e.vB)(tm,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.ideStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,_e.vB)(tm,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,Re.fl)(this.ideStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t){t?.forceOpenExplorerPanel&&this.ideStore.setActiveActivity(gp.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=sm(i);for(const e of s){const s=G(this.getTreeData().nodes.get(im(e)),`Can't find node with path '${e}'`);if(s.data.isFolderNode)yield(0,Re.fl)(this.expandNode(s));else{if(t?.directoryOnly)throw new Error("Can't reveal non-directory path");yield(0,Re.fl)(this.ideStore.loadFile(e,t?.coordinate))}}this.setSelectedNode(G(this.getTreeData().nodes.get(im(e)),`Can't find node with path '${e}'`))}}const am=e=>{const t=e.trim(),s=t.lastIndexOf(oa);if(!(s<=0))return t.substring(0,s)};class rm extends qp{loadConceptActivity=we.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,Re.rC)(this,{statusText:Re.LO,nodeForRenameConcept:Re.LO,nodeForMoveElement:Re.LO,setStatusText:Re.aD,setNodeForRenameConcept:Re.aD,setNodeForMoveElement:Re.aD,pullConceptsActivity:Re.aD,pollConceptsActivity:Re.ls,revealConcept:Re.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,Re.fl)(this.pollConceptsActivity()),(await this.ideStore.client.getConceptChildren()).map((e=>(0,_e.vB)(yp,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.ideStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,_e.vB)(yp,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof Ip||e.data.li_attr instanceof Op)&&("Diagram"===e.data.li_attr.pureType?yield(0,Re.fl)(this.ideStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,Re.fl)(this.ideStore.loadFile(e.data.li_attr.file,new Lp(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.ideStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}*revealConcept(e,t){t?.forceOpenExplorerPanel&&this.ideStore.setActiveActivity(gp.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=am(i);for(const e of s){const s=G(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`);if(s.data.li_attr instanceof Ap)yield(0,Re.fl)(this.expandNode(s));else if(t?.packageOnly)throw new Error("Can't reveal non-package path")}this.setSelectedNode(G(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`))}async movePackageableElements(e,t){let s=[];try{s=(await this.ideStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,_e.vB)(Fp,e)))}catch{return void this.ideStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}const i=[];Y(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=G(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:G(mu(a.pureId)),destinationPackage:t,usages:G(s[n]).second})}await(0,Re.fl)(this.ideStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.ideStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Np.PROPERTY:case Np.QUALIFIED_PROPERTY:$(s,Ip),n=await this.ideStore.findConceptUsages(bp.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Np.PACKAGE:{let e=[],s=[];try{s=await this.ideStore.client.getChildPackageableElements(i),e=(await this.ideStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,_e.vB)(Fp,e)))}catch{return void this.ideStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}const n=[];Y(e.length===s.length,"Can't find matching usages for child packageable elements");const a=mu(i)?.concat(oa).concat(t)??t;for(let t=0;t<e.length;++t){const r=G(s[t]),o=G(mu(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:G(e[t]).second})}return void await(0,Re.fl)(this.ideStore.movePackageableElements(n))}default:n=await this.ideStore.findConceptUsages(bp.ELEMENT,[`'${s.pureId}'`])}}catch(e){return M(e),void this.ideStore.applicationStore.notificationService.notifyError(e)}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}await(0,Re.fl)(this.ideStore.renameConcept(i,t,s.pureType,n))}}class om{cached;datamarts;text}(0,_e.yu)(om,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)()});class lm extends om{error;sessionError}(0,_e.yu)(lm,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)(),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class cm extends lm{RO;line;column;source}(0,_e.yu)(cm,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)(),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class dm{text;reinit}class hm extends dm{cache;modifiedFiles=[]}(0,_e.yu)(hm,{text:(0,_e.Ru)(),cache:(0,_e.Ru)(),modifiedFiles:(0,_e.pb)((0,_e.Ru)()),reinit:(0,_e.Ru)()});class um extends dm{RO;line;column;source;error;sessionError}(0,_e.yu)(um,{text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.jt)((0,_e.Ru)()),column:(0,_e.jt)((0,_e.Ru)()),source:(0,_e.jt)((0,_e.Ru)()),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class pm{RO;line;column;source}(0,_e.yu)(pm,{RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)()});class mm extends dm{jumpTo}(0,_e.yu)(mm,{text:(0,_e.Ru)(),jumpTo:(0,_e.Ry)(pm)});class _m{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,_e.yu)(_m,{sourceID:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),foundName:(0,_e.Ru)()});class gm{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,_e.yu)(gm,{sourceID:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),foundName:(0,_e.Ru)(),add:(0,_e.Ru)(),messageToBeModified:(0,_e.Ru)(),fileToBeModified:(0,_e.Ru)(),lineToBeModified:(0,_e.Ru)(),columnToBeModified:(0,_e.Ru)()});class Em extends um{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,_e.yu)(Em,{candidateName:(0,_e.Ru)(),candidatesWithPackageImported:(0,_e.pb)((0,_e.Ry)(_m)),candidatesWithPackageNotImported:(0,_e.pb)((0,_e.Ry)(gm))});class fm extends um{candidateName;candidates=[]}(0,_e.yu)(fm,{candidateName:(0,_e.Ru)(),candidates:(0,_e.pb)((0,_e.Ry)(gm))});class Tm{id;parentId;file;line;column}(0,_e.yu)(Tm,{id:(0,_e.Ru)(),parentId:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class Cm{children=[];li_attr;text;type}(0,_e.yu)(Cm,{children:(0,_e.pb)((0,_e.Ry)(Cm)),li_attr:(0,_e.Ry)(Tm),text:(0,_e.Ru)(),type:(0,_e.Ru)()});class Sm extends dm{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,_e.yu)(Sm,{count:(0,_e.Ru)(),filterPaths:(0,_e.pb)((0,_e.Ru)()),path:(0,_e.Ru)(),relevantTestsOnly:(0,_e.Ru)(),runnerId:(0,_e.Ru)(),tests:(0,_e.pb)((0,_e.Ry)(Cm))});class xm{uuid=(0,a.Z)()}class Nm{before;found;after}(0,_e.yu)(Nm,{after:(0,_e.Ru)(),before:(0,_e.Ru)(),found:(0,_e.Ru)()});class vm{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,_e.yu)(vm,{sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)(),preview:(0,_e.jt)((0,_e.Ry)(Nm))});class Am extends xm{sourceId;coordinates=[];isExpanded=!0;constructor(){super(),(0,Re.rC)(this,{coordinates:Re.LO,isExpanded:Re.LO,setIsExpanded:Re.aD,dismissCoordinate:Re.aD})}setCoordinates(e){this.coordinates=e}setIsExpanded(e){this.isExpanded=e}dismissCoordinate(e){w(this.coordinates,e)}}var Im,Om,ym;(0,_e.yu)(Am,{sourceId:(0,_e.Ru)(),coordinates:(0,_e.pb)((0,_e.Ry)(vm))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Im=Im||(Im={}));class Rm{status;test}class wm extends Rm{test=[]}(0,_e.yu)(wm,{status:(0,_e.Ru)(),test:(0,_e.pb)((0,_e.Ru)())});class Lm{text;RO;line;column;source;error}(0,_e.yu)(Lm,{text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)(),error:(0,_e.Ru)()});class Pm extends Rm{test=[];error}(0,_e.yu)(Pm,{status:(0,_e.Ru)(),test:(0,_e.pb)((0,_e.Ru)()),error:(0,_e.Ry)(Lm)});class bm{}class Dm extends bm{finished;tests=[]}(0,_e.yu)(Dm,{finished:(0,_e.Ru)(),tests:(0,_e.pb)((0,_e.PG)((()=>_e.AM),(e=>e.error?(0,_e.vB)(Pm,e):(0,_e.vB)(wm,e))))});class Mm extends bm{error;text}(0,_e.yu)(Mm,{error:(0,_e.Ru)(),text:(0,_e.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Om=Om||(Om={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(ym=ym||(ym={}));class Fm{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,Re.rC)(this,{total:Re.LO,time:Re.LO,passedTests:Re.LO,failedTests:Re.LO,testsWithError:Re.LO,notRunTests:Re.LO,results:Re.LO,passed:Re.Fl,error:Re.Fl,failed:Re.Fl,passedTestIds:Re.Fl,failedTestIds:Re.Fl,testWithErrorIds:Re.Fl,notRunTestIds:Re.Fl,numberOfTestsRun:Re.Fl,runPercentage:Re.Fl,suiteStatus:Re.Fl,setTime:Re.aD,addResult:Re.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?Om.FAILED:this.passed?Om.PASSED:Om.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Im.PASSED:this.passedTests.add(t);break;case Im.FAILED:this.failedTests.set(t,B(e,Pm));break;case Im.ERROR:this.testsWithError.set(t,B(e,Pm));break;default:throw new D(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class km{ideStore;testExecutionResult;checkTestRunnerState=we.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=we.create();treeData;viewAsList=!1;constructor(e,t){(0,Re.rC)(this,{testResultInfo:Re.LO.ref,allTests:Re.LO,selectedTestId:Re.LO,treeData:Re.LO.ref,viewAsList:Re.LO,setViewAsList:Re.aD,setSelectedTestId:Re.aD,setTestResultInfo:Re.aD,setTreeData:Re.aD,refreshTree:Re.aD,collapseTree:Re.aD,expandTree:Re.aD,buildTreeDataByLayer:Re.aD,pullTestRunnerResult:Re.aD,buildTestTreeData:Re.ls,pollTestRunnerResult:Re.ls,rerunTestSuite:Re.ls,cancelTestRun:Re.ls}),this.ideStore=e,this.testExecutionResult=t}getTreeData(){return G(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...G(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=G(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?y(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{Y(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new Fm(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.ideStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,_e.vB)(Mm,s):(0,_e.vB)(Dm,s);var s;return t instanceof Dm?(await Promise.all(t.tests.map((t=>O((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.ideStore.testRunState.isInProgress||(yield(0,Re.fl)(this.ideStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.ideStore.testRunState.isInProgress&&(yield this.ideStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.ideStore.applicationStore.notificationService.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}class jm{}class Um extends jm{error;errorDialog;text}(0,_e.yu)(Um,{error:(0,_e.Ru)(),errorDialog:(0,_e.Ru)(),text:(0,_e.Ru)()});class Gm{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return G(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:`'${_p}'`,format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptInfo=async(e,t,s)=>{const i=await this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});if(i.error)throw new Error(i.text);return i};getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:bp.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}));getSuggestionsForIncompletePath=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/incompletePath`,{path:e,types:t});getSuggestionsForIdentifier=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/identifier`,{importPaths:e,types:t});getSuggestionsForAttribute=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/attribute`,{importPaths:e,path:t});getSuggestionsForClass=e=>this.networkClient.post(`${this.baseUrl}/suggestion/class`,{importPaths:e});getSuggestionsForVariable=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/suggestion/variable`,{sourceId:e,line:t,column:s})}class Vm{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,Re.rC)(this,{_tempSize:Re.LO,size:Re.LO,defaultSize:Re.LO,snapSize:Re.LO,maxSize:Re.LO,isOpen:Re.Fl,isMaximizable:Re.Fl,isMaximized:Re.Fl,setSize:Re.aD,open:Re.aD,close:Re.aD,toggle:Re.aD,setMaxSize:Re.aD,maximize:Re.aD,minimize:Re.aD,toggleMaximize:Re.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}class $m{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return ra([Aa.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new $m(0,0);static ZERO_ONE=new $m(0,1);static ZERO_MANY=new $m(0,void 0);static ONE=new $m(1,1);static ONE_MANY=new $m(1,void 0)}class Bm{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return ra([Aa.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class zm extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class Hm extends zm{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Hm(e)}}class Ym extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class Wm extends Ym{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Wm(e)}}class Km extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Xm extends Km{ownerReference;constructor(e){const t=Ya.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new Xm(e)}}class Zm{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class qm{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return ra([Aa.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}}var Jm;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(Jm=Jm||(Jm={}));class Qm{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return ra([Aa.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),ya(this.parameters,this.body)])}}class e_ extends Ma{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new e_(ha.STRING);static BOOLEAN=new e_(ha.BOOLEAN);static BINARY=new e_(ha.BINARY);static NUMBER=new e_(ha.NUMBER);static INTEGER=new e_(ha.INTEGER);static FLOAT=new e_(ha.FLOAT);static DECIMAL=new e_(ha.DECIMAL);static DATE=new e_(ha.DATE);static STRICTDATE=new e_(ha.STRICTDATE);static DATETIME=new e_(ha.DATETIME);static STRICTTIME=new e_(ha.STRICTTIME);static LATESTDATE=new e_(ha.LATESTDATE)}class t_ extends Pa{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[new qm("",$m.ONE,Xm.create(new Zm(new Da(""))),new Da("")),new qm("",$m.ONE,Xm.create(new Zm(new Da(""))),new Da(""))];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}dispose(){super.dispose();const[e,t]=this.properties;if(e.genericType.value.rawType instanceof Da&&t.genericType.value.rawType instanceof Da){const s=B(e.genericType.value.rawType,Da),i=B(t.genericType.value.rawType,Da);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return ra([Aa.ASSOCIATION,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class s_ extends Pa{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return ra([Aa.MAPPING,this.path,ra(this.classMappings),ra(this.enumerationMappings),ra(this.associationMappings),ra(this.test),ra(this.includes),ra(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class i_ extends Pa{p_stereotypes=[];p_tags=[];get _elementHashCode(){return ra([Aa.PROFILE,this.path,ra(this.p_stereotypes.map((e=>e.value))),ra(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class n_ extends Pa{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ne.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return ra([Aa.SERVICE,ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),this.path,this.pattern,ra(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",ra(this.tests),ra(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class a_ extends Pa{functionName;constructor(e){super(e),this.functionName=e}}class r_ extends a_{}class o_ extends r_{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return ra([Aa.FUNCTION,this.path,ra(this.parameters),this.returnType.valueForSerialization??"",ra(this.taggedValues),ra(this.stereotypes.map((e=>e.pointerHashCode))),ya(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class l_ extends Pa{includes=[]}class c_ extends l_{sections=[];get _elementHashCode(){return ra([Aa.FLAT_DATA,this.path,ra(this.includes.map((e=>e.valueForSerialization??""))),ra(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class d_ extends Pa{runtimeValue;get _elementHashCode(){return ra([Aa.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class h_ extends Pa{connectionValue;get _elementHashCode(){return ra([Aa.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class u_ extends Pa{}class p_ extends u_{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return ra([Aa.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",ra(this.scopeElements.map((e=>e instanceof Ha?e.valueForSerialization??"":e))),ra(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class m_ extends Pa{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return ra([Aa.GENERATION_TREE,this.path,ra(this.generationNodes),ra(this.fileGenerations.map((e=>Ra(xa.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class __ extends l_{schemas=[];joins=[];filters=[];get _elementHashCode(){return ra([Aa.DATABASE,this.path,ra(this.includes.map((e=>e.valueForSerialization??""))),ra(this.schemas),ra(this.joins),ra(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class g_{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class E_ extends Pa{data;get hashCode(){return ra([Aa.DATA_ELEMENT,this.path,ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}class f_ extends Pa{executionParameters=[];get _elementHashCode(){return ra([Aa.EXECUTION_ENVIRONMENT_INSTANCE,this.path,ra(this.executionParameters)])}accept_PackageableElementVisitor(e){return e.visit_ExecutionEnvironmentInstance(this)}}const T_=new Set([Pa,ba,Ma,e_,Da,t_,Fa,o_,i_,ja,ka,E_,l_,s_,h_,d_,m_,p_,n_,f_,class extends Pa{sections=[];get _elementHashCode(){return ra([Aa.SECTION_INDEX,this.path,ra(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}}]);class C_{root;_origin;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;executionEnvironmentIndex=new Map;constructor(e,t,s){this.root=new Ua(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(T_.has(e))throw new b("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new g_(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter(V(Fa))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(V(ja))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(V(Da))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter(V(c_))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(V(__))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownExecutionEnvironments(){return Array.from(this.executionEnvironmentIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}get origin(){return this._origin}setOrigin(e){if(this._origin)throw new b("SDLC pointer has already been set for model.");this._origin=e}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new D("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new b("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof Da?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof Fa?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof ja?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnNullableExecutionEnviornment=e=>this.executionEnvironmentIndex.get(e);getOwnSectionIndex=e=>G(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>G(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>G(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>G(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>G(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>G(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>G(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>G(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>G(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>B(this.getOwnNullableStore(e),__,`Can't find database '${e}'`);getOwnFlatDataStore=e=>B(this.getOwnNullableStore(e),c_,`Can't find flat-data store '${e}'`);getOwnMapping=e=>G(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>G(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>G(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>G(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>G(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>G(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>G(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnExecutionEnvironment=e=>G(this.getOwnNullableExecutionEnviornment(e),`Can't find execution environment element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnExecutionEnvironment(e,t){this.executionEnvironmentIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.ownExecutionEnvironments,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>O((()=>{e.dispose()})))))}getNullablePackage=e=>e?F((()=>Cu(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.executionEnvironmentIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){Eu(t?Su(this,t,void 0):this.root,e),e instanceof s_?this.setOwnMapping(e.path,e):e instanceof l_?this.setOwnStore(e.path,e):e instanceof ba?this.setOwnType(e.path,e):e instanceof t_?this.setOwnAssociation(e.path,e):e instanceof i_?this.setOwnProfile(e.path,e):e instanceof o_?this.setOwnFunction(e.path,e):e instanceof n_?this.setOwnService(e.path,e):e instanceof h_?this.setOwnConnection(e.path,e):e instanceof d_?this.setOwnRuntime(e.path,e):e instanceof p_?this.setOwnFileGeneration(e.path,e):e instanceof m_?this.setOwnGenerationSpecification(e.path,e):e instanceof E_?this.setOwnDataElement(e.path,e):e instanceof f_?this.setOwnExecutionEnvironment(e.path,e):e instanceof Ua||this.getExtensionForElementClass(N(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&fu(e.package,e),e instanceof s_?this.mappingsIndex.delete(e.path):e instanceof l_?this.storesIndex.delete(e.path):e instanceof ba?(this.typesIndex.delete(e.path),e instanceof ja&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof t_?this.associationsIndex.delete(e.path):e instanceof i_?this.profilesIndex.delete(e.path):e instanceof o_?this.functionsIndex.delete(e.path):e instanceof n_?this.servicesIndex.delete(e.path):e instanceof d_?this.runtimesIndex.delete(e.path):e instanceof h_?this.connectionsIndex.delete(e.path):e instanceof p_?this.fileGenerationsIndex.delete(e.path):e instanceof m_?this.generationSpecificationsIndex.delete(e.path):e instanceof E_?this.dataElementsIndex.delete(e.path):e instanceof f_?this.executionEnvironmentIndex.delete(e.path):e instanceof Ua?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(N(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new D(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof Ua&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof Ua)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new D(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new D(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=_u(s);if(!(e instanceof Ua)){const t=this.getNullablePackage(i)??(""!==i?Su(this,i,void 0):this.root);e.name=n,e instanceof o_&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Au(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Au(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&fu(e.package,e),Eu(t,e))}var a,r;if(e instanceof s_)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof l_)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ba)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof ja&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof t_)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof i_)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof o_)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof n_)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof d_)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof h_)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof p_)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof E_)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof f_)this.executionEnvironmentIndex.delete(t),this.executionEnvironmentIndex.set(s,e);else if(e instanceof m_)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof Ua){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new b("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){fu(r,e);const t=""!==i?Su(this,i,void 0):this.root;Eu(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(N(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class S_{}class x_ extends S_{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class N_ extends C_{constructor(e,t,s){super(t.name,e,s),this.root=t}}const v_=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class A_{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new Ua((e=>`@dependency__${e}`)(e));this.roots.push(s),this.projectDependencyModelsIndex.set(e,new N_(this.extensionElementClasses,s,new x_(t.groupId,t.artifactId,t.versionId)))}))}get numberOfDependencies(){return this.projectDependencyModelsIndex.size}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=v_(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=v_(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=v_(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=v_(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=v_(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=v_(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=v_(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=v_(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=v_(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=v_(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=v_(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=v_(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=v_(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=v_(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=v_(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=v_(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnExecutionEnvironment=v_(this,((e,t)=>e.getOwnNullableExecutionEnviornment(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}get executionEnvironments(){return this.dependencyGraphs.flatMap((e=>e.ownExecutionEnvironments))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return G(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){const s=this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))));return s?.getOwnNullableElement(e,t)}}class I_ extends l_{static NAME="ModelStore";static INSTANCE=new I_;constructor(){super(I_.NAME)}accept_PackageableElementVisitor(e){throw new D}}class O_ extends C_{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(da.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(I_.NAME,I_.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[e_.STRING,e_.BOOLEAN,e_.BINARY,e_.NUMBER,e_.INTEGER,e_.FLOAT,e_.DECIMAL,e_.DATE,e_.STRICTDATE,e_.DATETIME,e_.STRICTTIME,e_.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class y_ extends C_{autoImports=[];constructor(e){super(da.SYSTEM,e)}initializeAutoImports(){this.autoImports=_a.map((e=>B(this.getOwnNullableElement(e,!0),Ua,`Can't find auto-import package '${e}'`)))}}class R_ extends C_{constructor(e){super(da.MODEL_GENERATION,e)}}class w_ extends C_{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(da.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new R_(i),this.dependencyManager=new A_(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get executionEnvironments(){return[...this.coreModel.ownExecutionEnvironments,...this.systemModel.ownExecutionEnvironments,...this.dependencyManager.executionEnvironments,...this.ownExecutionEnvironments,...this.generationModel.ownExecutionEnvironments]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>G(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>G(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>G(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>B(this.getType(e),Fa,`Can't find enumeration '${e}'`);getMeasure=e=>B(this.getType(e),ja,`Can't find measure '${e}'`);getUnit=e=>B(this.getType(e),ka,`Can't find unit '${e}'`);getClass=e=>B(this.getType(e),Da,`Can't find class '${e}'`);getAssociation=e=>G(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>G(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??B(this.getType(e),Da),`Can't find property owner '${e}'`);getFunction=e=>B(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),o_,`Can't find function '${e}'`);getStore=e=>G(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>B(this.getStore(e),c_,`Can't find flat-data store '${e}'`);getDatabase=e=>B(this.getStore(e),__,`Can't find database store '${e}'`);getMapping=e=>G(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>G(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>G(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>G(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>G(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>G(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>G(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return G(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>G(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>F((()=>this.getClass(e)));getNullableMapping=e=>F((()=>this.getMapping(e)));getNullableService=e=>F((()=>this.getService(e)));getNullableRuntime=e=>F((()=>this.getRuntime(e)));getNullableFileGeneration=e=>F((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=$m.ONE:0===e&&1===t?s=$m.ZERO_ONE:0===e&&void 0===t?s=$m.ZERO_MANY:1===e&&void 0===t?s=$m.ONE_MANY:0===e&&0===t&&(s=$m.ZERO),s??new $m(e,t)}addElement(e,t){const s=gu(t??"",e.name);if(this.getNullableElement(s,!1))throw new b(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new b(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class L_{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class P_{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class b_ extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class D_ extends b_{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new D_(e)}}class M_{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,_e.yu)(M_,{column:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)(),line:(0,_e.Ru)(),sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)()});const F_=(0,_e.PG)((()=>_e.AM),(e=>(e.sourceId=e.source,(0,_e.vB)(M_,e))));class k_{package;name;tags=[];stereotypes=[]}(0,_e.yu)(k_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ru)()),tags:(0,_e.pb)((0,_e.Ru)())});class j_{profile;value}(0,_e.yu)(j_,{profile:(0,_e.Ru)(),value:(0,_e.Ru)()});class U_{profile;value}(0,_e.yu)(U_,{profile:(0,_e.Ru)(),value:(0,_e.Ru)()});class G_{tag;value}(0,_e.yu)(G_,{tag:(0,_e.Ry)(U_),value:(0,_e.Ru)()});class V_{rawType;typeParameter}(0,_e.yu)(V_,{rawType:(0,_e.jt)((0,_e.Ru)()),typeParameter:(0,_e.jt)((0,_e.Ru)())});class $_{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,_e.yu)($_,{aggregation:(0,_e.Ru)(),genericType:(0,_e.Ry)(V_),multiplicity:(0,_e.Ru)(),name:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_))});class B_{package;name;sourceInformation}(0,_e.yu)(B_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),sourceInformation:F_});class z_{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,_e.yu)(z_,{generalizations:(0,_e.pb)((0,_e.Ry)(V_)),name:(0,_e.Ru)(),package:(0,_e.Ru)(),properties:(0,_e.pb)((0,_e.Ry)($_)),qualifiedProperties:(0,_e.pb)((0,_e.Ry)($_)),sourceInformation:F_,stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_))});class H_{package;name;enumValues=[]}(0,_e.yu)(H_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),enumValues:(0,_e.pb)((0,_e.Ru)())});class Y_{x;y}(0,_e.yu)(Y_,{x:(0,_e.Ru)(),y:(0,_e.Ru)()});class W_{height;width}(0,_e.yu)(W_,{height:(0,_e.Ru)(),width:(0,_e.Ru)()});class K_{points=[]}(0,_e.yu)(K_,{points:(0,_e.pb)((0,_e.Ry)(Y_))});class X_{id;source;target;geometry}(0,_e.yu)(X_,{geometry:(0,_e.Ry)(K_),id:(0,_e.Ru)(),source:(0,_e.Ru)(),target:(0,_e.Ru)()});class Z_{name;owningType}(0,_e.yu)(Z_,{name:(0,_e.Ru)(),owningType:(0,_e.Ru)()});class q_{id;source;target;property;geometry}(0,_e.yu)(q_,{geometry:(0,_e.Ry)(K_),id:(0,_e.Ru)(),property:(0,_e.Ry)(Z_),source:(0,_e.Ru)(),target:(0,_e.Ru)()});class J_{id;type;position;rectangleGeometry}(0,_e.yu)(J_,{id:(0,_e.Ru)(),position:(0,_e.Ry)(Y_),rectangleGeometry:(0,_e.Ry)(W_),type:(0,_e.Ru)()});class Q_{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,_e.yu)(Q_,{name:(0,_e.Ru)(),generalizationViews:(0,_e.pb)((0,_e.Ry)(X_)),package:(0,_e.Ru)(),propertyViews:(0,_e.pb)((0,_e.Ry)(q_)),sourceInformation:F_,stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_)),typeViews:(0,_e.pb)((0,_e.Ry)(J_))});class eg{classes=[];enumerations=[];profiles=[]}(0,_e.yu)(eg,{classes:(0,_e.pb)((0,_e.Ry)(z_)),enumerations:(0,_e.pb)((0,_e.Ry)(H_)),profiles:(0,_e.pb)((0,_e.Ry)(k_))});class tg{name;diagram;domainInfo}(0,_e.yu)(tg,{diagram:(0,_e.Ry)(Q_),name:(0,_e.Ru)(),domainInfo:(0,_e.jt)((0,_e.Ry)(eg))});class sg{class;enumerations=[];profiles=[];specializations=[]}(0,_e.yu)(sg,{class:(0,_e.Ry)(z_),enumerations:(0,_e.pb)((0,_e.Ry)(H_)),profiles:(0,_e.pb)((0,_e.Ry)(k_)),specializations:(0,_e.pb)((0,_e.Ry)(B_))});const ig=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},ng=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=_u(e),r=new Da(a);return Eu(Cu(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},ag=e=>{if("*"===e)return new $m(0,void 0);{const t=e.split("..");if(1===t.length)return new $m(parseInt(G(t[0]),10),parseInt(G(t[0]),10));if(2===t.length)return new $m(parseInt(G(t[0]),10),"*"===t[1]?void 0:parseInt(G(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},rg=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;y(e.taggedValues,new Bm(Hm.create((i=s.getProfile(t.tag.profile),n=t.tag.value,G(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;y(e.stereotypes,Wm.create((i=s.getProfile(t.profile),n=t.value,G(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=ng(G(t.rawType),s,i,void 0);y(e.generalizations,Xm.create(new Zm(n))),y(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new qm(t.name,ag(t.multiplicity),Xm.create(new Zm(s.getOwnNullableEnumeration(G(t.genericType.rawType))??ng(G(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?Jm.COMPOSITE:"Shared"===t.aggregation?Jm.SHARED:void 0,y(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{y(e.derivedProperties,new Qm(t.name,ag(t.multiplicity),Xm.create(new Zm(s.getOwnNullableEnumeration(G(t.genericType.rawType))??ng(G(t.genericType.rawType),s,i,void 0))),e))}))},og=e=>{const t=new w_(new O_([]),new y_([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Da(e.name);Eu(Cu(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new i_(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>y(s.p_tags,new L_(s,e)))),e.stereotypes.forEach((e=>y(s.p_stereotypes,new P_(s,e))))})),i.enumerations.forEach((e=>{const s=new Fa(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":oa}${e.name}`,n=t.getClass(i);rg(n,e,t,s)}))}const i=e.diagram,n=new Ah(i.name);return Eu(Cu(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new Mu(n,e.id,Ya.create(t.getClass(e.type)));s.position=new Pu(e.position.x,e.position.y),s.rectangle=new bu(e.rectangleGeometry.width,e.rectangleGeometry.height),y(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new Vu(n,D_.create((i=t.getClass(e.property.owningType),a=e.property.name,G(i instanceof Da?vu(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),G(n.classViews.find((t=>t.id===e.source))),G(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Pu(e.x,e.y))),Wu(s),y(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new $u(n,G(n.classViews.find((t=>t.id===e.source))),G(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Pu(e.x,e.y))),Wu(t),y(n.generalizationViews,t)})),[n,t,s]};var lg,cg,dg;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data",e.EXECUTION_ENVIRONMENT="ExecutionEnvironment"}(lg=lg||(lg={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(cg=cg||(cg={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(dg=dg||(dg={}));const hg=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;class ug extends Gu{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return ra([vh.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const pg=(0,Re.aD)(((e,t)=>{e.value=t})),mg=((0,Re.aD)(((e,t)=>{w(e.properties,t)})),(0,Re.aD)(((e,t)=>{y(e.properties,oh(t))}))),_g=((0,Re.aD)(((e,t,s)=>{R(e.properties,t,s)})),(0,Re.aD)(((e,t)=>{w(e.derivedProperties,t)})),(0,Re.aD)(((e,t)=>{y(e.derivedProperties,lh(t))})),(0,Re.aD)(((e,t,s)=>{R(e.derivedProperties,t,s)})),(0,Re.aD)(((e,t)=>{y(e.constraints,dh(t))})),(0,Re.aD)(((e,t)=>{w(e.constraints,t)})),(0,Re.aD)(((e,t,s)=>{R(e.constraints,t,s)})),(0,Re.aD)(((e,t)=>{y(e.generalizations,Zd(t))}))),gg=((0,Re.aD)(((e,t)=>{w(e.generalizations,t)})),(0,Re.aD)(((e,t,s)=>{R(e.generalizations,t,s)})),(0,Re.aD)(((e,t)=>{y(e._subclasses,t)})),(0,Re.aD)(((e,t)=>{w(e._subclasses,t)})),(0,Re.aD)(((e,t)=>{Zd(e),Xd(t),e.value=t,e.ownerReference.value=t.rawType}))),Eg=((0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{gg(e.genericType,Xd(t))})),(0,Re.aD)(((e,t)=>{e.multiplicity=t})),(0,Re.aD)(((e,t)=>{e.aggregation=t})),(0,Re.aD)(((e,t)=>{e.value=Qd(t),pg(e.ownerReference,t._OWNER)})),(0,Re.aD)(((e,t)=>{y(e.taggedValues,Kd(t))})),(0,Re.aD)(((e,t)=>{w(e.taggedValues,t)})),(0,Re.aD)(((e,t)=>{y(e.stereotypes,Yd(t))})),(0,Re.aD)(((e,t)=>{w(e.stereotypes,t)})),(0,Re.aD)(((e,t)=>{e.tag.value=eh(t),e.tag.ownerReference.value=t._OWNER})),(0,Re.aD)(((e,t)=>{e.value=t})),(0,Re.aD)(((e,t)=>{e.value=t})),(0,Re.aD)(((e,t,s)=>{R(e.taggedValues,t,s)})),(0,Re.aD)(((e,t,s)=>{R(e.stereotypes,t,s)})),(0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{e.functionDefinition=dr(t)})),(0,Re.aD)(((e,t)=>{y(e.p_tags,eh(t))})),(0,Re.aD)(((e,t)=>{w(e.p_tags,t)})),(0,Re.aD)(((e,t)=>{y(e.p_stereotypes,Qd(t))})),(0,Re.aD)(((e,t)=>{w(e.p_stereotypes,t)})),(0,Re.aD)(((e,t,s)=>{R(e.p_tags,t,s)})),(0,Re.aD)(((e,t,s)=>{R(e.p_stereotypes,t,s)})),(0,Re.aD)(((e,t)=>{w(e.parameters,t)})),(0,Re.aD)(((e,t)=>{y(e.parameters,hr(t))})),(0,Re.aD)(((e,t)=>{pg(e.returnType,mh(t))})),(0,Re.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,Re.aD)(((e,t,s)=>{R(e.parameters,t,s)})),(0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{y(e.values,sh(t))})),(0,Re.aD)(((e,t)=>{w(e.values,t)})),(0,Re.aD)(((e,t,s)=>{R(e.values,t,s)})),(0,Re.aD)(((e,t)=>{e.value=sh(t),pg(e.ownerReference,t._OWNER)})),(0,Re.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return Y(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),G(e.properties[(s+1)%2])})(e,t),n=B(t.genericType.ownerReference.value,Da,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&Y(w(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),y(s.propertiesFromAssociations,i);const r=new Zm(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,Re.aD)(((e,t)=>{e.canonicalUnit=ah(t)})),(0,Re.aD)(((e,t)=>{e.conversionFunction=dr(t)})),(0,Re.aD)(((e,t)=>{e.classViews=t.map(Eh)}))),fg=(0,Re.aD)(((e,t)=>{y(e.classViews,Eh(t))})),Tg=(0,Re.aD)(((e,t)=>{w(e.classViews,t)})),Cg=(0,Re.aD)(((e,t)=>{e.associationViews=t.map(Sh)})),Sg=(0,Re.aD)(((e,t)=>{w(e.associationViews,t)})),xg=(0,Re.aD)(((e,t)=>{e.generalizationViews=t.map(Ch)})),Ng=(0,Re.aD)(((e,t)=>{y(e.generalizationViews,Ch(t))})),vg=(0,Re.aD)(((e,t)=>{w(e.generalizationViews,t)})),Ag=(0,Re.aD)(((e,t)=>{e.propertyViews=t.map(xh)})),Ig=(0,Re.aD)(((e,t)=>{y(e.propertyViews,xh(t))})),Og=(0,Re.aD)(((e,t)=>{w(e.propertyViews,t)})),yg=(0,Re.aD)(((e,t)=>{e.hideProperties=t})),Rg=(0,Re.aD)(((e,t)=>{e.hideStereotypes=t})),wg=(0,Re.aD)(((e,t)=>{e.hideTaggedValues=t})),Lg=(0,Re.aD)(((e,t)=>{e._offsetX=t})),Pg=(0,Re.aD)(((e,t)=>{e._offsetY=t})),bg=(0,Re.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Dg=(0,Re.aD)(Wu),Mg=(0,Re.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new Bu(n.x,n.y).normal(new Bu(l.x,l.y)).unit(),d=Bu.fromPoints(n,new Pu(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new Pu(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&Yu(e,r),o})),Fg=(0,Re.aD)(Yu),kg=(0,Re.aD)(((e,t)=>{e.rectangle=t})),jg=(0,Re.aD)(((e,t)=>{e.position=t})),Ug=(0,Re.aD)((e=>{e._dummyObservable={}}));var Gg,Vg,$g;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(Gg=Gg||(Gg={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Vg=Vg||(Vg={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}($g=$g||($g={}));const Bg=.05,zg=[50,75,90,100,110,125,150,200,250,300,400],Hg=e=>(e instanceof Qm?"/ ":"")+e.name;class Yg{diagram;isReadOnly;enableLayoutAutoAdjustment;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,Re.rC)(this,{isReadOnly:Re.LO,enableLayoutAutoAdjustment:Re.LO,interactionMode:Re.LO,relationshipMode:Re.LO,zoom:Re.LO,mouseOverClassView:Re.LO,mouseOverClassName:Re.LO,mouseOverClassCorner:Re.LO,mouseOverClassProperty:Re.LO,mouseOverPropertyHolderViewLabel:Re.LO,selectionStart:Re.LO,selectedClassCorner:Re.LO,selectedClasses:Re.LO,selectedPropertyOrAssociation:Re.LO,selectedInheritance:Re.LO,leftClick:Re.LO,middleClick:Re.LO,rightClick:Re.LO,changeMode:Re.aD,setIsReadOnly:Re.aD,setEnableLayoutAutoAdjustment:Re.aD,setMouseOverClassView:Re.aD,setMouseOverClassName:Re.aD,setMouseOverClassCorner:Re.aD,setMouseOverClassProperty:Re.aD,setMouseOverPropertyHolderViewLabel:Re.aD,setSelectionStart:Re.aD,setSelectedClassCorner:Re.aD,setSelectedClasses:Re.aD,setSelectedPropertyOrAssociation:Re.aD,setSelectedInheritance:Re.aD,setLeftClick:Re.aD,setMiddleClick:Re.aD,setRightClick:Re.aD,setZoomLevel:Re.aD,align:Re.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new bu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new Pu(0,0),this.virtualScreen=new Du(new Pu(0,0),new bu(0,0)),this.zoom=1,this.triangle=[new Pu(0,0),new Pu(-15,-10),new Pu(-15,10)],this.diamond=[new Pu(0,0),new Pu(-10,-5),new Pu(-20,0),new Pu(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=Gg.LAYOUT,this.relationshipMode=Vg.NONE,this.isReadOnly=!1,this.enableLayoutAutoAdjustment=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new Pu(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Pu(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setEnableLayoutAutoAdjustment(e){this.enableLayoutAutoAdjustment=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(e){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh(),e?.initial&&(this.autoRecenter(),(this.canvas.width<this.virtualScreen.rectangle.width+2*this.screenPadding+20||this.canvas.height<this.virtualScreen.rectangle.height+2*this.screenPadding+20)&&this.zoomToFit())}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new bu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new Pu(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Gg.LAYOUT:case Gg.PAN:case Gg.ZOOM_IN:case Gg.ZOOM_OUT:case Gg.ADD_CLASS:if(t!==Vg.NONE)throw new b(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Gg.ADD_RELATIONSHIP:if(t===Vg.NONE)throw new b("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new D(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Gg.ADD_RELATIONSHIP)switch(t){case Vg.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Nu(e.class.value).includes(t.class.value)||Nu(t.class.value).includes(e.class.value)||_g(e.class.value,Xm.create(new Zm(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new $u(this.diagram,e,t);return Ng(this.diagram,s),s}};break;case Vg.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new qm(`property_${e.class.value.properties.length+1}`,$m.ONE,Xm.create(new Zm(t.class.value)),e.class.value);if(mg(e.class.value,s),e!==t){const i=new Vu(this.diagram,D_.create(s),e,t);return Ig(this.diagram,i),i}};break;default:throw new D(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case $g.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(e,t.position.y))));break}case $g.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>jg(t,new Pu(e-t.rectangle.width/2,t.position.y))));break}case $g.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(e-t.rectangle.width,t.position.y))));break}case $g.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e))));break}case $g.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e-t.rectangle.height/2))));break}case $g.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e-t.rectangle.height))));break}case $g.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];jg(s,new Pu(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];jg(n,new Pu(i.position.x+i.rectangle.width+s,n.position.y))}}break}case $g.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];jg(s,new Pu(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];jg(n,new Pu(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-3)}...`:e}canvasCoordinateToModelCoordinate(e){return new Pu((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new Pu((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}resolveMouseEventCoordinate(e){if(e.target instanceof HTMLElement){const t=zu(e.target);return new Pu(t.x+e.offsetX,t.y+e.offsetY)}return new Pu(e.x,e.y)}eventCoordinateToCanvasCoordinate(e){return new Pu(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Pu(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return zu(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=G(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof Vu){const r=this.drawLinePropertyText(G(a[a.length-2],"Diagram path expected to have at least 2 points"),G(a[a.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,Zu(r).x),n=Math.max(n,Zu(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new Du(new Pu(t,s),new bu(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Pu(0,0),this.virtualScreen=new Du(new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),new bu(0,0))}executeZoom(e,t){e=Math.max(e,Bg);const s=this.zoom;this.setZoomLevel(e),this.screenOffset=new Pu(((t.x-this.canvasCenter.x)*(s-e)+this.screenOffset.x*s)/e,((t.y-this.canvasCenter.y)*(s-e)+this.screenOffset.y*s)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Bg)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),Bg))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new Mu(this.diagram,i,Ya.create(e));return jg(n,t??this.canvasCoordinateToModelCoordinate(new Pu(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),fg(this.diagram,n),Ug(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Ng(this.diagram,new $u(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Ng(this.diagram,new $u(this.diagram,t,n)),vu(e).forEach((e=>{e.genericType.value.rawType===s&&Ig(this.diagram,new Vu(this.diagram,D_.create(e),n,t))})),vu(s).forEach((s=>{s.genericType.value.rawType===e&&Ig(this.diagram,new Vu(this.diagram,D_.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=Hg(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof Fa&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=hg(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(vu(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly||this.enableLayoutAutoAdjustment){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;kg(e,new bu(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of vu(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof Qm?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof e_?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Ug(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Hg(e),o=hg(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new Pu(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),m=n(c),_=this.modelCoordinateToCanvasCoordinate(new Pu(i(c),n(c)));a||this.ctx.fillText(o,_.x,_.y);const g=new Pu(Math.min(d,p),Math.min(h,m));return new Du(g,new bu(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,m)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new Du(new Pu(0,0),new bu(0,0))}drawPropertyOrAssociation(e){const t=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(G(t[t.length-2],"Diagram path expected to have at least 2 points"),G(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof qm){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===Jm.COMPOSITE||s.aggregation===Jm.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+Ku(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[0],e))*this.zoom),s.aggregation===Jm.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===Jm.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=G(s[s.length-2],"Diagram path expected to have at least 2 points").x,n=G(s[s.length-2],"Diagram path expected to have at least 2 points").y,a=G(s[s.length-1],"Diagram path expected to have at least 2 points").x,r=G(s[s.length-1],"Diagram path expected to have at least 2 points").y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+Ku(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&Fg(e,e.path.map((e=>new Pu(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=A(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==Gg.ZOOM_IN?Gg.ZOOM_IN:Gg.ZOOM_OUT,Vg.NONE)}switchToViewMode(){this.changeMode(Gg.LAYOUT,Vg.NONE)}switchToPanMode(){this.changeMode(Gg.PAN,Vg.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Gg.ADD_RELATIONSHIP,Vg.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Gg.ADD_RELATIONSHIP,Vg.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Gg.ADD_CLASS,Vg.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Da&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Pu(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Da&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,at.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Mu(t,(0,a.Z)(),Ya.create(xu(e.value,Da))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(jg(t[0],new Pu(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];jg(e,new Pu(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new $u(t,s,e):[]))))))]}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Tg(this.diagram,e),Cg(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),xg(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Ag(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof ug?Sg(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof Vu&&Og(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&vg(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{yg(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Rg(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{wg(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>fg(this.diagram,e))),t[1].forEach((e=>Ng(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,at.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Mu(this.diagram,(0,a.Z)(),Ya.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>fg(this.diagram,e))),t[1].forEach((e=>Ng(this.diagram,e)))}this.drawScreen()}}mouseup(e){const t=this.resolveMouseEventCoordinate(e);if(!this.isReadOnly)switch(this.interactionMode){case Gg.LAYOUT:this.diagram.generalizationViews.forEach((e=>Dg(e))),this.diagram.associationViews.forEach((e=>Dg(e))),this.diagram.propertyViews.forEach((e=>Dg(e)));break;case Gg.ADD_CLASS:{const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));this.onAddClassViewClick(e),this.changeMode(Gg.LAYOUT,Vg.NONE);break}case Gg.ZOOM_IN:{const e=Math.round(100*this.zoom);let s;s=e<=zg[0]-10?10*Math.floor(e/10)+10:e>=zg[zg.length-1]?100*Math.floor(e/100)+100:G(zg.find((t=>t>e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Gg.ZOOM_OUT:{const e=Math.round(100*this.zoom);let s;s=e<=zg[0]?10*Math.ceil(e/10)-10:e>=zg[zg.length-1]+100?100*Math.ceil(e/100)-100:G((0,uu.Z)(zg,(t=>t<e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Gg.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));for(let t=this.diagram.classViews.length-1;t>=0;t--){const s=this.diagram.classViews[t];if(s.contains(e.x,e.y)){const t=this.handleAddRelationship(this.startClassView,s);t&&(Lg(t.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Pg(t.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Lg(t.to,-(s.position.x+s.rectangle.width/2-e.x)),Pg(t.to,-(s.position.y+s.rectangle.height/2-e.y)))}}this.changeMode(Gg.LAYOUT,Vg.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){const t=this.resolveMouseEventCoordinate(e);if([Gg.ADD_RELATIONSHIP,Gg.ADD_CLASS,Gg.ZOOM_IN,Gg.ZOOM_OUT].includes(this.interactionMode))return;const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,s,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,s);const i=this.diagram.classViews.find((e=>e.contains(s.x,s.y)));i&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(i,s):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,s,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(s)}mousedown(e){const t=this.resolveMouseEventCoordinate(e);this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const s=this.eventCoordinateToCanvasCoordinate(t),i=this.canvasCoordinateToModelCoordinate(s);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Gg.PAN:return void(this.positionBeforeLastMove=t);case Gg.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(qu(t).contains(i.x,i.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Eg(this.diagram,this.reorderDiagramDomain(G(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:i},this.setSelectedClasses([]);else{let e=!1;for(let t=this.diagram.classViews.length-1;t>=0;t--){const n=this.diagram.classViews[t];if(n.contains(i.x,i.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||Eg(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=s.x/this.zoom-this.screenOffset.x,this.clickY=s.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Pu(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(i)}}break;case Gg.ADD_RELATIONSHIP:this.setSelectionStart(i),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(i.x,i.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Gg.LAYOUT,Vg.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=t);if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=t,void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,i),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.resolveMouseEventCoordinate(e);if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const s=this.zoom-e.deltaY/120*.05;this.executeZoom(s,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)))}mousemove(e){const t=this.resolveMouseEventCoordinate(e);if(this.cursorPosition=t,this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Gg.PAN)this.screenOffset=new Pu(this.screenOffset.x+(t.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(t.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=t,this.clearScreen(),this.drawAll();else if(this.leftClick){const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);switch(this.interactionMode){case Gg.LAYOUT:if(this.selectedClassCorner&&(kg(this.selectedClassCorner,new bu(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Ug(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let t=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=e.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=e.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);t=i.position.x-n,s=i.position.y-r,jg(i,new Pu(n,r)),Ug(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,t,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?bg(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&bg(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(t.x,t.y,e.x-t.x,e.y-t.y),this.ctx.strokeRect(t.x,t.y,e.x-t.x,e.y-t.y);const s=(e.x-t.x)/this.zoom,i=(e.y-t.y)/this.zoom;this.selection=new Du(new Pu(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new bu(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(Ju(this.selection,e)||Ju(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Gg.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const t of this.diagram.classViews.slice().reverse())if(t.contains(s.x,s.y)){this.setMouseOverClassView(t),qu(t).contains(s.x,s.y)&&this.setMouseOverClassCorner(t);const i=t.class.value;let n=t.position.y+this.classViewSpaceY;n+=t.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const a=this.computeClassNameWidth(t);new Du(this.modelCoordinateToCanvasCoordinate(new Pu(t.position.x+(t.rectangle.width-a)/2,n)),new bu(a,this.lineHeight)).contains(e.x,e.y)&&this.setMouseOverClassName(t),n+=this.lineHeight,n+=t.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,n+=2*this.classViewSpaceY;for(const s of vu(i))this.hasPropertyView(t,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Du(this.modelCoordinateToCanvasCoordinate(new Pu(t.position.x+this.classViewSpaceX,n)),new bu(this.drawClassViewProperty(t,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(e.x,e.y)&&this.setMouseOverClassProperty(s),n+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(G(t[t.length-2],"Diagram path expected to have at least 2 points"),G(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}}class Wg extends Up{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,Re.rC)(this,{_renderer:Re.LO,diagram:Re.LO,diagramInfo:Re.LO,diagramName:Re.Fl,diagramCursorClass:Re.Fl,addClassView:Re.ls,rebuild:Re.aD,setRenderer:Re.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=og(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Rp(this.diagramPath)}get description(){return`Diagram: ${Rp(this.diagramPath)}`}get diagramName(){return pu(this.diagramPath)}match(e){return e instanceof Wg&&this.diagramPath===e.diagramPath}get renderer(){return G(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case Gg.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Gg.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Gg.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Gg.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=og(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Lp(t.sourceId,t.startLine,t.startColumn);(0,Re.fl)(this.ideStore.executeNavigation(e)).catch(this.ideStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":oa}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new i_(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>y(s.p_tags,new L_(s,e)))),e.stereotypes.forEach((e=>y(s.p_stereotypes,new P_(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":oa}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new Fa(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":oa}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new Da(i.name),Eu(Cu(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=G(a),n=ng(G(`${e.package}${""===e.package?"":oa}${e.name}`),t,s,e.sourceInformation);y(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||y(n.generalizations,Xm.create(new Zm(i)))})),r&&rg(a,i,t,s),a})((0,_e.vB)(sg,yield this.ideStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");const s=e.map((e=>{const s=e.match(new RegExp(`^${t}_(?<count>\\d+)$`));return s?.groups?.count?parseInt(s.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0);return`${t}_${s+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.ideStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.ideStore.applicationStore.commandService.registerCommand({key:Bp.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Bp.RECENTER,Bp.USE_ZOOM_TOOL,Bp.USE_VIEW_TOOL,Bp.USE_PAN_TOOL].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e)))}}class Kg{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,Re.rC)(this,{text:Re.LO,isCaseSensitive:Re.LO,isRegExp:Re.LO,reset:Re.aD,setText:Re.aD,setCaseSensitive:Re.aD,setRegExp:Re.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}setRegExp(e){this.isRegExp=e}}class Xg extends L{}const Zg=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,qg=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Jg=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class Qg{ideStore;constructor(e){this.ideStore=e}}class eE extends Qg{result;constructor(e,t){super(e),this.result=t}}class tE extends Qg{result;constructor(e,t){super(e),this.result=t}}class sE{ideStore;usageConcept;searchEntries=[];constructor(e,t,s,i){(0,Re.rC)(this,{searchEntries:Re.LO,numberOfFiles:Re.Fl,numberOfResults:Re.Fl}),this.ideStore=e,this.usageConcept=t;const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=G(n.get(e.source)):(s=new Am,s.sourceId=e.source,n.set(e.source,s));const a=new vm(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),this.searchEntries=Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=G(n.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))}dismissSearchEntry(e){w(this.searchEntries,e),this.searchEntries.length||this.ideStore.setReferenceUsageResult(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class iE{searchState;searchEntries=[];constructor(e,t){(0,Re.rC)(this,{searchEntries:Re.LO,numberOfFiles:Re.Fl,numberOfResults:Re.Fl}),this.searchState=e,this.searchEntries=t}dismissSearchEntry(e){w(this.searchEntries,e),this.searchEntries.length||this.searchState.setResult(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class nE{ideStore;loadState=we.create();searchInput;text="";isCaseSensitive=!1;isRegExp=!1;result;constructor(e){(0,Re.rC)(this,{text:Re.LO,isCaseSensitive:Re.LO,isRegExp:Re.LO,result:Re.LO,setText:Re.aD,setCaseSensitive:Re.aD,setRegExp:Re.aD,setResult:Re.aD,search:Re.ls}),this.ideStore=e}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}select(){this.searchInput?.select()}*search(){if(!this.loadState.isInProgress){this.loadState.inProgress();try{const e=(yield this.ideStore.client.searchText(this.text,this.isCaseSensitive,this.isRegExp)).map((e=>(e=>(0,_e.vB)(Am,e))(e)));this.setResult(new iE(this,e)),this.loadState.pass()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e),this.loadState.fail()}}}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}setRegExp(e){this.isRegExp=e}setResult(e){this.result=e}}class aE{applicationStore;initState=we.create();directoryTreeState;conceptTreeState;client;activePanelMode=Ep.TERMINAL;panelGroupDisplayState=new Vm({initial:0,default:300,snap:100});activeActivity=gp.CONCEPT_EXPLORER;sideBarDisplayState=new Vm({initial:300,default:300,snap:150});tabManagerState=new Gp(this);executionState=we.create();navigationStack=[];fileSearchCommandLoadState=we.create();fileSearchCommandState=new Kg;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=we.create();referenceUsageResult;textSearchState;testRunState=we.create();testRunnerState;constructor(e){var t;(0,Re.rC)(this,{activePanelMode:Re.LO,activeActivity:Re.LO,navigationStack:Re.LO,openFileSearchCommand:Re.LO,fileSearchCommandResults:Re.LO,fileSearchCommandState:Re.LO,codeFixSuggestion:Re.LO,referenceUsageResult:Re.LO,testRunnerState:Re.LO,setCodeFixSuggestion:Re.aD,setReferenceUsageResult:Re.aD,setOpenFileSearchCommand:Re.aD,setActivePanelMode:Re.aD,setActiveActivity:Re.aD,setTestRunnerState:Re.aD,pullInitializationActivity:Re.aD,pullExecutionStatus:Re.aD,initialize:Re.ls,checkIfSessionWakingUp:Re.ls,loadDiagram:Re.ls,loadFile:Re.ls,execute:Re.ls,executeGo:Re.ls,manageExecuteGoResult:Re.ls,executeTests:Re.ls,executeFullTestSuite:Re.ls,executeNavigation:Re.ls,navigateBack:Re.ls,fullReCompile:Re.ls,command:Re.ls,findUsagesFromCoordinate:Re.ls,findUsages:Re.ls,renameConcept:Re.ls,movePackageableElements:Re.ls,updateFileUsingSuggestionCandidate:Re.ls,updateFile:Re.ls,searchFile:Re.ls,createNewDirectory:Re.ls,createNewFile:Re.ls,renameFile:Re.ls,deleteDirectoryOrFile:Re.ls}),this.applicationStore=e,this.textSearchState=new nE(this),this.directoryTreeState=new nm(this),this.conceptTreeState=new rm(this),this.client=new Gm(new ue({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl})),(t=this).applicationStore.terminalService.terminal.setup({webLinkProvider:{handler:(e,s)=>{const i=s.match(Jg);i?.groups?.url?t.applicationStore.navigationService.navigator.visitAddress(i.groups.url):i?.groups?.path&&i.groups.path_sourceId&&i.groups.path_column&&i.groups.path_line&&(0,Re.fl)(t.loadFile(i.groups.path_sourceId,new Lp(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:Jg},commands:[{command:Wp.GO,description:"Run the go() function in welcome file",usage:"go",aliases:["compile","executeGo"],handler:async e=>(0,Re.fl)(t.executeGo()).catch(t.applicationStore.alertUnhandledError)},{command:Wp.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=A(e);!s||s.match(Zg)?await(0,Re.fl)(t.executeTests(s??_p)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:Wp.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=A(e);s?.match(qg)?await(0,Re.fl)(t.deleteDirectoryOrFile(s,void 0,void 0)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("rm command requires a valid file/directory path")}},{command:Wp.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(qg))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(qg)?await(0,Re.fl)(t.renameFile(s,i)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid new file path")}},{command:Wp.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(qg)?await(0,Re.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:Wp.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(qg)?await(0,Re.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:Wp.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,Re.fl)(t.loadFile(pp)).catch(t.applicationStore.alertUnhandledError)}},{command:Wp.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(Zg)?await(0,Re.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:Wp.OPEN_DIRECTORY,description:"Open a directory or a package",usage:"cd /some/directory/path | cd some::package::path",handler:async e=>{const s=e[0];if(s&&(s.match(qg)||s.match(Zg)))try{s.match(Zg)?await(0,Re.fl)(t.conceptTreeState.revealConcept(s,{forceOpenExplorerPanel:!0,packageOnly:!0})):await(0,Re.fl)(t.directoryTreeState.revealPath(s,{forceOpenExplorerPanel:!0,directoryOnly:!0}))}catch(e){M(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or concept path")}},{command:Wp.LIST_DIRECTORY,description:"List children of a directory or package",usage:"cd /some/directory/path | cd some::package::path | cd ::",handler:async e=>{const s=e[0];if(s&&(s.match(qg)||s.match(Zg)||[mp,_p].includes(s)))try{s.match(Zg)||s===_p?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,_e.vB)(yp,e))).map((e=>e.li_attr instanceof Ap?`${et.BRIGHT_CYAN}${e.text}${et.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,_e.vB)(tm,e))).map((e=>e.isFolderNode?`${et.BRIGHT_CYAN}${e.text}${et.RESET}`:e.text)).join("\n"))}catch(e){M(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or package path")}},{command:Wp.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:Wp.ECHO,description:"Print text",usage:"echo 'some string'",handler:async(e,s,i)=>{const n=i.substring(i.indexOf(s)+s.length).trim();t.applicationStore.terminalService.terminal.output(n.replaceAll(/\\u001b/g,""))}},{command:Wp.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:Wp.HELP,description:"Show help",usage:"help",handler:async e=>(t.applicationStore.terminalService.terminal.showHelp(),Promise.resolve())}]})}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setActivePanelMode(e){this.activePanelMode=e}setCodeFixSuggestion(e){this.codeFixSuggestion=e}setReferenceUsageResult(e){this.referenceUsageResult=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.alertService.setBlockingAlert(void 0),this.applicationStore.alertService.setActionAlertInfo(void 0),this.applicationStore.terminalService.terminal.dispose()}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{this.applicationStore.alertService.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0});const s=this.client.initialize(!e).catch((e=>{M(e),this.applicationStore.notificationService.notifyError(e),this.initState.fail(),this.applicationStore.alertService.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Before debugging, make sure the server is running then restart the application"})}));yield this.pullInitializationActivity(),this.applicationStore.alertService.setBlockingAlert(void 0);const i=(0,Re.fl)(this.loadFile(pp)),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,_e.vB)(cm,n):(0,_e.vB)(lm,n):(0,_e.vB)(om,n);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open()),o instanceof lm?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof cm&&(yield(0,Re.fl)(this.loadFile(o.source,new Pp(o.source,o.line,o.column,new Xg((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r])),this.initState.pass()}catch(e){M(e),this.applicationStore.notificationService.notifyError(e),this.initState.fail(),this.applicationStore.alertService.setActionAlertInfo({message:"Failed to initialize IDE",prompt:"This can either due to an internal server error, which you would need to manually resolve; or a compilation, which you can proceed to debug",type:Dt.CAUTION,actions:[{label:"Compile to debug",type:Mt.PROCEED_WITH_CAUTION,default:!0,handler:()=>{(0,Re.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}]})}finally{this.applicationStore.terminalService.terminal.clear()}var n}else this.applicationStore.notificationService.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.alertService.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandService.registerCommand({key:Vp.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Vp.SEARCH_TEXT,action:()=>{this.setActivePanelMode(Ep.SEARCH),this.panelGroupDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Vp.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof Zp&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Vp.TOGGLE_TERMINAL_PANEL,action:()=>{this.panelGroupDisplayState.isOpen?this.activePanelMode!==Ep.TERMINAL?(this.setActivePanelMode(Ep.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.panelGroupDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Vp.EXECUTE,action:()=>{(0,Re.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.FULL_RECOMPILE,action:()=>{(0,Re.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,Re.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.RUN_ALL_TESTS,action:()=>{(0,Re.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.RUN_RELAVANT_TESTS,action:()=>{(0,Re.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Vp.SEARCH_FILE,Vp.SEARCH_TEXT,Vp.GO_TO_FILE,Vp.TOGGLE_TERMINAL_PANEL,Vp.EXECUTE,Vp.FULL_RECOMPILE,Vp.FULL_RECOMPILE_WITH_FULL_INIT,Vp.RUN_ALL_TESTS,Vp.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandService.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof Wg&&e.diagramPath===t));n||(yield(0,Re.fl)(this.checkIfSessionWakingUp()),n=new Wg(this,(0,_e.vB)(tg,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){try{let s=this.tabManagerState.tabs.find((t=>t instanceof Zp&&t.filePath===e));s||(yield(0,Re.fl)(this.checkIfSessionWakingUp()),s=new Zp(this,(0,_e.vB)(wp,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Pp&&s.showError(t))}catch(t){M(t),this.applicationStore.terminalService.terminal.fail(t.message,{systemCommand:`load file ${e}`})}}async reloadFile(e){const t=[];await Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof Zp&&s.filePath===e)s.setFile((0,_e.vB)(wp,await this.client.getFile(e)));else if(s instanceof Wg&&s.filePath===e)try{s.rebuild((0,_e.vB)(tg,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n,a){if(!this.initState.hasCompleted)return void this.applicationStore.notificationService.notifyWarning("Can't execute while initializing application");if(this.executionState.isInProgress)return void this.applicationStore.notificationService.notifyWarning("Another execution is already in progress!");this.setCodeFixSuggestion(void 0),this.executionState.inProgress();const r=this.tabManagerState.tabs.filter(V(Zp)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof Zp?{path:e.filePath,code:e.file.content}:e instanceof Wg?{diagram:e.diagramPath,code:ig(e.diagram)}:void 0)).filter(j),c=this.client.execute(l,e,t),d=1e3;let h,u=!1;yield Promise.all([c.then((e=>{u=!0,h=e})),new Promise(((e,t)=>setTimeout((()=>{!u&&s&&(this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus().finally((()=>{this.applicationStore.alertService.setBlockingAlert(void 0)})))),e()}),d,!0)))]);const p=(o=G(h)).error?o.candidateName&&o.PureUnmatchedFunctionException?(0,_e.vB)(Em,o):o.candidateName&&o.candidates?(0,_e.vB)(fm,o):(0,_e.vB)(um,o):o.jumpTo?(0,_e.vB)(mm,o):o.tests?(0,_e.vB)(Sm,o):(0,_e.vB)(hm,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof um?(this.applicationStore.notificationService.notifyError("Execution failed"+(p.text?`: ${p.text}`:"")),this.applicationStore.terminalService.terminal.fail(p.text,{systemCommand:n??"execute"}),p.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:p.sessionError}):yield(0,Re.fl)(i(p,r))):(a?.silentTerminalOnSuccess||this.applicationStore.terminalService.terminal.output(p.text??"",{clear:a?.clearTerminal,systemCommand:n??"execute"}),p instanceof hm?(this.applicationStore.notificationService.notifySuccess("Execution succeeded!"),p.reinit?(this.applicationStore.alertService.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,Re.fl)(this.initialize(!1,(()=>(0,Re.fl)(this.execute(e,t,s,i,n))),this.client.mode,this.client.compilerMode))):yield(0,Re.fl)(i(p,r))):yield(0,Re.fl)(i(p,r)))}catch(e){M(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:n??"execute"})}finally{this.applicationStore.alertService.setBlockingAlert(void 0),this.executionState.reset()}var o}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,Re.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,Re.fl)(this.manageExecuteGoResult(e,t))),Wp.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(V(Zp)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof um)e.source&&(yield(0,Re.fl)(this.loadFile(e.source,new Pp(e.source,e.line,e.column,new Xg(e.text.split("\n").filter(Boolean)[0]))))),e instanceof Em?(this.setCodeFixSuggestion(new eE(this,e)),this.setActivePanelMode(Ep.CODE_FIX_SUGGESTION),this.panelGroupDisplayState.open()):e instanceof fm&&(this.setCodeFixSuggestion(new tE(this,e)),this.setActivePanelMode(Ep.CODE_FIX_SUGGESTION),this.panelGroupDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof hm){if(e.modifiedFiles.length)for(const t of e.modifiedFiles)yield this.reloadFile(t);this.resetChangeDetection(t.concat(e.modifiedFiles)),!this.initState.hasFailed&&this.conceptTreeState.treeData||(yield(0,Re.fl)(this.conceptTreeState.initialize()),this.initState.pass())}yield s}*executeTests(e,t){t?this.applicationStore.notificationService.notifyUnsupportedFeature("Run relevant tests! (reason: VCS required)"):this.testRunState.isInProgress?this.applicationStore.notificationService.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,Re.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof um)e.source&&await(0,Re.fl)(this.loadFile(e.source,new Pp(e.source,e.line,e.column,new Xg(e.text.split("\n").filter(Boolean)[0])))),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open(),this.testRunState.fail();else if(e instanceof Sm){this.setActivePanelMode(Ep.TEST_RUNNER),this.panelGroupDisplayState.open();const t=new km(this,e);this.setTestRunnerState(t),await(0,Re.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,Re.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}),`${Wp.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,Re.fl)(this.executeTests(_p,e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,Re.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof mm&&await(0,Re.fl)(this.loadFile(e.jumpTo.source,new Lp(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column))),this.resetChangeDetection(t)}),"navigate",{silentTerminalOnSuccess:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,Re.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notificationService.notifyWarning("Can't navigate back any further - navigation stack is empty")}*fullReCompile(e){this.applicationStore.alertService.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:Dt.CAUTION,actions:[{label:"Perform full re-compile",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,Re.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(gp.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(V(Zp)).filter((t=>e.includes(t.filePath))).forEach((e=>e.resetChangeDetection()))}async refreshTrees(){await Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){let t;try{t=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notificationService.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}if(t.path){this.applicationStore.alertService.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==gp.CONCEPT_EXPLORER&&this.setActiveActivity(gp.CONCEPT_EXPLORER);const e=t.path.split(oa);let s=G(e[0]),i=G(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${oa}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,Re.fl)(this.conceptTreeState.expandNode(i)),i=G(this.conceptTreeState.getTreeData().nodes.get(s));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notificationService.notifyWarning("Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept")}finally{this.applicationStore.alertService.setBlockingAlert(void 0)}}}*command(e,t){try{const i=(s=yield e()).error?(0,_e.vB)(Um,s):new jm;return!(i instanceof Um&&(i.errorDialog?this.applicationStore.notificationService.notifyWarning(`Can't run command '${t}': ${i.text}`):this.applicationStore.terminalService.terminal.output(i.text,{systemCommand:t}),1))}catch(e){return M(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:t}),!1}var s}async getConceptInfo(e){try{return await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notificationService.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,_e.vB)(Mp,e)))}*findUsagesFromCoordinate(e){const t=yield this.getConceptInfo(e);t&&(yield(0,Re.fl)(this.findUsages(t)))}*findUsages(e){try{this.referenceUsageLoadState.inProgress(),this.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Dp(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===Np.ENUM_VALUE?bp.ENUM:e.pureType===Np.PROPERTY||e.pureType===Np.QUALIFIED_PROPERTY?bp.PROPERTY:bp.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,_e.qC)(vm,new vm(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,_e.vB)(vm,e)));this.setReferenceUsageResult(new sE(this,e,t,s)),this.setActivePanelMode(Ep.REFERENCES),this.panelGroupDisplayState.open()}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}finally{this.applicationStore.alertService.setBlockingAlert(void 0),this.referenceUsageLoadState.complete()}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){M(t),this.applicationStore.notificationService.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Ne.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(e){M(e),this.applicationStore.notificationService.notifyError(`Can't move packageable elements:\n${e.message}`)}}*updateFileUsingSuggestionCandidate(e){this.setCodeFixSuggestion(void 0),yield(0,Re.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield this.reloadFile(e);this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){M(t),this.applicationStore.notificationService.notifyError(`Can't update file '${e}'`)}}*searchFile(){this.fileSearchCommandLoadState.isInProgress||(this.fileSearchCommandLoadState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadState.pass())}*createNewDirectory(e){try{yield(0,Re.fl)(this.command((()=>this.client.createFolder(Rp(e))),Wp.NEW_DIRECTORY)),yield(0,Re.fl)(this.directoryTreeState.refreshTreeData())}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*createNewFile(e){try{const t=yield(0,Re.fl)(this.command((()=>this.client.createFile(Rp(e))),Wp.NEW_FILE));yield(0,Re.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,Re.fl)(this.loadFile(e)))}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*renameFile(e,t){try{yield(0,Re.fl)(this.command((()=>this.client.renameFile(e,t)),Wp.MOVE)),yield(0,Re.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof Zp&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,Re.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Rp(e))),Wp.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof Zp&&(void 0===t||t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,Re.fl)(this.directoryTreeState.refreshTreeData())};void 0===t||void 0===s?i().catch(this.applicationStore.alertUnhandledError):this.applicationStore.alertService.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:Dt.CAUTION,actions:[{label:"Delete anyway",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]})}}const rE=(0,kt.createContext)(void 0),oE=({children:e})=>{const t=Ut(),s=(0,Nt.fv)((()=>new aE(t)));return(0,T.jsx)(rE.Provider,{value:s,children:e})},lE=()=>G((0,kt.useContext)(rE),"Can't find editor store in context"),cE=(0,Nt.Pi)((()=>{const e=lE(),t=Ut().terminalService.terminal,s=(0,kt.useRef)(null),{ref:i,width:n,height:a}=(0,Hi.NB)();(0,kt.useEffect)((()=>(s.current&&t.searchConfig.setSearchInput(s.current),()=>t.searchConfig.setSearchInput(void 0))),[t]),(0,kt.useEffect)((()=>{i.current&&t.mount(i.current)}),[t,i]),(0,kt.useEffect)((()=>{e.panelGroupDisplayState.isOpen&&e.activePanelMode===Ep.TERMINAL&&t.focus()}),[t,e.panelGroupDisplayState.isOpen,e.activePanelMode]),(0,kt.useEffect)((()=>{t.autoResize()}),[t,n,a]);const r=()=>{t.clear(),t.focus()},o=()=>t.copyAll();return t.isSetup?(0,T.jsxs)("div",{className:"terminal-panel",children:[(0,T.jsxs)("div",{className:"terminal-panel__header",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__group",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__container",children:[(0,T.jsx)("input",{ref:s,className:"terminal-panel__header__searcher__input input--dark",spellCheck:!1,value:t.searchConfig.searchText,onChange:e=>{const s=e.target.value;t.setSearchText(s),t.search(s)},onKeyDown:e=>{"Enter"===e.code?e.shiftKey?t.findPrevious():t.findNext():"Escape"===e.code&&(t.clearSearch(),t.focus())},placeholder:"Find"}),(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__actions",children:[(0,T.jsx)("button",{className:"terminal-panel__header__searcher__input__action",tabIndex:-1,title:"Clear Search",onClick:()=>t.clearSearch(),children:(0,T.jsx)(Ys,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.matchCaseSensitive}),tabIndex:-1,title:"Match Case",onClick:()=>t.setSearchCaseSensitive(!t.searchConfig.matchCaseSensitive),children:(0,T.jsx)(Ks,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.matchWholeWord}),tabIndex:-1,title:"Match Whole Word",onClick:()=>t.setSearchWholeWord(!t.searchConfig.matchWholeWord),children:(0,T.jsx)(Xs,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.useRegex}),tabIndex:-1,title:"Use Regular Expression",onClick:()=>t.setSearchRegex(!t.searchConfig.useRegex),children:(0,T.jsx)(Ws,{})})]})]}),(0,T.jsx)("div",{className:"terminal-panel__header__searcher__result",children:t.searchConfig.resultCount?`${void 0!==t.searchConfig.currentResultIndex?t.searchConfig.currentResultIndex+1:0} of ${t.searchConfig.resultCount}`:"No results"}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Previous Match (Shift+Enter)",disabled:!t.searchConfig.resultCount,tabIndex:-1,onClick:()=>{t.findPrevious()},children:(0,T.jsx)(xs,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Next Match (Enter)",disabled:!t.searchConfig.resultCount,tabIndex:-1,onClick:()=>{t.findNext()},children:(0,T.jsx)(Ss,{className:"terminal-panel__header__action__icon"})})]}),(0,T.jsx)("div",{className:"terminal-panel__header__group__separator"}),(0,T.jsxs)("div",{className:"terminal-panel__header__group",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__action terminal-panel__header__group__action",{"terminal-panel__header__action--active":t.preserveLog}),title:"Toggle Preserve Console",tabIndex:-1,onClick:()=>t.setPreserveLog(!t.preserveLog),children:(0,T.jsx)(Kt,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Copy Text Content",tabIndex:-1,onClick:o,children:(0,T.jsx)(ys,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Clear Console",tabIndex:-1,onClick:r,children:(0,T.jsx)(ms,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Show Help",tabIndex:-1,onClick:()=>{t.showHelp(),t.focus()},children:(0,T.jsx)(ns,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(ji,{className:"terminal-panel__content",content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Gi,{onClick:o,children:"Copy All"}),(0,T.jsx)(Gi,{onClick:r,children:"Clear"})]}),menuProps:{elevation:7},children:(0,T.jsx)("div",{ref:i,className:"terminal-panel__container"})})]}):(0,T.jsx)("div",{className:"terminal-panel",children:(0,T.jsx)(Yi,{children:"Terminal is not set up yet"})})})),dE=(0,Nt.Pi)((e=>{const{searchResult:t,result:s}=e,i=lE(),n=Ut(),a=e=>()=>(0,Re.fl)(i.loadFile(s.sourceId,new Lp(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"text-search-panel__entry",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(Rs,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:Rp(s.sourceId)})]}),(0,T.jsxs)("div",{className:"text-search-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__header__action text-search-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"text-search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"text-search-panel__entry__header__action text-search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(qt,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"text-search-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label text-search-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text text-search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"text-search-panel__entry__content__item__action text-search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(qt,{})})})]},e.uuid)))})]})})),hE=(0,Nt.Pi)((e=>{const{searchResult:t}=e,s=lE(),i=Ut(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"text-search-panel__content",children:[(0,T.jsxs)("div",{className:"text-search-panel__content__header",children:[(0,T.jsx)("div",{className:"text-search-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} result(s) in ${t.numberOfFiles} files`:"No result"}),(0,T.jsxs)("div",{className:"text-search-panel__content__header__actions",children:[(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Refresh",onClick:()=>{(0,Re.fl)(s.textSearchState.search()).catch(i.alertUnhandledError)},children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>{s.textSearchState.setText(""),s.textSearchState.setResult(void 0)},children:(0,T.jsx)(Ys,{})}),!n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(Js,{})}),n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(Qs,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(dE,{searchResult:t,result:e},e.uuid)))})]})})),uE=(0,Nt.Pi)((()=>{const e=lE(),t=(0,kt.useRef)(null),s=e.textSearchState,i=(0,kt.useMemo)((()=>(0,tn.Z)((()=>s.search()),300)),[s]);return(0,kt.useEffect)((()=>(t.current&&s.setSearchInput(t.current),()=>s.setSearchInput(void 0))),[s]),(0,kt.useEffect)((()=>{e.panelGroupDisplayState.isOpen&&e.activePanelMode===Ep.SEARCH&&s.focus()}),[s,e.panelGroupDisplayState.isOpen,e.activePanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(zt,{isLoading:e.textSearchState.loadState.isInProgress}),(0,T.jsx)("div",{className:"text-search-panel__header",children:(0,T.jsxs)("div",{className:"text-search-panel__searcher__input__container",children:[(0,T.jsx)("input",{ref:t,autoFocus:!0,className:"text-search-panel__searcher__input input--dark",onChange:e=>{const t=e.target.value;s.setText(t),i.cancel(),t?i():s.setResult(void 0)},onKeyDown:e=>{"Enter"===e.code?(i.cancel(),s.text&&i()):"Escape"===e.code&&t.current?.select()},value:s.text,placeholder:"Search"}),(0,T.jsxs)("div",{className:"text-search-panel__searcher__input__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("text-search-panel__searcher__input__action",{"text-search-panel__searcher__input__action--active":s.isCaseSensitive}),tabIndex:-1,title:"Match Case",onClick:()=>s.setCaseSensitive(!s.isCaseSensitive),children:(0,T.jsx)(Ks,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("text-search-panel__searcher__input__action",{"text-search-panel__searcher__input__action--active":s.isRegExp}),tabIndex:-1,title:"Use Regular Expression",onClick:()=>s.setRegExp(!s.isRegExp),children:(0,T.jsx)(Ws,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(hE,{searchResult:e.textSearchState.result})]})})),pE=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}))}),(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},mE=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:mE,TreeNodeContainer:pE},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},_E=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(j),d={TreeNodeView:mE,TreeNodeContainer:pE},h=n?{...d,...n}:d;return(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,T.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var gE=s(410);const EE=gE.gs,fE="resizable-panel--collapsed",TE=(e,t)=>({collapsiblePanel:{className:(0,Ot.clsx)(...t?.classes??[],{[fE]:e}),onStartResize:e=>{e.domElement.classList.remove(fE),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),CE=gE.jW,SE=gE.nN,xE=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var NE=s(48845);const vE=(0,Nt.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=lE(),u=Ut(),p=r.testResultInfo,m=!t.data.type,_=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?ym.PASSED:t.failedTests.has(e)?ym.FAILED:t.testsWithError.has(e)?ym.ERROR:ym.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?ym.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?ym.RUNNING:ym.PASSED})(t,p):void 0){case ym.PASSED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,T.jsx)(_s,{})});break;case ym.FAILED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,T.jsx)(Is,{})});break;case ym.ERROR:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,T.jsx)(Jt,{})});break;case ym.RUNNING:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,T.jsx)(fs,{})});break;default:g=(0,T.jsx)(ns,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":_}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),m?E():o(t)},onDoubleClick:()=>{m?E():(0,Re.fl)(h.loadFile(t.data.li_attr.file,new Lp(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:e=>{e.stopPropagation(),E()},children:m?t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),AE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(oa),(0,T.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,T.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,T.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,T.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(j).map((e=>(0,T.jsx)(vE,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),IE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,T.jsxs)("div",{className:"explorer__content",children:[i&&(0,T.jsx)(Yi,{children:"No tests found"}),!i&&(0,T.jsx)(_E,{components:{TreeNodeContainer:vE},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(j),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),OE=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,yE=e=>{const{wrapText:t,result:s}=e,i=lE(),n=Ut(),[a,r]=(0,kt.useState)(),o=(0,kt.useRef)(void 0),l=(0,kt.useRef)(null),{ref:c,width:d,height:h}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,kt.useEffect)((()=>{if(!a&&l.current){const e=l.current,t=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,fontSize:12,extraEditorClassName:"monaco-editor--small-font",readOnly:!0,glyphMargin:!1,folding:!1,lineNumbers:"off",lineDecorationsWidth:10,lineNumbersMinChars:0,minimap:{enabled:!1},guides:{bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveBracketPair:!1,indentation:!1,highlightActiveIndentation:!1},renderLineHighlight:"none",theme:fp.LEGEND,language:Tp.TEXT});r(t)}}),[n,a]),o.current?.dispose(),o.current=Cp.languages.registerLinkProvider(Tp.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(OE)).forEach((e=>{void 0!==e.index&&e.groups?.path&&e.groups.path_sourceId&&e.groups.path_column&&e.groups.path_line&&t.push({range:{startLineNumber:s,startColumn:e.index+1,endLineNumber:s,endColumn:e.index+1+e.groups.path.length},tooltip:"Click to go to location",sourceId:e.groups.path_sourceId,line:e.groups.path_line,column:e.groups.path_column})}));return{links:t}},resolveLink:e=>{const t=e;(0,Re.fl)(i.loadFile(t.sourceId,new Lp(t.sourceId,Number.parseInt(t.line,10),Number.parseInt(t.column,10)))).catch(i.applicationStore.alertUnhandledError)}}),(0,kt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,kt.useEffect)((()=>{if(a){const e=s instanceof wm?"Test passed!":s instanceof Pm?s.error.text:"Running...";a.setValue(e),(s instanceof wm||s instanceof Pm)&&a.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof wm?"test-runner-panel__result__content--success":"test-runner-panel__result__content--failure"}}])}}),[a,s]),(0,kt.useEffect)((()=>{a&&a.updateOptions({wordWrap:t?"on":"off"})}),[a,t]),(0,kt.useEffect)((()=>()=>{a&&(e=>{e.dispose(),e.getModel()?.dispose()})(a),o.current?.dispose()}),[a]),(0,T.jsx)("div",{ref:c,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:l})})},RE=(0,Nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=lE(),a=Ut(),[r,o]=(0,kt.useState)(!1),l=i.results.get(s),c=G(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__label",children:c.text})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"test-runner-panel__result__header__icon--text-wrap"})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,Re.fl)(n.loadFile(c.li_attr.file,new Lp(c.li_attr.file,Number.parseInt(c.li_attr.line,10),Number.parseInt(c.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,T.jsx)(Hs,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(yE,{result:l,wrapText:r})})]})})),wE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=lE(),i=Ut(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Om.NONE,o=a?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(EE,{orientation:"vertical",children:[(0,T.jsx)(CE,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(zt,{isLoading:t.treeBuildingState.isInProgress}),(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,T.jsx)(_s,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,T.jsx)(Is,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,T.jsx)(Jt,{})]})]}),a&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,T.jsx)(Gs,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(Vs,{className:"test-runner-panel__icon--list-view"})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,T.jsx)(Ts,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(rs,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,Re.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(Os,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(ls,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(t.cancelTestRun()).catch(i.alertUnhandledError).finally((()=>{s.setTestRunnerState(void 0)}))},title:"Reset",children:(0,T.jsx)(qt,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(NE.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,T.jsx)("div",{className:"panel__content",children:t.treeData&&(0,T.jsxs)(T.Fragment,{children:[!t.viewAsList&&(0,T.jsx)(IE,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(AE,{testRunnerState:t})]})})]})}),(0,T.jsx)(SE,{children:(0,T.jsx)(xE,{color:s.panelGroupDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(CE,{minSize:400,children:[t.selectedTestId&&!a&&(0,T.jsx)("div",{}),t.selectedTestId&&a&&(0,T.jsx)(RE,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsx)("div",{className:"panel__header"}),(0,T.jsx)("div",{className:"panel__content",children:(0,T.jsx)(Yi,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),LE=(0,Nt.Pi)((()=>{const e=lE().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Yi,{children:(0,T.jsx)("div",{className:"panel-group__splash-screen",children:(0,T.jsxs)("div",{className:"panel-group__splash-screen__content",children:[(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Run full test suite"}),(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(wE,{testRunnerState:e})]})})),PE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=lE(),i=Ut(),n=()=>{(0,Re.fl)(s.loadFile(t.sourceID,new Lp(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-location",children:`${Rp(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"suggestions-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,T.jsx)(cs,{})})})]})})),bE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=lE(),i=Ut();return(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,Re.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-location",children:`${Rp(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"suggestions-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,Re.fl)(s.loadFile(t.sourceID,new Lp(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(cs,{})})})]})})),DE=(0,Nt.Pi)((e=>{const{suggestionState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"suggestions-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,T.jsx)(PE,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,T.jsx)(bE,{candidate:e},e.uuid)))})]})]})})),ME=(0,Nt.Pi)((e=>{const{suggestionState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"suggestions-panel__content",children:[!s.candidates.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidates.map((e=>(0,T.jsx)(bE,{candidate:e},e.uuid)))})]})]})})),FE=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof eE&&(0,T.jsx)(DE,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof tE&&(0,T.jsx)(ME,{suggestionState:e.codeFixSuggestion})]})})),kE=(0,Nt.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=lE(),n=Ut(),a=e=>()=>(0,Re.fl)(i.loadFile(s.sourceId,new Lp(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"references-panel__entry",children:[(0,T.jsxs)("div",{className:"references-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"references-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"references-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(Rs,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:Rp(s.sourceId)})]}),(0,T.jsxs)("div",{className:"references-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"references-panel__entry__header__action references-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"references-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"references-panel__entry__header__action references-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(qt,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"references-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"references-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label references-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"references-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text references-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"references-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"references-panel__entry__content__item__action references-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(qt,{})})})]},e.uuid)))})]})})),jE=(0,Nt.Pi)((e=>{const{referenceUsageState:t}=e,s=lE(),i=Ut(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"references-panel__content",children:[(0,T.jsxs)("div",{className:"references-panel__content__header",children:[(0,T.jsx)("div",{className:"references-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Dp(t.usageConcept)}`:`No usages found for ${Dp(t.usageConcept)}`}),(0,T.jsxs)("div",{className:"references-panel__content__header__actions",children:[(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Refresh",onClick:()=>{(0,Re.fl)(s.findUsages(t.usageConcept)).catch(i.alertUnhandledError)},children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(Ys,{})}),!n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(Js,{})}),n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(Qs,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(kE,{referenceUsageResult:t,result:e},e.uuid)))})]})})),UE=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(zt,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Yi,{children:(0,T.jsx)("div",{className:"panel-group__splash-screen",children:(0,T.jsx)("div",{className:"panel-group__splash-screen__content",children:(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Find Concept References"}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Alt"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)(jE,{referenceUsageState:e.referenceUsageResult})]})})),GE=(0,Nt.Pi)((()=>{const e=lE(),t={[Ep.TERMINAL]:{mode:Ep.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(Ns,{className:"panel-group__header__tab__icon--terminal"}),isVisible:!0},[Ep.SEARCH]:{mode:Ep.SEARCH,name:"SEARCH",icon:(0,T.jsx)(hs,{className:"panel-group__header__tab__icon--search"}),isVisible:!0},[Ep.TEST_RUNNER]:{mode:Ep.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(ri,{className:"panel-group__header__tab__icon--test"}),isVisible:!0},[Ep.REFERENCES]:{mode:Ep.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(Zs,{className:"panel-group__header__tab__icon--references"}),isVisible:!0},[Ep.CODE_FIX_SUGGESTION]:{mode:Ep.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(qs,{className:"panel-group__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Ep).filter((e=>j(t[e])&&t[e].isVisible)),i=t=>e.activePanelMode===t&&s.includes(t);return(0,kt.useEffect)((()=>{s.includes(e.activePanelMode)||e.setActivePanelMode(Ep.TERMINAL)}),[e,s,e.activePanelMode]),(0,T.jsxs)("div",{className:"panel panel-group",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel-group__header__tabs",children:s.map((e=>t[e])).filter(j).map((t=>{return(0,T.jsxs)("button",{tabIndex:-1,className:(0,Ot.clsx)("panel-group__header__tab",{"panel-group__header__tab--active":e.activePanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActivePanelMode(s)),children:[(0,T.jsx)("div",{className:"panel-group__header__tab__icon",children:t.icon}),(0,T.jsx)("div",{className:"panel-group__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,T.jsxs)("div",{className:"panel-group__header__actions",children:[(0,T.jsx)("button",{className:"panel-group__header__action",onClick:()=>e.panelGroupDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.panelGroupDisplayState.isMaximized?(0,T.jsx)(ti,{}):(0,T.jsx)(si,{})}),(0,T.jsx)("button",{className:"panel-group__header__action",onClick:()=>e.panelGroupDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(ni,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Ep.TERMINAL)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(cE,{})}),i(Ep.SEARCH)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(uE,{})}),i(Ep.TEST_RUNNER)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(LE,{})}),i(Ep.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(FE,{})}),i(Ep.REFERENCES)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(UE,{})})]})]})}));var VE=s(42689);const $E=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(Ci,{})}),BE=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),zE=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),HE=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),YE=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),WE=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),KE=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(Oi,{})}),XE=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(os,{})}),ZE=()=>(0,T.jsx)("div",{children:(0,T.jsx)(is,{})}),qE=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Oi,{})}),JE=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(fi,{})}),QE=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(ds,{})}),ef=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(Ds,{})}),tf=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),sf=e=>{switch(e){case Np.PACKAGE:return(0,T.jsx)($E,{});case Np.PROFILE:return(0,T.jsx)(WE,{});case Np.CLASS:return(0,T.jsx)(BE,{});case Np.ASSOCIATION:return(0,T.jsx)(tf,{});case Np.PROPERTY:case Np.QUALIFIED_PROPERTY:return(0,T.jsx)(JE,{});case Np.ENUMERATION:return(0,T.jsx)(zE,{});case Np.MEASURE:return(0,T.jsx)(HE,{});case Np.UNIT:return(0,T.jsx)(YE,{});case Np.FUNCTION:return(0,T.jsx)(KE,{});case Np.NATIVE_FUNCTION:return(0,T.jsx)(qE,{});case Np.DIAGRAM:return(0,T.jsx)(QE,{});case Np.DATABASE:return(0,T.jsx)(ef,{});case Np.MAPPING:return(0,T.jsx)(XE,{});default:return(0,T.jsx)(ZE,{})}},nf=/^\w[\w$]*$/,af=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,rf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Np.PACKAGE,[r,o]=(0,kt.useState)(a?pu(n):n),l=(0,kt.useRef)(null),c=Boolean(r.match(a?af:nf)),d=(a?pu(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,T.jsx)(It.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,T.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(h),onClick:p,children:"Rename"})]})]})})})),of=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,lf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),n=mu(t.data.li_attr.pureId)??"",[a,r]=(0,kt.useState)(n),o=(0,kt.useRef)(null),l=Boolean(a.match(of)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([B(t.data.li_attr,Op)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Move element"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Move"})]})]})})})),cf=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr,a=n.pureType,r=lE(),o=Ut();return(0,T.jsxs)(Ui,{ref:t,children:[n.pureType!==Np.PROPERTY&&n.pureType!==Np.QUALIFIED_PROPERTY&&(0,T.jsx)(Gi,{onClick:()=>{o.clipboardService.copyTextToClipboard(n.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),a===Np.PACKAGE&&(0,T.jsx)(Gi,{onClick:()=>{(0,Re.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),a===Np.FUNCTION&&(0,T.jsx)(Gi,{onClick:()=>{o.navigationService.navigator.visitAddress(`${r.client.baseUrl}/execute?func=${n.pureId}&mode=${r.client.mode}`)},children:"Service (JSON)"}),(n instanceof Ip||n instanceof Op)&&(0,T.jsx)(Gi,{onClick:()=>{(n instanceof Op||n instanceof Ip)&&r.findUsagesFromCoordinate(new Lp(n.file,Number.parseInt(n.line,10),Number.parseInt(n.column,10)))},children:"Find Usages"}),a!==Np.PACKAGE&&(0,T.jsx)(Gi,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(Vi,{}),(0,T.jsx)(Gi,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),n instanceof Op&&(0,T.jsx)(Gi,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var df;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(df=df||(df={}));const hf=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,kt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof Ip&&t.data.li_attr.classPath!==t.parent.id,p=[Np.PACKAGE,Np.CLASS].includes(t.data.li_attr.pureType),m=t.data.li_attr.pureType===Np.QUALIFIED_PROPERTY?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:pu(B(t.data.li_attr,Ip).classPath)})]}):t.label.includes("(")?(0,T.jsxs)(T.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,_=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,VE.c)((()=>({type:"Class"===t.data.li_attr.pureType?df.CLASS:df.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(ji,{content:(0,T.jsx)(cf,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&_(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(fs,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:_,children:p?t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,Ot.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:sf(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:m})]})})},uf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(_E,{components:{TreeNodeContainer:hf},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(j),innerProps:{onNodeOpen:e=>{(0,Re.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,Re.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:s=>{const i=s.data.li_attr;(i instanceof Op||i instanceof Ip)&&(0,Re.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Lp(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(rf,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(lf,{node:s.nodeForMoveElement})]})})),pf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.conceptTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,Re.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(rs,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(zt,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(uf,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Yi,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),mf=/^\w+(?:\.\w+)*$/,_f=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)("untitled.pure"),r=(0,kt.useRef)(null),o=Boolean(n.match(mf)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,Re.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),gf=/^\w+$/,Ef=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)("untitled"),r=(0,kt.useRef)(null),o=Boolean(n.match(gf)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,Re.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),ff=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Tf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)(t.data.li_attr.path),r=(0,kt.useRef)(null),o=Boolean(n.match(ff)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,Re.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Rename"})]})]})})})),Cf=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{node:s}=e,i=Ut(),n=lE(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(Ui,{ref:t,children:[(0,T.jsx)(Gi,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(Vi,{}),a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Gi,{disabled:Boolean(s.data instanceof tm&&s.data.children),onClick:()=>{(0,Re.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),Sf=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,kt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof tm&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,m=t.data instanceof tm&&!t.data.children,_=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(Cs,{className:"explorer__icon--readonly"}):p?m?(0,T.jsx)(As,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(vs,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(As,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Rs,{className:(0,Ot.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{m||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(ji,{content:(0,T.jsx)(Cf,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(p?g():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(fs,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||m?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},xf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(_E,{components:{TreeNodeContainer:Sf},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(j),innerProps:{onNodeOpen:e=>{(0,Re.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,Re.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(_f,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(Ef,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(Tf,{node:s.nodeForRenameFile})]})})),Nf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.directoryTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,Re.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof Zp&&(0,Re.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Xt,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(rs,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(zt,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(xf,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Yi,{children:"Failed to build directory tree"})]})]})})]})})),vf=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,Ot.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case gp.CONCEPT_EXPLORER:return(0,T.jsx)(pf,{});case gp.FILE_EXPLORER:return(0,T.jsx)(Nf,{});default:return null}})()},e.activeActivity)})})),Af=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)("logo",t),children:(0,T.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},If=(0,Nt.Pi)((()=>{const e=lE(),t=t=>()=>e.setActiveActivity(t),s=[{mode:gp.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(us,{})},{mode:gp.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(Rs,{})}].filter((e=>Boolean(e)));return(0,T.jsxs)("div",{className:"activity-bar",children:[(0,T.jsx)("div",{className:"activity-bar__logo",children:(0,T.jsx)(Af,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,Ot.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),Of=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,s=t.textEditorState.cursorObserver,i=s?.selection?t.textEditorState.model.getValueInRange(s.selection).length:0;return(0,T.jsx)("div",{className:"file-editor__status-bar",children:s?.position&&(0,T.jsx)("button",{className:"editor__status-bar__action file-editor__status-bar__cursor-info",onClick:()=>t.setShowGoToLinePrompt(!0),tabIndex:-1,title:"Go to Line/Column",children:`Ln ${s.position.lineNumber}, Col ${s.position.column} ${i?` (${i} selected)`:""}`})})})),yf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut();return(0,T.jsxs)("div",{className:"editor__status-bar",children:[(0,T.jsx)("div",{className:"editor__status-bar__left",children:(0,T.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,T.jsxs)("div",{className:"editor__status-bar__right",children:[e.tabManagerState.currentTab instanceof Zp&&(0,T.jsx)(Of,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":e.executionState.isInProgress}),disabled:e.initState.isInInitialState||e.executionState.isInProgress,onClick:()=>{(0,Re.fl)(e.executeGo()).catch(t.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(ss,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(e.panelGroupDisplayState.isOpen)}),onClick:()=>e.panelGroupDisplayState.toggle(),tabIndex:-1,title:"Toggle panel",children:(0,T.jsx)(Ns,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!t.assistantService.isHidden}),onClick:()=>t.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,T.jsx)($s,{})})]})]})})),Rf=e=>{(0,kt.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},wf=/[0-9]+(?::[0-9]+)?/,Lf=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,kt.useState)(""),n=(0,kt.useRef)(null),a=Boolean(s.match(wf)),r=t.textEditorState.editor?.getPosition(),[o,l]=(e=>{const t=e.split(":");return t.length<1||t.length>2?[1,void 0]:[F((()=>parseInt(G(A(t)))))??1,F((()=>parseInt(G(I(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=a?c?void 0:"Invalid line number":"Invalid value (format [line:column] - e.g. 123:45)",h=()=>t.setShowGoToLinePrompt(!1),u=e=>{e.preventDefault(),h(),t.textEditorState.setForcedCursorPosition({lineNumber:o,column:l??1})};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>n.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Go to..."}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:n,className:"input input--dark",onChange:e=>i(e.target.value),placeholder:r?`Current Line: ${r.lineNumber}, Col: ${r.column}. Type a line between 1 and ${t.textEditorState.model.getLineCount()} to navigate to`:void 0,value:s,spellCheck:!1}),""!==s&&d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:""===s||Boolean(d),onClick:u,children:"Go"})]})]})})})),Pf=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=lE(),i=Ut(),n=(0,kt.useRef)(null),[a,r]=(0,kt.useState)(),{ref:o,width:l,height:c}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,theme:fp.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off",readOnly:t.file.RO});s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[s,i,t,a]),Rf(t),(0,kt.useEffect)((()=>{void 0!==l&&void 0!==c&&a?.layout({width:l,height:c})}),[a,l,c]),(0,kt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Sp(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,kt.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose())}),[t,a]),(0,T.jsxs)("div",{className:"panel editor-group file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(Lf,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:o,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:n})})})]})})),bf=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=G(A(e.split(".")));return t.includes(i)};var Df;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.PARAMETER="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Df=Df||(Df={}));const Mf={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Df.IDENTIFIER,foreground:"dcdcaa"},{token:Df.NUMBER,foreground:"b5cea8"},{token:Df.DATE,foreground:"b5cea8"},{token:Df.COLOR,foreground:"b5cea8"},{token:Df.PACKAGE,foreground:"808080"},{token:Df.PARSER,foreground:"c586c0"},{token:Df.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Df.MULTIPLICITY,foreground:"2d796b"},{token:Df.GENERICS,foreground:"2d796b"},{token:Df.PROPERTY,foreground:"9cdcfe"},{token:Df.PARAMETER,foreground:"9cdcfe"},{token:Df.VARIABLE,foreground:"4fc1ff"},{token:Df.TYPE,foreground:"3dc9b0"},{token:`${Df.STRING}.escape`,foreground:"d7ba7d"}]},Ff={wordPattern:/(-?\d*\.\d\w*)|([^`~!@#%^$&*()\-=+[{\]}\\|;:'",.<>/?\s][^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]*)/,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};class kf{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,_e.yu)(kf,{pureType:(0,_e.Ru)(),pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),text:(0,_e.Ru)(),requiredClassProperties:(0,_e.jt)((0,_e.pb)((0,_e.Ru)()))});class jf{pureType;pureName;owner;ownerPureType}(0,_e.yu)(jf,{pureType:(0,_e.Ru)(),pureName:(0,_e.Ru)(),owner:(0,_e.Ru)(),ownerPureType:(0,_e.Ru)()});class Uf{pureId;pureName;requiredClassProperties=[]}(0,_e.yu)(Uf,{pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),requiredClassProperties:(0,_e.jt)((0,_e.pb)((0,_e.Ru)()))});class Gf{name}(0,_e.yu)(Gf,{name:(0,_e.Ru)()});const Vf="Diagram",$f="Diagram",Bf=()=>{const e=[];return e.push({label:{label:"/copyright",description:"(copyright header)"},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`// Copyright \${1:${(new Date).getFullYear()}} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n`,range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e},zf=e=>({label:{label:e.pureName,description:e.pureId},kind:Cp.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),Hf=(e,t)=>{const s=e.pureType,i=s===Np.FUNCTION||s===Np.NATIVE_FUNCTION?((e,t,s)=>{const i=pu(t),n=F((()=>i.substring(i.indexOf("_"),i.length-1))),a=n?.split("__")??[];return a.pop(),s&&a.shift(),`${e}(${a.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,n=s===Np.PACKAGE?Cp.languages.CompletionItemKind.Folder:s===Np.CLASS?Cp.languages.CompletionItemKind.Class:s===Np.FUNCTION?Cp.languages.CompletionItemKind.Function:s===Np.ENUMERATION?Cp.languages.CompletionItemKind.Enum:s===Np.PROFILE?Cp.languages.CompletionItemKind.Module:s===Np.ASSOCIATION?Cp.languages.CompletionItemKind.Interface:Cp.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:n,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===Np.PACKAGE?`zzzz_${e.text}`:e.text}},Yf=/(?<incompletePath>(?:\w[\w$]*::)+$)/,Wf=/->\s*(?:\w[\w$]*::)+$/,Kf=/\^\s*(?:\w[\w$]*::)+$/,Xf=/^\s*import\s+(?:(?<importPath>(?:(?:\w[\w$]*)::)*\w[\w$]*)::*)/,Zf=(e,t)=>{const s=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=`${la}${dg.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(la))).lastIndexOf(!0)).map((e=>e.match(Xf)?.groups?.importPath)).filter(j)},qf=/->\s*(?:\w[\w$]*)?$/,Jf=/\^\s*(?:\w[\w$]*)?$/,Qf=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,eT=(e,t)=>({label:e.name,kind:Cp.languages.CompletionItemKind.Variable,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:t?e.name:`zzzz_${e.name}`,insertText:e.name}),tT=/^\w[\w$]*$/,sT=(0,Nt.Pi)((e=>{const{renameConceptState:t}=e,s=Ut(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,kt.useState)(n),o=(0,kt.useRef)(null),l=Boolean(a.match(tT)),c=n===a,d=l?void 0:"Invalid concept name",h=()=>{(0,Re.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Rename"})]})]})})})),iT=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=(0,kt.useRef)(void 0),i=(0,kt.useRef)(void 0),n=(0,kt.useRef)(void 0),a=(0,kt.useRef)(null),[r,o]=(0,kt.useState)(),[l,c]=(0,kt.useState)(!1),d=lE(),h=Ut(),{ref:u,width:p,height:m}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{if(!r&&a.current){const e=a.current,s=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,language:Tp.PURE,theme:fp.LEGEND,wordSeparators:"`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",wordWrap:t.textEditorState.wrapText?"on":"off",readOnly:t.file.RO,contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,Re.fl)(d.executeNavigation(new Lp(t.filePath,e.lineNumber,e.column))).catch(h.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>c(!0))),s.addAction({id:Hp.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Lp(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Hp.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Lp(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Hp.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){if(!t.textEditorState.model.getWordAtPosition(s))return;const e=new Lp(t.filePath,s.lineNumber,s.column);(0,Re.fl)(t.setConceptToRenameState(e)).catch(d.applicationStore.alertUnhandledError)}}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),o(s)}}),[d,h,t,r]),s.current?.dispose(),s.current=Cp.languages.registerDefinitionProvider(Tp.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),n=Cp.editor.tokenize(i,Tp.PURE)[0];if(!n)return[];let a,r;for(let e=1;e<=n.length;++e){const t=e===n.length?i.length:G(n[e]).offset;if(t+1>s.column){a=G(n[e-1]),r={startLineNumber:s.lineNumber,startColumn:a.offset+1,endLineNumber:s.lineNumber,endColumn:t+1};break}}return a&&r&&bf(a.type,[Df.TYPE,Df.VARIABLE,Df.PROPERTY,Df.PARAMETER,Df.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:r}]:[]}}),i.current?.dispose(),i.current=Cp.languages.registerCompletionItemProvider(Tp.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let n=[];if(i.triggerKind===Cp.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":n=n.concat(Bf());break;case"#":n=n.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${la}${e.text}`,description:e.description},kind:Cp.languages.CompletionItemKind.Keyword,insertText:`${la}${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:dg.PURE,description:"(core Pure)",insertText:dg.PURE},{text:dg.MAPPING,description:"(dsl)",insertText:dg.MAPPING},{text:dg.CONNECTION,description:"(dsl)",insertText:dg.CONNECTION},{text:dg.RUNTIME,description:"(dsl)",insertText:dg.RUNTIME},{text:dg.RELATIONAL,description:"(external store)",insertText:dg.RELATIONAL},{text:Vf,description:"(dsl)",insertText:$f}]));break;case":":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Yf);if(i?.groups?.incompletePath){const n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Wf)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Kf));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-2),a?[Np.CLASS]:n?[Np.FUNCTION,Np.NATIVE_FUNCTION]:[])).map((e=>(0,_e.vB)(kf,e)))}catch{}return r.map((e=>a?zf(e):Hf(e,{preferArrowFunctionForm:n})))}return[]})(s,e,d));break;case">":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForIdentifier(i,[Np.FUNCTION,Np.NATIVE_FUNCTION])).map((e=>(0,_e.vB)(kf,e)))}catch{}return n.map((e=>Hf(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Qf),n=Zf(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(n,i.groups.owner)).map((e=>(0,_e.vB)(jf,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===Np.PROPERTY||t===Np.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===Np.PROPERTY?Cp.languages.CompletionItemKind.Property:t===Np.QUALIFIED_PROPERTY?Cp.languages.CompletionItemKind.Method:t===Np.TAG?Cp.languages.CompletionItemKind.Constant:t===Np.STEREOTYPE?Cp.languages.CompletionItemKind.Value:t===Np.ENUM_VALUE?Cp.languages.CompletionItemKind.Enum:Cp.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,_e.vB)(Uf,e)))}catch{}return n.map((e=>zf(e)))})(s,e,d));break;case"@":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,_e.vB)(Uf,e)))}catch{}return n.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:Cp.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":n=n.concat(await(async(e,t,s,i)=>{let n=[];try{n=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,_e.vB)(Gf,e)))}catch{}const a=new Set;let r=!1;for(let s=e.lineNumber-1;s>Math.max(0,e.lineNumber-1-10)&&!r;--s){const i=t.getLineContent(s+1);(i.match(/^\s*function\s+/)||i.match(/^\s*###\w+/))&&(r=!0);const n=G(Cp.editor.tokenize(t.getLineContent(s+1),Tp.PURE)[0]);n.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&bf(i.type,[Df.VARIABLE,Df.PARAMETER],!0)&&a.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===n.length-1?Number.MAX_SAFE_INTEGER:G(n[r+1]).offset+1}))}))}const o=n.map((e=>e.name));return n.map((e=>eT(e,!0))).concat(Array.from(a).filter((e=>!o.includes(e))).map((e=>{const t=new Gf;return t.name=e,t})).map((e=>eT(e,!1))))})(s,e,t.filePath,d))}return{suggestions:n}}}),n.current?.dispose(),n.current=Cp.languages.registerCompletionItemProvider(Tp.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===Cp.languages.CompletionTriggerKind.Invoke&&(i=i.concat(Bf()),i=i.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${la}${dg.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(la))),o=(e=>{if(e.startsWith(la))return e.substring(3).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case dg.PURE:return[{text:lg.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:lg.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:lg.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:lg.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:lg.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:lg.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:lg.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:lg.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:lg.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case dg.MAPPING:return[{text:lg.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:lg.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:lg.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:lg.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case dg.RELATIONAL:return[{text:lg.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case Vf:return[{text:$f,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n{\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n}"}];default:return[]}})(e)))),i=i.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"},{text:"NULL",description:"(nullish value)",insertText:"[]"}])),i=i.concat(await(async(e,t,s)=>{const i=Zf(e,t),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(qf)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Jf));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,a?[Np.CLASS]:n?[Np.FUNCTION,Np.NATIVE_FUNCTION]:[])).map((e=>(0,_e.vB)(kf,e)))}catch{}return r.map((e=>a?zf(e):Hf(e,{preferArrowFunctionForm:n})))})(t,e,d))),{suggestions:i}}}),Rf(t),(0,kt.useEffect)((()=>{if(l){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}c(!1)}}),[l]),(0,kt.useEffect)((()=>{void 0!==p&&void 0!==m&&r?.layout({width:p,height:m})}),[r,p,m]),(0,kt.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(Sp(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,kt.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),n.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel editor-group file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(sT,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(Lf,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:u,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:a})})})]})}));var nT=s(8533);const aT=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,kt.useRef)(null),[h,u]=(0,kt.useState)(null);return(0,kt.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,T.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,T.jsx)(ki,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},rT=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Ut(),n=s.diagram,a=t,{width:r,height:o}=(0,Hi.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,kt.useEffect)((()=>{const e=new Yg(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render({initial:!0})}),[a,s,n]),(0,kt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.render({initial:!0})}),[s,s.isDiagramRendererInitialized]),(0,kt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,kt.useCallback)(((e,t)=>{if(e instanceof yp){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Pu(n.x,n.y))):void 0;(0,Re.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,nT.L)((()=>({accept:df.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,T.jsx)("div",{ref:a,className:(0,Ot.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),oT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=lE(),i=Ut(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_LEFT),children:(0,T.jsx)(ui,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_CENTER),children:(0,T.jsx)(pi,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_RIGHT),children:(0,T.jsx)(mi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_TOP),children:(0,T.jsx)(ci,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_MIDDLE),children:(0,T.jsx)(di,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_BOTTOM),children:(0,T.jsx)(hi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.SPACE_HORIZONTALLY),children:(0,T.jsx)(_i,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.SPACE_VERTICALLY),children:(0,T.jsx)(gi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(aT,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(Vi,{}),zg.map((e=>(0,T.jsxs)(Gi,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,T.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,T.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,T.jsx)(ts,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(s.loadFile(t.filePath,new Lp(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Hs,{className:"diagram-editor__icon--go-to-file"})})})]})})),lT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,T.jsxs)("div",{className:"diagram-editor__tools",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.LAYOUT}),tabIndex:-1,onClick:i(Gg.LAYOUT,Vg.NONE),title:"View Tool (V)",children:(0,T.jsx)(Si,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.PAN}),tabIndex:-1,onClick:i(Gg.PAN,Vg.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(xi,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Gg.ZOOM_IN,Vg.NONE),children:(0,T.jsx)(Ni,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Gg.ZOOM_OUT,Vg.NONE),children:(0,T.jsx)(vi,{className:"diagram-editor__icon--zoom-out"})})]})})),cT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,kt.useRef)(null);return Rf(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(oT,{diagramEditorState:t})}),(0,T.jsx)("div",{className:"diagram-editor__content",children:(0,T.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,T.jsx)(lT,{diagramEditorState:t}),(0,T.jsx)(rT,{diagramEditorState:t,ref:s})]})})]})}));var dT=s(98533),hT=s(84153);(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{children:s,placeholder:i,showPlaceholder:n,className:a}=e;return(0,T.jsxs)("div",{ref:t,className:(0,Ot.clsx)("dnd__entry__container",a),children:[n&&(0,T.jsx)("div",{className:"dnd__entry__placeholder",children:i?(0,T.jsx)(T.Fragment,{children:i}):(0,T.jsx)("div",{className:"dnd__entry__placeholder__content"})}),(0,T.jsx)(T.Fragment,{children:s})]})})));const uT=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,T.jsx)("div",{className:(0,Ot.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,T.jsx)(T.Fragment,{children:t})};function pT(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,dT.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,T.jsx)(St.Z,{children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const mT=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},_T=(0,Nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Gi,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Gi,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),gT=(0,Nt.Pi)((e=>{const t=(0,kt.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,kt.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,nT.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,VE.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,kt.useEffect)((()=>{e((0,hT.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,Ot.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,T.jsx)(uT,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(ji,{content:(0,T.jsx)(_T,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,T.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,T.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,T.jsx)(qt,{})})]})})});var h})),ET=(0,Nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(aT,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(Ui,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Gi,{className:(0,Ot.clsx)("tab-manager__menu__item",{"tab-manager__menu__item--active":e===t.currentTab}),onClick:()=>t.openTab(e),children:[(0,T.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,T.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,T.jsx)(qt,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(ti,{})})})),fT=(0,Nt.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,T.jsxs)("div",{className:"tab-manager",children:[(0,T.jsxs)("div",{className:"tab-manager__content",onWheel:mT,children:[t.tabs.map((e=>(0,T.jsx)(gT,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(pT,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(ET,{managerTabState:t})]})})),TT=()=>{const[e,t]=(0,kt.useState)(!1),{ref:s,width:i,height:n}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,T.jsx)("div",{ref:s,className:"editor-group__splash-screen",children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("editor-group__splash-screen__content",{"editor-group__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Run the go() function"}),(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},CT=(0,Nt.Pi)((()=>{const e=lE(),t=e.tabManagerState.currentTab;return t?(0,T.jsxs)("div",{className:"panel editor-group",children:[(0,T.jsxs)("div",{className:"panel__header editor-group__header",children:[(0,T.jsx)("div",{className:"editor-group__header__tabs",children:(0,T.jsx)(fT,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof Zp){const s=e.tabManagerState.tabs.filter((e=>e instanceof Zp&&e.fileName===t.fileName)).length>1;return(0,T.jsxs)("div",{className:"editor-group__header__tab",children:[(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(Rs,{className:"editor-group__header__tab__icon--file"})}),(0,T.jsx)("div",{className:"editor-group__header__tab__label",children:t.fileName}),s&&(0,T.jsx)("div",{className:"editor-group__header__tab__path",children:t.filePath}),t.file.RO&&(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(Zt,{className:"editor-group__header__tab__icon--readonly"})})]})}if(t instanceof Wg){const s=e.tabManagerState.tabs.filter((e=>e instanceof Wg&&e.diagramName===t.diagramName)).length>1;return(0,T.jsxs)("div",{className:"editor-group__header__tab",children:[(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(QE,{})}),(0,T.jsx)("div",{className:"editor-group__header__tab__label",children:t.diagramName}),s&&(0,T.jsx)("div",{className:"editor-group__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,T.jsx)("div",{className:"panel__header__actions"})]}),(0,T.jsx)("div",{className:"panel__content editor-group__content",children:t instanceof Zp?t.textEditorState.language===Tp.PURE?(0,T.jsx)(iT,{editorState:t}):(0,T.jsx)(Pf,{editorState:t}):t instanceof Wg?(0,T.jsx)(cT,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(TT,{})}));var ST=s(50166),xT=s(97493);xT.Select.createFilter;const NT=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,kt.useRef)(null);return(0,kt.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(ST.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,T.jsx)("div",{style:t,children:i[e]})}):(0,T.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},vT="selector-input",AT="selector-input--dark",IT=()=>(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__loading-indicator ${AT}__loading-indicator`,children:(0,T.jsx)(fs,{})}),OT=()=>(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__dropdown-indicator`,children:(0,T.jsx)(ts,{})}),yT=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__clear-indicator`,children:(0,T.jsx)(qt,{})})})},RT=e=>(0,T.jsx)(xT.Select.components.Input,{...e,isHidden:!1}),wT=(0,kt.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?xT.CreatableSelect.default:xT.Select.default,u=l?AT:vT;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:yT,DropdownIndicator:OT,LoadingIndicator:IT,MenuList:NT,Input:RT,...r},...{...d,darkMode:l,noMatchMessage:n}})})),LT=(e,t)=>e.label.localeCompare(t.label),PT=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,n=(0,kt.useRef)(null),a=(0,kt.useMemo)((()=>(0,tn.Z)((()=>{(0,Re.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(It.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Open file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)(wT,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(LT),onChange:s=>{s?.value&&(r(),i.reset(),(0,Re.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,Ot.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.setRegExp(!i.isRegExp),children:(0,T.jsx)(Ws,{})})]})]})})}));var bT;!function(e){e.MODE="mode",e.FAST_COMPILE="fastCompile"}(bT=bT||(bT={}));const DT=(MT=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),{ref:s,width:i,height:n}=(0,Hi.NB)(),a=TE(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=TE(0===e.panelGroupDisplayState.size,{onStopResize:t=>e.panelGroupDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.panelGroupDisplayState.size}),o=TE(e.panelGroupDisplayState.isMaximized);return(0,kt.useEffect)((()=>{s.current&&e.panelGroupDisplayState.setMaxSize(s.current.offsetHeight)}),[e,s,n,i]),(0,kt.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,kt.useEffect)((()=>{(0,Re.fl)(e.initialize(!1,void 0,t.navigationService.navigator.getCurrentLocationParameterValue(bT.MODE),t.navigationService.navigator.getCurrentLocationParameterValue(bT.FAST_COMPILE))).catch(t.alertUnhandledError)}),[e,t]),(0,kt.useEffect)((()=>(t.navigationService.navigator.blockNavigation([()=>!0],void 0,(()=>t.notificationService.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigationService.navigator.unblockNavigation()})),[e,t]),Rf(e),(0,T.jsxs)("div",{className:"ide",children:[(0,T.jsxs)("div",{className:"ide__body",children:[(0,T.jsx)(If,{}),(0,T.jsx)("div",{className:"ide__content-container",ref:s,children:(0,T.jsx)("div",{className:"ide__content",children:(0,T.jsxs)(EE,{orientation:"vertical",children:[(0,T.jsx)(CE,{...a.collapsiblePanel,direction:1,children:(0,T.jsx)(vf,{})}),(0,T.jsx)(SE,{}),(0,T.jsx)(CE,{...a.remainingPanel,minSize:300,children:(0,T.jsxs)(EE,{orientation:"horizontal",children:[(0,T.jsx)(CE,{...o.collapsiblePanel,...0===e.panelGroupDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(CT,{})}),(0,T.jsx)(SE,{children:(0,T.jsx)(xE,{color:e.panelGroupDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(CE,{...r.collapsiblePanel,...e.panelGroupDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)(GE,{})})]})})]})})})]}),(0,T.jsx)(yf,{}),(0,T.jsx)(PT,{})]})})),function(){return(0,T.jsx)(oE,{children:(0,T.jsx)(MT,{})})});var MT;const FT=(0,Nt.Pi)((e=>{const{children:t}=e,s=G((0,kt.useContext)(dp),"Can't find application platform in context"),i=Ut();return(0,kt.useEffect)((()=>{i.initialize(s).catch(i.alertUnhandledError)}),[i,s]),i.initState.hasSucceeded?(0,T.jsx)(un,{children:t}):(0,T.jsx)(T.Fragment,{})}));class kT{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager}}const jT=(0,kt.createContext)(void 0),UT=({children:e})=>{const t=Ut(),s=(0,Nt.fv)((()=>new kT(t)));return(0,T.jsx)(jT.Provider,{value:s,children:e})},GT=({children:e})=>(0,T.jsx)(FT,{children:(0,T.jsx)(UT,{children:e})}),VT=e=>{const{baseUrl:t}=e;return(0,T.jsx)(up,{baseUrl:t,children:(0,T.jsx)(GT,{children:(0,T.jsx)(DT,{})})})},$T=JSON.parse('{"i8":"8.0.4","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class BT extends Hn{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class zT extends BT{static NAME=$T.Rw.p;constructor(){super(zT.NAME,$T.i8)}getExtraApplicationSetups(){return[async e=>{await(async e=>{const t=`Monospaced font '${Je}' has not been loaded properly, code editor might not display properly`;await Promise.all([400,700].map((e=>document.fonts.load(`${e} 1em ${Je}`)))).then((()=>{document.fonts.check(`1em ${Je}`)?Cp.editor.remeasureFonts():e.logService.error(h.create(me.APPLICATION_SETUP__FAILURE),t)})).catch((()=>e.logService.error(h.create(me.APPLICATION_SETUP__FAILURE),t)));const s="legend.code-editor.override-default-keybinding";Cp.editor.registerCommand(s,((t,...s)=>{e.keyboardShortcutsService.dispatch(s[0])}));const i=[[Cp.KeyCode.F1,"F1"],[Cp.KeyCode.F8,"F8"],[Cp.KeyCode.F9,"F9"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyG,"Control+KeyG"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyB,"Control+KeyB"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyO,"Control+KeyO"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyD,"Control+KeyD"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyP,"Control+KeyP"],[Cp.KeyMod.Shift|Cp.KeyCode.F10,"Shift+F10"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.F2,"Control+F2"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.F12,"Control+F12"]];Cp.editor.addKeybindingRules(i.map((([e,t])=>({keybinding:e,command:s,commandArgs:t}))))})(e),function(e){var t,s;Cp.editor.defineTheme(fp.LEGEND,Mf),Cp.languages.register({id:Tp.PURE}),Cp.languages.setLanguageConfiguration(Tp.PURE,Ff),Cp.languages.setMonarchTokensProvider(Tp.PURE,(t=e?.extraKeywords??[],s=e?.extraParserKeywords??[],{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",lg.CLASS,lg.ASSOCIATION,lg.ENUMERATION,lg.MEASURE,lg.PROFILE,lg.FUNCTION,lg.MAPPING,lg.RUNTIME,lg.CONNECTION,lg.FILE_GENERATION,lg.GENERATION_SPECIFICATION,lg.DATA_ELEMENT,cg.JSON_MODEL_CONNECTION,cg.MODEL_CHAIN_CONNECTION,cg.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",lg.SERVICE,lg.FLAT_DATA,lg.DATABASE,cg.FLAT_DATA_CONNECTION,cg.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[dg.PURE,dg.CONNECTION,dg.RUNTIME,dg.MAPPING,dg.SERVICE,dg.FLATDATA,dg.RELATIONAL,dg.GENERATION_SPECIFICATION,dg.FILE_GENERATION_SPECIFICATION,dg.DATA].concat(s).map((e=>`${la}${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:[a-zA-Z0-9]+(?:\.\.(?:[a-zA-Z0-9]+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/(?:(?:<\w+>)|(?:<[^:.@^()]+[^-]>))/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Df.PARSER,"@default":Df.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Df.LANGUAGE_STRUCT,"@keywords":`${Df.KEYWORD}.$0`,"([a-zA-Z_$][\\w$]*)_((\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))__)*(\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))_":Df.TYPE,"@default":Df.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Df.OPERATOR,"@default":Df.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Df.DELIMITER],[/'([^'\\]|\\.)*$/,`${Df.STRING}.invalid`],[/'/,Df.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Df.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Df.PACKAGE,Df.TYPE,Df.GENERICS,Df.WHITESPACE,Df.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Df.PACKAGE,Df.TYPE,Df.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Df.TYPE}.operator`,Df.WHITESPACE,Df.PACKAGE,Df.TYPE,Df.GENERICS,Df.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Df.DELIMITER,Df.PROPERTY]],[/(@identifier)(\s*=)/,[Df.PROPERTY,Df.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Df.TYPE,Df.OPERATOR,Df.PROPERTY]],[/(@identifier)(\s*:)/,[Df.PARAMETER,Df.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[Df.KEYWORD,Df.WHITESPACE,Df.VARIABLE,Df.OPERATOR]],[/(\$@identifier)/,[`${Df.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${Df.DATE}.latest`]],[/(@date)/,[Df.DATE]],[/(@time)/,[`${Df.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Df.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Df.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Df.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Df.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Df.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Df.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Df.NUMBER}.float`],[/(@digits)[lL]?/,Df.NUMBER]],whitespace:[[/[ \t\r\n]+/,Df.WHITESPACE],[/\/\*\*(?!\/)/,`${Df.COMMENT}.doc`,"@doc"],[/\/\*/,Df.COMMENT,"@comment"],[/\/\/.*$/,Df.COMMENT]],comment:[[/[^/*]+/,Df.COMMENT],[/\*\//,Df.COMMENT,"@pop"],[/[/*]/,Df.COMMENT]],doc:[[/[^/*]+/,`${Df.COMMENT}.doc`],[/\/\*/,`${Df.COMMENT}.doc.invalid`],[/\*\//,`${Df.COMMENT}.doc`,"@pop"],[/[/*]/,`${Df.COMMENT}.doc`]],string:[[/[^\\']+/,Df.STRING],[/@escapes/,`${Df.STRING}.escape`],[/\\./,`${Df.STRING}.escape.invalid`],[/'/,Df.STRING,"@pop"]],characters:[[/'[^\\']'/,Df.STRING],[/(')(@escapes)(')/,[Df.STRING,`${Df.STRING}.escape`,Df.STRING]],[/'/,`${Df.STRING}.invalid`]]}}))}({extraKeywords:[$f],extraParserKeywords:[Vf]})}]}getExtraKeyedCommandConfigEntries(){return[$p,Yp,zp].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class HT extends $n{static create(){const e=new HT(Zn.create());return e.withBasePlugins([new Yn,new zT]),e.withBasePresets([new ip]),e}async configureApplication(e){return new Kn(e)}async loadApplication(e){(0,C.s)((()=>{let e=document.getElementsByTagName(Bn).length?document.getElementsByTagName(Bn)[0]:void 0;return e||(e=document.createElement(Bn),document.body.appendChild(e)),e.setAttribute("style","height: 100%; width: 100%; display: block"),e})()).render((0,T.jsx)(Gt,{store:e,children:(0,T.jsx)(VT,{baseUrl:this.baseAddress})}))}}class YT{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){HT.create().setup({baseAddress:e}).withPresets(YT.getPresetCollection()).withPlugins(YT.getPluginCollection()).start().catch((e=>{throw e}))}}YT.run("/ide/")},97493:(e,t,s)=>{const i=s(54319),n=s(31776);e.exports={CreatableSelect:i,Select:n}},44524:(e,t,s)=>{const i=s(18978),n=s(1553),a=s(65186),r=s(49385),o=s(70563),l=s(16636),c=s(91914),d=s(8799),h=s(77245),u=s(30924),p=s(34543),m=s(75100),_=s(58920),g=s(52742);e.exports={FA:i,GI:n,MD:a,VSC:r,GO:o,SI:l,IO5:c,BS:d,BI:h,CG:u,FI:p,RI:m,TB:_,HI:g}},81931:(e,t,s)=>{const i=s(71659);e.exports={Fuse:i}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{14:"6a7e96d2",135:"3b62eae4",246:"63a82c7f",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(15411)));l=o.O(l)})();
|
2
|
-
//# sourceMappingURL=index.
|
1
|
+
(()=>{"use strict";var e,t,s,i,n,a={15411:(e,t,s)=>{const i=JSON.parse('{"i8":"10.0.0","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:m,info:_,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T=s(52322),C=s(17029),S=s(85928),x=s(21112);const N=e=>e.constructor,v=()=>()=>{},A=e=>e.length?e[0]:void 0,I=e=>e.length?e[e.length-1]:void 0,O=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),y=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),R=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},w=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class L extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class P extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class b extends P{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class D extends P{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,S.Z)(i,(e=>void 0!==e)));var i;return(0,x.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function M(e){if(!(e instanceof Error))throw new b("Expected error to be thrown")}const F=e=>{try{return e()}catch{return}};class k extends P{constructor(e,t){super("Assertion Error",e,t)}}const j=e=>null!=e;function U(e,t=""){if(null==e)throw new k(t||"Value is nullable")}const G=(e,t="")=>(U(e,t),e),V=e=>t=>((e,t)=>e instanceof t)(t,e);function $(e,t,s=""){if(!(e instanceof t))throw new k(s||`Value is expected to be of type '${t.name}'`)}const B=(e,t,s="")=>($(e,t,s),e);function z(e,t=""){if(""===G(e,t))throw new k(t||"Expected string value to be non-empty")}function H(e,t=""){return z(e,t),e}function Y(e,t=""){if(!e)throw new k(t||"Expected predicate to be truthy")}const W=e=>"string"==typeof e,K=e=>"number"==typeof e&&!isNaN(e),X=e=>"boolean"==typeof e,Z=e=>"object"==typeof e&&null!==e;var q=s(39391),J=s(33654),Q=s(18247),ee=s(72659);const te=q.W,se="charset=utf-8";var ie,ne,ae;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ie=ie||(ie={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(ne=ne||(ne={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ae=ae||(ae={}));const re={mode:"cors",credentials:"include",redirect:"manual"},oe=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class le extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Z(e))return W(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&W(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const ce=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new le(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===te.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ne.APPLICATION_JSON:return e.json();case ne.TEXT_PLAIN:return e.text();default:return Promise.reject(new le(e,`Can't process response for request with Content-Type '${i}'`))}},de=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME",i=document.getElementById(s);i?.remove();const n=document.createElement("iframe");n.id=s,n.src=e,n.style.display="none",n.addEventListener("load",(()=>{n.remove(),t()})),document.body.appendChild(n)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>ce(e,t,s))):fetch(e,t).then((e=>ce(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ne.APPLICATION_JSON,e!==ae.GET&&(s[ie.CONTENT_TYPE]=`${ne.APPLICATION_JSON};${se}`),oe(s,t)};class ue{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...re,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ae.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ae.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ae.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ae.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!F((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(j).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((W(s)||Z(s))&&r?.enableCompression&&(Y(e!==ae.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,J.Wt)(Z(e)?JSON.stringify(e):e)]))(s),n=oe(n,{[ie.CONTENT_TYPE]:`${ne.APPLICATION_ZLIB};${se}`})),void 0!==s)if(W(s)||s instanceof Blob)c=s;else{if(!Z(s))throw new k("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===te.UNAUTHORIZED)(e)?de(l,d,o):ce(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?de(l,d,o):Promise.reject(e)))}}const pe=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var me;!function(e){e.APPLICATION_SETUP__FAILURE="application.setup.failure",e.APPLICATION_LOAD__SUCCESS="application.load.success",e.APPLICATION_LOAD__FAILURE="application.load.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION__FAILURE="application.configuration.failure",e.IDENTITY_AUTO_FETCH__FAILURE="application.identity.auto-fetch.failure",e.DOCUMENTATION_FETCH__FAILURE="application.documentation.fetch.failure",e.DOCUMENTATION_LOAD__SKIP="application.documentation.load.skip",e.DOCUMENTATION_REQUIREMENT_CHECK__FAILURE="application.documentation.requirement-check.failure",e.CONTEXTUAL_DOCUMENTATION_LOAD__SKIP="application.virtual-assistant.contextual-documentation-load.skip",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS="application.virtual-assistant.documentation-entry.access",e.TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE="application.load.terminal-command.configuration-check.failure",e.COLOR_THEME_CONFIGURATION_CHECK__FAILURE="application.layout.color-theme.configuration-check.failure",e.SETTING_CONFIGURATION_CHECK__FAILURE="application.setting.configuration-check.failure",e.SETTING_RETRIVE_FAILURE="application.setting.retrieve.failure",e.COMMAND_CENTER_REGISTRATION__FAILURE="application.command.registration.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT__ACCESS="application.context.access",e.APPLICATION_USAGE__INTERRUPT="application.usage.interrupt"}(me=me||(me={}));var _e=s(79013);class ge{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,_e.qC)(this.schema,e)}fromJson(e){return(0,_e.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const Ee=e=>(0,_e.PG)((t=>void 0===t?_e.AM:(0,_e.qC)(e,t)),(t=>(0,_e.vB)(e,t))),fe=e=>(0,_e.PG)((()=>e),(()=>e)),Te=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?_e.AM:[],Ce=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?_e.AM:[]:_e.AM,Se=(e,t)=>(0,_e.PG)((s=>Ce(s,(t=>(0,_e.qC)(e,t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:t?.INTERNAL__forceReturnEmptyInTest})),(t=>Te(t,(t=>(0,_e.vB)(e,t)),{skipIfEmpty:!1}))),xe=(e,t,s)=>(0,_e.PG)((t=>Ce(t,(t=>e(t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:s?.INTERNAL__forceReturnEmptyInTest})),(e=>Te(e,(e=>t(e)),{skipIfEmpty:!1})));var Ne=s(4e4);class ve{key;markdownText;title;text;url;related;static serialization=new ge((0,_e.yu)(ve,{markdownText:(0,_e.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,_e.jt)((0,_e.pb)((0,_e.Ru)())),title:(0,_e.jt)((0,_e.Ru)()),text:(0,_e.jt)((0,_e.Ru)()),url:(0,_e.jt)((0,_e.Ru)())}));static create(e,t){const s=ve.serialization.fromJson(e);return s.key=t,s}}const Ae=e=>Object.entries(e).map((e=>({key:e[0],content:ve.create(e[1],e[0])})));class Ie{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.logService.warn(h.create(me.DOCUMENTATION_LOAD__SKIP),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Ne.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.logService.warn(h.create(me.DOCUMENTATION_REQUIREMENT_CHECK__FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.logService.warn(h.create(me.CONTEXTUAL_DOCUMENTATION_LOAD__SKIP),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=ve.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t.key})),e}}var Oe,ye,Re=s(80075);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(Oe||(Oe={}));class we{state;_message;_messageFormatter;constructor(){this.state=Oe.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=Oe.INITIAL,this}inProgress(){return this.state=Oe.IN_PROGRESS,this}fail(){return this.state=Oe.FAILED,this}pass(){return this.state=Oe.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}sync(e){const t=e.exportData();this.state=t.state,this._message=t.message}exportData(){return{state:this.state,message:this._message}}get isInInitialState(){return this.state===Oe.INITIAL}get isInProgress(){return this.state===Oe.IN_PROGRESS}get hasFailed(){return this.state===Oe.FAILED}get hasSucceeded(){return this.state===Oe.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,Re.rC)(new we,{state:Re.LO,_message:Re.LO,reset:Re.aD,inProgress:Re.aD,pass:Re.aD,fail:Re.aD,complete:Re.aD,setMessage:Re.aD,sync:Re.aD,isInInitialState:Re.Fl,isInProgress:Re.Fl,hasFailed:Re.Fl,hasSucceeded:Re.Fl,hasCompleted:Re.Fl,message:Re.Fl})}}!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ye=ye||(ye={}));class Le{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class Pe{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new Le;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}const be=s(81931).Fuse.default;var De,Me;!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(De=De||(De={}));class Fe{currentMode=De.STANDARD;onSearchModeChange;constructor(e){(0,Re.rC)(this,{currentMode:Re.LO,isAdvancedSearchActive:Re.Fl,setCurrentMode:Re.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==De.STANDARD}generateSearchText(e){switch(this.currentMode){case De.INCLUDE:return`'"${e}"`;case De.EXACT:return`="${e}"`;case De.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(Me=Me||(Me={}));class ke{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,Re.rC)(this,{isOpen:Re.LO,setIsOpen:Re.aD}),this.documentationKey=e.key,this.title=H(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class je{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Ue=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Ge{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!0;isOpen=!1;selectedTab=Me.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=we.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,Re.rC)(this,{isHidden:Re.LO,isOpen:Re.LO,panelRenderingKey:Re.LO,isOverSearchLimit:Re.LO,selectedTab:Re.LO,searchText:Re.LO,searchResults:Re.LO,currentDocumentationEntry:Re.LO,showSearchConfigurationMenu:Re.LO,currentContextualDocumentationEntry:Re.Fl,setIsHidden:Re.aD,setIsOpen:Re.aD,setSelectedTab:Re.aD,setSearchText:Re.aD,resetSearch:Re.aD,search:Re.aD,openDocumentationEntry:Re.aD,refreshPanelRendering:Re.aD,setShowSearchConfigurationMenu:Re.aD}),this.applicationStore=e,this.searchEngine=new be(this.applicationStore.documentationService.getAllDocEntries().filter(Ue),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Fe((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new je(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(j).filter(Ue).map((e=>new ke(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getDocEntry(e);t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new ke(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}openDocumentationEntryLink(e){const t=this.applicationStore.documentationService.getDocEntry(e);t&&((e=>Ue(e)&&Boolean(e.text??e.markdownText))(t)?this.openDocumentationEntry(t.key):t.url&&this.applicationStore.navigationService.navigator.visitAddress(t.url))}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new ke(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Ve{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class $e{static logEvent_ApplicationInitializationSucceeded(e,t){e.logEvent(me.APPLICATION_LOAD__SUCCESS,{application:{name:t.config.appName,version:t.config.appVersion,env:t.config.env},browser:{userAgent:navigator.userAgent},screen:{height:window.screen.height,width:window.screen.width}})}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(me.APPLICATION_CONTEXT__ACCESS,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(me.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(me.APPLICATION_USAGE__INTERRUPT,{})}}class Be{applicationStore;contextStack=[];constructor(e){(0,Re.rC)(this,{contextStack:Re.LO,currentContext:Re.Fl,push:Re.aD,pop:Re.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new b(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&$e.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class ze{applicationStore;commandRegistry=new Map;constructor(e){(0,Re.rC)(this,{commandRegistry:Re.LO,registerCommand:Re.aD,deregisterCommand:Re.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(me.COMMAND_CENTER_REGISTRATION__FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class He{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,Re.rC)(this,{keyMap:Re.LO,commandKeyMap:Re.LO,isHotkeysBlocked:Re.LO,addHotkey:Re.aD,blockGlobalHotkeys:Re.aD,unblockGlobalHotkeys:Re.aD}),this.applicationStore=e,this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{const t=[e.content.defaultKeyboardShortcut,...e.content.additionalKeyboardShortcuts??[]].filter(j);t.length?t.forEach((t=>this.addHotkey(e.key,t))):this.commandKeyMap.has(e.key)||this.commandKeyMap.set(e.key,[])}))}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}addHotkey(e,t){this.commandKeyMap.set(e,[...this.commandKeyMap.get(e)??[],t]),this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandService.runCommand(e))return}}var Ye=s(77289),We=s(73678),Ke=s(78440),Xe=s(51919),Ze=s(85399),qe=s(89358);const Je="Roboto Mono",Qe="yyyy-MM-dd'T'HH:mm:ss";var et;!function(e){e.RESET="[0m",e.BOLD="[1m",e.DIM="[2m",e.ITALIC="[3m",e.UNDERLINE="[4m",e.BLINKING="[5m",e.STRIKETHROUGH="[9m",e.BLACK="[30m",e.RED="[31m",e.GREEN="[32m",e.YELLOW="[33m",e.BLUE="[34m",e.MAGENTA="[35m",e.CYAN="[36m",e.WHITE="[37m",e.BRIGHT_BLACK="[1;30m",e.BRIGHT_RED="[1;31m",e.BRIGHT_GREEN="[1;32m",e.BRIGHT_YELLOW="[1;33m",e.BRIGHT_BLUE="[1;34m",e.BRIGHT_MAGENTA="[1;35m",e.BRIGHT_CYAN="[1;36m",e.BRIGHT_WHITE="[1;37m",e.DIMMED_BLACK="[2;30m",e.DIMMED_RED="[2;31m",e.DIMMED_GREEN="[2;32m",e.DIMMED_YELLOW="[2;33m",e.DIMMED_BLUE="[2;34m",e.DIMMED_MAGENTA="[2;35m",e.DIMMED_CYAN="[2;36m",e.DIMMED_WHITE="[2;37m",e.BLACK_BG="[40m",e.RED_BG="[41m",e.GREEN_BG="[42m",e.YELLOW_BG="[43m",e.BLUE_BG="[44m",e.MAGENTA_BG="[45m",e.CYAN_BG="[46m",e.WHITE_BG="[47m",e.BRIGHT_BLACK_BG="[1;40m",e.BRIGHT_RED_BG="[1;41m",e.BRIGHT_GREEN_BG="[1;42m",e.BRIGHT_YELLOW_BG="[1;43m",e.BRIGHT_BLUE_BG="[1;44m",e.BRIGHT_MAGENTA_BG="[1;45m",e.BRIGHT_CYAN_BG="[1;46m",e.BRIGHT_WHITE_BG="[1;47m",e.DIMMED_BLACK_BG="[2;40m",e.DIMMED_RED_BG="[2;41m",e.DIMMED_GREEN_BG="[2;42m",e.DIMMED_YELLOW_BG="[2;43m",e.DIMMED_BLUE_BG="[2;44m",e.DIMMED_MAGENTA_BG="[2;45m",e.DIMMED_CYAN_BG="[2;46m",e.DIMMED_WHITE_BG="[2;47m"}(et=et||(et={}));const tt=(e,t)=>`[${e};${t}H`;class st{searchInput;searchText="";useRegex=!1;matchWholeWord=!1;matchCaseSensitive=!1;resultCount;currentResultIndex;constructor(){(0,Re.rC)(this,{searchText:Re.LO,useRegex:Re.LO,matchWholeWord:Re.LO,matchCaseSensitive:Re.LO,resultCount:Re.LO,currentResultIndex:Re.LO})}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}}class it{applicationStore;searchConfig=new st;constructor(e){(0,Re.rC)(this,{setSearchText:Re.aD,setSearchRegex:Re.aD,setSearchWholeWord:Re.aD,setSearchCaseSensitive:Re.aD,setSearchResultCount:Re.aD,setSearchCurrentResultIndex:Re.aD}),this.applicationStore=e}setSearchText(e){this.searchConfig.searchText=e}setSearchRegex(e){this.searchConfig.useRegex=e}setSearchWholeWord(e){this.searchConfig.matchWholeWord=e}setSearchCaseSensitive(e){this.searchConfig.matchCaseSensitive=e}setSearchResultCount(e){this.searchConfig.resultCount=e}setSearchCurrentResultIndex(e){this.searchConfig.currentResultIndex=e}}class nt extends it{preserveLog=!1;commandRegistry=new Map;constructor(e){super(e),(0,Re.rC)(this,{preserveLog:Re.LO,setPreserveLog:Re.aD})}setPreserveLog(e){this.preserveLog=e}showHelp(){}showCommonANSIEscapeSequences(){}}var at=s(1367),rt=s(67295),ot=s(72531);s(90286);const lt=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ct=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],dt=e=>(e??"").trim().replace(/\b(?:\w+)\b/gu,(e=>ct.includes(e.toLowerCase())?e.toLowerCase():lt(e))).replace(/^(?:\w+)\b/u,(e=>lt(e))).replace(/\b(?:\w+)$/u,(e=>lt(e))),ht=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,rt.P)(e,void 0,s);return U(i,"Can't stringify lossless JSON value"),i})((0,ot.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var ut;function pt(e){return e.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=G(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}))}!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace",e.BACKQUOTE="Backquote"}(ut=ut||(ut={}));const mt=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ut.SHIFT,ut.META,ut.ALT,ut.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),_t=(e,t)=>mt(e,G(pt(t)[0]));var gt=s(4707),Et=s(3493),ft=s(76919);const Tt=(0,gt.Z)({transitions:{create:()=>"none"}}),Ct=e=>{const{children:t}=e;return(0,T.jsx)(Et.Z,{injectFirst:!0,children:(0,T.jsx)(ft.Z,{theme:Tt,children:t})})};var St=s(83820),xt=s(96242),Nt=s(34309),vt=s(12238),At=s(78683),It=s(81934),Ot=s(6277);const yt=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)(t,i),children:s})};return s.displayName=e,s},Rt=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)("modal",{"modal--dark":s},i),children:t})},wt=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("modal__title",i),children:[s&&(0,T.jsx)("div",{className:"modal__title__icon",children:s}),(0,T.jsx)("div",{className:"modal__title__label",children:dt(t)})]})},Lt=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,Ot.clsx)("modal__header",i),children:(0,T.jsx)(wt,{title:t})}):(0,T.jsx)("div",{className:(0,Ot.clsx)("modal__header",i),children:s})},Pt=(yt("ModalHeaderActions","modal__header__actions"),yt("ModalBody","modal__body")),bt=yt("ModalFooter","modal__footer");var Dt,Mt;yt("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Dt=Dt||(Dt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Mt=Mt||(Mt={}));class Ft{applicationStore;blockingAlertInfo;actionAlertInfo;constructor(e){(0,Re.rC)(this,{blockingAlertInfo:Re.LO,actionAlertInfo:Re.LO,setBlockingAlert:Re.aD,setActionAlertInfo:Re.aD}),this.applicationStore=e}setBlockingAlert(e){e?this.applicationStore.keyboardShortcutsService.blockGlobalHotkeys():this.applicationStore.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.applicationStore.notificationService.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.applicationStore.keyboardShortcutsService.blockGlobalHotkeys():this.applicationStore.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}}var kt=s(2784);const jt=(0,kt.createContext)(void 0),Ut=()=>G((0,kt.useContext)(jt),"Can't find application store in context"),Gt=({children:e,store:t})=>{const s=(0,Nt.fv)((()=>t));return(0,T.jsx)(jt.Provider,{value:s,children:e})},Vt=e=>{switch(e){case Mt.PROCEED_WITH_CAUTION:return"btn--caution";case Mt.PROCEED:case Mt.STANDARD:default:return"btn--dark"}},$t=(0,Nt.Pi)((e=>{const{info:t}=e,s=Ut(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.alertService.setActionAlertInfo(void 0)};return(0,T.jsx)(It.Z,{open:Boolean(s.alertService.actionAlertInfo),onClose:v,TransitionProps:{onEnter:()=>l?.()},children:(0,T.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??Dt.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(Lt,{title:i}),(0,T.jsxs)(Pt,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,T.jsxs)(bt,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Vt(e.type??Mt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},t))),!c.length&&(0,T.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Bt=(0,Nt.Pi)((()=>{const e=Ut().alertService.actionAlertInfo;return e?(0,T.jsx)($t,{info:e}):null})),zt=e=>{const{isLoading:t}=e,s=(0,kt.useRef)(null);return(0,kt.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,T.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Ht=(0,Nt.Pi)((()=>{const e=Ut().alertService.blockingAlertInfo;return e?(0,T.jsx)(It.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(Rt,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(zt,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(Pt,{children:[(0,T.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,T.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Yt=s(44524);const Wt=Yt.FA,Kt=Wt.FaHistory,Xt=Wt.FaCrosshairs,Zt=(Wt.FaLayerGroup,Wt.FaGhost,Wt.FaLock),qt=(Wt.FaMask,Wt.FaFile,Wt.FaLongArrowAltRight,Wt.FaTimes),Jt=Wt.FaTimesCircle,Qt=Wt.FaPlus,es=Wt.FaCog,ts=(Wt.FaEye,Wt.FaCaretUp,Wt.FaCaretDown),ss=(Wt.FaFire,Wt.FaSave,Wt.FaSquare,Wt.FaRegSquare,Wt.FaCheckSquare,Wt.FaMinusSquare,Wt.FaHashtag,Wt.FaHammer),is=(Wt.FaClock,Wt.FaRegClock,Wt.FaToggleOn,Wt.FaQuestion),ns=Wt.FaQuestionCircle,as=Wt.FaInfoCircle,rs=Wt.FaCompress,os=Wt.FaMap,ls=Wt.FaPlay,cs=(Wt.FaGripVertical,Wt.FaRobot,Wt.FaArrowLeft,Wt.FaArrowRight,Wt.FaArrowAltCircleDown,Wt.FaArrowAltCircleRight),ds=(Wt.FaArrowCircleRight,Wt.FaUser,Wt.FaShapes),hs=(Wt.FaEnvelope,Wt.FaSkull,Wt.FaDollarSign,Wt.FaSearch),us=(Wt.FaStar,Wt.FaKey,Wt.FaExternalLinkAlt,Wt.FaExternalLinkSquareAlt,Wt.FaLightbulb,Wt.FaRegLightbulb,Wt.FaList),ps=Wt.FaCircle,ms=Wt.FaTrash,_s=(Wt.FaRegCircle,Wt.FaShieldAlt,Wt.FaTag,Wt.FaTags,Wt.FaBolt,Wt.FaCheckCircle),gs=Wt.FaExclamationTriangle,Es=Wt.FaBug,fs=Wt.FaCircleNotch,Ts=(Wt.FaRegKeyboard,Wt.FaUserSecret,Wt.FaBuffer,Wt.FaSitemap,Wt.FaExpand),Cs=(Wt.FaExpandArrowsAlt,Wt.FaSortAlphaDown,Wt.FaSort,Wt.FaSortAlphaDownAlt,Wt.FaFolderPlus,Wt.FaCaretRight,Wt.FaCaretLeft,Wt.FaWrench),Ss=Wt.FaArrowDown,xs=Wt.FaArrowUp,Ns=Wt.FaTerminal,vs=(Wt.FaTruckLoading,Wt.FaFolderOpen),As=Wt.FaFolder,Is=(Wt.FaFileCode,Wt.FaCodeBranch,Wt.FaArrowAltCircleUp,Wt.FaArrowAltCircleLeft,Wt.FaRegStopCircle,Wt.FaAsterisk,Wt.FaFilter,Wt.FaExclamationCircle),Os=(Wt.FaRocket,Wt.FaCheck,Wt.FaBan),ys=(Wt.FaFileImport,Wt.FaUserFriends,Wt.FaDownload,Wt.FaUpload,Wt.FaRegWindowRestore,Wt.FaPauseCircle,Wt.FaShare,Wt.FaRegCopy),Rs=Wt.FaFileAlt,ws=(Wt.FaEdit,Wt.FaArrowsAltH,Wt.FaRegWindowMaximize,Wt.FaWindowMaximize,Wt.FaLongArrowAltDown,Wt.FaLongArrowAltUp,Wt.FaMeteor,Wt.FaPiedPiperSquare,Wt.FaPuzzlePiece,Wt.FaToggleOn,Wt.FaToggleOff,Wt.FaMapMarkerAlt),Ls=Wt.FaHatWizard,Ps=Wt.FaRegLaughWink,bs=Wt.FaRegSadTear,Ds=(Wt.FaBusinessTime,Wt.FaDatabase),Ms=(Wt.FaServer,Wt.FaTable,Wt.FaArchive,Wt.FaBrain,Wt.FaBookOpen,Wt.FaLevelDownAlt,Yt.GI),Fs=(Ms.GiWaterDrop,Ms.GiBeard),ks=Ms.GiSunglasses,js=(Ms.GiHouseKeys,Yt.MD),Us=(js.MdManageSearch,js.MdModeEdit,js.MdTextFields,js.MdMoreVert,js.MdMoreHoriz,js.MdWrapText,js.MdVerticalAlignBottom,js.MdRefresh),Gs=(js.MdFunctions,js.MdCompareArrows,js.MdPlaylistAddCheck,js.MdAdd,js.MdEdit,js.MdSubject),Vs=js.MdViewHeadline,$s=js.MdAssistant,Bs=(js.MdSettingsEthernet,js.MdLink,js.MdWindow,js.MdReviews,js.MdCalculate,js.MdRocketLaunch,js.MdOutlineDataset,js.MdVerified,js.MdQueryStats,Yt.VSC),zs=(Bs.VscError,Bs.VscWarning,Bs.VscWordWrap),Hs=Bs.VscGoToFile,Ys=Bs.VscClose,Ws=(Bs.VscRunAll,Bs.VscRunErrors,Bs.VscOpenPreview,Bs.VscDiff,Bs.VscRegex),Ks=(Bs.VscVersions,Bs.VscCaseSensitive),Xs=Bs.VscWholeWord,Zs=Bs.VscReferences,qs=Bs.VscWand,Js=Bs.VscCollapseAll,Qs=Bs.VscExpandAll,ei=(Bs.VscJson,Yt.GO),ti=ei.GoChevronDown,si=ei.GoChevronUp,ii=(ei.GoChevronLeft,ei.GoChevronRight),ni=(ei.GoFileBinary,ei.GoGitPullRequest,ei.GoGitMerge,ei.GoCloudDownload,ei.GoCloudUpload,ei.GoSync,ei.GoGitBranch,ei.GoX),ai=(ei.GoPlug,Yt.SI.SiSwagger,Yt.IO5),ri=(ai.IoResize,ai.IoFileTrayFullOutline,ai.IoMenuOutline,ai.IoBeaker,ai.IoFlaskSharp),oi=(ai.IoSyncCircleSharp,Yt.BS),li=(oi.BsDisplayFill,oi.BsFillTriangleFill,oi.BsFillFileEarmarkSpreadsheetFill,oi.BsBoxSeam,oi.BsGripVertical),ci=oi.BsAlignTop,di=oi.BsAlignMiddle,hi=oi.BsAlignBottom,ui=oi.BsAlignStart,pi=oi.BsAlignCenter,mi=oi.BsAlignEnd,_i=oi.BsDistributeHorizontal,gi=oi.BsDistributeVertical,Ei=(oi.BsDatabaseFillLock,oi.BsDatabaseFillCheck,oi.BsChevronDown,oi.BsChevronRight,oi.BsChevronLeft,Yt.BI),fi=(Ei.BiShapeTriangle,Ei.BiAtom),Ti=(Yt.CG.CgOptions,Yt.FI),Ci=Ti.FiPackage,Si=(Ti.FiMinus,Ti.FiMousePointer),xi=Ti.FiMove,Ni=(Ti.FiPlusCircle,Ti.FiSidebar,Ti.FiTriangle,Ti.FiZoomIn),vi=Ti.FiZoomOut,Ai=(Ti.FiGitMerge,Ti.FiLink,Yt.RI),Ii=(Ai.RiShapeLine,Ai.RiTestTubeFill,Ai.RiRobotFill,Ai.RiGovernmentFill,Ai.RiMoneyDollarCircleFill,Yt.TB),Oi=(Ii.TbArrowsJoin2,Ii.TbArrowsSplit2,Ii.TbMathFunction),yi=(Ii.TbBook,Yt.HI);yi.HiCode,yi.HiHome;var Ri=s(73882),wi=s(53083);const Li=6e3;var Pi;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Pi=Pi||(Pi={}));class bi{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Di{notification;constructor(){(0,Re.rC)(this,{notification:Re.LO,setNotification:Re.aD,notify:Re.aD,notifySuccess:Re.aD,notifyWarning:Re.aD,notifyIllegalState:Re.aD,notifyError:Re.aD})}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new bi(Pi.INFO,e,t??[],null===s?void 0:s??Li))}notifySuccess(e,t,s){this.setNotification(new bi(Pi.SUCCESS,e,t??[],null===s?void 0:s??Li))}notifyWarning(e,t,s){this.setNotification(new bi(Pi.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Li))}notifyError(e,t){let s;e instanceof L?s=e.detail:e instanceof Error?s=e.message:(Y(W(e),"Can't display error"),s=e),s&&this.setNotification(new bi(Pi.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new bi(Pi.ILEGAL_STATE,W(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Li))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return M(e),this.notifyIllegalState(e.message),t}}}const Mi=(0,Nt.Pi)((()=>{const e=Ut(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Pi.INFO,[a,r]=(0,kt.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(as,{})});switch(n){case Pi.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Es,{})});break;case Pi.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Jt,{})});break;case Pi.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(gs,{})});break;case Pi.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(_s,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(Ri.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Li,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(wi.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,T.jsxs)("div",{className:"notification__message__content",children:[o,(0,T.jsx)("div",{className:(0,Ot.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,T.jsx)(ti,{}):(0,T.jsx)(si,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(qt,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Fi=s(17954);const ki=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(Fi.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},ji=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,kt.useRef)(null),[c,d]=(0,kt.useState)(!1),[h,u]=(0,kt.useState)(),[p,m]=(0,kt.useState)(0),[_,g]=(0,kt.useState)(0),E=()=>{u(void 0),d(!1),g(0),m(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),m(n)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(ki,{open:c,anchorPosition:{left:p,top:_},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${_}`)]})},Ui=(0,kt.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,T.jsx)("div",{ref:t,className:(0,Ot.clsx)("menu",s),...n,children:i})})),Gi=e=>{const{className:t,onClick:s,title:i,disabled:n,children:a,...r}=e;return(0,T.jsx)("button",{className:(0,Ot.clsx)("menu__item",t),disabled:Boolean(n),title:i,onClick:s,...r,children:a})},Vi=yt("MenuContentDivider","menu__divider");yt("MenuContentItemIcon","menu__item__icon"),yt("MenuContentItemLabel","menu__item__label");var $i=s(95081),Bi=s(53019);const zi=e=>(0,T.jsx)($i.D,{className:(0,Ot.clsx)("markdown-content",e.className),remarkPlugins:[Bi.Z],components:e.components??{},children:e.value.value});var Hi=s(62515);const Yi=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,Hi.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,kt.useState)(!1),{ref:o,width:l,height:c}=(0,Hi.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,kt.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,Ot.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var Wi=s(85688),Ki=s(28019),Xi=s(8978);const Zi=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,T.jsxs)("div",{className:(0,Ot.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Wi.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,T.jsx)(Ki.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Xi.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,T.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var qi=s(33207);const Ji=e=>{const{children:t,...s}=e;return(0,T.jsx)(qi.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var Qi,en=s(41327),tn=s(13474),sn=s(65068);!function(e){e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax"}(Qi=Qi||(Qi={}));const nn=(0,Nt.Pi)((e=>{const{entry:t}=e,s=Ut(),i=()=>{t.isOpen||$e.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(ji,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(Ui,{children:(0,T.jsx)(Gi,{onClick:n,children:"Copy Documentation Key"})}),children:(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),t.url?(0,T.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{$e.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:W(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,T.jsx)(zi,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),an=(0,Nt.Pi)((()=>{const e=Ut(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(ji,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Gi,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Gi,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,T.jsx)(T.Fragment,{children:W(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(zi,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,T.jsx)(nn,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Yi,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Ps,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),rn=(0,Nt.Pi)((()=>{const e=Ut(),t=(0,kt.useRef)(null),s=e.assistantService,i=s.searchText,n=(0,kt.useMemo)((()=>(0,tn.Z)((()=>s.search()),100)),[s]);return(0,kt.useEffect)((()=>{t.current?.focus()}),[]),(0,T.jsxs)("div",{className:"virtual-assistant__search",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,T.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&s.refreshPanelRendering()},className:(0,Ot.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":i}),spellCheck:!1,onChange:e=>{s.setSearchText(e.target.value),n()},value:i,placeholder:"Ask me a question"}),i&&(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:s.searchResults.length+(s.isOverSearchLimit?"+":"")}),(0,T.jsx)("button",{className:(0,Ot.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":s.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":s.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>s.setShowSearchConfigurationMenu(!s.showSearchConfigurationMenu),title:(s.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,T.jsx)(es,{})}),i?(0,T.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{s.resetSearch(),s.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,T.jsx)(qt,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(hs,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(zt,{isLoading:s.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":s.showSearchConfigurationMenu}),children:(0,T.jsxs)("div",{className:"virtual-assistant__search__input__advanced-config__panel",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__input__advanced-config__panel__header__label",children:["search config",e.documentationService.hasDocEntry(Qi.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX)&&(0,T.jsx)("div",{onClick:()=>s.openDocumentationEntryLink(Qi.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see documentation",className:"virtual-assistant__search__input__advanced-config__panel__header__label__hint",children:(0,T.jsx)(ns,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(Zi,{value:s.searchConfigurationState.currentMode,onChange:e=>{const t=e.target.value;s.searchConfigurationState.setCurrentMode(t)},row:!1,options:[De.STANDARD,De.INCLUDE,De.EXACT,De.INVERSE],size:1})})]})}),s.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(nn,{entry:s.currentDocumentationEntry},s.currentDocumentationEntry.uuid)}),!s.currentDocumentationEntry&&(0,T.jsxs)(T.Fragment,{children:[Boolean(s.searchResults.length)&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:s.searchResults.map((e=>(0,T.jsx)(nn,{entry:e},e.uuid)))}),i&&!s.searchResults.length&&(0,T.jsx)(Yi,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(bs,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!i&&!s.searchResults.length&&(0,T.jsx)(ji,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>{pe(`documentation-registry_${(0,sn.Z)(new Date(Date.now()),Qe)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ne.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(Gi,{onClick:()=>{pe(`documentation-registry_${(0,sn.Z)(new Date(Date.now()),Qe)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ne.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,T.jsxs)("div",{className:"virtual-assistant__character",children:[(0,T.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,T.jsx)(Ls,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(ks,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Fs,{className:"virtual-assistant__character__beard"})]}),(0,T.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,T.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),on=(0,Nt.Pi)((e=>{const{triggerElement:t}=e,s=Ut().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,T.jsx)(Ji,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,T.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===Me.SEARCH}),onClick:()=>s.setSelectedTab(Me.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(hs,{})})}),(0,T.jsx)("div",{className:(0,Ot.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===Me.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(Me.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(ws,{}),i&&(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,T.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,T.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,T.jsx)(Ys,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===Me.SEARCH&&(0,T.jsx)(rn,{}),n===Me.CONTEXTUAL_SUPPORT&&(0,T.jsx)(an,{})]})]})},s.panelRenderingKey)})),ln=(0,Nt.Pi)((()=>{const[e,t]=(0,kt.useState)(!1),[s,i]=(0,kt.useState)((0,a.Z)()),n=Ut(),r=(0,kt.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,kt.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,T.jsx)(en,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,T.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,T.jsxs)("div",{className:(0,Ot.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,T.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(Me.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,T.jsx)(Ys,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(ps,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(ji,{className:(0,Ot.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,T.jsx)(Gi,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,T.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,T.jsx)(li,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(on,{triggerElement:r.current})]})},s)}));var cn;!function(e){e.TOP_LEVEL_CONTAINER="application.top-level-container",e.BACKDROP_CONTAINER="application.backdrop-container"}(cn||(cn={}));const dn=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Backquote","Control+Shift+KeyN","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB","Alt+KeyZ"],hn=e=>(0,T.jsx)("div",{className:"backdrop__container","data-elementid":e.elementId}),un=(0,Nt.Pi)((e=>{const{children:t}=e,s=Ut(),i=((e,t)=>{const s={};return e.forEach(((e,i)=>{e.length&&(s[i]={combinations:e,handler:t})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:dn,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{dn.includes(e)&&t.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,kt.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&((0,at.Z)(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)),(e=>e.combination)).forEach((e=>{const s=e.combination,n=pt(e.combination);if(!n.length)return;const a=t.get(s)??n,r=G(a[0]);mt(i,r)?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(s,i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(i);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[i]),(0,kt.useEffect)((()=>{const e=()=>{document.hidden&&($e.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(Ct,{children:[(0,T.jsx)(Ht,{}),(0,T.jsx)(Bt,{}),(0,T.jsx)(Mi,{}),(0,T.jsx)(ln,{}),s.layoutService.showBackdrop&&(0,T.jsx)(St.Z,{container:s.layoutService.getElementByID(s.layoutService.backdropContainerElementID??cn.BACKDROP_CONTAINER)??null,children:(0,T.jsx)(xt.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(vt.W,{backend:At.PD,children:(0,T.jsxs)("div",{className:"app__container","data-elementid":cn.TOP_LEVEL_CONTAINER,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(hn,{elementId:cn.BACKDROP_CONTAINER}),t]})})]})})),pn={foreground:"#cccccc",background:"#1e1e1e",cursor:"#cccccc",selectionBackground:"#264f78",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#e5e5e5"},mn={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},_n=`\n${et.BOLD}${et.BRIGHT_BLUE}$purist${et.RESET}\n${et.BOLD}${et.MAGENTA}❯${et.RESET} `,gn="❯ ";class En extends nt{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=we.create();constructor(e){super(e),this.instance=new Ye.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${Je}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:pn,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new Ke.FitAddon,this.searcher=new Xe.SearchAddon,this.renderer=new qe.WebglAddon}setup(e){if(this.setupState.hasCompleted)throw new b("Terminal is already set up");this.setupState.complete(),this.renderer.onContextLoss((()=>{this.renderer.dispose()})),this.instance.loadAddon(this.resizer),this.instance.loadAddon(this.searcher),this.instance.loadAddon(this.renderer),this.instance.loadAddon(new Ze.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>_t(e,"Control+KeyF")||_t(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(_t(e,"Control+KeyC")&&this.instance.hasSelection()||_t(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new We.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new We.WebLinksAddon,this.instance.loadAddon(this.webLinkProvider),(e?.commands??[]).forEach((e=>{[e.command,...e.aliases??[]].forEach((t=>{this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(me.TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE),`Found multiple duplicated terminal commands '${t}'`):this.commandRegistry.set(t,e)}))})),this.searcher.onDidChangeResults((e=>{e?(this.setSearchResultCount(e.resultCount),this.setSearchCurrentResultIndex(e.resultIndex)):(this.setSearchResultCount(void 0),this.setSearchCurrentResultIndex(void 0))})),this._TEMPORARY__onKeyListener=this.instance.onKey((({key:e,domEvent:t})=>{var s,i;if("ArrowUp"!==t.code)if("ArrowDown"!==t.code)if(this.commandHistoryNavigationIdx=void 0,"Enter"===t.code){if(this.command.trim()){const e=this.command,[t,...s]=e.replaceAll(/\s+/g," ").split(" ");if(this.addCommandToHistory(this.command),!t)return;const i=this.commandRegistry.get(t);if(!i)return void this.fail(`command not found: ${t}`);if(this.isRunningCommand)return;this.isRunningCommand=!0,i.handler(s.map((e=>e.trim())),t,e).finally((()=>{this.isRunningCommand=!1,this.isFlushed||this.abort()}))}}else if(_t(t,"Control+KeyD")||_t(t,"Control+KeyC")&&!this.instance.hasSelection())this.abort();else if("Backspace"===t.code)this.deleteFromCommand(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!0):-1);else if("Delete"===t.code)this.deleteFromCommand(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!1):1);else if("ArrowLeft"===t.code){const e=this.computeCursorMovement(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!0):-1);this.instance.scrollLines(e.scroll),this.instance.write(e.seq)}else if("ArrowRight"===t.code){const e=this.computeCursorMovement(t.altKey||t.ctrlKey?this.computeCursorJumpMovement(!1):1);this.instance.scrollLines(e.scroll),this.instance.write(e.seq)}else e.match(/^[A-Za-z0-9!@#$%^&*()\-_=+"':;,.<>/?[\]{}|\\~` ]$/)?this.writeToCommand(e):(s=t,i=this.applicationStore,i.layoutService.getElementByID(cn.TOP_LEVEL_CONTAINER)?.dispatchEvent(new KeyboardEvent(s.type,s)));else void 0!==this.commandHistoryNavigationIdx&&this.setCommandFromHistory(0===this.commandHistoryNavigationIdx?void 0:this.commandHistoryNavigationIdx-1);else this.setCommandFromHistory(void 0!==this.commandHistoryNavigationIdx?this.commandHistoryNavigationIdx+1:0)})),this._TEMPORARY__onDataListener=this.instance.onData((e=>{e.length>1&&!e.startsWith("")&&this.writeToCommand(e.replaceAll(/[^A-Za-z0-9!@#$%^&*()\-_=+"':;,.<>/?[\]{}|\\~` ]/g,"").trimEnd())}))}getCommandRange(){const e=this.instance.buffer.active,t=this.instance.cols,s=`${gn}${this.command}`,i=`${gn}${this.command.substring(0,t-2)}${this.command.length<t-2?" ".repeat(t-this.command.length-2):""}`;let n=0,a=0;for(let s=e.baseY+e.cursorY;s>-1;--s){if(G(e.getLine(s)).translateToString()===i){n=s,a+=(s===e.baseY+e.cursorY?e.cursorX:t)-2;break}a+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:n,startX:2,endY:n+(s.length-s.length%t)/t,endX:s.length%t,cursorIdx:a}}computeCursorJumpMovement(e){const t=this.getCommandRange();let s,i=!1;if(e){for(let e=t.cursorIdx-1;e>-1;--e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=t.cursorIdx-e-1;break}}else for(let e=t.cursorIdx+1;e<this.command.length;++e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=e-t.cursorIdx-1;break}return void 0===s&&(s=e?t.cursorIdx:this.command.length-t.cursorIdx),e?-s:s}computeCursorMovement(e,t=!0){const s=this.instance.buffer.active,i=this.instance.cols,n=this.instance.rows,a=this.getCommandRange(),r=t?e<0?a.cursorIdx:this.command.length-a.cursorIdx:e,o=Math.min(Math.abs(e),r);let l=s.cursorX,c=s.cursorY,d=s.baseY+s.cursorY;e<0?(l=(i+(s.cursorX-o)%i)%i,c=s.cursorY-(o>s.cursorX?Math.ceil(o/i):0),d=c+s.baseY,c=Math.max(c,-1)):e>0&&(l=(s.cursorX+o)%i,c=s.cursorY+(s.cursorX+o>=i?Math.floor((s.cursorX+o)/i):0),d=c+s.baseY,c=Math.min(c,n-1));const h=d>s.viewportY+n?d-(s.viewportY+n):d<s.viewportY?d-s.viewportY:0;return{seq:tt(c+1,l+1),scroll:h}}writeToCommand(e){const t=this.getCommandRange(),s=this.command.slice(0,t.cursorIdx),i=this.command.slice(t.cursorIdx),n=this.computeCursorMovement(e.length,!1);this.instance.scrollLines(n.scroll),this.instance.write(e+i+n.seq),this.setCommand(s+e+i)}deleteFromCommand(e){const t=this.getCommandRange(),s=e<0?t.cursorIdx:this.command.length-t.cursorIdx,i=Math.min(Math.abs(e),s);let n,a,r;if(0===e)return;e<0?(n=this.command.slice(0,t.cursorIdx-i),a=this.command.slice(t.cursorIdx,this.command.length),r=-i):(n=this.command.slice(0,t.cursorIdx),a=this.command.slice(t.cursorIdx+i,this.command.length),r=0);const o=this.computeCursorMovement(r);this.instance.scrollLines(o.scroll),this.instance.write(tt(t.startY+1,t.startX+1)+n+a+" ".repeat(i)+o.seq),this.setCommand(n+a)}get isSetup(){return this.setupState.hasCompleted}isFocused(){return document.activeElement===this.instance.textarea}mount(e){if(!this.setupState.hasCompleted)throw new b("XTerm terminal has not been set up yet");this.instance.open(e)}dispose(){this.searcher.dispose(),this.resizer.dispose(),this.renderer.dispose(),this.webLinkProvider?.dispose(),this._TEMPORARY__onKeyListener?.dispose(),this._TEMPORARY__onDataListener?.dispose(),this.instance.dispose()}autoResize(){this.resizer.fit()}focus(){this.instance.focus()}addCommandToHistory(e){e!==this.commandHistory.at(0)&&this.commandHistory.unshift(e)}setCommandFromHistory(e){const t=void 0===e?this.currentCommandSearchString:this.commandHistory.filter((e=>e.startsWith(this.currentCommandSearchString))).at(e);if(void 0!==t){let s=this.getCommandRange();this.instance.write(tt(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(tt(s.endY+1,s.endX+1)),this.commandHistoryNavigationIdx=e}}setCommand(e){this.command=e,this.currentCommandSearchString=e,this.commandHistoryNavigationIdx=void 0}newCommand(){this.instance.write(_n),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${et.DIM}(system: ${e})\n${et.RESET}`))}flushScreen(){this.instance.write("c"),this.instance.reset()}get isFlushed(){const e=this.instance.buffer.active;let t=!0;for(let s=e.baseY+e.cursorY;s>-1;--s){const i=G(e.getLine(s)).translateToString();if(i.trim()){t=i!==gn;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(et.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${et.BRIGHT_BLACK}+-------------------------------------------------------+${et.RESET}\n${et.BRIGHT_BLACK}|${et.RESET} ${et.BRIGHT_GREEN}[@@]${et.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${et.BRIGHT_BLACK}|${et.RESET}\n${et.BRIGHT_BLACK}|${et.RESET} ${et.BRIGHT_GREEN}/|__|\\${et.RESET} ${et.BRIGHT_BLACK}|${et.RESET}\n${et.BRIGHT_BLACK}+--${et.RESET} ${et.BRIGHT_GREEN}d b${et.RESET} ${et.BRIGHT_BLACK}-----------------------------------------------+${et.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,at.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${et.BRIGHT_GREEN}${e.command.padEnd(30)}${et.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${et.DIM}${e.usage}${et.RESET}`)).join("\n")}`)),this.abort()}showCommonANSIEscapeSequences(){this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write(`\nCommon ANSI Escape Sequences for Styling:\n\n${Object.entries(et).map((([e,t])=>`${t}${(e=>e?e.trim().match(/^[A-Z_]+$/)?dt(e.trim().replace(/_+/gu," ").toLowerCase()):lt(e.trim()).split(/(?<chunk>[A-Z][a-z]+|[0-9]+)/).map((e=>e.toUpperCase()===e?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).filter(Boolean).join(" ").replace(/_+/gu," ").replace(/\s+/gu," "):"")(e).padEnd(20)}${et.RESET} ${t.replace("","\\u001b")}`)).join("\n")}`),this.abort()}abort(){this.resetANSIStyling(),this.instance.write("\n"),this.newCommand(),this.instance.scrollToBottom(),this.isRunningCommand=!1}fail(e,t){t?.systemCommand&&this.newSystemCommand(t.systemCommand),this.instance.write(`\n${et.RED}${e}${et.RED}`),this.abort()}output(e,t){this.resetANSIStyling(),t?.clear&&!this.preserveLog||!t?.systemCommand||this.newSystemCommand(t.systemCommand),!this.preserveLog&&t?.clear?this.flushScreen():(this.preserveLog||this.isRunningCommand)&&this.instance.write("\n"),this.instance.write(e),this.resetANSIStyling(),this.instance.write("\n"),this.instance.scrollToBottom(),this.newCommand()}search(e){this.searcher.findNext(e,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive,incremental:!0})}clearSearch(){this.searcher.clearDecorations(),this.instance.clearSelection(),this.setSearchText(""),this.setSearchResultCount(void 0),this.setSearchCurrentResultIndex(void 0)}findPrevious(){this.searcher.findPrevious(this.searchConfig.searchText,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:mn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}getContent(){const e=this.instance.buffer.active,t=[];for(let s=0;s<e.length;++s){const i=G(e.getLine(s));t.push(i.translateToString())}return t.join("\n").trimEnd()}copy(){this.instance.hasSelection()?this.applicationStore.clipboardService.copyTextToClipboard(this.instance.getSelection()).catch(this.applicationStore.alertUnhandledError):this.applicationStore.notificationService.notifyWarning("Ther terminal has no selection to copy")}copyAll(){this.applicationStore.clipboardService.copyTextToClipboard(this.getContent()).catch(this.applicationStore.alertUnhandledError)}}class fn{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new En(e)}}const Tn="(unknown)";class Cn{applicationStore;currentUser=Tn;constructor(e){(0,Re.rC)(this,{currentUser:Re.LO,setCurrentUser:Re.aD}),this.applicationStore=e}get isAnonymous(){return this.currentUser===Tn}setCurrentUser(e){this.currentUser=e}}var Sn,xn=s(7279);class Nn{get localStorage(){return G(window.localStorage,"'window.localStorage' object is not available in non-web environment")}setItem(e,t){this.localStorage.setItem(e,t)}getItem(e){return this.localStorage.getItem(e)}removeItem(e){this.localStorage.removeItem(e)}clear(){this.localStorage.clear()}hasItem(e){return this.localStorage.hasItem(e)}}class vn{storeIndex;storageService;data;constructor(e,t){this.storageService=e,this.storeIndex=t,this.data=this.storageService.getIndex(this.storeIndex)??{}}getValue(e){return this.data[e]}getNumericValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!K(e))throw new k(t||"Value is expected to be a number")}(e,t),e))(t):void 0}getStringValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!W(e))throw new k(t||"Value is expected to be a string")}(e,t),e))(t):void 0}getBooleanValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!X(e))throw new k(t||"Value is expected to be a boolean")}(e,t),e))(t):void 0}getObjectValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!Z(e))throw new k(t||"Value is expected to be a object")}(e,t),e))(t):void 0}hasValue(e){return j(this.data[e])}persistValue(e,t){void 0!==t?this.data[e]=t:delete this.data[e],this.storageService.updateIndex(this.storeIndex,this.data)}}class An{applicationStore;storage;data;constructor(e){this.applicationStore=e,this.storage=new Nn;const t=this.storage.getItem(e.config.applicationStorageKey);this.data=t?F((()=>JSON.parse(t)))??{}:{}}getIndex(e){return this.data[e]}updateIndex(e,t){(0,xn.Z)(t)?delete this.data[e]:this.data[e]=t,this.storage.setItem(this.applicationStore.config.applicationStorageKey,JSON.stringify(this.data))}}class In{applicationStore;plugins=[];constructor(e){this.applicationStore=e}registerPlugins(e){this.plugins=e}setup(){const e={userId:this.applicationStore.identityService.currentUser,appName:this.applicationStore.config.appName,appEnv:this.applicationStore.config.env,appVersion:this.applicationStore.config.appVersion,appSessionId:this.applicationStore.uuid,appStartTime:this.applicationStore.timeService.timestamp};this.plugins.forEach((t=>t.setup(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}class On{timestamp=Date.now();interruptions=[];recordUsageInterruption(){this.interruptions.push(Date.now())}finalizeTimingsRecord(e,t){const s=e.elapsed,i=e.startTime,n=i+s,a={...t??{},...Object.fromEntries(e.records),total:s};let r=0;for(const e of this.interruptions)if(e>=i&&e<=n)r++;else if(e>n)break;return r>0?{...a,__numberOfInteruptions:r}:a}}!function(e){e.DEFAULT_DARK="default-dark",e.LEGACY_LIGHT="legacy-light",e.HIGH_CONTRAST_LIGHT="hc-light"}(Sn=Sn||(Sn={}));const yn={name:"Default Dark (default)",key:Sn.DEFAULT_DARK,TEMPORARY__globalCSSClassName:"theme__default-dark"},Rn={name:"Legacy Light",key:Sn.LEGACY_LIGHT,TEMPORARY__globalCSSClassName:"theme__legacy-light"},wn={name:"High-Contrast Light",key:Sn.HIGH_CONTRAST_LIGHT,TEMPORARY__globalCSSClassName:"theme__hc-light"};var Ln;!function(e){e.COLOR_THEME="application.layout.colorTheme"}(Ln=Ln||(Ln={}));const Pn={[Ln.COLOR_THEME]:{defaultValue:Sn.DEFAULT_DARK}};class bn{applicationStore;backdropContainerElementID;showBackdrop=!1;colorThemeRegistry=new Map;currentColorTheme;constructor(e){(0,Re.rC)(this,{currentColorTheme:Re.LO.ref,TEMPORARY__isLightColorThemeEnabled:Re.Fl,backdropContainerElementID:Re.LO,showBackdrop:Re.LO,setBackdropContainerElementID:Re.aD,setShowBackdrop:Re.aD,setColorTheme:Re.aD}),this.applicationStore=e,this.colorThemeRegistry.set(Sn.DEFAULT_DARK,yn),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraColorThemes?.()??[])).forEach((e=>{this.colorThemeRegistry.has(e.key)?this.applicationStore.logService.warn(h.create(me.COLOR_THEME_CONFIGURATION_CHECK__FAILURE),`Found duplicated color themes with key '${e.key}'`):this.colorThemeRegistry.set(e.key,e)}));const t=this.applicationStore.settingService.getStringValue(Ln.COLOR_THEME)??Sn.DEFAULT_DARK;this.currentColorTheme=G(this.colorThemeRegistry.get(t)),this.TEMPORARY__syncGlobalCSSClassName(this.currentColorTheme,void 0)}getElementByID(e){return document.querySelector(`[data-elementid='${e}']`)??void 0}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}get TEMPORARY__isLightColorThemeEnabled(){return this.currentColorTheme.key!==Sn.DEFAULT_DARK}TEMPORARY__syncGlobalCSSClassName(e,t){t&&document.body.classList.remove(t.TEMPORARY__globalCSSClassName),document.body.classList.add(e.TEMPORARY__globalCSSClassName)}setColorTheme(e,t){const s=this.colorThemeRegistry.get(e);if(e===this.currentColorTheme.key||!s)return;const i=this.currentColorTheme;this.currentColorTheme=s,this.TEMPORARY__syncGlobalCSSClassName(s,i),t?.persist&&this.applicationStore.settingService.persistValue(Ln.COLOR_THEME,e)}}class Dn{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class Mn{navigator;constructor(e){this.navigator=e}}var Fn=s(65741);class kn{applicationStore;storage;registry=new Map;constructor(e){this.applicationStore=e,this.storage=new vn(this.applicationStore.storageService,"application-settings-storage"),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraSettingConfigurationEntries?.()??[])).forEach((e=>{this.registry.has(e.key)?this.applicationStore.logService.warn(h.create(me.SETTING_CONFIGURATION_CHECK__FAILURE),`Found duplicated setting with key '${e.key}'`):this.registry.set(e.key,e)}))}getNumericValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(K(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve numeric value for setting '${e}'`)}getStringValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(W(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve string value for setting '${e}'`)}getBooleanValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(X(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve boolean value for setting '${e}'`)}getObjectValue(e){const t=this.storage.getValue(e)??this.registry.get(e)?.defaultValue;if(Z(t))return t;this.applicationStore.logService.warn(h.create(me.SETTING_RETRIVE_FAILURE),`Can't retrieve object value for setting '${e}'`)}persistValue(e,t){const s=this.registry.get(e)?.defaultValue;this.storage.persistValue(e,void 0!==s&&(0,Fn.Z)(s,t)?void 0:t)}}class jn{goToLocation(e,t){throw new D("Navigator does not support this operation")}reload(e){throw new D("Navigator does not support this operation")}goToAddress(e,t){throw new D("Navigator does not support this operation")}visitAddress(e){throw new D("Navigator does not support this operation")}generateAddress(e){throw new D("Navigator does not support this operation")}updateCurrentLocation(e){throw new D("Navigator does not support this operation")}updateCurrentZone(e){throw new D("Navigator does not support this operation")}resetZone(){throw new D("Navigator does not support this operation")}getCurrentBaseAddress(e){throw new D("Navigator does not support this operation")}getCurrentAddress(){throw new D("Navigator does not support this operation")}getCurrentLocation(){throw new D("Navigator does not support this operation")}getCurrentLocationParameters(){throw new D("Navigator does not support this operation")}getCurrentLocationParameterValue(e){throw new D("Navigator does not support this operation")}getCurrentZone(){throw new D("Navigator does not support this operation")}blockNavigation(e,t,s){throw new D("Navigator does not support this operation")}unblockNavigation(){throw new D("Navigator does not support this operation")}get isNavigationBlocked(){throw new D("Navigator does not support this operation")}INTERNAL__internalizeTransientParameter(e){throw new D("Navigator does not support this operation")}}class Un{uuid=(0,a.Z)();config;pluginManager;initState=we.create();platform;timeService;logService;storageService;settingService;alertService;notificationService;identityService;commandService;keyboardShortcutsService;layoutService;clipboardService;terminalService;navigationService;navigationContextService;documentationService;assistantService;eventService;telemetryService;tracerService;constructor(e,t){this.config=e,this.pluginManager=t,this.timeService=new On,this.logService=new p,this.logService.registerPlugins(t.getLoggerPlugins()),this.storageService=new An(this),this.settingService=new kn(this),this.alertService=new Ft(this),this.notificationService=new Di,this.identityService=new Cn(this),this.layoutService=new bn(this),this.clipboardService=new Dn(this),this.terminalService=new fn(this),this.commandService=new ze(this),this.keyboardShortcutsService=new He(this),this.navigationService=new Mn(new jn),this.navigationContextService=new Be(this),this.documentationService=new Ie(this),this.assistantService=new Ge(this),this.eventService=new Ve,this.eventService.registerEventNotifierPlugins(t.getEventNotifierPlugins()),this.telemetryService=new In(this),this.telemetryService.registerPlugins(t.getTelemetryServicePlugins()),this.telemetryService.setup(),this.tracerService=new Pe,this.tracerService.registerPlugins(t.getTracerServicePlugins())}async initialize(e){if(this.initState.isInInitialState){this.initState.inProgress();try{if(this.platform)throw new b("Platform is already configured");this.platform=e,this.navigationService=new Mn(e.getNavigator()),await e.initialize(),this.initState.pass()}catch(e){M(e),this.notificationService.notifyError(e),this.logService.error(h.create(me.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),this.initState.fail()}}else this.notificationService.notifyIllegalState("Application store is re-initialized")}alertUnhandledError=e=>{this.logService.error(h.create(me.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notificationService.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)}}class Gn{}class Vn extends Gn{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class $n{config;logger;pluginManager;basePresets=[];basePlugins=[];baseAddress;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Vn}setup(e){return this.baseAddress=H(e.baseAddress,"Can't setup application: 'baseAddress' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new ue;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){M(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION__FAILURE),e)}U(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){M(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION__FAILURE),e)}return U(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseAddress:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new ue(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(H(e.url,"Can't load documentation registry: 'url' field is missing or empty"));U(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){M(e),this.logger.warn(h.create(me.DOCUMENTATION_FETCH__FAILURE),e)}}))),e.keyedDocumentationEntries=[...Ae(t),...e.keyedDocumentationEntries]}async start(){U(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseAddress);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]);const s=new Un(this.config,this.pluginManager);await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(s)))),await this.loadApplication(s),this.logger.info(h.create(me.APPLICATION_LOAD__SUCCESS),"Legend application loaded")}catch(e){throw M(e),this.logger.error(h.create(me.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),e}}}const Bn="legend-application-root",zn=JSON.parse('{"i8":"15.0.2","Rw":{"j":"@finos/legend-application-plugin-core"}}');class Hn extends o{}class Yn extends Hn{static NAME=zn.Rw.j;constructor(){super(Yn.NAME,zn.i8)}install(e){e.registerApplicationPlugin(this)}getExtraApplicationSetups(){return[async e=>{(0,Re.jQ)({enforceActions:"observed"})}]}getExtraColorThemes(){return[Rn,wn]}getExtraSettingConfigurationEntries(){return e=Pn,Object.entries(e).map((e=>({key:e[0],...e[1]})));var e}}class Wn{appName;baseAddress;env;applicationStorageKey;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseAddress=e.baseAddress,this.appName=H(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=H(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.applicationStorageKey=e.configData.application?.storageKey??this.getDefaultApplicationStorageKey(),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Ae(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=G(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=G(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=G(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}static resolveAbsoluteUrl(e){return e.trim().startsWith("/")?window.location.origin+e:e}}class Kn extends Wn{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),U(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Wn.resolveAbsoluteUrl(H(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty")),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}getDefaultApplicationStorageKey(){return"legend-pure-ide"}}class Xn extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Zn extends Xn{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Zn}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const qn=JSON.parse('{"i8":"8.0.5","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class Jn extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Qn=e=>t=>(0,Re.bi)(t)?t:e(t),ea=e=>(t,s)=>(0,Re.bi)(t)?t:e(t,s),ta=e=>{(0,Re.rC)(e,{_isDeleted:Re.LO,_isDisposed:Re.LO,name:Re.LO,package:Re.LO,isDeleted:Re.Fl,path:Re.Fl,_elementHashCode:Re.Fl,hashCode:Re.Fl,setIsDeleted:Re.aD,dispose:Re.aD})},sa=Qn((e=>(0,Re.rC)(e,{value:Re.LO,valueForSerialization:Re.Fl})));var ia=s(34485),na=s(3096);const aa=e=>ia.sha1().update(e).digest("hex"),ra=e=>aa(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?aa(e):e.hashCode)).join(",")),oa="::",la="###",ca=["$implicit"];var da,ha,ua,pa,ma;(ma=da=da||(da={})).CORE="CORE",ma.MAIN="ROOT",ma.MODEL_GENERATION="MODEL_GENERATION_ROOT",ma.SYSTEM="SYSTEM_ROOT",ma.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(pa=ha=ha||(ha={})).STRING="String",pa.BOOLEAN="Boolean",pa.BINARY="Binary",pa.NUMBER="Number",pa.INTEGER="Integer",pa.FLOAT="Float",pa.DECIMAL="Decimal",pa.DATE="Date",pa.STRICTDATE="StrictDate",pa.DATETIME="DateTime",pa.STRICTTIME="StrictTime",pa.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(ua=ua||(ua={}));const _a=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var ga,Ea,fa,Ta,Ca,Sa,xa,Na,va,Aa,Ia;(Ea=ga=ga||(ga={})).ANY="meta::pure::metamodel::type::Any",Ea.NIL="meta::pure::metamodel::type::Nil",Ea.PROFILE_DOC="meta::pure::profiles::doc",Ea.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ea.PROFILE="meta::pure::metamodel::extension::Profile",Ea.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ea.MEASURE="meta::pure::metamodel::type::Measure",Ea.CLASS="meta::pure::metamodel::type::Class",Ea.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ea.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ea.FLAT_DATA="meta::flatData::metamodel::FlatData",Ea.DATABASE="meta::relational::metamodel::Database",Ea.MAPPING="meta::pure::mapping::Mapping",Ea.SERVICE="meta::legend::service::metamodel::Service",Ea.CONNECTION="meta::pure::runtime::PackageableConnection",Ea.RUNTIME="meta::pure::runtime::PackageableRuntime",Ea.EXECUTION_ENVIRONMENT="meta::legend::service::metamodel::ExecutionEnvironmentInstance",Ea.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ea.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ea.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ea.DATA_ELEMENT="meta::pure::data::DataElement",(Sa=fa=fa||(fa={})).BUSINESS_TEMPORAL="businesstemporal",Sa.PROCESSING_TEMPORAL="processingtemporal",Sa.BITEMPORAL="bitemporal",(Ca=Ta=Ta||(Ta={})).ALL_VERSIONS="AllVersions",Ca.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(va=xa=xa||(xa={})).CLASS="CLASS",va.STORE="STORE",va.MAPPING="MAPPING",va.RUNTIME="RUNTIME",va.FILE_GENERATION="FILE_GENERATION",va.SERVICE="SERVICE",function(e){e.LET="meta::pure::functions::lang::letFunction",e.NEW="meta::pure::functions::meta::new"}(Na=Na||(Na={})),(Ia=Aa=Aa||(Aa={})).PACKAGE="PACKAGE",Ia.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Ia.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Ia.PROFILE="PROFILE",Ia.TAG_POINTER="TAG_POINTER",Ia.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Ia.TAGGED_VALUE="TAGGED_VALUE",Ia.ENUMERATION="ENUMERATION",Ia.ENUM_VALUE="ENUM_VALUE",Ia.CLASS="CLASS",Ia.PROPERTY="PROPERTY",Ia.PROPERTY_POINTER="PROPERTY_POINTER",Ia.MULTIPLICITY="MULTIPLICITY",Ia.CONSTRAINT="CONSTRAINT",Ia.DERIVED_PROPERTY="DERIVED_PROPERTY",Ia.ASSOCIATION="ASSOCIATION",Ia.FUNCTION="FUNCTION",Ia.MEASURE="MEASURE",Ia.UNIT="UNIT",Ia.ASSERT_FAIL="ASSERT_FAIL",Ia.ASSERT_PASS="ASSERT_PASS",Ia.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Ia.EQUAL_TO="EQUAL_TO",Ia.EQUAL_TO_JSON="EQUAL_TO_JSON",Ia.EQUAL_TO_TDS="EQUAL_TO_TDS",Ia.TEST_RESULT="TEST_RESULT",Ia.TEST_ERROR="TEST_ERROR",Ia.TEST_FAILED="TEST_FAILED",Ia.TEST_PASSED="TEST_PASSED",Ia.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Ia.SECTION_INDEX="SECTION_INDEX",Ia.SECTION="SECTION",Ia.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Ia.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Ia.RAW_LAMBDA="RAW_LAMBDA",Ia.RAW_VARIABLE="RAW_VARIABLE",Ia.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Ia.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Ia.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Ia.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Ia.EXPRESSION="EXPRESSION",Ia.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Ia.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Ia.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Ia.INSTANCE_VALUE="INSTANCE_VALUE",Ia.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Ia.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Ia.KEY_EXPRESSION_INSTANCE_VALUE="KEY_EXPRESSION_INSTANCE_VALUE",Ia.KEY_EXPRESSION_VALUE="KEY_EXPRESSION_VALUE",Ia.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Ia.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Ia.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Ia.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Ia.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Ia.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Ia.FUNCTION_TYPE="FUNCTION_TYPE",Ia.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Ia.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Ia.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Ia.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Ia.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Ia.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Ia.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Ia.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE",Ia.MAPPING="MAPPING",Ia.MAPPING_INCLUDE="MAPPING_INCLUDE",Ia.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Ia.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Ia.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Ia.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Ia.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Ia.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Ia.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Ia.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Ia.PROPERTY_MAPPING="PROPERTY_MAPPING",Ia.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Ia.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Ia.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Ia.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Ia.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Ia.MAPPING_TEST="MAPPING_TEST",Ia.STORE_TEST_DATA="STORE_TEST_DATA",Ia.INPUT_DATA="INPUT_DATA",Ia.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Ia.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Ia.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Ia.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Ia.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Ia.FILTER_MAPPING="FILTER_MAPPING",Ia.COLUMN_MAPPING="COLUMN_MAPPING",Ia.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Ia.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Ia.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Ia.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Ia.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Ia.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Ia.RUNTIME="RUNTIME",Ia.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Ia.ENGINE_RUNTIME="ENGINE_RUNTIME",Ia.LEGACY_RUNTIME="LEGACY_RUNTIME",Ia.RUNTIME_POINTER="RUNTIME_POINTER",Ia.STORE_CONNECTIONS="STORE_CONNECTIONS",Ia.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Ia.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Ia.CONNECTION_POINTER="CONNECTION_POINTER",Ia.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Ia.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Ia.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Ia.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Ia.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Ia.GENERATION_TREE="GENERATION_TREE",Ia.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Ia.FILE_GENERATION="FILE_GENERATION",Ia.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Ia.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Ia.MODEL_STORE_DATA="MODEL_STORE_DATA",Ia.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Ia.DATA_ELEMENT="DATA_ELEMENT",Ia.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Ia.RELATIONAL_TDS="RELATIONAL_TDS",Ia.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Ia.BINDING="BINDING",Ia.SCHEMA_SET="SCHEMA_SET",Ia.SCHEMA="SCHEMA",Ia.MODEL_UNIT="MODEL_UNIT",Ia.URL_STREAM="URL_STREAM",Ia.EXTERNAL_FORMAT_CONNECTION="EXTERNAL_FORMAT_CONNECTION",Ia.SERVICE="SERVICE",Ia.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Ia.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Ia.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Ia.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Ia.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Ia.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Ia.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Ia.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Ia.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Ia.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Ia.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Ia.SERVICE_TEST="SERVICE_TEST",Ia.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Ia.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Ia.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Ia.EXECUTION_ENVIRONMENT_INSTANCE="EXECUTION_ENVIRONMENT_INSTANCE",Ia.SINGLE_EXECUTION_PARAMETER="SINGLE_EXECUTION_PARAMETER",Ia.MULTI_EXECUTION_PARAMETER="MULTI_EXECUTION_PARAMETER",Ia.DATABASE="DATABASE",Ia.DATABASE_SCHEMA="DATABASE_SCHEMA",Ia.DATABASE_JOIN="DATABASE_JOIN",Ia.DATABASE_FILTER="DATABASE_FILTER",Ia.DATBASE_VIEW="DATBASE_VIEW",Ia.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Ia.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Ia.RELATIONAL="RELATIONAL",Ia.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Ia.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Ia.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Ia.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Ia.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Ia.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Ia.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Ia.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Ia.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Ia.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Ia.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Ia.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Ia.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Ia.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Ia.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Ia.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Ia.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Ia.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Ia.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Ia.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Ia.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Ia.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Ia.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Ia.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Ia.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Ia.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Ia.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Ia.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Ia.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Ia.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Ia.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Ia.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Ia.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Ia.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Ia.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Ia.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Ia.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Ia.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Ia.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Ia.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Ia.TRINO_DATASOURCE_SPECIFICATION="TRINO_DATASOURCE_SPECIFICATION",Ia.TRINO_SSL_SPECIFICATION="TRINO_SSL_SPECIFICATION",Ia.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Ia.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Ia.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Ia.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Ia.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Ia.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Ia.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Ia.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Ia.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Ia.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY="TRINO_KEREBEROS_AUTHENTICATION_STRATEGY",Ia.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Ia.SCHEMA_MAPPER="SCHEMA_MAPPER",Ia.TABLE_MAPPER="TABLE_MAPPER",Ia.FLAT_DATA="FLAT_DATA",Ia.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Ia.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Ia.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Ia.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Ia.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Ia.FLAT_DATA_STRING="FLAT_DATA_STRING",Ia.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Ia.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Ia.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Ia.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Ia.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Ia.FLAT_DATA_DATE="FLAT_DATA_DATE",Ia.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Ia.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Ia.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Ia.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Ia.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Ia.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Ia.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Ia.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER";const Oa=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},Y(Z(t=e),"Can't hash non-object value"),na(t,s);var t,s},ya=(e,t)=>ra([e?Oa(e):"",t?Oa(t):""]),Ra=(e,t)=>[Aa.PACKAGEABLE_ELEMENT_POINTER,e??"",t].map(aa).join(",");class wa{stereotypes=[];taggedValues=[]}class La extends wa{name}class Pa extends La{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}${oa}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return ra([Aa.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new b(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ba extends Pa{}class Da extends ba{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return ra([Aa.CLASS,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),ra(this.constraints),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class Ma extends ba{}class Fa extends Ma{values=[];get _elementHashCode(){return ra([Aa.ENUMERATION,this.path,ra(this.values),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ka extends Ma{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return ra([Aa.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new D}}class ja extends ba{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return ra([Aa.MEASURE,this.path,this.canonicalUnit??"",ra(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class Ua extends Pa{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class Ga{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return ra([Aa.SECTION,this.parserName,ra(this.elements.map((e=>e.valueForSerialization??"")))])}}class Va extends Ga{imports=[];get hashCode(){return ra([Aa.IMPORT_AWARE_CODE_SECTION,super.hashCode,ra(this.imports.map((e=>e.valueForSerialization??"")))])}}class $a extends Ga{get hashCode(){return ra([Aa.DEFAULT_CODE_SECTION,super.hashCode])}}class Ba{_UUID=(0,a.Z)()}class za extends Ba{ownerReference;constructor(e){super(),this.ownerReference=e}}class Ha extends Ba{value;constructor(e){super(),this.value=e}}class Ya extends Ha{constructor(e){super(e)}static create(e){return new Ya(e)}get valueForSerialization(){return this.value.path}}const Wa=Qn((e=>(0,Re.rC)(e,{name:Re.LO,value:Re.LO.ref,hashCode:Re.Fl}))),Ka=Qn((e=>(ta(e),(0,Re.rC)(e,{type:Re.LO,generationOutputPath:Re.LO,scopeElements:Re.LO,configurationProperties:Re.LO,_elementHashCode:Re.KG}),e.scopeElements.forEach((e=>{e instanceof Ha&&sa(e)})),e.configurationProperties.forEach(Wa),e))),Xa=Qn((e=>((0,Re.rC)(e,{id:Re.LO,hashCode:Re.Fl}),sa(e.generationElement),e))),Za=Qn((e=>(ta(e),(0,Re.rC)(e,{generationNodes:Re.LO,fileGenerations:Re.LO,_elementHashCode:Re.KG}),e.generationNodes.forEach(Xa),e.fileGenerations.forEach(sa),e)));class qa{}class Ja extends qa{expectedOutput;constructor(e){super(),this.expectedOutput=ht(e)}get hashCode(){return ra([Aa.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Qa{}class er extends Qa{mappings=[];connections=[];get hashCode(){return ra([Aa.ENGINE_RUNTIME,ra(this.mappings.map((e=>Ra(xa.MAPPING,e.valueForSerialization??"")))),ra(this.connections.filter((e=>e.storeConnections.length)))])}}class tr extends Qa{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return ra([Aa.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class sr{}class ir extends sr{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return ra([Aa.FLAT_DATA_INPUT_DATA,Ra(xa.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var nr,ar,rr;(rr=nr=nr||(nr={})).JSON="JSON",rr.XML="XML";class or extends sr{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===nr.JSON?ht(s):s}get hashCode(){return ra([Aa.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(ar=ar||(ar={}));class lr extends sr{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return ra([Aa.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const cr=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),sa(e.type),e))),dr=Qn((e=>(0,Re.rC)(e,{body:Re.LO.ref,parameters:Re.LO.ref,hashCode:Re.Fl}))),hr=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,hashCode:Re.Fl}),sa(e.type),e)));class ur{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){dr(e)}visit_RawVariableExpression(e){hr(e)}visit_RawPrimitiveInstanceValue(e){cr(e)}}ea(((e,t)=>(e.accept_RawValueSpecificationVisitor(new ur(t)),e)));class pr{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class mr extends pr{trueString;falseString;get hashCode(){return ra([Aa.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class _r extends pr{get hashCode(){return ra([Aa.FLAT_DATA_STRING])}}class gr extends pr{get hashCode(){return ra([Aa.FLAT_DATA_NUMBER])}}class Er extends pr{dateFormat;timeZone;get hashCode(){return ra([Aa.FLAT_DATA_DATE,this.dateFormat?ra(this.dateFormat):"",this.timeZone??""])}}class fr extends pr{fields=[];get hashCode(){return ra([Aa.FLAT_DATA_RECORD_TYPE,ra(this.fields)])}}const Tr=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{flatData:Re.LO,sectionName:Re.LO,hashCode:Re.Fl}),e))),Cr=Qn((e=>((0,Re.rC)(e,{label:Re.LO,flatDataDataType:Re.LO,optional:Re.LO,address:Re.LO,hashCode:Re.Fl}),(e=>{e instanceof mr?(0,Re.rC)(e,{trueString:Re.LO,falseString:Re.LO,hashCode:Re.Fl}):e instanceof _r||e instanceof gr?(0,Re.rC)(e,{hashCode:Re.Fl}):e instanceof Er?(0,Re.rC)(e,{dateFormat:Re.LO,timeZone:Re.LO,hashCode:Re.Fl}):e instanceof fr&&Qn(Sr)(e)})(e.flatDataDataType),e)));function Sr(e){return(0,Re.rC)(e,{fields:Re.LO,hashCode:Re.Fl}),e.fields.forEach(Cr),e}Qn(Sr);const xr=Qn(Sr),Nr=Qn((e=>((0,Re.rC)(e,{name:Re.LO,value:Re.LO,hashCode:Re.Fl}),e))),vr=Qn((e=>((0,Re.rC)(e,{driverId:Re.LO,name:Re.LO,sectionProperties:Re.LO,recordType:Re.LO,hashCode:Re.Fl}),e.sectionProperties.forEach(Nr),e.recordType&&xr(e.recordType),e))),Ar=(Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Qn((e=>(ta(e),(0,Re.rC)(e,{sections:Re.LO,_elementHashCode:Re.KG}),e.sections.forEach(vr),e)))),Ir=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),Or=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{filter:Re.LO,hashCode:Re.Fl}),Ir(e.sourceRootRecordType),e.filter&&dr(e.filter),e))),yr=ea(((e,t)=>(sd(e,t),dd(e,t),(0,Re.rC)(e,{rootInstanceSetImplementation:Re.LO,hashCode:Re.Fl}),e))),Rr=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,transform:Re.LO,hashCode:Re.Fl}),dr(e.transform),e))),wr=Qn((e=>((0,Re.rC)(e,{data:Re.LO,hashCode:Re.Fl}),sa(e.sourceFlatData),e))),Lr=Qn((e=>((0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),e)));class Pr{}class br extends Pr{serverPrincipal;get hashCode(){return ra([Aa.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class Dr extends Pr{get hashCode(){return ra([Aa.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class Mr extends Pr{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return ra([Aa.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class Fr extends Pr{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return ra([Aa.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class kr extends Pr{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return ra([Aa.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class jr extends Pr{get hashCode(){return ra([Aa.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class Ur extends Pr{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return ra([Aa.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,ra(this.additionalGcpScopes)])}}class Gr extends Pr{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return ra([Aa.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Vr extends Pr{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return ra([Aa.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class $r extends Pr{kerberosRemoteServiceName;kerberosUseCanonicalHostname;constructor(e,t){super(),this.kerberosRemoteServiceName=e,this.kerberosUseCanonicalHostname=t}get hashCode(){return ra([Aa.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY,this.kerberosRemoteServiceName,this.kerberosUseCanonicalHostname.toString()])}}class Br{}class zr extends Br{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return ra([Aa.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Hr extends Br{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return ra([Aa.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Yr extends Br{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return ra([Aa.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Wr extends Br{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return ra([Aa.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",ra(this.testDataSetupSqls)])}}class Kr extends Br{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return ra([Aa.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class Xr extends Br{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return ra([Aa.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Zr extends Br{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return ra([Aa.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class qr extends Br{projectId;instanceId;databaseId;proxyHost;proxyPort;constructor(e,t,s,i,n){super(),this.projectId=e,this.instanceId=t,this.databaseId=s,this.proxyHost=i,this.proxyPort=n}get hashCode(){return ra([Aa.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class Jr extends Br{host;port;sslSpecification;catalog;schema;clientTags;constructor(e,t,s){super(),this.host=e,this.port=t,this.sslSpecification=s}get hashCode(){return ra([Aa.TRINO_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.sslSpecification,this.catalog??"",this.schema??"",this.clientTags??""])}}class Qr{}class eo extends Qr{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return ra([this.from,this.to])}}class to extends eo{get hashCode(){return ra([super.hashCode,Aa.SCHEMA_MAPPER])}}class so extends eo{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return ra([super.hashCode,Aa.TABLE_MAPPER,this.schema])}}class io{_UUID=(0,a.Z)()}class no extends io{mappers=[];get hashCode(){return ra([Aa.MAPPER_POST_PROCESSOR,ra(this.mappers)])}}const ao="{target}",ro="default";class oo{}class lo extends oo{}class co extends lo{}class ho extends co{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return ra([Aa.RELATIONAL_OPERATION_DYNA_FUNC,this.name,ra(this.parameters)])}}var uo;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(uo=uo||(uo={}));const po=e=>[e].concat(e.children.length?po(e.children[0]):[]);class mo extends oo{relationalOperationElement;joinTreeNode;get hashCode(){return ra([Aa.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,ra(this.joinTreeNode?po(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class _o extends oo{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new D}}class go extends oo{alias;column;columnName;get hashCode(){return ra([Aa.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?ao:this.alias.name,this.column.value.name])}}class Eo extends oo{value;constructor(e){super(),this.value=e}get hashCode(){return ra([Aa.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class fo extends oo{values=[];get hashCode(){return ra([Aa.RELATIONAL_OPERATION_LITERAL_LIST,ra(this.values)])}}class To extends oo{owner;name;type;nullable;get hashCode(){return ra([Aa.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Co{}class So extends Co{infinityDate}class xo{}class No extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BIGINT])}}class vo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_SMALLINT])}}class Ao extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_TINYINT])}}class Io extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_INTEGER])}}class Oo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_FLOAT])}}class yo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_DOUBLE])}}class Ro extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class wo extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Lo extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Po extends xo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class bo extends xo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Do extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_TIMESTAMP])}}class Mo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_VARCHAR])}}class Fo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BIT])}}class ko extends xo{size;constructor(e){super(),this.size=e}get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class jo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_REAL])}}class Uo extends xo{get hashCode(){return ra([Aa.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class Go extends za{ownerReference;constructor(e){super(e),this.ownerReference=e}}class Vo extends Go{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(aa).join(",")}get selfJoinPointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",ro,ao].map(aa).join(",")}}class $o extends Go{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(aa).join(",")}get selfJoinPointerHashCode(){return[Aa.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",ro,ao].map(aa).join(",")}}const Bo=Qn((e=>((0,Re.rC)(e,{packageableElementIncludes:Re.LO,packageableElementExcludes:Re.LO,hashCode:Re.Fl}),e.packageableElementIncludes.forEach(sa),e.packageableElementExcludes.forEach(sa),e))),zo=(Qn((e=>(Xc(e),(0,Re.rC)(e,{schemaSet:Re.LO,schemaId:Re.LO,contentType:Re.LO,modelUnit:Re.LO,_elementHashCode:Re.KG}),e.schemaSet&&sa(e.schemaSet),Bo(e.modelUnit),e))),Qn((e=>((0,Re.rC)(e,{binding:Re.LO,hashCode:Re.Fl}),sa(e.binding),e)))),Ho=Qn((e=>((0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),e))),Yo=(Qn((e=>(yd(e),(0,Re.rC)(e,{externalSource:Re.LO,hashCode:Re.Fl}),Ho(e.externalSource),e))),Qn((e=>(0,Re.rC)(e,{id:Re.LO,location:Re.LO,content:Re.LO,hashCode:Re.Fl})))),Wo=(Qn((e=>(ta(e),(0,Re.rC)(e,{format:Re.LO,schemas:Re.LO,_elementHashCode:Re.KG}),e.schemas.forEach(Yo),e))),Qn((e=>e instanceof No||e instanceof vo||e instanceof Ao||e instanceof Io||e instanceof Oo||e instanceof yo||e instanceof Do||e instanceof Date||e instanceof Mo||e instanceof Fo||e instanceof jo||e instanceof Uo?(0,Re.rC)(e,{hashCode:Re.Fl}):e instanceof Ro||e instanceof wo||e instanceof Lo||e instanceof ko?(0,Re.rC)(e,{size:Re.LO,hashCode:Re.Fl}):e instanceof Po||e instanceof bo?(0,Re.rC)(e,{precision:Re.LO,scale:Re.LO,hashCode:Re.Fl}):e))),Ko=Qn((e=>((0,Re.rC)(e,{name:Re.LO,type:Re.LO,nullable:Re.LO,hashCode:Re.Fl}),Wo(e.type),e))),Xo=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl,selfJoinPointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Zo=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl,selfJoinPointerHashCode:Re.Fl}),sa(e.ownerReference),e))),qo=Qn((e=>((0,Re.rC)(e,{relation:Re.LO,name:Re.LO,database:Re.LO,isSelfJoinTarget:Re.LO}),(e=>{e instanceof $o?Zo(e):e instanceof Vo&&Xo(e)})(e.relation),e))),Jo=Qn((e=>((0,Re.rC)(e,{name:Re.LO,parameters:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(rl),e))),Qo=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),el=Qn((e=>((0,Re.rC)(e,{alias:Re.LO,column:Re.LO,columnName:Re.LO,hashCode:Re.Fl}),qo(e.alias),Qo(e.column),e))),tl=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),sl=Qn((e=>((0,Re.rC)(e,{alias:Re.LO,children:Re.LO,joinType:Re.LO,hashCode:Re.Fl}),e.alias&&qo(e.alias),e.children.forEach(sl),tl(e.join),e))),il=Qn((e=>((0,Re.rC)(e,{relationalOperationElement:Re.LO,joinTreeNode:Re.LO,hashCode:Re.Fl}),e.relationalOperationElement&&rl(e.relationalOperationElement),e.joinTreeNode&&sl(e.joinTreeNode),e))),nl=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),e.value instanceof oo&&rl(e.value),e))),al=Qn((e=>((0,Re.rC)(e,{values:Re.LO,hashCode:Re.Fl}),e.values.forEach(nl),e)));function rl(e){return e instanceof ho?Jo(e):e instanceof _o?qo(e):e instanceof go?el(e):e instanceof To?Ko(e):e instanceof Eo?nl(e):e instanceof fo?al(e):e instanceof mo?il(e):e}const ol=Qn((e=>e)),ll=ea(((e,t)=>{if(e instanceof So)return ol(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),cl=Qn((e=>((0,Re.rC)(e,{columnName:Re.LO,relationalOperationElement:Re.LO,hashCode:Re.Fl}),rl(e.relationalOperationElement),e))),dl=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),hl=Qn((e=>((0,Re.rC)(e,{joinTreeNode:Re.LO,database:Re.LO,filterName:Re.LO,hashCode:Re.Fl}),e.joinTreeNode&&sl(e.joinTreeNode),dl(e.filter),e))),ul=Qn((e=>((0,Re.rC)(e,{columns:Re.LO}),e.columns.forEach(rl),e))),pl=e=>{(0,Re.rC)(e,{columns:Re.LO,name:Re.LO})},ml=ea(((e,t)=>(pl(e),(0,Re.rC)(e,{primaryKey:Re.LO,hashCode:Re.Fl}),e.primaryKey.forEach(Ko),e.milestoning.forEach((e=>ll(e,t))),e))),_l=ea(((e,t)=>(pl(e),(0,Re.rC)(e,{primaryKey:Re.LO,columnMappings:Re.LO,filter:Re.LO,distinct:Re.LO,groupBy:Re.LO,hashCode:Re.Fl}),e.primaryKey.forEach(Ko),e.columnMappings.forEach(cl),e.filter&&hl(e.filter),e.groupBy&&ul(e.groupBy),e))),gl=ea(((e,t)=>((0,Re.rC)(e,{name:Re.LO,tables:Re.LO,views:Re.LO,hashCode:Re.Fl}),e.tables.forEach((e=>ml(e,t))),e.views.forEach((e=>_l(e,t))),e))),El=Qn((e=>((0,Re.rC)(e,{name:Re.LO,operation:Re.LO,hashCode:Re.Fl}),rl(e.operation),e))),fl=Qn((e=>((0,Re.rC)(e,{name:Re.LO,target:Re.LO,aliases:Re.LO,operation:Re.LO,hashCode:Re.Fl}),e.target&&qo(e.target),rl(e.operation),e))),Tl=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{schemas:Re.LO,joins:Re.LO,filters:Re.LO,_elementHashCode:Re.KG}),e.schemas.forEach((e=>gl(e,t))),e.joins.forEach(fl),e.filters.forEach(El),e))),Cl=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,relationalOperation:Re.LO.ref,bindingTransformer:Re.LO,hashCode:Re.Fl}),e.bindingTransformer&&zo(e.bindingTransformer),e))),Sl=(e,t)=>(dd(e,t),sd(e,t),(0,Re.rC)(e,{id:Re.LO,rootInstanceSetImplementation:Re.LO,primaryKey:Re.LO}),e.primaryKey.forEach(rl),e),xl=ea(Sl),Nl=ea(((e,t)=>(Sl(e,t),(0,Re.rC)(e,{inlineSetImplementation:Re.LO}),Ed(e.inlineSetImplementation,t),e))),vl=ea(((e,t)=>(Sl(e,t),(0,Re.rC)(e,{otherwisePropertyMapping:Re.LO,hashCode:Re.Fl}),ad(e.otherwisePropertyMapping,t),e))),Al=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{primaryKey:Re.LO}),e.primaryKey.forEach(rl),e))),Il=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{columnMappings:Re.LO,filter:Re.LO,distinct:Re.LO,groupBy:Re.LO,mainTableAlias:Re.LO,superSetImplementationId:Re.LO,hashCode:Re.Fl}),e.columnMappings.forEach(cl),e.filter&&hl(e.filter),e.groupBy&&ul(e.groupBy),e.mainTableAlias&&qo(e.mainTableAlias),e))),Ol=Qn((e=>((0,Re.rC)(e,{data:Re.LO,inputType:Re.LO,hashCode:Re.Fl}),sa(e.database),e))),yl=Qn((e=>(0,Re.rC)(e,{host:Re.LO,port:Re.LO,databaseName:Re.LO,hashCode:Re.Fl}))),Rl=Qn((e=>(0,Re.rC)(e,{hostname:Re.LO,port:Re.LO,protocol:Re.LO,httpPath:Re.LO,hashCode:Re.Fl}))),wl=Qn((e=>(0,Re.rC)(e,{databaseName:Re.LO,directory:Re.LO,autoServerMode:Re.LO,hashCode:Re.Fl}))),Ll=Qn((e=>(0,Re.rC)(e,{testDataSetupCsv:Re.LO,testDataSetupSqls:Re.LO,hashCode:Re.Fl}))),Pl=Qn((e=>(0,Re.rC)(e,{accountName:Re.LO,region:Re.LO,warehouseName:Re.LO,databaseName:Re.LO,cloudType:Re.LO,quotedIdentifiersIgnoreCase:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,nonProxyHosts:Re.LO,organization:Re.LO,accountType:Re.LO,role:Re.LO,hashCode:Re.Fl}))),bl=Qn((e=>(0,Re.rC)(e,{databaseName:Re.LO,endpointURL:Re.LO,port:Re.LO,region:Re.LO,clusterID:Re.LO,host:Re.LO,hashCode:Re.Fl}))),Dl=Qn((e=>(0,Re.rC)(e,{projectId:Re.LO,defaultDataset:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,hashCode:Re.Fl}))),Ml=Qn((e=>(0,Re.rC)(e,{projectId:Re.LO,instanceId:Re.LO,databaseId:Re.LO,proxyHost:Re.LO,proxyPort:Re.LO,hashCode:Re.Fl}))),Fl=Qn((e=>(0,Re.rC)(e,{ssl:Re.LO,trustStorePathVaultReference:Re.LO,trustStorePasswordVaultReference:Re.LO,hashCode:Re.Fl}))),kl=Qn((e=>((0,Re.rC)(e,{host:Re.LO,port:Re.LO,catalog:Re.LO,schema:Re.LO,clientTags:Re.LO,hashCode:Re.Fl}),Fl(e.sslSpecification),e))),jl=Qn((e=>(0,Re.rC)(e,{serverPrincipal:Re.LO,hashCode:Re.Fl}))),Ul=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl}))),Gl=Qn((e=>(0,Re.rC)(e,{apiToken:Re.LO,hashCode:Re.Fl}))),Vl=Qn((e=>(0,Re.rC)(e,{oauthKey:Re.LO,scopeName:Re.LO,hashCode:Re.Fl}))),$l=Qn((e=>(0,Re.rC)(e,{privateKeyVaultReference:Re.LO,passPhraseVaultReference:Re.LO,publicUserName:Re.LO,hashCode:Re.Fl}))),Bl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl}))),zl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,userNameVaultReference:Re.LO,passwordVaultReference:Re.LO,baseVaultReference:Re.LO}))),Hl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,serviceAccountEmail:Re.LO,additionalGcpScopes:Re.LO}))),Yl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,vaultReference:Re.LO}))),Wl=Qn((e=>(0,Re.rC)(e,{hashCode:Re.Fl,kerberosRemoteServiceName:Re.LO,kerberosUseCanonicalHostname:Re.LO}))),Kl=e=>{(0,Re.rC)(e,{from:Re.LO,to:Re.LO,hashCode:Re.Fl})},Xl=Qn((e=>(Kl(e),e))),Zl=Qn((e=>(Kl(e),(0,Re.rC)(e,{schema:Re.LO}),Xl(e.schema),e))),ql=ea(((e,t)=>((e=>{yd(e),(0,Re.rC)(e,{type:Re.LO,timeZone:Re.LO,quoteIdentifiers:Re.LO})})(e),(0,Re.rC)(e,{datasourceSpecification:Re.LO,authenticationStrategy:Re.LO,postProcessors:Re.LO,hashCode:Re.Fl}),((e,t)=>{if(e instanceof zr)return yl(e);if(e instanceof Hr)return Rl(e);if(e instanceof Yr)return wl(e);if(e instanceof Wr)return Ll(e);if(e instanceof Kr)return Pl(e);if(e instanceof Xr)return bl(e);if(e instanceof Zr)return Dl(e);if(e instanceof qr)return Ml(e);if(e instanceof Jr)return kl(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof br)return jl(e);if(e instanceof Dr)return Ul(e);if(e instanceof Mr)return Gl(e);if(e instanceof Fr)return Vl(e);if(e instanceof kr)return $l(e);if(e instanceof jr)return Bl(e);if(e instanceof Gr)return zl(e);if(e instanceof Ur)return Hl(e);if(e instanceof Vr)return Yl(e);if(e instanceof $r)return Wl(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof no)return(e=>((e=>{(0,Re.rC)(e,{hashCode:Re.Fl})})(e),(0,Re.rC)(e,{mappers:Re.LO}),e.mappers.forEach((e=>{(e=>{e instanceof to?Xl(e):e instanceof so&&Zl(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class Jl{id}class Ql extends Jl{__parent;assertions=[]}class ec extends Jl{__parent;tests=[]}class tc extends Ql{query;get hashCode(){return ra([Aa.MAPPING_TEST,this.query,this.id,ra(this.assertions)])}}class sc extends ec{mappingStoreTestDatas=[];get hashCode(){return ra([Aa.MAPPING_TEST_SUITE,ra(this.mappingStoreTestDatas),this.id,ra(this.tests)])}}class ic extends Ql{serializationFormat;parameters=[];keys=[];get hashCode(){return ra([Aa.SERVICE_TEST,this.id,ra(this.assertions),ra(this.parameters),ra(this.keys),this.serializationFormat??""])}}class nc extends ec{testData;get hashCode(){return ra([Aa.SERVICE_TEST_SUITE,this.id,ra(this.tests),this.testData])}}class ac{id;parentTest}class rc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO,this.id,Oa(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class oc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class lc extends ac{expected;get hashCode(){return ra([Aa.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class cc{}class dc extends cc{dataElement;get hashCode(){return ra([Aa.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class hc extends cc{contentType;data;get hashCode(){return ra([Aa.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class uc extends cc{instances;get hashCode(){return ra([Aa.MODEL_STORE_DATA,ra(Array.from(this.instances.keys()).map((e=>e.path))),Oa(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class pc extends cc{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return ra([Aa.RELATIONAL_CSV_DATA_TABLE,ra(this.tables)])}}const mc=Qn((e=>((0,Re.rC)(e,{contentType:Re.LO,data:Re.LO,hashCode:Re.Fl}),e))),_c=Qn((e=>((0,Re.rC)(e,{dataElement:Re.LO,hashCode:Re.Fl}),e))),gc=Qn((e=>((0,Re.rC)(e,{instances:Re.LO,hashCode:Re.Fl}),e))),Ec=Qn((e=>((0,Re.rC)(e,{values:Re.LO,table:Re.LO,schema:Re.LO,hashCode:Re.Fl}),e))),fc=Qn((e=>((0,Re.rC)(e,{tables:Re.LO,hashCode:Re.Fl}),e.tables.forEach(Ec),e)));function Tc(e,t){if(e instanceof dc)return _c(e);if(e instanceof hc)return mc(e);if(e instanceof uc)return gc(e);if(e instanceof pc)return fc(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Cc=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{stereotypes:Re.LO,taggedValues:Re.LO,data:Re.LO,_elementHashCode:Re.KG}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),Tc(e.data,t),e)));class Sc{}class xc extends Sc{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return ra([Aa.SERVICE_PURE_EXECUTION,this.func])}}class Nc extends xc{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return ra([Aa.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class vc extends xc{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return ra([Aa.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,ra(this.executionParameters)])}}class Ac{_OWNER;constructor(e){this._OWNER=e}}class Ic extends Ac{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return ra([Aa.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,ra(this.asserts)])}}class Oc extends Ac{tests=[];get hashCode(){return ra([Aa.SERVICE_LEGACY_MULTI_EXECUTION_TEST,ra(this.tests)])}}const yc=ea(((e,t)=>((0,Re.rC)(e,{connectionId:Re.LO,testData:Re.LO,hashCode:Re.Fl}),Tc(e.testData,t),e))),Rc=Qn((e=>((0,Re.rC)(e,{name:Re.LO,value:Re.LO.ref,hashCode:Re.Fl}),e))),wc=Qn((e=>((0,Re.rC)(e,{assertion:Re.LO,hashCode:Re.Fl,id:Re.LO}),dr(e.assertion),e))),Lc=Qn((e=>((0,Re.rC)(e,{assertions:Re.LO,description:Re.LO,parameters:Re.LO,hashCode:Re.Fl}),e.assertions.forEach(wc),e.parameters.forEach(dr),e))),Pc=ea(((e,t)=>((0,Re.rC)(e,{connectionsTestData:Re.LO,hashCode:Re.Fl}),e.connectionsTestData.forEach((e=>yc(e,t))),e))),bc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,serializationFormat:Re.LO,assertions:Re.LO,parameters:Re.LO,keys:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(Rc),e.assertions.forEach(Kc),e))),Dc=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,tests:Re.LO,testData:Re.LO,hashCode:Re.Fl}),e.tests.forEach((e=>Wc(e,t))),Pc(e.testData,t),e))),Mc=Qn((e=>((0,Re.rC)(e,{parametersValues:Re.LO,assert:Re.LO,singleExecutionTestParent:Re.LO,hashCode:Re.Fl}),dr(e.assert),e))),Fc=Qn((e=>((0,Re.rC)(e,{data:Re.LO,asserts:Re.LO,hashCode:Re.Fl}),e.asserts.forEach(Mc),e))),kc=Qn((e=>(Fc(e),(0,Re.rC)(e,{key:Re.LO}),e))),jc=Qn((e=>((0,Re.rC)(e,{tests:Re.LO,hashCode:Re.Fl}),e.tests.forEach(kc),e))),Uc=e=>{(0,Re.rC)(e,{func:Re.LO}),dr(e.func)},Gc=ea(((e,t)=>(Uc(e),(0,Re.rC)(e,{runtime:Re.LO,hashCode:Re.Fl}),e.mapping&&sa(e.mapping),e.runtime&&Gd(e.runtime,t),e))),Vc=ea(((e,t)=>((0,Re.rC)(e,{key:Re.LO,runtime:Re.LO,hashCode:Re.Fl}),sa(e.mapping),Gd(e.runtime,t),e))),$c=ea(((e,t)=>(Uc(e),(0,Re.rC)(e,{executionKey:Re.LO,executionParameters:Re.LO,hashCode:Re.Fl}),e.executionParameters.forEach((e=>Vc(e,t))),e))),Bc=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{pattern:Re.LO,owners:Re.LO,documentation:Re.LO,autoActivateUpdates:Re.LO,execution:Re.LO,test:Re.LO,tests:Re.LO,postValidations:Re.LO,patternParameters:Re.Fl,_elementHashCode:Re.KG}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),((e,t)=>{e instanceof Nc?Gc(e,t):e instanceof vc&&$c(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Ic?Fc(e):e instanceof Oc&&jc(e)})(e.test),e.tests.forEach((e=>Dc(e,t))),e.postValidations.forEach((e=>Lc(e))),e))),zc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),e))),Hc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),mc(e.expected),e))),Yc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,expected:Re.LO,hashCode:Re.Fl}),mc(e.expected),e)));function Wc(e,t){if(e instanceof ic)return bc(e);if(e instanceof tc)return qc(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Kc(e){return e instanceof rc?zc(e):e instanceof oc?Yc(e):e instanceof lc?Hc(e):e}const Xc=e=>{ta(e),(0,Re.rC)(e,{includes:Re.LO}),e.includes.forEach(sa)},Zc=ea(((e,t)=>((0,Re.rC)(e,{store:Re.LO,data:Re.LO,hashCode:Re.Fl}),Tc(e.data,t),e))),qc=Qn((e=>((0,Re.rC)(e,{id:Re.LO,query:Re.LO,assertions:Re.LO,hashCode:Re.Fl}),e.assertions.forEach(Kc),e))),Jc=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,tests:Re.LO,mappingStoreTestDatas:Re.LO,hashCode:Re.Fl}),e.tests.forEach((e=>Wc(e,t))),e.mappingStoreTestDatas.forEach((e=>Zc(e,t))),e))),Qc=Qn((e=>((0,Re.rC)(e,{value:Re.LO,valueForSerialization:Re.Fl}),sa(e.ownerReference),e))),ed=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),td=Qn((e=>((0,Re.rC)(e,{localMappingProperty:Re.LO,localMappingPropertyType:Re.LO,localMappingPropertyMultiplicity:Re.LO,hashCode:Re.Fl}),sa(e.localMappingPropertyType),e))),sd=(e,t)=>{(0,Re.rC)(e,{sourceSetImplementation:Re.LO,targetSetImplementation:Re.LO}),ch(e.property),ed(e.sourceSetImplementation),e.targetSetImplementation&&ed(e.targetSetImplementation),e.localMappingProperty&&td(e.localMappingProperty)},id=ea(((e,t)=>(sd(e,t),(0,Re.rC)(e,{transformer:Re.LO,transform:Re.LO,explodeProperty:Re.LO,hashCode:Re.Fl}),e.transformer&&Qc(e.transformer),dr(e.transform),e)));class nd{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){id(e,this.observerContext)}visit_FlatDataPropertyMapping(e){Rr(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){yr(e,this.observerContext)}visit_RelationalPropertyMapping(e){Cl(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Tr(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){xl(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Nl(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){vl(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const ad=(e,t)=>(e.accept_PropertyMappingVisitor(new nd(t)),e),rd=Qn((e=>(0,Re.rC)(e,{isDefault:Re.Fl,valueForSerialization:Re.Fl}))),od=Qn((e=>(0,Re.rC)(e,{valueForSerialization:Re.Fl}))),ld=e=>{(0,Re.rC)(e,{root:Re.LO}),sa(e.class),rd(e.id),od(e.root)},cd=Qn((e=>((0,Re.rC)(e,{setImplementation:Re.LO,class:Re.LO,properties:Re.LO}),e))),dd=(e,t)=>{ld(e),(0,Re.rC)(e,{mappingClass:Re.LO,propertyMappings:Re.LO}),e.mappingClass&&cd(e.mappingClass),e.propertyMappings.forEach((e=>ad(e,t)))},hd=Qn((e=>((0,Re.rC)(e,{}),ed(e.setImplementation),e))),ud=e=>{ld(e),(0,Re.rC)(e,{parameters:Re.LO,operation:Re.LO,hashCode:Re.Fl}),e.parameters.forEach(hd)},pd=Qn((e=>(ud(e),e))),md=Qn((e=>(ud(e),(0,Re.rC)(e,{validationFunction:Re.LO}),dr(e.validationFunction),e))),_d=ea(((e,t)=>(dd(e,t),(0,Re.rC)(e,{filter:Re.LO,hashCode:Re.Fl}),e.srcClass&&sa(e.srcClass),e.filter&&dr(e.filter),e)));class gd{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){md(e)}visit_OperationSetImplementation(e){pd(e)}visit_PureInstanceSetImplementation(e){_d(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Or(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Al(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Il(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Ed=(e,t)=>(e.accept_SetImplementationVisitor(new gd(t)),e),fd=Qn((e=>((0,Re.rC)(e,{original:Re.LO,substitute:Re.LO}),sa(e.original),sa(e.substitute),e))),Td=Qn((e=>((0,Re.rC)(e,{included:Re.LO,storeSubstitutions:Re.LO}),sa(e.included),e.storeSubstitutions.forEach(fd),e))),Cd=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),Sd=Qn((e=>((0,Re.rC)(e,{sourceValues:Re.LO,hashCode:Re.Fl}),ih(e.enum),e.sourceValues.forEach(Cd),e))),xd=Qn((e=>((0,Re.rC)(e,{sourceType:Re.LO,enumValueMappings:Re.LO,hashCode:Re.Fl}),sa(e.enumeration),rd(e.id),e.sourceType&&sa(e.sourceType),e.enumValueMappings.forEach(Sd),e))),Nd=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,stores:Re.LO,propertyMappings:Re.LO,hashCode:Re.Fl}),sa(e.association),rd(e.id),e.stores.forEach(sa),e.propertyMappings.forEach((e=>ad(e,t))),e))),vd=Qn((e=>((0,Re.rC)(e,{inputType:Re.LO,data:Re.LO,hashCode:Re.Fl}),sa(e.sourceClass),e))),Ad=Qn((e=>(0,Re.rC)(e,{expectedOutput:Re.LO,hashCode:Re.Fl}))),Id=ea(((e,t)=>((0,Re.rC)(e,{name:Re.LO,query:Re.LO,inputData:Re.LO,assert:Re.LO,hashCode:Re.Fl}),dr(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof or)return vd(e);if(e instanceof ir)return wr(e);if(e instanceof lr)return Ol(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof Ja&&Ad(e)})(e.assert),e))),Od=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{includes:Re.LO,classMappings:Re.LO,enumerationMappings:Re.LO,associationMappings:Re.LO,test:Re.LO,tests:Re.LO,_elementHashCode:Re.KG}),e.includes.forEach(Td),e.classMappings.forEach((e=>Ed(e,t))),e.enumerationMappings.forEach(xd),e.associationMappings.forEach((e=>Nd(e,t))),e.test.forEach((e=>Id(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof nc?Dc(e,t):e instanceof sc?Jc(e,t):e}(e,t))),e))),yd=e=>{(0,Re.rC)(e,{store:Re.LO}),sa(e.store)},Rd=Qn((e=>(yd(e),(0,Re.rC)(e,{hashCode:Re.Fl}),e))),wd=Qn((e=>(yd(e),(0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),Ld=Qn((e=>(yd(e),(0,Re.rC)(e,{url:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),Pd=Qn((e=>(yd(e),(0,Re.rC)(e,{mappings:Re.LO,hashCode:Re.Fl}),e.mappings.forEach(sa),e)));class bd{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){Rd(e)}visit_ModelChainConnection(e){Pd(e)}visit_JsonModelConnection(e){wd(e)}visit_XmlModelConnection(e){Ld(e)}visit_FlatDataConnection(e){Lr(e)}visit_RelationalDatabaseConnection(e){ql(e,this.observerContext)}}const Dd=(e,t)=>(e.accept_ConnectionVisitor(new bd(t)),e),Md=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{connectionValue:Re.LO,_elementHashCode:Re.KG}),Dd(e.connectionValue,t),e))),Fd=ea(((e,t)=>((0,Re.rC)(e,{id:Re.LO,connection:Re.LO,hashCode:Re.Fl}),Dd(e.connection,t),e))),kd=ea(((e,t)=>((0,Re.rC)(e,{storeConnections:Re.LO,hashCode:Re.Fl}),sa(e.store),e.storeConnections.forEach((e=>Fd(e,t))),e))),jd=ea(((e,t)=>((0,Re.rC)(e,{mappings:Re.LO,connections:Re.LO,hashCode:Re.Fl}),e.mappings.forEach(sa),e.connections.forEach((e=>kd(e,t))),e))),Ud=Qn((e=>((0,Re.rC)(e,{hashCode:Re.Fl}),sa(e.packageableRuntime),e))),Gd=(e,t)=>e instanceof tr?Ud(e):e instanceof er?jd(e,t):e,Vd=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{runtimeValue:Re.LO,_elementHashCode:Re.KG}),jd(e.runtimeValue,t),e))),$d=ea(((e,t)=>(ta(e),(0,Re.rC)(e,{_elementHashCode:Re.KG}),e)));class Bd{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){Hd(e,this.observerContext)}visit_SectionIndex(e){Jd(e)}visit_PrimitiveType(e){}visit_Profile(e){th(e)}visit_Enumeration(e){nh(e)}visit_Measure(e){rh(e)}visit_Class(e){hh(e)}visit_Association(e){uh(e)}visit_ConcreteFunctionDefinition(e){ph(e)}visit_FlatData(e){Ar(e)}visit_Database(e){Tl(e,this.observerContext)}visit_Mapping(e){Od(e,this.observerContext)}visit_Service(e){Bc(e,this.observerContext)}visit_ExecutionEnvironmentInstance(e){$d(e,this.observerContext)}visit_PackageableRuntime(e){Vd(e,this.observerContext)}visit_PackageableConnection(e){Md(e,this.observerContext)}visit_FileGenerationSpecification(e){Ka(e)}visit_GenerationSpecification(e){Za(e)}visit_DataElement(e){Cc(e,this.observerContext)}}const zd=ea(((e,t)=>(e.accept_PackageableElementVisitor(new Bd(t)),e))),Hd=ea(((e,t)=>((e=>{ta(e),(0,Re.rC)(e,{children:Re.LO,hashCode:Re.KG})})(e),e.children.forEach((e=>{e instanceof Ua?Hd(e,t):zd(e,t)})),e))),Yd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),Wd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),e))),Kd=Qn((e=>((0,Re.rC)(e,{value:Re.LO,hashCode:Re.Fl}),Wd(e.tag),e))),Xd=Qn((e=>(0,Re.rC)(e,{rawType:Re.LO}))),Zd=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),Xd(e.value),sa(e.ownerReference),e))),qd=Qn((e=>((0,Re.rC)(e,{parserName:Re.LO,elements:Re.LO}),e instanceof Va?(0,Re.rC)(e,{imports:Re.LO,hashCode:Re.Fl}):e instanceof $a&&(0,Re.rC)(e,{hashCode:Re.Fl}),e))),Jd=Qn((e=>(ta(e),(0,Re.rC)(e,{sections:Re.LO,_elementHashCode:Re.KG}),e.sections.forEach(qd),e))),Qd=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),eh=Qn((e=>(0,Re.rC)(e,{value:Re.LO}))),th=Qn((e=>(ta(e),(0,Re.rC)(e,{p_stereotypes:Re.LO,p_tags:Re.LO,_elementHashCode:Re.KG}),e.p_stereotypes.forEach(Qd),e.p_tags.forEach(eh),e))),sh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,hashCode:Re.Fl}),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ih=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),nh=Qn((e=>(ta(e),(0,Re.rC)(e,{values:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,_elementHashCode:Re.KG}),e.values.forEach(sh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ah=Qn((e=>((0,Re.rC)(e,{measure:Re.LO,conversionFunction:Re.LO,hashCode:Re.Fl}),e.conversionFunction&&dr(e.conversionFunction),e))),rh=Qn((e=>(ta(e),(0,Re.rC)(e,{canonicalUnit:Re.LO,nonCanonicalUnits:Re.LO,_elementHashCode:Re.KG}),e.canonicalUnit&&ah(e.canonicalUnit),e.nonCanonicalUnits.forEach(ah),e))),oh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,hashCode:Re.Fl}),Zd(e.genericType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),lh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,multiplicity:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,body:Re.LO.ref,parameters:Re.LO.ref,hashCode:Re.Fl}),Zd(e.genericType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ch=Qn((e=>((0,Re.rC)(e,{value:Re.LO,pointerHashCode:Re.Fl}),sa(e.ownerReference),e))),dh=Qn((e=>((0,Re.rC)(e,{name:Re.LO,functionDefinition:Re.LO,externalId:Re.LO,enforcementLevel:Re.LO,messageFunction:Re.LO,hashCode:Re.Fl}),dr(e.functionDefinition),e.messageFunction&&dr(e.messageFunction),e))),hh=Qn((e=>(ta(e),(0,Re.rC)(e,{_subclasses:Re.LO,properties:Re.LO,propertiesFromAssociations:Re.LO,derivedProperties:Re.LO,generalizations:Re.LO,constraints:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,dispose:Re.KG,_elementHashCode:Re.KG}),e.properties.forEach(oh),e.propertiesFromAssociations.forEach(oh),e.derivedProperties.forEach(lh),e.generalizations.forEach(Zd),e.constraints.forEach(dh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),uh=Qn((e=>(ta(e),(0,Re.rC)(e,{properties:Re.LO,stereotypes:Re.LO,taggedValues:Re.LO,derivedProperties:Re.LO,dispose:Re.KG,_elementHashCode:Re.KG}),e.properties.forEach(oh),e.derivedProperties.forEach(lh),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),ph=Qn((e=>(ta(e),(0,Re.rC)(e,{functionName:Re.LO,returnMultiplicity:Re.LO,parameters:Re.LO.shallow,expressionSequence:Re.LO.ref,stereotypes:Re.LO,taggedValues:Re.LO,_elementHashCode:Re.KG}),e.parameters.forEach(hr),sa(e.returnType),e.stereotypes.forEach(Yd),e.taggedValues.forEach(Kd),e))),mh=Qn((e=>e instanceof Fa?nh(e):e instanceof ka?ah(e):e instanceof Da?hh(e):e instanceof ja?rh(e):e)),_h=(Qn((e=>e instanceof Fa?nh(e):e instanceof ka?ah(e):e)),Qn((e=>(0,Re.rC)(e,{_dummyObservable:Re.LO})))),gh=Qn((e=>((0,Re.rC)(e,{value:Re.LO}),sa(e.ownerReference),e))),Eh=Qn((e=>(_h(e),(0,Re.rC)(e,{id:Re.LO,hideProperties:Re.LO,hideTaggedValues:Re.LO,hideStereotypes:Re.LO,hashCode:Re.Fl}),sa(e.class),e))),fh=Qn((e=>(gh(e.classView),e))),Th=Qn((e=>((0,Re.rC)(e,{path:Re.LO,pathForSerialization:Re.Fl}),fh(e.from),fh(e.to),e))),Ch=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),e))),Sh=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),ch(e.property),sa(e.association),e))),xh=Qn((e=>(Th(e),(0,Re.rC)(e,{hashCode:Re.Fl}),ch(e.property),e))),Nh=Qn((e=>(ta(e),(0,Re.rC)(e,{classViews:Re.LO,associationViews:Re.LO,generalizationViews:Re.LO,propertyViews:Re.LO,_elementHashCode:Re.KG}),e.classViews.forEach(Eh),e.associationViews.forEach(Sh),e.generalizationViews.forEach(Ch),e.propertyViews.forEach(xh),e)));var vh;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(vh=vh||(vh={}));class Ah extends Pa{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return ra([vh.DIAGRAM,this.path,ra(this.classViews),ra(this.generalizationViews),ra(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Ih extends Jn{constructor(){super(qn.Rw.LW,qn.i8)}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Ah)return Nh(e)}]}}class Oh{package;name;get path(){return`${this.package}${oa}${this.name}`}get hashCode(){return ra([Aa.PACKAGEABLE_ELEMENT,this.path])}}class yh extends Oh{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return ra([vh.DIAGRAM,this.path,ra(this.classViews),ra(this.generalizationViews),ra(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Rh{rectangle;position;get hashCode(){return ra([vh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class wh extends Rh{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return ra([vh.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Lh{x;y;get hashCode(){return ra([vh.POINT,this.x.toString(),this.y.toString()])}}class Ph{width;height;get hashCode(){return ra([vh.RECTANGLE,this.width.toString(),this.height.toString()])}}class bh{points=[]}class Dh{sourceView;targetView;line;get hashCode(){return ra([vh.RELATIONSHIP_VIEW,this.sourceView,this.targetView,ra(this.line.points)])}}class Mh extends Dh{property;get hashCode(){return ra([vh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class Fh extends Mh{get hashCode(){return ra([vh.PROPERTY_VIEW,super.hashCode])}}class kh extends Dh{get hashCode(){return ra([vh.GENERALIZATION_VIEW,super.hashCode])}}class jh{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return ra([Aa.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new jh(0,0);static ZERO_ONE=new jh(0,1);static ZERO_MANY=new jh(0,void 0);static ONE=new jh(1,1);static ONE_MANY=new jh(1,void 0)}new ge((0,_e.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)()})),(0,_e.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return ra([Aa.PACKAGEABLE_ELEMENT_POINTER,this.type??"",this.path])}},{path:(0,_e.Ru)(),type:(0,_e.jt)((0,_e.Ru)())});const Uh=(0,_e.yu)(jh,{lowerBound:(0,_e.Ru)(),upperBound:(0,_e.jt)((0,_e.Ru)())});class Gh{class;property;get hashCode(){return ra([Aa.PROPERTY_POINTER,this.property,this.class??""])}}class Vh{}class $h{queryTimeOutInSeconds=null;enableConstraints=!0}var Bh,zh;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(Bh||(Bh={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(zh=zh||(zh={})),(0,_e.yu)(class extends $h{},{_type:fe(Bh.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,_e.Ru)(),enableConstraints:(0,_e.Ru)()});const Hh=(0,_e.yu)(class extends Vh{body;parameters;get hashCode(){return ra([Aa.RAW_LAMBDA,ya(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:fe(zh.LAMBDA),body:(0,_e.LZ)(),parameters:(0,_e.LZ)()}),Yh=(0,_e.yu)(class extends Vh{class;name;multiplicity;get hashCode(){return ra([Aa.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:fe(zh.VARIABLE),class:(0,_e.Ru)(),multiplicity:Ee(Uh),name:(0,_e.Ru)()});(0,_e.yu)(class extends Vh{multiplicity=jh.ONE;type;value;get hashCode(){return ra([Aa.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,_e.bm)("_type",(0,_e.PG)((e=>{switch(e){case ha.INTEGER:return zh.CINTEGER;case ha.DECIMAL:return zh.CDECIMAL;case ha.STRING:return zh.CSTRING;case ha.BOOLEAN:return zh.CBOOLEAN;case ha.FLOAT:return zh.CFLOAT;case ha.DATETIME:return zh.CDATETIME;case ha.STRICTDATE:return zh.CSTRICTDATE;case ha.STRICTTIME:return zh.CSTRICTTIME;case ha.LATESTDATE:return zh.CLATESTDATE;default:throw new D(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case zh.CINTEGER:return ha.INTEGER;case zh.CDECIMAL:return ha.DECIMAL;case zh.CSTRING:return ha.STRING;case zh.CBOOLEAN:return ha.BOOLEAN;case zh.CFLOAT:return ha.FLOAT;case zh.CDATETIME:return ha.DATETIME;case zh.CSTRICTDATE:return ha.STRICTDATE;case zh.CSTRICTTIME:return ha.STRICTTIME;case zh.CLATESTDATE:return ha.LATESTDATE;default:throw new D(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,_e.jt)((0,_e.Ru)())});const Wh=(0,_e.yu)(Gh,{class:(0,_e.jt)((0,_e.Ru)()),property:(0,_e.Ru)()}),Kh=(0,_e.yu)(class{profile;value;get hashCode(){return ra([Aa.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,_e.Ru)(),value:(0,_e.Ru)()}),Xh=(0,_e.yu)(class{profile;value;get hashCode(){return ra([Aa.TAG_POINTER,this.value,this.profile])}},{profile:(0,_e.Ru)(),value:(0,_e.Ru)()}),Zh=(0,_e.yu)(class{tag;value;get hashCode(){return ra([Aa.TAGGED_VALUE,this.tag,this.value])}},{tag:Ee(Xh),value:(0,_e.Ru)()}),qh=((0,_e.yu)(class extends Oh{stereotypes=[];tags=[];get hashCode(){return ra([Aa.PROFILE,this.path,ra(this.stereotypes),ra(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:fe("profile"),name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ru)()),tags:(0,_e.pb)((0,_e.Ru)())}),(0,_e.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ENUM_VALUE,this.value,ra(this.stereotypes),ra(this.taggedValues)])}},{stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),value:(0,_e.Ru)()})),Jh=((0,_e.yu)(class extends Oh{values=[];stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ENUMERATION,this.path,ra(this.values),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:fe("Enumeration"),name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),values:(0,_e.pb)(Ee(qh))}),(0,_e.yu)(class extends Oh{measure;conversionFunction;get hashCode(){return ra([Aa.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new D}},{_type:fe("unit"),conversionFunction:(0,_e.jt)(Ee(Hh)),measure:(0,_e.Ru)(),name:(0,_e.Ru)(),package:(0,_e.Ru)()})),Qh=((0,_e.yu)(class extends Oh{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return ra([Aa.MEASURE,this.path,this.canonicalUnit??"",ra(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:fe("measure"),canonicalUnit:(0,_e.jt)(Ee(Jh)),name:(0,_e.Ru)(),nonCanonicalUnits:(0,_e.pb)(Ee(Jh)),package:(0,_e.Ru)()}),(0,_e.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",ra(this.stereotypes),ra(this.taggedValues)])}},{aggregation:(0,_e.jt)((0,_e.Ru)()),multiplicity:Ee(Uh),name:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0}),type:(0,_e.Ru)()})),eu=(0,_e.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return ra([Aa.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,ra(this.stereotypes),ra(this.taggedValues),ya(this.parameters,this.body)])}},{body:(0,_e.LZ)(),name:(0,_e.Ru)(),parameters:(0,_e.LZ)(),returnMultiplicity:Ee(Uh),returnType:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),tu=(0,_e.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return ra([Aa.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,_e.jt)((0,_e.Ru)()),externalId:(0,_e.jt)((0,_e.Ru)()),functionDefinition:Ee(Hh),messageFunction:(0,_e.jt)(Ee(Hh)),name:(0,_e.Ru)()});var su;(0,_e.yu)(class extends Oh{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return ra([Aa.CLASS,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.superTypes),ra(this.constraints),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:fe("class"),constraints:Se(tu,{INTERNAL__forceReturnEmptyInTest:!0}),name:(0,_e.Ru)(),originalMilestonedProperties:xe((()=>_e.AM),(()=>_e.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,_e.Ru)(),properties:Se(Qh,{INTERNAL__forceReturnEmptyInTest:!0}),derivedProperties:(0,_e.bm)("qualifiedProperties",Se(eu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),superTypes:(su={INTERNAL__forceReturnEmptyInTest:!0},xe((e=>e),(e=>e),su)),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,_e.yu)(class extends Oh{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return ra([Aa.ASSOCIATION,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.stereotypes),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:fe("association"),name:(0,_e.Ru)(),originalMilestonedProperties:xe((()=>_e.AM),(()=>_e.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,_e.Ru)(),properties:(0,_e.pb)(Ee(Qh)),derivedProperties:(0,_e.bm)("qualifiedProperties",Se(eu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,_e.yu)(class extends Oh{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return ra([Aa.FUNCTION,this.path,ra(this.parameters),this.returnType,ra(this.taggedValues),ra(this.stereotypes),ya(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:fe("function"),body:(0,_e.pb)((0,_e.LZ)()),name:(0,_e.Ru)(),package:(0,_e.Ru)(),parameters:(0,_e.pb)(Ee(Yh)),postConstraints:(0,_e.pb)((0,_e.Ru)()),preConstraints:(0,_e.pb)((0,_e.Ru)()),returnMultiplicity:Ee(Uh),returnType:(0,_e.Ru)(),stereotypes:Se(Kh,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Se(Zh,{INTERNAL__forceReturnEmptyInTest:!0})});const iu="diagram",nu=(0,_e.yu)(Lh,{x:(0,_e.Ru)(),y:(0,_e.Ru)()}),au=(0,_e.yu)(Ph,{height:(0,_e.Ru)(),width:(0,_e.Ru)()}),ru=(0,_e.yu)(bh,{points:(0,_e.pb)(Ee(nu))}),ou=(0,_e.yu)(wh,{class:(0,_e.Ru)(),hideProperties:(0,_e.jt)((0,_e.Ru)()),hideStereotypes:(0,_e.jt)((0,_e.Ru)()),hideTaggedValues:(0,_e.jt)((0,_e.Ru)()),id:(0,_e.Ru)(),position:Ee(nu),rectangle:Ee(au)}),lu=(0,_e.yu)(Fh,{line:Ee(ru),property:Ee(Wh),sourceView:(0,_e.Ru)(),targetView:(0,_e.Ru)()}),cu=(0,_e.yu)(kh,{line:Ee(ru),sourceView:(0,_e.Ru)(),targetView:(0,_e.Ru)()}),du=(0,_e.yu)(yh,{_type:fe(iu),classViews:(0,_e.pb)(Ee(ou)),generalizationViews:(0,_e.pb)(Ee(cu)),name:(0,_e.Ru)(),package:(0,_e.Ru)(),propertyViews:(0,_e.pb)(Ee(lu))});class hu extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var uu=s(95903);const pu=e=>G((0,uu.Z)(e.split(oa))),mu=e=>{const t=e.lastIndexOf(oa);return-1===t?void 0:e.substring(0,t)},_u=(e,t)=>{const s=e.lastIndexOf(oa);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+2,e.length)]},gu=(e,t)=>`${e?`${e}${oa}`:""}${t}`,Eu=(e,t)=>{e.children.push(t),t.package=e},fu=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Tu=(e,t,s,i)=>{const n=t.indexOf(oa),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof Ua&&e.name===a)),!r){if(!s)throw new k(`Can't find child package '${a}' in package '${e.path}'`);Y(!ca.includes(a),`Can't create package with reserved name '${a}'`),r=new Ua(a),r.package=e,e.children.push(r)}return i&&i.set(gu(e.path,a),r),-1!==n?Tu(r,t.substring(n+2),s,i):r},Cu=(e,t,s,i)=>{if(i){const n=i.get(gu(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=gu(e.path,a),r=i.get(n);if(r)return Tu(r,t.substring(a.length+2,t.length),s,i);const o=a.lastIndexOf(oa);a=-1!==o?a.substring(0,o):""}}return Tu(e,t,s,i)},Su=(e,t,s)=>(z(t,"Package path is required"),Cu(e.root,t,!0,s)),xu=(e,t)=>B(e.rawType,t),Nu=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=xu(e.value,Da);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},vu=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Au=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Iu=(e,t)=>`${G(e,"Package path is required")}${oa}${G(t,"Name is required")}`;class Ou{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){z(e.package,"Element 'package' field is missing or empty"),z(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new k(`Element '${e}' already exists`);s.add(e)}else Y(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Iu(e.package,e.name),t,i);const n=this.firstPass(e,t);return Eu(Su(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const yu=e=>e.classView.value.id,Ru=e=>{const t=new Fh,s=new bh;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new Gh;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=yu(e.from),t.targetView=yu(e.to),t},wu=e=>{const t=new kh,s=new bh;return s.points=e.pathForSerialization,t.line=s,t.sourceView=yu(e.from),t.targetView=yu(e.to),t},Lu=e=>{const t=new wh;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new Lh;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Ph;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Pu{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return ra([vh.POINT,this.x.toString(),this.y.toString()])}}class bu{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return ra([vh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Du{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Pu(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new Du(new Pu(e.position.x+e.rectangle.width,e.position.y),new bu(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Du(new Pu(e.position.x,e.position.y+e.rectangle.height),new bu(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,ra([vh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Mu extends Du{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Pu(0,0),new bu(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return ra([vh.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Fu{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class ku extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ju extends ku{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ju(e)}}class Uu{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new Fu(ju.create(t)),this.to=new Fu(ju.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new Pu(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Pu(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{Y(Boolean(e.length),"Path requires at least 1 point");let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];const o=e.slice(i-1,a+2);return o.length<2?[n,r]:o};get pathForSerialization(){return Uu.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return ra([vh.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,ra(this.pathForSerialization)])}}class Gu extends Uu{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return ra([vh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class Vu extends Gu{get hashCode(){return ra([vh.PROPERTY_VIEW,super.hashCode])}}class $u extends Uu{get hashCode(){return ra([vh.GENERALIZATION_VIEW,super.hashCode])}}class Bu{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new Bu(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new Bu(this.x/e,this.y/e)}normal(e){return new Bu(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const zu=e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new Pu(t,s)},Hu=(e,t)=>e.classViews.find((e=>e.id===t)),Yu=(e,t)=>{e.path=t},Wu=e=>{const t=e.buildFullPath(),s=Uu.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=G(s[0],"Diagram path expected to have at least 2 points").x-t.x,e.from._offsetY=G(s[0],"Diagram path expected to have at least 2 points").y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=Bu.fromPoints(s[e+1],s[e]).unit(),n=Bu.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}Yu(e,i)},Ku=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),Xu=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Zu=e=>new Pu(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),qu=e=>{const t=Zu(e);return new Du(new Pu(t.x-5,t.y-5),new bu(10,10))},Ju=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Qu=e=>{const t=G(e.x,"Point 'x' coordinate is missing"),s=G(e.y,"Point 'y' coordinate is missing");return new Pu(t,s)};class ep extends hu{constructor(){super(qn.Rw.zE,qn.i8)}V1_getExtraElementBuilders(){return[new Ou({elementClassName:"Diagram",_class:yh,firstPass:(e,t)=>{$(e,yh);const s=new Ah(e.name),i=Iu(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Ah),s},secondPass:(e,t)=>{$(e,yh);const s=(i=Iu(e.package,e.name),n=t.currentSubGraph,G(n.getOwnNullableExtensionElement(i,Ah),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{z(e.class,"Class view 'class' field is missing or empty"),z(e.id,"Class view 'id' field is missing or empty"),U(e.rectangle,"Class view 'rectangle' field is missing"),U(e.position,"Class view 'position' field is missing");const i=new Mu(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=G(e.width,"Rectangle 'width' is missing"),s=G(e.height,"Rectangle 'height' is missing");return new bu(t,s)})(e.rectangle),i.position=Qu(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{U(e.property,"Property view 'property' field is missing"),U(e.line,"Property view 'line' field is missing");const i=G(Hu(s,G(e.sourceView)),"Property view 'sourceView' field is missing"),n=G(Hu(s,G(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new Vu(s,a,i,n);r.path=e.line.points.map((e=>Qu(e)));try{Wu(r)}catch(e){M(e),t.logService.warn(h.create(e.message))}return r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t,s)=>{U(e.line,"Generalization view 'line' field is missing");const i=G(Hu(t,G(e.sourceView)),"Generalization view 'sourceView' field is missing"),n=G(Hu(t,G(e.targetView)),"Generalization view 'targetView' field is missing"),a=new $u(t,i,n);a.path=e.line.points.map((e=>Qu(e)));try{Wu(a)}catch(e){M(e),s.logService.warn(h.create(e.message))}return a})(e,s,t)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof yh)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof yh)return(0,_e.qC)(du,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===iu)return(0,_e.vB)(du,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Ah)return(e=>{const t=new yh;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Lu),t.generalizationViews=e.generalizationViews.map(wu),t.propertyViews=e.propertyViews.map(Ru),t})(e)}]}}class tp extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class sp extends tp{constructor(){super(qn.Rw.f1,qn.i8)}getExtraPureGraphExtensionClasses(){return[Ah]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Ah).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Da?vu(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>w(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>w(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>w(e.generalizationViews,t)))})(t,e)))}]}}class ip extends c{constructor(){super(qn.Rw.NA,qn.i8,[new sp,new Ih,new ep])}}var np,ap=s(40979),rp=s(74926);class op{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,Re.rC)(this,{_isNavigationBlocked:Re.LO,isNavigationBlocked:Re.Fl,blockNavigation:Re.aD,unblockNavigation:Re.aD}),this.historyAPI=e}get window(){return G(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}updateCurrentLocation(e){this.historyAPI.push(e)}updateCurrentZone(e){this.window.location.hash="#"+e}resetZone(){this.updateCurrentLocation(this.getCurrentLocation())}getCurrentBaseAddress(e){return e?.withAppRoot?this.generateAddress(""):this.window.location.origin}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}getCurrentLocationParameters(){const e={},t=((e,t=!1)=>t?Q.Z.parseUrl(e).query:Q.Z.parse(e))((s=this.getCurrentAddress(),(0,ee.N)(s)),!0);var s;return Object.keys(t).forEach((s=>{e[s]=((e,t)=>{const s=t[e];return s?decodeURIComponent(s):void 0})(s,t)})),e}getCurrentLocationParameterValue(e){return this.getCurrentLocationParameters()[e]}getCurrentZone(){return this.window.location.hash.substring(1)}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}INTERNAL__internalizeTransientParameter(e){const t=this.getCurrentZone(),s=this.getCurrentLocationParameters();var i,n;delete s[e],this.updateCurrentLocation((i=this.getCurrentLocation(),n=(e=>{const t={};return Object.entries(e).forEach((([e,s])=>{s&&(t[e]=s.toString())})),Q.Z.stringify(t)})(s),n?`${i}?${n}`:i)),this.updateCurrentZone(t)}}class lp{applicationStore;constructor(e){this.applicationStore=e}async initialize(){}}!function(e){e.INITIAL_COLOR_THEME="initialColorTheme"}(np=np||(np={}));class cp extends lp{navigator;constructor(e,t){super(e),this.navigator=new op(t.historyAPI)}getNavigator(){return this.navigator}async initialize(){const e=this.applicationStore.navigationService.navigator.getCurrentLocationParameterValue(np.INITIAL_COLOR_THEME);e&&(this.applicationStore.layoutService.setColorTheme(e),this.applicationStore.navigationService.navigator.INTERNAL__internalizeTransientParameter(np.INITIAL_COLOR_THEME))}}const dp=(0,kt.createContext)(void 0),hp=({children:e})=>{const t=Ut(),s=(0,ap.k6)(),i=(0,Nt.fv)((()=>new cp(t,{historyAPI:s})));return(0,T.jsx)(dp.Provider,{value:i,children:e})},up=({children:e,baseUrl:t})=>(0,T.jsx)(rp.VK,{basename:t,children:(0,T.jsx)(hp,{children:e})}),pp="/welcome.pure",mp="/",_p="::";var gp,Ep,fp,Tp;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(gp=gp||(gp={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Ep=Ep||(Ep={})),function(e){e.LEGEND="legend",e.TEMPORARY__VSCODE_LIGHT="vs"}(fp=fp||(fp={})),function(e){e.TEXT="plaintext",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql",e.XML="xml",e.YAML="yaml",e.GRAPHQL="graphql"}(Tp=Tp||(Tp={}));var Cp=s(90361);const Sp=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},xp="dummy_problem_marker_owner";var Np;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.TAG="Tag",e.STEREOTYPE="Stereotype",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(Np=Np||(Np={}));class vp{pureId;pureType;pureName;get id(){return this.pureId}}class Ap extends vp{deprecated}(0,_e.yu)(Ap,{pureId:(0,_e.Ru)(),pureType:(0,_e.Ru)(),deprecated:(0,_e.Ru)()});class Ip extends vp{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,_e.yu)(Ip,{pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),pureType:(0,_e.Ru)(),RO:(0,_e.Ru)(),classPath:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class Op extends vp{RO;notpublic;user;file;line;column}(0,_e.yu)(Op,{pureId:(0,_e.Ru)(),pureName:(0,_e.jt)((0,_e.Ru)()),pureType:(0,_e.Ru)(),RO:(0,_e.Ru)(),notpublic:(0,_e.Ru)(),user:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class yp{li_attr;id;text;icon;children;state;getNodeAttribute(e){return B(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,_e.yu)(yp,{li_attr:(0,_e.PG)((()=>_e.AM),(e=>e.classPath?(0,_e.vB)(Ip,e):e.file?(0,_e.vB)(Op,e):(0,_e.vB)(Ap,e))),id:(0,_e.Ru)(),text:(0,_e.Ru)(),icon:(0,_e.Ru)(),children:(0,_e.Ru)(),state:(0,_e.Ru)()});const Rp=e=>e.startsWith("/")?e.substring(1,e.length):e;class wp{content;RO;constructor(){(0,Re.rC)(this,{content:Re.LO,hashCode:Re.Fl,setContent:Re.aD})}setContent(e){this.content=e}get hashCode(){return aa(this.content)}}(0,_e.yu)(wp,{content:(0,_e.Ru)(),RO:(0,_e.Ru)()});class Lp{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Pp extends Lp{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var bp;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(bp=bp||(bp={}));const Dp=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Mp{source;line;column;startLine;startColumn;endLine;endColumn}(0,_e.yu)(Mp,{source:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)()});class Fp{first;second}(0,_e.yu)(Fp,{first:(0,_e.Ru)(),second:(0,_e.pb)((0,_e.Ry)(Mp))});class kp{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class jp{currentTab;tabs=[];constructor(){(0,Re.rC)(this,{currentTab:Re.LO,tabs:Re.LO,setCurrentTab:Re.aD,closeTab:Re.aD,closeAllTabs:Re.aD,closeAllOtherTabs:Re.aD,openTab:Re.aD,swapTabs:Re.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){U(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){R(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(Y(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class Up extends kp{ideStore;constructor(e){super(),this.ideStore=e}}class Gp extends jp{ideStore;constructor(e){super(),this.ideStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof Zp&&e.hasChanged?this.ideStore.applicationStore.alertService.setActionAlertInfo({message:"Unsaved changes will be lost if you continue. Do you still want to proceed?",prompt:"To save changes, abort and compile",type:Dt.CAUTION,actions:[{label:"Proceed",type:Mt.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.ideStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.ideStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]}):super.closeTab(e)}}var Vp;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_TERMINAL_PANEL="editor.toggle-terminal-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests"}(Vp=Vp||(Vp={}));const $p={[Vp.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Vp.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Vp.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Vp.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Vp.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Vp.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Vp.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Vp.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Vp.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Bp;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(Bp=Bp||(Bp={}));const zp={[Bp.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Bp.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Bp.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Bp.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Hp;!function(e){e.TOGGLE_TEXT_WRAP="editor.file-editor.toggle-text-wrap",e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage",e.RENAME_CONCEPT="editor.file-editor.rename-concept",e.GO_TO_LINE="editor.file-editor.go-to-line",e.DELETE_LINE="editor.file-editor.delete-line"}(Hp=Hp||(Hp={}));const Yp={[Hp.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Hp.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Hp.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Hp.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Hp.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Hp.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Hp.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Hp.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var Wp;!function(e){e.GO="go",e.TEST="test",e.REMOVE="rm",e.MOVE="mv",e.NEW_DIRECTORY="mkdir",e.NEW_FILE="touch",e.OPEN_FILE="open",e.OPEN_DIRECTORY="cd",e.LIST_DIRECTORY="ls",e.WELCOME="welcome",e.ECHO="echo",e.CLEAR="clear",e.ANSI="ansi",e.HELP="help"}(Wp=Wp||(Wp={}));class Kp{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,Re.rC)(this,{viewState:Re.LO.ref,editor:Re.LO.ref,_dummyCursorObservable:Re.LO.ref,forcedCursorPosition:Re.LO.ref,wrapText:Re.LO,cursorObserver:Re.Fl,notifyCursorObserver:Re.aD,setViewState:Re.aD,setEditor:Re.aD,setForcedCursorPosition:Re.aD,setWrapText:Re.aD}),this.language=(e=>{switch(I(e.split("."))){case"pure":return Tp.PURE;case"java":return Tp.JAVA;case"md":return Tp.MARKDOWN;case"sql":return Tp.SQL;case"json":return Tp.JSON;case"xml":return Tp.XML;case"yml":case"yaml":return Tp.YAML;case"graphql":return Tp.GRAPHQL;default:return Tp.TEXT}})(e.filePath),this.model=Cp.editor.createModel(e.uuid,this.language),this.model.setValue(e.file.content)}notifyCursorObserver(){this._dummyCursorObservable={}}get cursorObserver(){return this._dummyCursorObservable,this.editor?{position:this.editor.getPosition()??void 0,selection:this.editor.getSelection()??void 0}:void 0}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class Xp{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class Zp extends Up{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,Re.rC)(this,{_currentHashCode:Re.LO,file:Re.LO,renameConceptState:Re.LO,showGoToLinePrompt:Re.LO,hasChanged:Re.Fl,resetChangeDetection:Re.aD,setFile:Re.aD,setShowGoToLinePrompt:Re.aD,setConceptToRenameState:Re.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new Kp(this)}get label(){return Rp(this.filePath)}get description(){return`File: ${Rp(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return G(I(this.filePath.split("/")))}match(e){return e instanceof Zp&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}get hasChanged(){return this._currentHashCode!==this.file.hashCode}resetChangeDetection(){this._currentHashCode=this.file.hashCode}setFile(e){this.file=e,this.textEditorState.model.setValue(e.content),this.resetChangeDetection()}setShowGoToLinePrompt(e){this.showGoToLinePrompt=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);if(this.hasChanged)return void this.ideStore.applicationStore.notificationService.notifyWarning("Can't rename concept: source is not compiled");const t=yield this.ideStore.getConceptInfo(e);this.renameConceptState=t?new Xp(this,t,e):void 0}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,Cp.editor.setModelMarkers(t,i??xp,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:Cp.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,Cp.editor.removeAllMarkers(e??xp)}registerCommands(){this.textEditorState.language===Tp.PURE&&(this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_TO_DEFINITION,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,Re.fl)(this.ideStore.executeNavigation(new Lp(this.filePath,e.lineNumber,e.column))).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_BACK,action:()=>{(0,Re.fl)(this.ideStore.navigateBack()).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.REVEAL_CONCEPT_IN_TREE,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.ideStore.revealConceptInTree(new Lp(this.filePath,e.lineNumber,e.column)).catch(this.ideStore.applicationStore.alertUnhandledError)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.FIND_USAGES,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Lp(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.RENAME_CONCEPT,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){if(!this.textEditorState.model.getWordAtPosition(e))return;const t=new Lp(this.filePath,e.lineNumber,e.column);(0,Re.fl)(this.setConceptToRenameState(t)).catch(this.ideStore.applicationStore.alertUnhandledError)}}})),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.DELETE_LINE,trigger:()=>this.ideStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.textEditorState.model.pushEditOperations([],[{range:{startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber+1,endColumn:1},text:"",forceMoveMarkers:!0}],(()=>null))}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.GO_TO_LINE,trigger:()=>this.ideStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.ideStore.applicationStore.commandService.registerCommand({key:Hp.TOGGLE_TEXT_WRAP,trigger:()=>this.ideStore.tabManagerState.currentTab===this,action:()=>{this.textEditorState.setWrapText(!this.textEditorState.wrapText)}})}findConceptUsages(e){const t=()=>{(0,Re.fl)(this.ideStore.findUsagesFromCoordinate(e)).catch(this.ideStore.applicationStore.alertUnhandledError)};this.hasChanged?this.ideStore.applicationStore.alertService.setActionAlertInfo({message:"Source is not compiled, finding concept usages might be inaccurate. Do you want compile to proceed?",type:Dt.CAUTION,actions:[{label:"Compile and Proceed",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.ideStore.executeGo()).then(t).catch(this.ideStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]}):t()}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.ideStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.ideStore.findConceptUsages(t.pureType===Np.ENUM_VALUE?bp.ENUM:t.pureType===Np.PROPERTY||t.pureType===Np.QUALIFIED_PROPERTY?bp.PROPERTY:bp.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,Re.fl)(this.ideStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e)}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}}deregisterCommands(){this.textEditorState.language===Tp.PURE&&[Hp.GO_TO_DEFINITION,Hp.GO_BACK,Hp.REVEAL_CONCEPT_IN_TREE,Hp.FIND_USAGES,Hp.RENAME_CONCEPT].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e))),[Hp.GO_TO_LINE,Hp.TOGGLE_TEXT_WRAP].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e)))}}class qp{ideStore;treeData;selectedNode;loadInitialDataState=we.create();refreshDataState=we.create();constructor(e){(0,Re.rC)(this,{treeData:Re.LO.ref,loadInitialDataState:Re.LO,refreshDataState:Re.LO,initialize:Re.ls,expandNode:Re.ls,openNode:Re.ls,refreshTreeData:Re.ls,setTreeData:Re.aD,setSelectedNode:Re.aD}),this.ideStore=e}getTreeData(){return G(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.ideStore.applicationStore.notificationService.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...G(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){if(!this.treeData)return;const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return M(e),this.ideStore.applicationStore.notificationService.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>G(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(G(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,Re.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>G(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class Jp{id;path;RO}class Qp extends Jp{file;statusType}(0,_e.yu)(Qp,{id:(0,_e.Ru)(),path:(0,_e.Ru)(),file:(0,_e.Ru)(),statusType:(0,_e.Ru)(),RO:(0,_e.Ru)()});class em extends Jp{repo}(0,_e.yu)(em,{id:(0,_e.Ru)(),path:(0,_e.Ru)(),repo:(0,_e.Ru)(),RO:(0,_e.Ru)()});class tm{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof em}get isFileNode(){return this.li_attr instanceof Qp}get isRepoNode(){return this.li_attr instanceof em&&Boolean(this.li_attr.repo)}getNodeAttribute(e){return B(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,_e.yu)(tm,{li_attr:(0,_e.PG)((()=>_e.AM),(e=>e.file?(0,_e.vB)(Qp,e):(0,_e.vB)(em,e))),text:(0,_e.Ru)(),icon:(0,_e.Ru)(),children:(0,_e.Ru)(),state:(0,_e.Ru)()});const sm=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},im=e=>`file_${e}`;class nm extends qp{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,Re.rC)(this,{nodeForCreateNewFile:Re.LO,nodeForCreateNewDirectory:Re.LO,nodeForRenameFile:Re.LO,setNodeForCreateNewFile:Re.aD,setNodeForCreateNewDirectory:Re.aD,setNodeForRenameFile:Re.aD,revealPath:Re.ls})}setNodeForCreateNewFile=e=>{Y(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{Y(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{Y(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.ideStore.client.getDirectoryChildren()).map((e=>(0,_e.vB)(tm,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.ideStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,_e.vB)(tm,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,Re.fl)(this.ideStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t){t?.forceOpenExplorerPanel&&this.ideStore.setActiveActivity(gp.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=sm(i);for(const e of s){const s=G(this.getTreeData().nodes.get(im(e)),`Can't find node with path '${e}'`);if(s.data.isFolderNode)yield(0,Re.fl)(this.expandNode(s));else{if(t?.directoryOnly)throw new Error("Can't reveal non-directory path");yield(0,Re.fl)(this.ideStore.loadFile(e,t?.coordinate))}}this.setSelectedNode(G(this.getTreeData().nodes.get(im(e)),`Can't find node with path '${e}'`))}}const am=e=>{const t=e.trim(),s=t.lastIndexOf(oa);if(!(s<=0))return t.substring(0,s)};class rm extends qp{loadConceptActivity=we.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,Re.rC)(this,{statusText:Re.LO,nodeForRenameConcept:Re.LO,nodeForMoveElement:Re.LO,setStatusText:Re.aD,setNodeForRenameConcept:Re.aD,setNodeForMoveElement:Re.aD,pullConceptsActivity:Re.aD,pollConceptsActivity:Re.ls,revealConcept:Re.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,Re.fl)(this.pollConceptsActivity()),(await this.ideStore.client.getConceptChildren()).map((e=>(0,_e.vB)(yp,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.ideStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,_e.vB)(yp,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof Ip||e.data.li_attr instanceof Op)&&("Diagram"===e.data.li_attr.pureType?yield(0,Re.fl)(this.ideStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,Re.fl)(this.ideStore.loadFile(e.data.li_attr.file,new Lp(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.ideStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}*revealConcept(e,t){t?.forceOpenExplorerPanel&&this.ideStore.setActiveActivity(gp.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=am(i);for(const e of s){const s=G(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`);if(s.data.li_attr instanceof Ap)yield(0,Re.fl)(this.expandNode(s));else if(t?.packageOnly)throw new Error("Can't reveal non-package path")}this.setSelectedNode(G(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`))}async movePackageableElements(e,t){let s=[];try{s=(await this.ideStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,_e.vB)(Fp,e)))}catch{return void this.ideStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}const i=[];Y(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=G(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:G(mu(a.pureId)),destinationPackage:t,usages:G(s[n]).second})}await(0,Re.fl)(this.ideStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.ideStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Np.PROPERTY:case Np.QUALIFIED_PROPERTY:$(s,Ip),n=await this.ideStore.findConceptUsages(bp.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Np.PACKAGE:{let e=[],s=[];try{s=await this.ideStore.client.getChildPackageableElements(i),e=(await this.ideStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,_e.vB)(Fp,e)))}catch{return void this.ideStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}const n=[];Y(e.length===s.length,"Can't find matching usages for child packageable elements");const a=mu(i)?.concat(oa).concat(t)??t;for(let t=0;t<e.length;++t){const r=G(s[t]),o=G(mu(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:G(e[t]).second})}return void await(0,Re.fl)(this.ideStore.movePackageableElements(n))}default:n=await this.ideStore.findConceptUsages(bp.ELEMENT,[`'${s.pureId}'`])}}catch(e){return M(e),void this.ideStore.applicationStore.notificationService.notifyError(e)}finally{this.ideStore.applicationStore.alertService.setBlockingAlert(void 0)}await(0,Re.fl)(this.ideStore.renameConcept(i,t,s.pureType,n))}}class om{cached;datamarts;text}(0,_e.yu)(om,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)()});class lm extends om{error;sessionError}(0,_e.yu)(lm,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)(),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class cm extends lm{RO;line;column;source}(0,_e.yu)(cm,{cached:(0,_e.Ru)(),datamarts:(0,_e.pb)((0,_e.Ru)()),text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)(),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class dm{text;reinit}class hm extends dm{cache;modifiedFiles=[]}(0,_e.yu)(hm,{text:(0,_e.Ru)(),cache:(0,_e.Ru)(),modifiedFiles:(0,_e.pb)((0,_e.Ru)()),reinit:(0,_e.Ru)()});class um extends dm{RO;line;column;source;error;sessionError}(0,_e.yu)(um,{text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.jt)((0,_e.Ru)()),column:(0,_e.jt)((0,_e.Ru)()),source:(0,_e.jt)((0,_e.Ru)()),error:(0,_e.Ru)(),sessionError:(0,_e.Ru)()});class pm{RO;line;column;source}(0,_e.yu)(pm,{RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)()});class mm extends dm{jumpTo}(0,_e.yu)(mm,{text:(0,_e.Ru)(),jumpTo:(0,_e.Ry)(pm)});class _m{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,_e.yu)(_m,{sourceID:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),foundName:(0,_e.Ru)()});class gm{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,_e.yu)(gm,{sourceID:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),foundName:(0,_e.Ru)(),add:(0,_e.Ru)(),messageToBeModified:(0,_e.Ru)(),fileToBeModified:(0,_e.Ru)(),lineToBeModified:(0,_e.Ru)(),columnToBeModified:(0,_e.Ru)()});class Em extends um{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,_e.yu)(Em,{candidateName:(0,_e.Ru)(),candidatesWithPackageImported:(0,_e.pb)((0,_e.Ry)(_m)),candidatesWithPackageNotImported:(0,_e.pb)((0,_e.Ry)(gm))});class fm extends um{candidateName;candidates=[]}(0,_e.yu)(fm,{candidateName:(0,_e.Ru)(),candidates:(0,_e.pb)((0,_e.Ry)(gm))});class Tm{id;parentId;file;line;column}(0,_e.yu)(Tm,{id:(0,_e.Ru)(),parentId:(0,_e.Ru)(),file:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)()});class Cm{children=[];li_attr;text;type}(0,_e.yu)(Cm,{children:(0,_e.pb)((0,_e.Ry)(Cm)),li_attr:(0,_e.Ry)(Tm),text:(0,_e.Ru)(),type:(0,_e.Ru)()});class Sm extends dm{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,_e.yu)(Sm,{count:(0,_e.Ru)(),filterPaths:(0,_e.pb)((0,_e.Ru)()),path:(0,_e.Ru)(),relevantTestsOnly:(0,_e.Ru)(),runnerId:(0,_e.Ru)(),tests:(0,_e.pb)((0,_e.Ry)(Cm))});class xm{uuid=(0,a.Z)()}class Nm{before;found;after}(0,_e.yu)(Nm,{after:(0,_e.Ru)(),before:(0,_e.Ru)(),found:(0,_e.Ru)()});class vm{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,_e.yu)(vm,{sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)(),preview:(0,_e.jt)((0,_e.Ry)(Nm))});class Am extends xm{sourceId;coordinates=[];isExpanded=!0;constructor(){super(),(0,Re.rC)(this,{coordinates:Re.LO,isExpanded:Re.LO,setIsExpanded:Re.aD,dismissCoordinate:Re.aD})}setCoordinates(e){this.coordinates=e}setIsExpanded(e){this.isExpanded=e}dismissCoordinate(e){w(this.coordinates,e)}}var Im,Om,ym;(0,_e.yu)(Am,{sourceId:(0,_e.Ru)(),coordinates:(0,_e.pb)((0,_e.Ry)(vm))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Im=Im||(Im={}));class Rm{status;test}class wm extends Rm{test=[]}(0,_e.yu)(wm,{status:(0,_e.Ru)(),test:(0,_e.pb)((0,_e.Ru)())});class Lm{text;RO;line;column;source;error}(0,_e.yu)(Lm,{text:(0,_e.Ru)(),RO:(0,_e.Ru)(),line:(0,_e.Ru)(),column:(0,_e.Ru)(),source:(0,_e.Ru)(),error:(0,_e.Ru)()});class Pm extends Rm{test=[];error}(0,_e.yu)(Pm,{status:(0,_e.Ru)(),test:(0,_e.pb)((0,_e.Ru)()),error:(0,_e.Ry)(Lm)});class bm{}class Dm extends bm{finished;tests=[]}(0,_e.yu)(Dm,{finished:(0,_e.Ru)(),tests:(0,_e.pb)((0,_e.PG)((()=>_e.AM),(e=>e.error?(0,_e.vB)(Pm,e):(0,_e.vB)(wm,e))))});class Mm extends bm{error;text}(0,_e.yu)(Mm,{error:(0,_e.Ru)(),text:(0,_e.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Om=Om||(Om={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(ym=ym||(ym={}));class Fm{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,Re.rC)(this,{total:Re.LO,time:Re.LO,passedTests:Re.LO,failedTests:Re.LO,testsWithError:Re.LO,notRunTests:Re.LO,results:Re.LO,passed:Re.Fl,error:Re.Fl,failed:Re.Fl,passedTestIds:Re.Fl,failedTestIds:Re.Fl,testWithErrorIds:Re.Fl,notRunTestIds:Re.Fl,numberOfTestsRun:Re.Fl,runPercentage:Re.Fl,suiteStatus:Re.Fl,setTime:Re.aD,addResult:Re.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?Om.FAILED:this.passed?Om.PASSED:Om.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Im.PASSED:this.passedTests.add(t);break;case Im.FAILED:this.failedTests.set(t,B(e,Pm));break;case Im.ERROR:this.testsWithError.set(t,B(e,Pm));break;default:throw new D(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class km{ideStore;testExecutionResult;checkTestRunnerState=we.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=we.create();treeData;viewAsList=!1;constructor(e,t){(0,Re.rC)(this,{testResultInfo:Re.LO.ref,allTests:Re.LO,selectedTestId:Re.LO,treeData:Re.LO.ref,viewAsList:Re.LO,setViewAsList:Re.aD,setSelectedTestId:Re.aD,setTestResultInfo:Re.aD,setTreeData:Re.aD,refreshTree:Re.aD,collapseTree:Re.aD,expandTree:Re.aD,buildTreeDataByLayer:Re.aD,pullTestRunnerResult:Re.aD,buildTestTreeData:Re.ls,pollTestRunnerResult:Re.ls,rerunTestSuite:Re.ls,cancelTestRun:Re.ls}),this.ideStore=e,this.testExecutionResult=t}getTreeData(){return G(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...G(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=G(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?y(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{Y(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new Fm(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.ideStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,_e.vB)(Mm,s):(0,_e.vB)(Dm,s);var s;return t instanceof Dm?(await Promise.all(t.tests.map((t=>O((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.ideStore.testRunState.isInProgress||(yield(0,Re.fl)(this.ideStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.ideStore.testRunState.isInProgress&&(yield this.ideStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.ideStore.applicationStore.notificationService.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}class jm{}class Um extends jm{error;errorDialog;text}(0,_e.yu)(Um,{error:(0,_e.Ru)(),errorDialog:(0,_e.Ru)(),text:(0,_e.Ru)()});class Gm{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return G(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:`'${_p}'`,format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptInfo=async(e,t,s)=>{const i=await this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});if(i.error)throw new Error(i.text);return i};getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:bp.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}));getSuggestionsForIncompletePath=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/incompletePath`,{path:e,types:t});getSuggestionsForIdentifier=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/identifier`,{importPaths:e,types:t});getSuggestionsForAttribute=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/attribute`,{importPaths:e,path:t});getSuggestionsForClass=e=>this.networkClient.post(`${this.baseUrl}/suggestion/class`,{importPaths:e});getSuggestionsForVariable=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/suggestion/variable`,{sourceId:e,line:t,column:s})}class Vm{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,Re.rC)(this,{_tempSize:Re.LO,size:Re.LO,defaultSize:Re.LO,snapSize:Re.LO,maxSize:Re.LO,isOpen:Re.Fl,isMaximizable:Re.Fl,isMaximized:Re.Fl,setSize:Re.aD,open:Re.aD,close:Re.aD,toggle:Re.aD,setMaxSize:Re.aD,maximize:Re.aD,minimize:Re.aD,toggleMaximize:Re.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}class $m{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return ra([Aa.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new $m(0,0);static ZERO_ONE=new $m(0,1);static ZERO_MANY=new $m(0,void 0);static ONE=new $m(1,1);static ONE_MANY=new $m(1,void 0)}class Bm{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return ra([Aa.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class zm extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class Hm extends zm{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Hm(e)}}class Ym extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class Wm extends Ym{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Wm(e)}}class Km extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Xm extends Km{ownerReference;constructor(e){const t=Ya.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new Xm(e)}}class Zm{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class qm{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return ra([Aa.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}}var Jm;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(Jm=Jm||(Jm={}));class Qm{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return ra([Aa.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),ya(this.parameters,this.body)])}}class e_ extends Ma{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new e_(ha.STRING);static BOOLEAN=new e_(ha.BOOLEAN);static BINARY=new e_(ha.BINARY);static NUMBER=new e_(ha.NUMBER);static INTEGER=new e_(ha.INTEGER);static FLOAT=new e_(ha.FLOAT);static DECIMAL=new e_(ha.DECIMAL);static DATE=new e_(ha.DATE);static STRICTDATE=new e_(ha.STRICTDATE);static DATETIME=new e_(ha.DATETIME);static STRICTTIME=new e_(ha.STRICTTIME);static LATESTDATE=new e_(ha.LATESTDATE)}class t_ extends Pa{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[new qm("",$m.ONE,Xm.create(new Zm(new Da(""))),new Da("")),new qm("",$m.ONE,Xm.create(new Zm(new Da(""))),new Da(""))];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}dispose(){super.dispose();const[e,t]=this.properties;if(e.genericType.value.rawType instanceof Da&&t.genericType.value.rawType instanceof Da){const s=B(e.genericType.value.rawType,Da),i=B(t.genericType.value.rawType,Da);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return ra([Aa.ASSOCIATION,this.path,ra(this.properties),ra(this.derivedProperties),ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class s_ extends Pa{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return ra([Aa.MAPPING,this.path,ra(this.classMappings),ra(this.enumerationMappings),ra(this.associationMappings),ra(this.test),ra(this.includes),ra(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class i_ extends Pa{p_stereotypes=[];p_tags=[];get _elementHashCode(){return ra([Aa.PROFILE,this.path,ra(this.p_stereotypes.map((e=>e.value))),ra(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class n_ extends Pa{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ne.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return ra([Aa.SERVICE,ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),this.path,this.pattern,ra(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",ra(this.tests),ra(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class a_ extends Pa{functionName;constructor(e){super(e),this.functionName=e}}class r_ extends a_{}class o_ extends r_{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return ra([Aa.FUNCTION,this.path,ra(this.parameters),this.returnType.valueForSerialization??"",ra(this.taggedValues),ra(this.stereotypes.map((e=>e.pointerHashCode))),ya(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class l_ extends Pa{includes=[]}class c_ extends l_{sections=[];get _elementHashCode(){return ra([Aa.FLAT_DATA,this.path,ra(this.includes.map((e=>e.valueForSerialization??""))),ra(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class d_ extends Pa{runtimeValue;get _elementHashCode(){return ra([Aa.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class h_ extends Pa{connectionValue;get _elementHashCode(){return ra([Aa.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class u_ extends Pa{}class p_ extends u_{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return ra([Aa.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",ra(this.scopeElements.map((e=>e instanceof Ha?e.valueForSerialization??"":e))),ra(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class m_ extends Pa{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return ra([Aa.GENERATION_TREE,this.path,ra(this.generationNodes),ra(this.fileGenerations.map((e=>Ra(xa.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class __ extends l_{schemas=[];joins=[];filters=[];get _elementHashCode(){return ra([Aa.DATABASE,this.path,ra(this.includes.map((e=>e.valueForSerialization??""))),ra(this.schemas),ra(this.joins),ra(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class g_{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class E_ extends Pa{data;get hashCode(){return ra([Aa.DATA_ELEMENT,this.path,ra(this.stereotypes.map((e=>e.pointerHashCode))),ra(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}class f_ extends Pa{executionParameters=[];get _elementHashCode(){return ra([Aa.EXECUTION_ENVIRONMENT_INSTANCE,this.path,ra(this.executionParameters)])}accept_PackageableElementVisitor(e){return e.visit_ExecutionEnvironmentInstance(this)}}const T_=new Set([Pa,ba,Ma,e_,Da,t_,Fa,o_,i_,ja,ka,E_,l_,s_,h_,d_,m_,p_,n_,f_,class extends Pa{sections=[];get _elementHashCode(){return ra([Aa.SECTION_INDEX,this.path,ra(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}}]);class C_{root;_origin;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;executionEnvironmentIndex=new Map;constructor(e,t,s){this.root=new Ua(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(T_.has(e))throw new b("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new g_(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter(V(Fa))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(V(ja))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(V(Da))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter(V(c_))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(V(__))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownExecutionEnvironments(){return Array.from(this.executionEnvironmentIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}get origin(){return this._origin}setOrigin(e){if(this._origin)throw new b("SDLC pointer has already been set for model.");this._origin=e}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new D("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new b("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof Da?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof Fa?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof ja?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnNullableExecutionEnviornment=e=>this.executionEnvironmentIndex.get(e);getOwnSectionIndex=e=>G(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>G(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>G(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>G(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>G(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>G(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>G(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>G(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>G(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>B(this.getOwnNullableStore(e),__,`Can't find database '${e}'`);getOwnFlatDataStore=e=>B(this.getOwnNullableStore(e),c_,`Can't find flat-data store '${e}'`);getOwnMapping=e=>G(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>G(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>G(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>G(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>G(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>G(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>G(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnExecutionEnvironment=e=>G(this.getOwnNullableExecutionEnviornment(e),`Can't find execution environment element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnExecutionEnvironment(e,t){this.executionEnvironmentIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.ownExecutionEnvironments,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>O((()=>{e.dispose()})))))}getNullablePackage=e=>e?F((()=>Cu(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.executionEnvironmentIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){Eu(t?Su(this,t,void 0):this.root,e),e instanceof s_?this.setOwnMapping(e.path,e):e instanceof l_?this.setOwnStore(e.path,e):e instanceof ba?this.setOwnType(e.path,e):e instanceof t_?this.setOwnAssociation(e.path,e):e instanceof i_?this.setOwnProfile(e.path,e):e instanceof o_?this.setOwnFunction(e.path,e):e instanceof n_?this.setOwnService(e.path,e):e instanceof h_?this.setOwnConnection(e.path,e):e instanceof d_?this.setOwnRuntime(e.path,e):e instanceof p_?this.setOwnFileGeneration(e.path,e):e instanceof m_?this.setOwnGenerationSpecification(e.path,e):e instanceof E_?this.setOwnDataElement(e.path,e):e instanceof f_?this.setOwnExecutionEnvironment(e.path,e):e instanceof Ua||this.getExtensionForElementClass(N(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&fu(e.package,e),e instanceof s_?this.mappingsIndex.delete(e.path):e instanceof l_?this.storesIndex.delete(e.path):e instanceof ba?(this.typesIndex.delete(e.path),e instanceof ja&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof t_?this.associationsIndex.delete(e.path):e instanceof i_?this.profilesIndex.delete(e.path):e instanceof o_?this.functionsIndex.delete(e.path):e instanceof n_?this.servicesIndex.delete(e.path):e instanceof d_?this.runtimesIndex.delete(e.path):e instanceof h_?this.connectionsIndex.delete(e.path):e instanceof p_?this.fileGenerationsIndex.delete(e.path):e instanceof m_?this.generationSpecificationsIndex.delete(e.path):e instanceof E_?this.dataElementsIndex.delete(e.path):e instanceof f_?this.executionEnvironmentIndex.delete(e.path):e instanceof Ua?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(N(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new D(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof Ua&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof Ua)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new D(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new D(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=_u(s);if(!(e instanceof Ua)){const t=this.getNullablePackage(i)??(""!==i?Su(this,i,void 0):this.root);e.name=n,e instanceof o_&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Au(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Au(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&fu(e.package,e),Eu(t,e))}var a,r;if(e instanceof s_)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof l_)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ba)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof ja&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof t_)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof i_)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof o_)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof n_)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof d_)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof h_)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof p_)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof E_)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof f_)this.executionEnvironmentIndex.delete(t),this.executionEnvironmentIndex.set(s,e);else if(e instanceof m_)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof Ua){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new b("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){fu(r,e);const t=""!==i?Su(this,i,void 0):this.root;Eu(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(N(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class S_{}class x_ extends S_{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class N_ extends C_{constructor(e,t,s){super(t.name,e,s),this.root=t}}const v_=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class A_{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new Ua((e=>`@dependency__${e}`)(e));this.roots.push(s),this.projectDependencyModelsIndex.set(e,new N_(this.extensionElementClasses,s,new x_(t.groupId,t.artifactId,t.versionId)))}))}get numberOfDependencies(){return this.projectDependencyModelsIndex.size}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=v_(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=v_(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=v_(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=v_(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=v_(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=v_(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=v_(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=v_(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=v_(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=v_(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=v_(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=v_(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=v_(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=v_(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=v_(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=v_(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnExecutionEnvironment=v_(this,((e,t)=>e.getOwnNullableExecutionEnviornment(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}get executionEnvironments(){return this.dependencyGraphs.flatMap((e=>e.ownExecutionEnvironments))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return G(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){const s=this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))));return s?.getOwnNullableElement(e,t)}}class I_ extends l_{static NAME="ModelStore";static INSTANCE=new I_;constructor(){super(I_.NAME)}accept_PackageableElementVisitor(e){throw new D}}class O_ extends C_{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(da.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(I_.NAME,I_.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[e_.STRING,e_.BOOLEAN,e_.BINARY,e_.NUMBER,e_.INTEGER,e_.FLOAT,e_.DECIMAL,e_.DATE,e_.STRICTDATE,e_.DATETIME,e_.STRICTTIME,e_.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class y_ extends C_{autoImports=[];constructor(e){super(da.SYSTEM,e)}initializeAutoImports(){this.autoImports=_a.map((e=>B(this.getOwnNullableElement(e,!0),Ua,`Can't find auto-import package '${e}'`)))}}class R_ extends C_{constructor(e){super(da.MODEL_GENERATION,e)}}class w_ extends C_{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(da.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new R_(i),this.dependencyManager=new A_(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get executionEnvironments(){return[...this.coreModel.ownExecutionEnvironments,...this.systemModel.ownExecutionEnvironments,...this.dependencyManager.executionEnvironments,...this.ownExecutionEnvironments,...this.generationModel.ownExecutionEnvironments]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>G(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>G(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>G(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>B(this.getType(e),Fa,`Can't find enumeration '${e}'`);getMeasure=e=>B(this.getType(e),ja,`Can't find measure '${e}'`);getUnit=e=>B(this.getType(e),ka,`Can't find unit '${e}'`);getClass=e=>B(this.getType(e),Da,`Can't find class '${e}'`);getAssociation=e=>G(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>G(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??B(this.getType(e),Da),`Can't find property owner '${e}'`);getFunction=e=>B(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),o_,`Can't find function '${e}'`);getStore=e=>G(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>B(this.getStore(e),c_,`Can't find flat-data store '${e}'`);getDatabase=e=>B(this.getStore(e),__,`Can't find database store '${e}'`);getMapping=e=>G(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>G(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>G(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>G(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>G(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>G(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>G(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return G(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>G(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>F((()=>this.getClass(e)));getNullableMapping=e=>F((()=>this.getMapping(e)));getNullableService=e=>F((()=>this.getService(e)));getNullableRuntime=e=>F((()=>this.getRuntime(e)));getNullableFileGeneration=e=>F((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=$m.ONE:0===e&&1===t?s=$m.ZERO_ONE:0===e&&void 0===t?s=$m.ZERO_MANY:1===e&&void 0===t?s=$m.ONE_MANY:0===e&&0===t&&(s=$m.ZERO),s??new $m(e,t)}addElement(e,t){const s=gu(t??"",e.name);if(this.getNullableElement(s,!1))throw new b(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new b(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class L_{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class P_{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class b_ extends za{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Aa.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(aa).join(",")}}class D_ extends b_{ownerReference;constructor(e){const t=Ya.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new D_(e)}}class M_{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,_e.yu)(M_,{column:(0,_e.Ru)(),endLine:(0,_e.Ru)(),endColumn:(0,_e.Ru)(),line:(0,_e.Ru)(),sourceId:(0,_e.Ru)(),startLine:(0,_e.Ru)(),startColumn:(0,_e.Ru)()});const F_=(0,_e.PG)((()=>_e.AM),(e=>(e.sourceId=e.source,(0,_e.vB)(M_,e))));class k_{package;name;tags=[];stereotypes=[]}(0,_e.yu)(k_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ru)()),tags:(0,_e.pb)((0,_e.Ru)())});class j_{profile;value}(0,_e.yu)(j_,{profile:(0,_e.Ru)(),value:(0,_e.Ru)()});class U_{profile;value}(0,_e.yu)(U_,{profile:(0,_e.Ru)(),value:(0,_e.Ru)()});class G_{tag;value}(0,_e.yu)(G_,{tag:(0,_e.Ry)(U_),value:(0,_e.Ru)()});class V_{rawType;typeParameter}(0,_e.yu)(V_,{rawType:(0,_e.jt)((0,_e.Ru)()),typeParameter:(0,_e.jt)((0,_e.Ru)())});class $_{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,_e.yu)($_,{aggregation:(0,_e.Ru)(),genericType:(0,_e.Ry)(V_),multiplicity:(0,_e.Ru)(),name:(0,_e.Ru)(),stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_))});class B_{package;name;sourceInformation}(0,_e.yu)(B_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),sourceInformation:F_});class z_{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,_e.yu)(z_,{generalizations:(0,_e.pb)((0,_e.Ry)(V_)),name:(0,_e.Ru)(),package:(0,_e.Ru)(),properties:(0,_e.pb)((0,_e.Ry)($_)),qualifiedProperties:(0,_e.pb)((0,_e.Ry)($_)),sourceInformation:F_,stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_))});class H_{package;name;enumValues=[]}(0,_e.yu)(H_,{name:(0,_e.Ru)(),package:(0,_e.Ru)(),enumValues:(0,_e.pb)((0,_e.Ru)())});class Y_{x;y}(0,_e.yu)(Y_,{x:(0,_e.Ru)(),y:(0,_e.Ru)()});class W_{height;width}(0,_e.yu)(W_,{height:(0,_e.Ru)(),width:(0,_e.Ru)()});class K_{points=[]}(0,_e.yu)(K_,{points:(0,_e.pb)((0,_e.Ry)(Y_))});class X_{id;source;target;geometry}(0,_e.yu)(X_,{geometry:(0,_e.Ry)(K_),id:(0,_e.Ru)(),source:(0,_e.Ru)(),target:(0,_e.Ru)()});class Z_{name;owningType}(0,_e.yu)(Z_,{name:(0,_e.Ru)(),owningType:(0,_e.Ru)()});class q_{id;source;target;property;geometry}(0,_e.yu)(q_,{geometry:(0,_e.Ry)(K_),id:(0,_e.Ru)(),property:(0,_e.Ry)(Z_),source:(0,_e.Ru)(),target:(0,_e.Ru)()});class J_{id;type;position;rectangleGeometry}(0,_e.yu)(J_,{id:(0,_e.Ru)(),position:(0,_e.Ry)(Y_),rectangleGeometry:(0,_e.Ry)(W_),type:(0,_e.Ru)()});class Q_{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,_e.yu)(Q_,{name:(0,_e.Ru)(),generalizationViews:(0,_e.pb)((0,_e.Ry)(X_)),package:(0,_e.Ru)(),propertyViews:(0,_e.pb)((0,_e.Ry)(q_)),sourceInformation:F_,stereotypes:(0,_e.pb)((0,_e.Ry)(j_)),taggedValues:(0,_e.pb)((0,_e.Ry)(G_)),typeViews:(0,_e.pb)((0,_e.Ry)(J_))});class eg{classes=[];enumerations=[];profiles=[]}(0,_e.yu)(eg,{classes:(0,_e.pb)((0,_e.Ry)(z_)),enumerations:(0,_e.pb)((0,_e.Ry)(H_)),profiles:(0,_e.pb)((0,_e.Ry)(k_))});class tg{name;diagram;domainInfo}(0,_e.yu)(tg,{diagram:(0,_e.Ry)(Q_),name:(0,_e.Ru)(),domainInfo:(0,_e.jt)((0,_e.Ry)(eg))});class sg{class;enumerations=[];profiles=[];specializations=[]}(0,_e.yu)(sg,{class:(0,_e.Ry)(z_),enumerations:(0,_e.pb)((0,_e.Ry)(H_)),profiles:(0,_e.pb)((0,_e.Ry)(k_)),specializations:(0,_e.pb)((0,_e.Ry)(B_))});const ig=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},ng=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=_u(e),r=new Da(a);return Eu(Cu(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},ag=e=>{if("*"===e)return new $m(0,void 0);{const t=e.split("..");if(1===t.length)return new $m(parseInt(G(t[0]),10),parseInt(G(t[0]),10));if(2===t.length)return new $m(parseInt(G(t[0]),10),"*"===t[1]?void 0:parseInt(G(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},rg=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;y(e.taggedValues,new Bm(Hm.create((i=s.getProfile(t.tag.profile),n=t.tag.value,G(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;y(e.stereotypes,Wm.create((i=s.getProfile(t.profile),n=t.value,G(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=ng(G(t.rawType),s,i,void 0);y(e.generalizations,Xm.create(new Zm(n))),y(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new qm(t.name,ag(t.multiplicity),Xm.create(new Zm(s.getOwnNullableEnumeration(G(t.genericType.rawType))??ng(G(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?Jm.COMPOSITE:"Shared"===t.aggregation?Jm.SHARED:void 0,y(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{y(e.derivedProperties,new Qm(t.name,ag(t.multiplicity),Xm.create(new Zm(s.getOwnNullableEnumeration(G(t.genericType.rawType))??ng(G(t.genericType.rawType),s,i,void 0))),e))}))},og=e=>{const t=new w_(new O_([]),new y_([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Da(e.name);Eu(Cu(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new i_(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>y(s.p_tags,new L_(s,e)))),e.stereotypes.forEach((e=>y(s.p_stereotypes,new P_(s,e))))})),i.enumerations.forEach((e=>{const s=new Fa(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":oa}${e.name}`,n=t.getClass(i);rg(n,e,t,s)}))}const i=e.diagram,n=new Ah(i.name);return Eu(Cu(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new Mu(n,e.id,Ya.create(t.getClass(e.type)));s.position=new Pu(e.position.x,e.position.y),s.rectangle=new bu(e.rectangleGeometry.width,e.rectangleGeometry.height),y(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new Vu(n,D_.create((i=t.getClass(e.property.owningType),a=e.property.name,G(i instanceof Da?vu(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),G(n.classViews.find((t=>t.id===e.source))),G(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Pu(e.x,e.y))),Wu(s),y(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new $u(n,G(n.classViews.find((t=>t.id===e.source))),G(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Pu(e.x,e.y))),Wu(t),y(n.generalizationViews,t)})),[n,t,s]};var lg,cg,dg;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data",e.EXECUTION_ENVIRONMENT="ExecutionEnvironment"}(lg=lg||(lg={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(cg=cg||(cg={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(dg=dg||(dg={}));const hg=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;class ug extends Gu{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return ra([vh.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const pg=(0,Re.aD)(((e,t)=>{e.value=t})),mg=((0,Re.aD)(((e,t)=>{w(e.properties,t)})),(0,Re.aD)(((e,t)=>{y(e.properties,oh(t))}))),_g=((0,Re.aD)(((e,t,s)=>{R(e.properties,t,s)})),(0,Re.aD)(((e,t)=>{w(e.derivedProperties,t)})),(0,Re.aD)(((e,t)=>{y(e.derivedProperties,lh(t))})),(0,Re.aD)(((e,t,s)=>{R(e.derivedProperties,t,s)})),(0,Re.aD)(((e,t)=>{y(e.constraints,dh(t))})),(0,Re.aD)(((e,t)=>{w(e.constraints,t)})),(0,Re.aD)(((e,t,s)=>{R(e.constraints,t,s)})),(0,Re.aD)(((e,t)=>{y(e.generalizations,Zd(t))}))),gg=((0,Re.aD)(((e,t)=>{w(e.generalizations,t)})),(0,Re.aD)(((e,t,s)=>{R(e.generalizations,t,s)})),(0,Re.aD)(((e,t)=>{y(e._subclasses,t)})),(0,Re.aD)(((e,t)=>{w(e._subclasses,t)})),(0,Re.aD)(((e,t)=>{Zd(e),Xd(t),e.value=t,e.ownerReference.value=t.rawType}))),Eg=((0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{gg(e.genericType,Xd(t))})),(0,Re.aD)(((e,t)=>{e.multiplicity=t})),(0,Re.aD)(((e,t)=>{e.aggregation=t})),(0,Re.aD)(((e,t)=>{e.value=Qd(t),pg(e.ownerReference,t._OWNER)})),(0,Re.aD)(((e,t)=>{y(e.taggedValues,Kd(t))})),(0,Re.aD)(((e,t)=>{w(e.taggedValues,t)})),(0,Re.aD)(((e,t)=>{y(e.stereotypes,Yd(t))})),(0,Re.aD)(((e,t)=>{w(e.stereotypes,t)})),(0,Re.aD)(((e,t)=>{e.tag.value=eh(t),e.tag.ownerReference.value=t._OWNER})),(0,Re.aD)(((e,t)=>{e.value=t})),(0,Re.aD)(((e,t)=>{e.value=t})),(0,Re.aD)(((e,t,s)=>{R(e.taggedValues,t,s)})),(0,Re.aD)(((e,t,s)=>{R(e.stereotypes,t,s)})),(0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{e.functionDefinition=dr(t)})),(0,Re.aD)(((e,t)=>{y(e.p_tags,eh(t))})),(0,Re.aD)(((e,t)=>{w(e.p_tags,t)})),(0,Re.aD)(((e,t)=>{y(e.p_stereotypes,Qd(t))})),(0,Re.aD)(((e,t)=>{w(e.p_stereotypes,t)})),(0,Re.aD)(((e,t,s)=>{R(e.p_tags,t,s)})),(0,Re.aD)(((e,t,s)=>{R(e.p_stereotypes,t,s)})),(0,Re.aD)(((e,t)=>{w(e.parameters,t)})),(0,Re.aD)(((e,t)=>{y(e.parameters,hr(t))})),(0,Re.aD)(((e,t)=>{pg(e.returnType,mh(t))})),(0,Re.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,Re.aD)(((e,t,s)=>{R(e.parameters,t,s)})),(0,Re.aD)(((e,t)=>{e.name=t})),(0,Re.aD)(((e,t)=>{y(e.values,sh(t))})),(0,Re.aD)(((e,t)=>{w(e.values,t)})),(0,Re.aD)(((e,t,s)=>{R(e.values,t,s)})),(0,Re.aD)(((e,t)=>{e.value=sh(t),pg(e.ownerReference,t._OWNER)})),(0,Re.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return Y(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),G(e.properties[(s+1)%2])})(e,t),n=B(t.genericType.ownerReference.value,Da,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&Y(w(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),y(s.propertiesFromAssociations,i);const r=new Zm(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,Re.aD)(((e,t)=>{e.canonicalUnit=ah(t)})),(0,Re.aD)(((e,t)=>{e.conversionFunction=dr(t)})),(0,Re.aD)(((e,t)=>{e.classViews=t.map(Eh)}))),fg=(0,Re.aD)(((e,t)=>{y(e.classViews,Eh(t))})),Tg=(0,Re.aD)(((e,t)=>{w(e.classViews,t)})),Cg=(0,Re.aD)(((e,t)=>{e.associationViews=t.map(Sh)})),Sg=(0,Re.aD)(((e,t)=>{w(e.associationViews,t)})),xg=(0,Re.aD)(((e,t)=>{e.generalizationViews=t.map(Ch)})),Ng=(0,Re.aD)(((e,t)=>{y(e.generalizationViews,Ch(t))})),vg=(0,Re.aD)(((e,t)=>{w(e.generalizationViews,t)})),Ag=(0,Re.aD)(((e,t)=>{e.propertyViews=t.map(xh)})),Ig=(0,Re.aD)(((e,t)=>{y(e.propertyViews,xh(t))})),Og=(0,Re.aD)(((e,t)=>{w(e.propertyViews,t)})),yg=(0,Re.aD)(((e,t)=>{e.hideProperties=t})),Rg=(0,Re.aD)(((e,t)=>{e.hideStereotypes=t})),wg=(0,Re.aD)(((e,t)=>{e.hideTaggedValues=t})),Lg=(0,Re.aD)(((e,t)=>{e._offsetX=t})),Pg=(0,Re.aD)(((e,t)=>{e._offsetY=t})),bg=(0,Re.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Dg=(0,Re.aD)(Wu),Mg=(0,Re.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new Bu(n.x,n.y).normal(new Bu(l.x,l.y)).unit(),d=Bu.fromPoints(n,new Pu(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new Pu(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&Yu(e,r),o})),Fg=(0,Re.aD)(Yu),kg=(0,Re.aD)(((e,t)=>{e.rectangle=t})),jg=(0,Re.aD)(((e,t)=>{e.position=t})),Ug=(0,Re.aD)((e=>{e._dummyObservable={}}));var Gg,Vg,$g;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(Gg=Gg||(Gg={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Vg=Vg||(Vg={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}($g=$g||($g={}));const Bg=.05,zg=[50,75,90,100,110,125,150,200,250,300,400],Hg=e=>(e instanceof Qm?"/ ":"")+e.name;class Yg{diagram;isReadOnly;enableLayoutAutoAdjustment;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,Re.rC)(this,{isReadOnly:Re.LO,enableLayoutAutoAdjustment:Re.LO,interactionMode:Re.LO,relationshipMode:Re.LO,zoom:Re.LO,mouseOverClassView:Re.LO,mouseOverClassName:Re.LO,mouseOverClassCorner:Re.LO,mouseOverClassProperty:Re.LO,mouseOverPropertyHolderViewLabel:Re.LO,selectionStart:Re.LO,selectedClassCorner:Re.LO,selectedClasses:Re.LO,selectedPropertyOrAssociation:Re.LO,selectedInheritance:Re.LO,leftClick:Re.LO,middleClick:Re.LO,rightClick:Re.LO,changeMode:Re.aD,setIsReadOnly:Re.aD,setEnableLayoutAutoAdjustment:Re.aD,setMouseOverClassView:Re.aD,setMouseOverClassName:Re.aD,setMouseOverClassCorner:Re.aD,setMouseOverClassProperty:Re.aD,setMouseOverPropertyHolderViewLabel:Re.aD,setSelectionStart:Re.aD,setSelectedClassCorner:Re.aD,setSelectedClasses:Re.aD,setSelectedPropertyOrAssociation:Re.aD,setSelectedInheritance:Re.aD,setLeftClick:Re.aD,setMiddleClick:Re.aD,setRightClick:Re.aD,setZoomLevel:Re.aD,align:Re.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new bu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new Pu(0,0),this.virtualScreen=new Du(new Pu(0,0),new bu(0,0)),this.zoom=1,this.triangle=[new Pu(0,0),new Pu(-15,-10),new Pu(-15,10)],this.diamond=[new Pu(0,0),new Pu(-10,-5),new Pu(-20,0),new Pu(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=Gg.LAYOUT,this.relationshipMode=Vg.NONE,this.isReadOnly=!1,this.enableLayoutAutoAdjustment=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new Pu(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Pu(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setEnableLayoutAutoAdjustment(e){this.enableLayoutAutoAdjustment=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(e){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh(),e?.initial&&(this.autoRecenter(),(this.canvas.width<this.virtualScreen.rectangle.width+2*this.screenPadding+20||this.canvas.height<this.virtualScreen.rectangle.height+2*this.screenPadding+20)&&this.zoomToFit())}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new bu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new Pu(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Gg.LAYOUT:case Gg.PAN:case Gg.ZOOM_IN:case Gg.ZOOM_OUT:case Gg.ADD_CLASS:if(t!==Vg.NONE)throw new b(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Gg.ADD_RELATIONSHIP:if(t===Vg.NONE)throw new b("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new D(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Gg.ADD_RELATIONSHIP)switch(t){case Vg.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Nu(e.class.value).includes(t.class.value)||Nu(t.class.value).includes(e.class.value)||_g(e.class.value,Xm.create(new Zm(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new $u(this.diagram,e,t);return Ng(this.diagram,s),s}};break;case Vg.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new qm(`property_${e.class.value.properties.length+1}`,$m.ONE,Xm.create(new Zm(t.class.value)),e.class.value);if(mg(e.class.value,s),e!==t){const i=new Vu(this.diagram,D_.create(s),e,t);return Ig(this.diagram,i),i}};break;default:throw new D(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case $g.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(e,t.position.y))));break}case $g.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>jg(t,new Pu(e-t.rectangle.width/2,t.position.y))));break}case $g.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(e-t.rectangle.width,t.position.y))));break}case $g.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e))));break}case $g.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e-t.rectangle.height/2))));break}case $g.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>jg(t,new Pu(t.position.x,e-t.rectangle.height))));break}case $g.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];jg(s,new Pu(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];jg(n,new Pu(i.position.x+i.rectangle.width+s,n.position.y))}}break}case $g.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];jg(s,new Pu(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];jg(n,new Pu(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-3)}...`:e}canvasCoordinateToModelCoordinate(e){return new Pu((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new Pu((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}resolveMouseEventCoordinate(e){if(e.target instanceof HTMLElement){const t=zu(e.target);return new Pu(t.x+e.offsetX,t.y+e.offsetY)}return new Pu(e.x,e.y)}eventCoordinateToCanvasCoordinate(e){return new Pu(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Pu(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return zu(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=G(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof Vu){const r=this.drawLinePropertyText(G(a[a.length-2],"Diagram path expected to have at least 2 points"),G(a[a.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,Zu(r).x),n=Math.max(n,Zu(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new Du(new Pu(t,s),new bu(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Pu(0,0),this.virtualScreen=new Du(new Pu(this.canvasDimension.width/2,this.canvasDimension.height/2),new bu(0,0))}executeZoom(e,t){e=Math.max(e,Bg);const s=this.zoom;this.setZoomLevel(e),this.screenOffset=new Pu(((t.x-this.canvasCenter.x)*(s-e)+this.screenOffset.x*s)/e,((t.y-this.canvasCenter.y)*(s-e)+this.screenOffset.y*s)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Bg)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),Bg))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new Mu(this.diagram,i,Ya.create(e));return jg(n,t??this.canvasCoordinateToModelCoordinate(new Pu(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),fg(this.diagram,n),Ug(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Ng(this.diagram,new $u(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Ng(this.diagram,new $u(this.diagram,t,n)),vu(e).forEach((e=>{e.genericType.value.rawType===s&&Ig(this.diagram,new Vu(this.diagram,D_.create(e),n,t))})),vu(s).forEach((s=>{s.genericType.value.rawType===e&&Ig(this.diagram,new Vu(this.diagram,D_.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=Hg(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof Fa&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=hg(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(vu(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly||this.enableLayoutAutoAdjustment){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;kg(e,new bu(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of vu(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof Qm?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof e_?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Ug(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Hg(e),o=hg(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new Pu(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),m=n(c),_=this.modelCoordinateToCanvasCoordinate(new Pu(i(c),n(c)));a||this.ctx.fillText(o,_.x,_.y);const g=new Pu(Math.min(d,p),Math.min(h,m));return new Du(g,new bu(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,m)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new Du(new Pu(0,0),new bu(0,0))}drawPropertyOrAssociation(e){const t=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(G(t[t.length-2],"Diagram path expected to have at least 2 points"),G(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof qm){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===Jm.COMPOSITE||s.aggregation===Jm.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+Ku(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ku(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Xu(this.diamond[0],e))*this.zoom),s.aggregation===Jm.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===Jm.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=G(s[s.length-2],"Diagram path expected to have at least 2 points").x,n=G(s[s.length-2],"Diagram path expected to have at least 2 points").y,a=G(s[s.length-1],"Diagram path expected to have at least 2 points").x,r=G(s[s.length-1],"Diagram path expected to have at least 2 points").y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+Ku(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ku(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Xu(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&Fg(e,e.path.map((e=>new Pu(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=A(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==Gg.ZOOM_IN?Gg.ZOOM_IN:Gg.ZOOM_OUT,Vg.NONE)}switchToViewMode(){this.changeMode(Gg.LAYOUT,Vg.NONE)}switchToPanMode(){this.changeMode(Gg.PAN,Vg.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Gg.ADD_RELATIONSHIP,Vg.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Gg.ADD_RELATIONSHIP,Vg.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Gg.ADD_CLASS,Vg.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Da&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Pu(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Da&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,at.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Mu(t,(0,a.Z)(),Ya.create(xu(e.value,Da))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(jg(t[0],new Pu(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];jg(e,new Pu(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new $u(t,s,e):[]))))))]}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Tg(this.diagram,e),Cg(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),xg(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Ag(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof ug?Sg(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof Vu&&Og(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&vg(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{yg(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Rg(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{wg(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>fg(this.diagram,e))),t[1].forEach((e=>Ng(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,at.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Mu(this.diagram,(0,a.Z)(),Ya.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>fg(this.diagram,e))),t[1].forEach((e=>Ng(this.diagram,e)))}this.drawScreen()}}mouseup(e){const t=this.resolveMouseEventCoordinate(e);if(!this.isReadOnly)switch(this.interactionMode){case Gg.LAYOUT:this.diagram.generalizationViews.forEach((e=>Dg(e))),this.diagram.associationViews.forEach((e=>Dg(e))),this.diagram.propertyViews.forEach((e=>Dg(e)));break;case Gg.ADD_CLASS:{const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));this.onAddClassViewClick(e),this.changeMode(Gg.LAYOUT,Vg.NONE);break}case Gg.ZOOM_IN:{const e=Math.round(100*this.zoom);let s;s=e<=zg[0]-10?10*Math.floor(e/10)+10:e>=zg[zg.length-1]?100*Math.floor(e/100)+100:G(zg.find((t=>t>e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Gg.ZOOM_OUT:{const e=Math.round(100*this.zoom);let s;s=e<=zg[0]?10*Math.ceil(e/10)-10:e>=zg[zg.length-1]+100?100*Math.ceil(e/100)-100:G((0,uu.Z)(zg,(t=>t<e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Gg.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));for(let t=this.diagram.classViews.length-1;t>=0;t--){const s=this.diagram.classViews[t];if(s.contains(e.x,e.y)){const t=this.handleAddRelationship(this.startClassView,s);t&&(Lg(t.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Pg(t.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Lg(t.to,-(s.position.x+s.rectangle.width/2-e.x)),Pg(t.to,-(s.position.y+s.rectangle.height/2-e.y)))}}this.changeMode(Gg.LAYOUT,Vg.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){const t=this.resolveMouseEventCoordinate(e);if([Gg.ADD_RELATIONSHIP,Gg.ADD_CLASS,Gg.ZOOM_IN,Gg.ZOOM_OUT].includes(this.interactionMode))return;const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,s,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,s);const i=this.diagram.classViews.find((e=>e.contains(s.x,s.y)));i&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(i,s):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,s,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(s)}mousedown(e){const t=this.resolveMouseEventCoordinate(e);this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const s=this.eventCoordinateToCanvasCoordinate(t),i=this.canvasCoordinateToModelCoordinate(s);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Gg.PAN:return void(this.positionBeforeLastMove=t);case Gg.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(qu(t).contains(i.x,i.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Eg(this.diagram,this.reorderDiagramDomain(G(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:i},this.setSelectedClasses([]);else{let e=!1;for(let t=this.diagram.classViews.length-1;t>=0;t--){const n=this.diagram.classViews[t];if(n.contains(i.x,i.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||Eg(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=s.x/this.zoom-this.screenOffset.x,this.clickY=s.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Pu(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Mg(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(i)}}break;case Gg.ADD_RELATIONSHIP:this.setSelectionStart(i),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(i.x,i.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Gg.LAYOUT,Vg.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=t);if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=t,void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,i),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.resolveMouseEventCoordinate(e);if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const s=this.zoom-e.deltaY/120*.05;this.executeZoom(s,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)))}mousemove(e){const t=this.resolveMouseEventCoordinate(e);if(this.cursorPosition=t,this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Gg.PAN)this.screenOffset=new Pu(this.screenOffset.x+(t.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(t.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=t,this.clearScreen(),this.drawAll();else if(this.leftClick){const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);switch(this.interactionMode){case Gg.LAYOUT:if(this.selectedClassCorner&&(kg(this.selectedClassCorner,new bu(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Ug(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let t=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=e.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=e.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);t=i.position.x-n,s=i.position.y-r,jg(i,new Pu(n,r)),Ug(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,t,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?bg(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&bg(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(t.x,t.y,e.x-t.x,e.y-t.y),this.ctx.strokeRect(t.x,t.y,e.x-t.x,e.y-t.y);const s=(e.x-t.x)/this.zoom,i=(e.y-t.y)/this.zoom;this.selection=new Du(new Pu(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new bu(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(Ju(this.selection,e)||Ju(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Gg.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const t of this.diagram.classViews.slice().reverse())if(t.contains(s.x,s.y)){this.setMouseOverClassView(t),qu(t).contains(s.x,s.y)&&this.setMouseOverClassCorner(t);const i=t.class.value;let n=t.position.y+this.classViewSpaceY;n+=t.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const a=this.computeClassNameWidth(t);new Du(this.modelCoordinateToCanvasCoordinate(new Pu(t.position.x+(t.rectangle.width-a)/2,n)),new bu(a,this.lineHeight)).contains(e.x,e.y)&&this.setMouseOverClassName(t),n+=this.lineHeight,n+=t.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,n+=2*this.classViewSpaceY;for(const s of vu(i))this.hasPropertyView(t,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Du(this.modelCoordinateToCanvasCoordinate(new Pu(t.position.x+this.classViewSpaceX,n)),new bu(this.drawClassViewProperty(t,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(e.x,e.y)&&this.setMouseOverClassProperty(s),n+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=Uu.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(G(t[t.length-2],"Diagram path expected to have at least 2 points"),G(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}}class Wg extends Up{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,Re.rC)(this,{_renderer:Re.LO,diagram:Re.LO,diagramInfo:Re.LO,diagramName:Re.Fl,diagramCursorClass:Re.Fl,addClassView:Re.ls,rebuild:Re.aD,setRenderer:Re.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=og(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Rp(this.diagramPath)}get description(){return`Diagram: ${Rp(this.diagramPath)}`}get diagramName(){return pu(this.diagramPath)}match(e){return e instanceof Wg&&this.diagramPath===e.diagramPath}get renderer(){return G(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case Gg.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Gg.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Gg.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Gg.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=og(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Lp(t.sourceId,t.startLine,t.startColumn);(0,Re.fl)(this.ideStore.executeNavigation(e)).catch(this.ideStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":oa}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new i_(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>y(s.p_tags,new L_(s,e)))),e.stereotypes.forEach((e=>y(s.p_stereotypes,new P_(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":oa}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new Fa(e.name);Eu(Cu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":oa}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new Da(i.name),Eu(Cu(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=G(a),n=ng(G(`${e.package}${""===e.package?"":oa}${e.name}`),t,s,e.sourceInformation);y(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||y(n.generalizations,Xm.create(new Zm(i)))})),r&&rg(a,i,t,s),a})((0,_e.vB)(sg,yield this.ideStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");const s=e.map((e=>{const s=e.match(new RegExp(`^${t}_(?<count>\\d+)$`));return s?.groups?.count?parseInt(s.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0);return`${t}_${s+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.ideStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.ideStore.applicationStore.commandService.registerCommand({key:Bp.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.ideStore.applicationStore.commandService.registerCommand({key:Bp.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Bp.RECENTER,Bp.USE_ZOOM_TOOL,Bp.USE_VIEW_TOOL,Bp.USE_PAN_TOOL].forEach((e=>this.ideStore.applicationStore.commandService.deregisterCommand(e)))}}class Kg{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,Re.rC)(this,{text:Re.LO,isCaseSensitive:Re.LO,isRegExp:Re.LO,reset:Re.aD,setText:Re.aD,setCaseSensitive:Re.aD,setRegExp:Re.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}setRegExp(e){this.isRegExp=e}}class Xg extends L{}const Zg=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,qg=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Jg=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class Qg{ideStore;constructor(e){this.ideStore=e}}class eE extends Qg{result;constructor(e,t){super(e),this.result=t}}class tE extends Qg{result;constructor(e,t){super(e),this.result=t}}class sE{ideStore;usageConcept;searchEntries=[];constructor(e,t,s,i){(0,Re.rC)(this,{searchEntries:Re.LO,numberOfFiles:Re.Fl,numberOfResults:Re.Fl}),this.ideStore=e,this.usageConcept=t;const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=G(n.get(e.source)):(s=new Am,s.sourceId=e.source,n.set(e.source,s));const a=new vm(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),this.searchEntries=Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=G(n.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))}dismissSearchEntry(e){w(this.searchEntries,e),this.searchEntries.length||this.ideStore.setReferenceUsageResult(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class iE{searchState;searchEntries=[];constructor(e,t){(0,Re.rC)(this,{searchEntries:Re.LO,numberOfFiles:Re.Fl,numberOfResults:Re.Fl}),this.searchState=e,this.searchEntries=t}dismissSearchEntry(e){w(this.searchEntries,e),this.searchEntries.length||this.searchState.setResult(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class nE{ideStore;loadState=we.create();searchInput;text="";isCaseSensitive=!1;isRegExp=!1;result;constructor(e){(0,Re.rC)(this,{text:Re.LO,isCaseSensitive:Re.LO,isRegExp:Re.LO,result:Re.LO,setText:Re.aD,setCaseSensitive:Re.aD,setRegExp:Re.aD,setResult:Re.aD,search:Re.ls}),this.ideStore=e}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}select(){this.searchInput?.select()}*search(){if(!this.loadState.isInProgress){this.loadState.inProgress();try{const e=(yield this.ideStore.client.searchText(this.text,this.isCaseSensitive,this.isRegExp)).map((e=>(e=>(0,_e.vB)(Am,e))(e)));this.setResult(new iE(this,e)),this.loadState.pass()}catch(e){M(e),this.ideStore.applicationStore.notificationService.notifyError(e),this.loadState.fail()}}}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}setRegExp(e){this.isRegExp=e}setResult(e){this.result=e}}class aE{applicationStore;initState=we.create();directoryTreeState;conceptTreeState;client;activePanelMode=Ep.TERMINAL;panelGroupDisplayState=new Vm({initial:0,default:300,snap:100});activeActivity=gp.CONCEPT_EXPLORER;sideBarDisplayState=new Vm({initial:300,default:300,snap:150});tabManagerState=new Gp(this);executionState=we.create();navigationStack=[];fileSearchCommandLoadState=we.create();fileSearchCommandState=new Kg;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=we.create();referenceUsageResult;textSearchState;testRunState=we.create();testRunnerState;constructor(e){var t;(0,Re.rC)(this,{activePanelMode:Re.LO,activeActivity:Re.LO,navigationStack:Re.LO,openFileSearchCommand:Re.LO,fileSearchCommandResults:Re.LO,fileSearchCommandState:Re.LO,codeFixSuggestion:Re.LO,referenceUsageResult:Re.LO,testRunnerState:Re.LO,setCodeFixSuggestion:Re.aD,setReferenceUsageResult:Re.aD,setOpenFileSearchCommand:Re.aD,setActivePanelMode:Re.aD,setActiveActivity:Re.aD,setTestRunnerState:Re.aD,pullInitializationActivity:Re.aD,pullExecutionStatus:Re.aD,initialize:Re.ls,checkIfSessionWakingUp:Re.ls,loadDiagram:Re.ls,loadFile:Re.ls,execute:Re.ls,executeGo:Re.ls,manageExecuteGoResult:Re.ls,executeTests:Re.ls,executeFullTestSuite:Re.ls,executeNavigation:Re.ls,navigateBack:Re.ls,fullReCompile:Re.ls,command:Re.ls,findUsagesFromCoordinate:Re.ls,findUsages:Re.ls,renameConcept:Re.ls,movePackageableElements:Re.ls,updateFileUsingSuggestionCandidate:Re.ls,updateFile:Re.ls,searchFile:Re.ls,createNewDirectory:Re.ls,createNewFile:Re.ls,renameFile:Re.ls,deleteDirectoryOrFile:Re.ls}),this.applicationStore=e,this.textSearchState=new nE(this),this.directoryTreeState=new nm(this),this.conceptTreeState=new rm(this),this.client=new Gm(new ue({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl})),(t=this).applicationStore.terminalService.terminal.setup({webLinkProvider:{handler:(e,s)=>{const i=s.match(Jg);i?.groups?.url?t.applicationStore.navigationService.navigator.visitAddress(i.groups.url):i?.groups?.path&&i.groups.path_sourceId&&i.groups.path_column&&i.groups.path_line&&(0,Re.fl)(t.loadFile(i.groups.path_sourceId,new Lp(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:Jg},commands:[{command:Wp.GO,description:"Run the go() function in welcome file",usage:"go",aliases:["compile","executeGo"],handler:async e=>(0,Re.fl)(t.executeGo()).catch(t.applicationStore.alertUnhandledError)},{command:Wp.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=A(e);!s||s.match(Zg)?await(0,Re.fl)(t.executeTests(s??_p)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:Wp.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=A(e);s?.match(qg)?await(0,Re.fl)(t.deleteDirectoryOrFile(s,void 0,void 0)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("rm command requires a valid file/directory path")}},{command:Wp.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(qg))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(qg)?await(0,Re.fl)(t.renameFile(s,i)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid new file path")}},{command:Wp.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(qg)?await(0,Re.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:Wp.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(qg)?await(0,Re.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:Wp.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,Re.fl)(t.loadFile(pp)).catch(t.applicationStore.alertUnhandledError)}},{command:Wp.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(Zg)?await(0,Re.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:Wp.OPEN_DIRECTORY,description:"Open a directory or a package",usage:"cd /some/directory/path | cd some::package::path",handler:async e=>{const s=e[0];if(s&&(s.match(qg)||s.match(Zg)))try{s.match(Zg)?await(0,Re.fl)(t.conceptTreeState.revealConcept(s,{forceOpenExplorerPanel:!0,packageOnly:!0})):await(0,Re.fl)(t.directoryTreeState.revealPath(s,{forceOpenExplorerPanel:!0,directoryOnly:!0}))}catch(e){M(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or concept path")}},{command:Wp.LIST_DIRECTORY,description:"List children of a directory or package",usage:"cd /some/directory/path | cd some::package::path | cd ::",handler:async e=>{const s=e[0];if(s&&(s.match(qg)||s.match(Zg)||[mp,_p].includes(s)))try{s.match(Zg)||s===_p?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,_e.vB)(yp,e))).map((e=>e.li_attr instanceof Ap?`${et.BRIGHT_CYAN}${e.text}${et.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,_e.vB)(tm,e))).map((e=>e.isFolderNode?`${et.BRIGHT_CYAN}${e.text}${et.RESET}`:e.text)).join("\n"))}catch(e){M(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or package path")}},{command:Wp.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:Wp.ECHO,description:"Print text",usage:"echo 'some string'",handler:async(e,s,i)=>{const n=i.substring(i.indexOf(s)+s.length).trim();t.applicationStore.terminalService.terminal.output(n.replaceAll(/\\u001b/g,""))}},{command:Wp.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:Wp.HELP,description:"Show help",usage:"help",handler:async e=>(t.applicationStore.terminalService.terminal.showHelp(),Promise.resolve())}]})}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setActivePanelMode(e){this.activePanelMode=e}setCodeFixSuggestion(e){this.codeFixSuggestion=e}setReferenceUsageResult(e){this.referenceUsageResult=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.alertService.setBlockingAlert(void 0),this.applicationStore.alertService.setActionAlertInfo(void 0),this.applicationStore.terminalService.terminal.dispose()}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{this.applicationStore.alertService.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0});const s=this.client.initialize(!e).catch((e=>{M(e),this.applicationStore.notificationService.notifyError(e),this.initState.fail(),this.applicationStore.alertService.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Before debugging, make sure the server is running then restart the application"})}));yield this.pullInitializationActivity(),this.applicationStore.alertService.setBlockingAlert(void 0);const i=(0,Re.fl)(this.loadFile(pp)),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,_e.vB)(cm,n):(0,_e.vB)(lm,n):(0,_e.vB)(om,n);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open()),o instanceof lm?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof cm&&(yield(0,Re.fl)(this.loadFile(o.source,new Pp(o.source,o.line,o.column,new Xg((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r])),this.initState.pass()}catch(e){M(e),this.applicationStore.notificationService.notifyError(e),this.initState.fail(),this.applicationStore.alertService.setActionAlertInfo({message:"Failed to initialize IDE",prompt:"This can either due to an internal server error, which you would need to manually resolve; or a compilation, which you can proceed to debug",type:Dt.CAUTION,actions:[{label:"Compile to debug",type:Mt.PROCEED_WITH_CAUTION,default:!0,handler:()=>{(0,Re.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}]})}finally{this.applicationStore.terminalService.terminal.clear()}var n}else this.applicationStore.notificationService.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.alertService.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandService.registerCommand({key:Vp.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Vp.SEARCH_TEXT,action:()=>{this.setActivePanelMode(Ep.SEARCH),this.panelGroupDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Vp.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof Zp&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Vp.TOGGLE_TERMINAL_PANEL,action:()=>{this.panelGroupDisplayState.isOpen?this.activePanelMode!==Ep.TERMINAL?(this.setActivePanelMode(Ep.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.panelGroupDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Vp.EXECUTE,action:()=>{(0,Re.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.FULL_RECOMPILE,action:()=>{(0,Re.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,Re.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.RUN_ALL_TESTS,action:()=>{(0,Re.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Vp.RUN_RELAVANT_TESTS,action:()=>{(0,Re.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Vp.SEARCH_FILE,Vp.SEARCH_TEXT,Vp.GO_TO_FILE,Vp.TOGGLE_TERMINAL_PANEL,Vp.EXECUTE,Vp.FULL_RECOMPILE,Vp.FULL_RECOMPILE_WITH_FULL_INIT,Vp.RUN_ALL_TESTS,Vp.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandService.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof Wg&&e.diagramPath===t));n||(yield(0,Re.fl)(this.checkIfSessionWakingUp()),n=new Wg(this,(0,_e.vB)(tg,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){try{let s=this.tabManagerState.tabs.find((t=>t instanceof Zp&&t.filePath===e));s||(yield(0,Re.fl)(this.checkIfSessionWakingUp()),s=new Zp(this,(0,_e.vB)(wp,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Pp&&s.showError(t))}catch(t){M(t),this.applicationStore.terminalService.terminal.fail(t.message,{systemCommand:`load file ${e}`})}}async reloadFile(e){const t=[];await Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof Zp&&s.filePath===e)s.setFile((0,_e.vB)(wp,await this.client.getFile(e)));else if(s instanceof Wg&&s.filePath===e)try{s.rebuild((0,_e.vB)(tg,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n,a){if(!this.initState.hasCompleted)return void this.applicationStore.notificationService.notifyWarning("Can't execute while initializing application");if(this.executionState.isInProgress)return void this.applicationStore.notificationService.notifyWarning("Another execution is already in progress!");this.setCodeFixSuggestion(void 0),this.executionState.inProgress();const r=this.tabManagerState.tabs.filter(V(Zp)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof Zp?{path:e.filePath,code:e.file.content}:e instanceof Wg?{diagram:e.diagramPath,code:ig(e.diagram)}:void 0)).filter(j),c=this.client.execute(l,e,t),d=1e3;let h,u=!1;yield Promise.all([c.then((e=>{u=!0,h=e})),new Promise(((e,t)=>setTimeout((()=>{!u&&s&&(this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus().finally((()=>{this.applicationStore.alertService.setBlockingAlert(void 0)})))),e()}),d,!0)))]);const p=(o=G(h)).error?o.candidateName&&o.PureUnmatchedFunctionException?(0,_e.vB)(Em,o):o.candidateName&&o.candidates?(0,_e.vB)(fm,o):(0,_e.vB)(um,o):o.jumpTo?(0,_e.vB)(mm,o):o.tests?(0,_e.vB)(Sm,o):(0,_e.vB)(hm,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof um?(this.applicationStore.notificationService.notifyError("Execution failed"+(p.text?`: ${p.text}`:"")),this.applicationStore.terminalService.terminal.fail(p.text,{systemCommand:n??"execute"}),p.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:p.sessionError}):yield(0,Re.fl)(i(p,r))):(a?.silentTerminalOnSuccess||this.applicationStore.terminalService.terminal.output(p.text??"",{clear:a?.clearTerminal,systemCommand:n??"execute"}),p instanceof hm?(this.applicationStore.notificationService.notifySuccess("Execution succeeded!"),p.reinit?(this.applicationStore.alertService.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,Re.fl)(this.initialize(!1,(()=>(0,Re.fl)(this.execute(e,t,s,i,n))),this.client.mode,this.client.compilerMode))):yield(0,Re.fl)(i(p,r))):yield(0,Re.fl)(i(p,r)))}catch(e){M(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:n??"execute"})}finally{this.applicationStore.alertService.setBlockingAlert(void 0),this.executionState.reset()}var o}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,Re.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,Re.fl)(this.manageExecuteGoResult(e,t))),Wp.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(V(Zp)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof um)e.source&&(yield(0,Re.fl)(this.loadFile(e.source,new Pp(e.source,e.line,e.column,new Xg(e.text.split("\n").filter(Boolean)[0]))))),e instanceof Em?(this.setCodeFixSuggestion(new eE(this,e)),this.setActivePanelMode(Ep.CODE_FIX_SUGGESTION),this.panelGroupDisplayState.open()):e instanceof fm&&(this.setCodeFixSuggestion(new tE(this,e)),this.setActivePanelMode(Ep.CODE_FIX_SUGGESTION),this.panelGroupDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof hm){if(e.modifiedFiles.length)for(const t of e.modifiedFiles)yield this.reloadFile(t);this.resetChangeDetection(t.concat(e.modifiedFiles)),!this.initState.hasFailed&&this.conceptTreeState.treeData||(yield(0,Re.fl)(this.conceptTreeState.initialize()),this.initState.pass())}yield s}*executeTests(e,t){t?this.applicationStore.notificationService.notifyUnsupportedFeature("Run relevant tests! (reason: VCS required)"):this.testRunState.isInProgress?this.applicationStore.notificationService.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,Re.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof um)e.source&&await(0,Re.fl)(this.loadFile(e.source,new Pp(e.source,e.line,e.column,new Xg(e.text.split("\n").filter(Boolean)[0])))),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open(),this.testRunState.fail();else if(e instanceof Sm){this.setActivePanelMode(Ep.TEST_RUNNER),this.panelGroupDisplayState.open();const t=new km(this,e);this.setTestRunnerState(t),await(0,Re.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,Re.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}),`${Wp.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,Re.fl)(this.executeTests(_p,e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,Re.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof mm&&await(0,Re.fl)(this.loadFile(e.jumpTo.source,new Lp(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column))),this.resetChangeDetection(t)}),"navigate",{silentTerminalOnSuccess:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,Re.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notificationService.notifyWarning("Can't navigate back any further - navigation stack is empty")}*fullReCompile(e){this.applicationStore.alertService.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:Dt.CAUTION,actions:[{label:"Perform full re-compile",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{(0,Re.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,Re.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(gp.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(V(Zp)).filter((t=>e.includes(t.filePath))).forEach((e=>e.resetChangeDetection()))}async refreshTrees(){await Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){let t;try{t=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notificationService.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}if(t.path){this.applicationStore.alertService.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==gp.CONCEPT_EXPLORER&&this.setActiveActivity(gp.CONCEPT_EXPLORER);const e=t.path.split(oa);let s=G(e[0]),i=G(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${oa}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,Re.fl)(this.conceptTreeState.expandNode(i)),i=G(this.conceptTreeState.getTreeData().nodes.get(s));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notificationService.notifyWarning("Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept")}finally{this.applicationStore.alertService.setBlockingAlert(void 0)}}}*command(e,t){try{const i=(s=yield e()).error?(0,_e.vB)(Um,s):new jm;return!(i instanceof Um&&(i.errorDialog?this.applicationStore.notificationService.notifyWarning(`Can't run command '${t}': ${i.text}`):this.applicationStore.terminalService.terminal.output(i.text,{systemCommand:t}),1))}catch(e){return M(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:t}),!1}var s}async getConceptInfo(e){try{return await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notificationService.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,_e.vB)(Mp,e)))}*findUsagesFromCoordinate(e){const t=yield this.getConceptInfo(e);t&&(yield(0,Re.fl)(this.findUsages(t)))}*findUsages(e){try{this.referenceUsageLoadState.inProgress(),this.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Dp(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===Np.ENUM_VALUE?bp.ENUM:e.pureType===Np.PROPERTY||e.pureType===Np.QUALIFIED_PROPERTY?bp.PROPERTY:bp.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,_e.qC)(vm,new vm(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,_e.vB)(vm,e)));this.setReferenceUsageResult(new sE(this,e,t,s)),this.setActivePanelMode(Ep.REFERENCES),this.panelGroupDisplayState.open()}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}finally{this.applicationStore.alertService.setBlockingAlert(void 0),this.referenceUsageLoadState.complete()}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){M(t),this.applicationStore.notificationService.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Ne.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(e){M(e),this.applicationStore.notificationService.notifyError(`Can't move packageable elements:\n${e.message}`)}}*updateFileUsingSuggestionCandidate(e){this.setCodeFixSuggestion(void 0),yield(0,Re.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActivePanelMode(Ep.TERMINAL),this.panelGroupDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield this.reloadFile(e);this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){M(t),this.applicationStore.notificationService.notifyError(`Can't update file '${e}'`)}}*searchFile(){this.fileSearchCommandLoadState.isInProgress||(this.fileSearchCommandLoadState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadState.pass())}*createNewDirectory(e){try{yield(0,Re.fl)(this.command((()=>this.client.createFolder(Rp(e))),Wp.NEW_DIRECTORY)),yield(0,Re.fl)(this.directoryTreeState.refreshTreeData())}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*createNewFile(e){try{const t=yield(0,Re.fl)(this.command((()=>this.client.createFile(Rp(e))),Wp.NEW_FILE));yield(0,Re.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,Re.fl)(this.loadFile(e)))}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*renameFile(e,t){try{yield(0,Re.fl)(this.command((()=>this.client.renameFile(e,t)),Wp.MOVE)),yield(0,Re.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof Zp&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){M(e),this.applicationStore.notificationService.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,Re.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Rp(e))),Wp.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof Zp&&(void 0===t||t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,Re.fl)(this.directoryTreeState.refreshTreeData())};void 0===t||void 0===s?i().catch(this.applicationStore.alertUnhandledError):this.applicationStore.alertService.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:Dt.CAUTION,actions:[{label:"Delete anyway",type:Mt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Mt.PROCEED,default:!0}]})}}const rE=(0,kt.createContext)(void 0),oE=({children:e})=>{const t=Ut(),s=(0,Nt.fv)((()=>new aE(t)));return(0,T.jsx)(rE.Provider,{value:s,children:e})},lE=()=>G((0,kt.useContext)(rE),"Can't find editor store in context"),cE=(0,Nt.Pi)((()=>{const e=lE(),t=Ut().terminalService.terminal,s=(0,kt.useRef)(null),{ref:i,width:n,height:a}=(0,Hi.NB)();(0,kt.useEffect)((()=>(s.current&&t.searchConfig.setSearchInput(s.current),()=>t.searchConfig.setSearchInput(void 0))),[t]),(0,kt.useEffect)((()=>{i.current&&t.mount(i.current)}),[t,i]),(0,kt.useEffect)((()=>{e.panelGroupDisplayState.isOpen&&e.activePanelMode===Ep.TERMINAL&&t.focus()}),[t,e.panelGroupDisplayState.isOpen,e.activePanelMode]),(0,kt.useEffect)((()=>{t.autoResize()}),[t,n,a]);const r=()=>{t.clear(),t.focus()},o=()=>t.copyAll();return t.isSetup?(0,T.jsxs)("div",{className:"terminal-panel",children:[(0,T.jsxs)("div",{className:"terminal-panel__header",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__group",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__container",children:[(0,T.jsx)("input",{ref:s,className:"terminal-panel__header__searcher__input input--dark",spellCheck:!1,value:t.searchConfig.searchText,onChange:e=>{const s=e.target.value;t.setSearchText(s),t.search(s)},onKeyDown:e=>{"Enter"===e.code?e.shiftKey?t.findPrevious():t.findNext():"Escape"===e.code&&(t.clearSearch(),t.focus())},placeholder:"Find"}),(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__actions",children:[(0,T.jsx)("button",{className:"terminal-panel__header__searcher__input__action",tabIndex:-1,title:"Clear Search",onClick:()=>t.clearSearch(),children:(0,T.jsx)(Ys,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.matchCaseSensitive}),tabIndex:-1,title:"Match Case",onClick:()=>t.setSearchCaseSensitive(!t.searchConfig.matchCaseSensitive),children:(0,T.jsx)(Ks,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.matchWholeWord}),tabIndex:-1,title:"Match Whole Word",onClick:()=>t.setSearchWholeWord(!t.searchConfig.matchWholeWord),children:(0,T.jsx)(Xs,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__searcher__input__action",{"terminal-panel__header__searcher__input__action--active":t.searchConfig.useRegex}),tabIndex:-1,title:"Use Regular Expression",onClick:()=>t.setSearchRegex(!t.searchConfig.useRegex),children:(0,T.jsx)(Ws,{})})]})]}),(0,T.jsx)("div",{className:"terminal-panel__header__searcher__result",children:t.searchConfig.resultCount?`${void 0!==t.searchConfig.currentResultIndex?t.searchConfig.currentResultIndex+1:0} of ${t.searchConfig.resultCount}`:"No results"}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Previous Match (Shift+Enter)",disabled:!t.searchConfig.resultCount,tabIndex:-1,onClick:()=>{t.findPrevious()},children:(0,T.jsx)(xs,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Next Match (Enter)",disabled:!t.searchConfig.resultCount,tabIndex:-1,onClick:()=>{t.findNext()},children:(0,T.jsx)(Ss,{className:"terminal-panel__header__action__icon"})})]}),(0,T.jsx)("div",{className:"terminal-panel__header__group__separator"}),(0,T.jsxs)("div",{className:"terminal-panel__header__group",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("terminal-panel__header__action terminal-panel__header__group__action",{"terminal-panel__header__action--active":t.preserveLog}),title:"Toggle Preserve Console",tabIndex:-1,onClick:()=>t.setPreserveLog(!t.preserveLog),children:(0,T.jsx)(Kt,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Copy Text Content",tabIndex:-1,onClick:o,children:(0,T.jsx)(ys,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Clear Console",tabIndex:-1,onClick:r,children:(0,T.jsx)(ms,{className:"terminal-panel__header__action__icon"})}),(0,T.jsx)("button",{className:"terminal-panel__header__action terminal-panel__header__group__action",title:"Show Help",tabIndex:-1,onClick:()=>{t.showHelp(),t.focus()},children:(0,T.jsx)(ns,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(ji,{className:"terminal-panel__content",content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Gi,{onClick:o,children:"Copy All"}),(0,T.jsx)(Gi,{onClick:r,children:"Clear"})]}),menuProps:{elevation:7},children:(0,T.jsx)("div",{ref:i,className:"terminal-panel__container"})})]}):(0,T.jsx)("div",{className:"terminal-panel",children:(0,T.jsx)(Yi,{children:"Terminal is not set up yet"})})})),dE=(0,Nt.Pi)((e=>{const{searchResult:t,result:s}=e,i=lE(),n=Ut(),a=e=>()=>(0,Re.fl)(i.loadFile(s.sourceId,new Lp(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"text-search-panel__entry",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(Rs,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:Rp(s.sourceId)})]}),(0,T.jsxs)("div",{className:"text-search-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__header__action text-search-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"text-search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"text-search-panel__entry__header__action text-search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(qt,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"text-search-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label text-search-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text text-search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"text-search-panel__entry__content__item__action text-search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(qt,{})})})]},e.uuid)))})]})})),hE=(0,Nt.Pi)((e=>{const{searchResult:t}=e,s=lE(),i=Ut(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"text-search-panel__content",children:[(0,T.jsxs)("div",{className:"text-search-panel__content__header",children:[(0,T.jsx)("div",{className:"text-search-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} result(s) in ${t.numberOfFiles} files`:"No result"}),(0,T.jsxs)("div",{className:"text-search-panel__content__header__actions",children:[(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Refresh",onClick:()=>{(0,Re.fl)(s.textSearchState.search()).catch(i.alertUnhandledError)},children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>{s.textSearchState.setText(""),s.textSearchState.setResult(void 0)},children:(0,T.jsx)(Ys,{})}),!n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(Js,{})}),n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(Qs,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(dE,{searchResult:t,result:e},e.uuid)))})]})})),uE=(0,Nt.Pi)((()=>{const e=lE(),t=(0,kt.useRef)(null),s=e.textSearchState,i=(0,kt.useMemo)((()=>(0,tn.Z)((()=>s.search()),300)),[s]);return(0,kt.useEffect)((()=>(t.current&&s.setSearchInput(t.current),()=>s.setSearchInput(void 0))),[s]),(0,kt.useEffect)((()=>{e.panelGroupDisplayState.isOpen&&e.activePanelMode===Ep.SEARCH&&s.focus()}),[s,e.panelGroupDisplayState.isOpen,e.activePanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(zt,{isLoading:e.textSearchState.loadState.isInProgress}),(0,T.jsx)("div",{className:"text-search-panel__header",children:(0,T.jsxs)("div",{className:"text-search-panel__searcher__input__container",children:[(0,T.jsx)("input",{ref:t,autoFocus:!0,className:"text-search-panel__searcher__input input--dark",onChange:e=>{const t=e.target.value;s.setText(t),i.cancel(),t?i():s.setResult(void 0)},onKeyDown:e=>{"Enter"===e.code?(i.cancel(),s.text&&i()):"Escape"===e.code&&t.current?.select()},value:s.text,placeholder:"Search"}),(0,T.jsxs)("div",{className:"text-search-panel__searcher__input__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("text-search-panel__searcher__input__action",{"text-search-panel__searcher__input__action--active":s.isCaseSensitive}),tabIndex:-1,title:"Match Case",onClick:()=>s.setCaseSensitive(!s.isCaseSensitive),children:(0,T.jsx)(Ks,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("text-search-panel__searcher__input__action",{"text-search-panel__searcher__input__action--active":s.isRegExp}),tabIndex:-1,title:"Use Regular Expression",onClick:()=>s.setRegExp(!s.isRegExp),children:(0,T.jsx)(Ws,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(hE,{searchResult:e.textSearchState.result})]})})),pE=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}))}),(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},mE=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:mE,TreeNodeContainer:pE},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},_E=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(j),d={TreeNodeView:mE,TreeNodeContainer:pE},h=n?{...d,...n}:d;return(0,T.jsx)("div",{className:(0,Ot.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,T.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var gE=s(410);const EE=gE.gs,fE="resizable-panel--collapsed",TE=(e,t)=>({collapsiblePanel:{className:(0,Ot.clsx)(...t?.classes??[],{[fE]:e}),onStartResize:e=>{e.domElement.classList.remove(fE),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),CE=gE.jW,SE=gE.nN,xE=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var NE=s(48845);const vE=(0,Nt.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=lE(),u=Ut(),p=r.testResultInfo,m=!t.data.type,_=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?ym.PASSED:t.failedTests.has(e)?ym.FAILED:t.testsWithError.has(e)?ym.ERROR:ym.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?ym.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?ym.RUNNING:ym.PASSED})(t,p):void 0){case ym.PASSED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,T.jsx)(_s,{})});break;case ym.FAILED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,T.jsx)(Is,{})});break;case ym.ERROR:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,T.jsx)(Jt,{})});break;case ym.RUNNING:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,T.jsx)(fs,{})});break;default:g=(0,T.jsx)(ns,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":_}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),m?E():o(t)},onDoubleClick:()=>{m?E():(0,Re.fl)(h.loadFile(t.data.li_attr.file,new Lp(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:e=>{e.stopPropagation(),E()},children:m?t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),AE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(oa),(0,T.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,T.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,T.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,T.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(j).map((e=>(0,T.jsx)(vE,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),IE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,T.jsxs)("div",{className:"explorer__content",children:[i&&(0,T.jsx)(Yi,{children:"No tests found"}),!i&&(0,T.jsx)(_E,{components:{TreeNodeContainer:vE},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(j),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),OE=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,yE=e=>{const{wrapText:t,result:s}=e,i=lE(),n=Ut(),[a,r]=(0,kt.useState)(),o=(0,kt.useRef)(void 0),l=(0,kt.useRef)(null),{ref:c,width:d,height:h}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,kt.useEffect)((()=>{if(!a&&l.current){const e=l.current,t=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,fontSize:12,extraEditorClassName:"monaco-editor--small-font",readOnly:!0,glyphMargin:!1,folding:!1,lineNumbers:"off",lineDecorationsWidth:10,lineNumbersMinChars:0,minimap:{enabled:!1},guides:{bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveBracketPair:!1,indentation:!1,highlightActiveIndentation:!1},renderLineHighlight:"none",theme:fp.LEGEND,language:Tp.TEXT});r(t)}}),[n,a]),o.current?.dispose(),o.current=Cp.languages.registerLinkProvider(Tp.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(OE)).forEach((e=>{void 0!==e.index&&e.groups?.path&&e.groups.path_sourceId&&e.groups.path_column&&e.groups.path_line&&t.push({range:{startLineNumber:s,startColumn:e.index+1,endLineNumber:s,endColumn:e.index+1+e.groups.path.length},tooltip:"Click to go to location",sourceId:e.groups.path_sourceId,line:e.groups.path_line,column:e.groups.path_column})}));return{links:t}},resolveLink:e=>{const t=e;(0,Re.fl)(i.loadFile(t.sourceId,new Lp(t.sourceId,Number.parseInt(t.line,10),Number.parseInt(t.column,10)))).catch(i.applicationStore.alertUnhandledError)}}),(0,kt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,kt.useEffect)((()=>{if(a){const e=s instanceof wm?"Test passed!":s instanceof Pm?s.error.text:"Running...";a.setValue(e),(s instanceof wm||s instanceof Pm)&&a.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof wm?"test-runner-panel__result__content--success":"test-runner-panel__result__content--failure"}}])}}),[a,s]),(0,kt.useEffect)((()=>{a&&a.updateOptions({wordWrap:t?"on":"off"})}),[a,t]),(0,kt.useEffect)((()=>()=>{a&&(e=>{e.dispose(),e.getModel()?.dispose()})(a),o.current?.dispose()}),[a]),(0,T.jsx)("div",{ref:c,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:l})})},RE=(0,Nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=lE(),a=Ut(),[r,o]=(0,kt.useState)(!1),l=i.results.get(s),c=G(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__label",children:c.text})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"test-runner-panel__result__header__icon--text-wrap"})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,Re.fl)(n.loadFile(c.li_attr.file,new Lp(c.li_attr.file,Number.parseInt(c.li_attr.line,10),Number.parseInt(c.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,T.jsx)(Hs,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(yE,{result:l,wrapText:r})})]})})),wE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=lE(),i=Ut(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Om.NONE,o=a?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(EE,{orientation:"vertical",children:[(0,T.jsx)(CE,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(zt,{isLoading:t.treeBuildingState.isInProgress}),(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,T.jsx)(_s,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,T.jsx)(Is,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,T.jsx)(Jt,{})]})]}),a&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,T.jsx)(Gs,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(Vs,{className:"test-runner-panel__icon--list-view"})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,T.jsx)(Ts,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(rs,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,Re.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(Os,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(ls,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(t.cancelTestRun()).catch(i.alertUnhandledError).finally((()=>{s.setTestRunnerState(void 0)}))},title:"Reset",children:(0,T.jsx)(qt,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(NE.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,T.jsx)("div",{className:"panel__content",children:t.treeData&&(0,T.jsxs)(T.Fragment,{children:[!t.viewAsList&&(0,T.jsx)(IE,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(AE,{testRunnerState:t})]})})]})}),(0,T.jsx)(SE,{children:(0,T.jsx)(xE,{color:s.panelGroupDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(CE,{minSize:400,children:[t.selectedTestId&&!a&&(0,T.jsx)("div",{}),t.selectedTestId&&a&&(0,T.jsx)(RE,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsx)("div",{className:"panel__header"}),(0,T.jsx)("div",{className:"panel__content",children:(0,T.jsx)(Yi,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),LE=(0,Nt.Pi)((()=>{const e=lE().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Yi,{children:(0,T.jsx)("div",{className:"panel-group__splash-screen",children:(0,T.jsxs)("div",{className:"panel-group__splash-screen__content",children:[(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Run full test suite"}),(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(wE,{testRunnerState:e})]})})),PE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=lE(),i=Ut(),n=()=>{(0,Re.fl)(s.loadFile(t.sourceID,new Lp(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-location",children:`${Rp(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"suggestions-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,T.jsx)(cs,{})})})]})})),bE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=lE(),i=Ut();return(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,Re.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-location",children:`${Rp(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"suggestions-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,Re.fl)(s.loadFile(t.sourceID,new Lp(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(cs,{})})})]})})),DE=(0,Nt.Pi)((e=>{const{suggestionState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"suggestions-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,T.jsx)(PE,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,T.jsx)(bE,{candidate:e},e.uuid)))})]})]})})),ME=(0,Nt.Pi)((e=>{const{suggestionState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"suggestions-panel__content",children:[!s.candidates.length&&(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"suggestions-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"suggestions-panel__entry",children:s.candidates.map((e=>(0,T.jsx)(bE,{candidate:e},e.uuid)))})]})]})})),FE=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof eE&&(0,T.jsx)(DE,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof tE&&(0,T.jsx)(ME,{suggestionState:e.codeFixSuggestion})]})})),kE=(0,Nt.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=lE(),n=Ut(),a=e=>()=>(0,Re.fl)(i.loadFile(s.sourceId,new Lp(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"references-panel__entry",children:[(0,T.jsxs)("div",{className:"references-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"references-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"references-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(Rs,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:Rp(s.sourceId)})]}),(0,T.jsxs)("div",{className:"references-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"references-panel__entry__header__action references-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"references-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"references-panel__entry__header__action references-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(qt,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"references-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"references-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label references-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"references-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text references-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"references-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"references-panel__entry__content__item__action references-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(qt,{})})})]},e.uuid)))})]})})),jE=(0,Nt.Pi)((e=>{const{referenceUsageState:t}=e,s=lE(),i=Ut(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"references-panel__content",children:[(0,T.jsxs)("div",{className:"references-panel__content__header",children:[(0,T.jsx)("div",{className:"references-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Dp(t.usageConcept)}`:`No usages found for ${Dp(t.usageConcept)}`}),(0,T.jsxs)("div",{className:"references-panel__content__header__actions",children:[(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Refresh",onClick:()=>{(0,Re.fl)(s.findUsages(t.usageConcept)).catch(i.alertUnhandledError)},children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(Ys,{})}),!n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(Js,{})}),n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(Qs,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(kE,{referenceUsageResult:t,result:e},e.uuid)))})]})})),UE=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(zt,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Yi,{children:(0,T.jsx)("div",{className:"panel-group__splash-screen",children:(0,T.jsx)("div",{className:"panel-group__splash-screen__content",children:(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"panel-group__splash-screen__content__item__label",children:"Find Concept References"}),(0,T.jsxs)("div",{className:"panel-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Alt"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)(jE,{referenceUsageState:e.referenceUsageResult})]})})),GE=(0,Nt.Pi)((()=>{const e=lE(),t={[Ep.TERMINAL]:{mode:Ep.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(Ns,{className:"panel-group__header__tab__icon--terminal"}),isVisible:!0},[Ep.SEARCH]:{mode:Ep.SEARCH,name:"SEARCH",icon:(0,T.jsx)(hs,{className:"panel-group__header__tab__icon--search"}),isVisible:!0},[Ep.TEST_RUNNER]:{mode:Ep.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(ri,{className:"panel-group__header__tab__icon--test"}),isVisible:!0},[Ep.REFERENCES]:{mode:Ep.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(Zs,{className:"panel-group__header__tab__icon--references"}),isVisible:!0},[Ep.CODE_FIX_SUGGESTION]:{mode:Ep.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(qs,{className:"panel-group__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Ep).filter((e=>j(t[e])&&t[e].isVisible)),i=t=>e.activePanelMode===t&&s.includes(t);return(0,kt.useEffect)((()=>{s.includes(e.activePanelMode)||e.setActivePanelMode(Ep.TERMINAL)}),[e,s,e.activePanelMode]),(0,T.jsxs)("div",{className:"panel panel-group",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel-group__header__tabs",children:s.map((e=>t[e])).filter(j).map((t=>{return(0,T.jsxs)("button",{tabIndex:-1,className:(0,Ot.clsx)("panel-group__header__tab",{"panel-group__header__tab--active":e.activePanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActivePanelMode(s)),children:[(0,T.jsx)("div",{className:"panel-group__header__tab__icon",children:t.icon}),(0,T.jsx)("div",{className:"panel-group__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,T.jsxs)("div",{className:"panel-group__header__actions",children:[(0,T.jsx)("button",{className:"panel-group__header__action",onClick:()=>e.panelGroupDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.panelGroupDisplayState.isMaximized?(0,T.jsx)(ti,{}):(0,T.jsx)(si,{})}),(0,T.jsx)("button",{className:"panel-group__header__action",onClick:()=>e.panelGroupDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(ni,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Ep.TERMINAL)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(cE,{})}),i(Ep.SEARCH)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(uE,{})}),i(Ep.TEST_RUNNER)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(LE,{})}),i(Ep.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(FE,{})}),i(Ep.REFERENCES)&&(0,T.jsx)("div",{className:"panel-group__content__tab",children:(0,T.jsx)(UE,{})})]})]})}));var VE=s(42689);const $E=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(Ci,{})}),BE=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),zE=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),HE=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),YE=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),WE=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),KE=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(Oi,{})}),XE=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(os,{})}),ZE=()=>(0,T.jsx)("div",{children:(0,T.jsx)(is,{})}),qE=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Oi,{})}),JE=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(fi,{})}),QE=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(ds,{})}),ef=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(Ds,{})}),tf=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),sf=e=>{switch(e){case Np.PACKAGE:return(0,T.jsx)($E,{});case Np.PROFILE:return(0,T.jsx)(WE,{});case Np.CLASS:return(0,T.jsx)(BE,{});case Np.ASSOCIATION:return(0,T.jsx)(tf,{});case Np.PROPERTY:case Np.QUALIFIED_PROPERTY:return(0,T.jsx)(JE,{});case Np.ENUMERATION:return(0,T.jsx)(zE,{});case Np.MEASURE:return(0,T.jsx)(HE,{});case Np.UNIT:return(0,T.jsx)(YE,{});case Np.FUNCTION:return(0,T.jsx)(KE,{});case Np.NATIVE_FUNCTION:return(0,T.jsx)(qE,{});case Np.DIAGRAM:return(0,T.jsx)(QE,{});case Np.DATABASE:return(0,T.jsx)(ef,{});case Np.MAPPING:return(0,T.jsx)(XE,{});default:return(0,T.jsx)(ZE,{})}},nf=/^\w[\w$]*$/,af=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,rf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Np.PACKAGE,[r,o]=(0,kt.useState)(a?pu(n):n),l=(0,kt.useRef)(null),c=Boolean(r.match(a?af:nf)),d=(a?pu(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,T.jsx)(It.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,T.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(h),onClick:p,children:"Rename"})]})]})})})),of=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,lf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),n=mu(t.data.li_attr.pureId)??"",[a,r]=(0,kt.useState)(n),o=(0,kt.useRef)(null),l=Boolean(a.match(of)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([B(t.data.li_attr,Op)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Move element"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Move"})]})]})})})),cf=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr,a=n.pureType,r=lE(),o=Ut();return(0,T.jsxs)(Ui,{ref:t,children:[n.pureType!==Np.PROPERTY&&n.pureType!==Np.QUALIFIED_PROPERTY&&(0,T.jsx)(Gi,{onClick:()=>{o.clipboardService.copyTextToClipboard(n.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),a===Np.PACKAGE&&(0,T.jsx)(Gi,{onClick:()=>{(0,Re.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),a===Np.FUNCTION&&(0,T.jsx)(Gi,{onClick:()=>{o.navigationService.navigator.visitAddress(`${r.client.baseUrl}/execute?func=${n.pureId}&mode=${r.client.mode}`)},children:"Service (JSON)"}),(n instanceof Ip||n instanceof Op)&&(0,T.jsx)(Gi,{onClick:()=>{(n instanceof Op||n instanceof Ip)&&r.findUsagesFromCoordinate(new Lp(n.file,Number.parseInt(n.line,10),Number.parseInt(n.column,10)))},children:"Find Usages"}),a!==Np.PACKAGE&&(0,T.jsx)(Gi,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(Vi,{}),(0,T.jsx)(Gi,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),n instanceof Op&&(0,T.jsx)(Gi,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var df;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(df=df||(df={}));const hf=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,kt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof Ip&&t.data.li_attr.classPath!==t.parent.id,p=[Np.PACKAGE,Np.CLASS].includes(t.data.li_attr.pureType),m=t.data.li_attr.pureType===Np.QUALIFIED_PROPERTY?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:pu(B(t.data.li_attr,Ip).classPath)})]}):t.label.includes("(")?(0,T.jsxs)(T.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,_=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,VE.c)((()=>({type:"Class"===t.data.li_attr.pureType?df.CLASS:df.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(ji,{content:(0,T.jsx)(cf,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&_(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(fs,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:_,children:p?t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,Ot.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:sf(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:m})]})})},uf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(_E,{components:{TreeNodeContainer:hf},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(j),innerProps:{onNodeOpen:e=>{(0,Re.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,Re.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:s=>{const i=s.data.li_attr;(i instanceof Op||i instanceof Ip)&&(0,Re.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Lp(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(rf,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(lf,{node:s.nodeForMoveElement})]})})),pf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.conceptTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,Re.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(rs,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(zt,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(uf,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Yi,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),mf=/^\w+(?:\.\w+)*$/,_f=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)("untitled.pure"),r=(0,kt.useRef)(null),o=Boolean(n.match(mf)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,Re.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),gf=/^\w+$/,Ef=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)("untitled"),r=(0,kt.useRef)(null),o=Boolean(n.match(gf)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,Re.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),ff=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Tf=(0,Nt.Pi)((e=>{const{node:t}=e,s=lE(),i=Ut(),[n,a]=(0,kt.useState)(t.data.li_attr.path),r=(0,kt.useRef)(null),o=Boolean(n.match(ff)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,Re.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,T.jsx)(It.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Rename"})]})]})})})),Cf=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{node:s}=e,i=Ut(),n=lE(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(Ui,{ref:t,children:[(0,T.jsx)(Gi,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(Vi,{}),a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,T.jsx)(Gi,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Gi,{disabled:Boolean(s.data instanceof tm&&s.data.children),onClick:()=>{(0,Re.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),Sf=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,kt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof tm&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,m=t.data instanceof tm&&!t.data.children,_=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(Cs,{className:"explorer__icon--readonly"}):p?m?(0,T.jsx)(As,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(vs,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(As,{className:(0,Ot.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Rs,{className:(0,Ot.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{m||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(ji,{content:(0,T.jsx)(Cf,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(p?g():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(fs,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||m?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(ti,{}):(0,T.jsx)(ii,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},xf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(_E,{components:{TreeNodeContainer:Sf},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(j),innerProps:{onNodeOpen:e=>{(0,Re.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,Re.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(_f,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(Ef,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(Tf,{node:s.nodeForRenameFile})]})})),Nf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.directoryTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,Re.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Us,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof Zp&&(0,Re.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Xt,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(rs,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(zt,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(xf,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Yi,{children:"Failed to build directory tree"})]})]})})]})})),vf=(0,Nt.Pi)((()=>{const e=lE();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,Ot.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case gp.CONCEPT_EXPLORER:return(0,T.jsx)(pf,{});case gp.FILE_EXPLORER:return(0,T.jsx)(Nf,{});default:return null}})()},e.activeActivity)})})),Af=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,Ot.clsx)("logo",t),children:(0,T.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},If=(0,Nt.Pi)((()=>{const e=lE(),t=t=>()=>e.setActiveActivity(t),s=[{mode:gp.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(us,{})},{mode:gp.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(Rs,{})}].filter((e=>Boolean(e)));return(0,T.jsxs)("div",{className:"activity-bar",children:[(0,T.jsx)("div",{className:"activity-bar__logo",children:(0,T.jsx)(Af,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,Ot.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),Of=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,s=t.textEditorState.cursorObserver,i=s?.selection?t.textEditorState.model.getValueInRange(s.selection).length:0;return(0,T.jsx)("div",{className:"file-editor__status-bar",children:s?.position&&(0,T.jsx)("button",{className:"editor__status-bar__action file-editor__status-bar__cursor-info",onClick:()=>t.setShowGoToLinePrompt(!0),tabIndex:-1,title:"Go to Line/Column",children:`Ln ${s.position.lineNumber}, Col ${s.position.column} ${i?` (${i} selected)`:""}`})})})),yf=(0,Nt.Pi)((()=>{const e=lE(),t=Ut();return(0,T.jsxs)("div",{className:"editor__status-bar",children:[(0,T.jsx)("div",{className:"editor__status-bar__left",children:(0,T.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,T.jsxs)("div",{className:"editor__status-bar__right",children:[e.tabManagerState.currentTab instanceof Zp&&(0,T.jsx)(Of,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":e.executionState.isInProgress}),disabled:e.initState.isInInitialState||e.executionState.isInProgress,onClick:()=>{(0,Re.fl)(e.executeGo()).catch(t.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(ss,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(e.panelGroupDisplayState.isOpen)}),onClick:()=>e.panelGroupDisplayState.toggle(),tabIndex:-1,title:"Toggle panel",children:(0,T.jsx)(Ns,{})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!t.assistantService.isHidden}),onClick:()=>t.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,T.jsx)($s,{})})]})]})})),Rf=e=>{(0,kt.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},wf=/[0-9]+(?::[0-9]+)?/,Lf=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,kt.useState)(""),n=(0,kt.useRef)(null),a=Boolean(s.match(wf)),r=t.textEditorState.editor?.getPosition(),[o,l]=(e=>{const t=e.split(":");return t.length<1||t.length>2?[1,void 0]:[F((()=>parseInt(G(A(t)))))??1,F((()=>parseInt(G(I(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=a?c?void 0:"Invalid line number":"Invalid value (format [line:column] - e.g. 123:45)",h=()=>t.setShowGoToLinePrompt(!1),u=e=>{e.preventDefault(),h(),t.textEditorState.setForcedCursorPosition({lineNumber:o,column:l??1})};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>n.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Go to..."}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:n,className:"input input--dark",onChange:e=>i(e.target.value),placeholder:r?`Current Line: ${r.lineNumber}, Col: ${r.column}. Type a line between 1 and ${t.textEditorState.model.getLineCount()} to navigate to`:void 0,value:s,spellCheck:!1}),""!==s&&d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:""===s||Boolean(d),onClick:u,children:"Go"})]})]})})})),Pf=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=lE(),i=Ut(),n=(0,kt.useRef)(null),[a,r]=(0,kt.useState)(),{ref:o,width:l,height:c}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,theme:fp.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off",readOnly:t.file.RO});s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[s,i,t,a]),Rf(t),(0,kt.useEffect)((()=>{void 0!==l&&void 0!==c&&a?.layout({width:l,height:c})}),[a,l,c]),(0,kt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Sp(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,kt.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose())}),[t,a]),(0,T.jsxs)("div",{className:"panel editor-group file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(Lf,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:o,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:n})})})]})})),bf=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=G(A(e.split(".")));return t.includes(i)};var Df;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.PARAMETER="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Df=Df||(Df={}));const Mf={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Df.IDENTIFIER,foreground:"dcdcaa"},{token:Df.NUMBER,foreground:"b5cea8"},{token:Df.DATE,foreground:"b5cea8"},{token:Df.COLOR,foreground:"b5cea8"},{token:Df.PACKAGE,foreground:"808080"},{token:Df.PARSER,foreground:"c586c0"},{token:Df.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Df.MULTIPLICITY,foreground:"2d796b"},{token:Df.GENERICS,foreground:"2d796b"},{token:Df.PROPERTY,foreground:"9cdcfe"},{token:Df.PARAMETER,foreground:"9cdcfe"},{token:Df.VARIABLE,foreground:"4fc1ff"},{token:Df.TYPE,foreground:"3dc9b0"},{token:`${Df.STRING}.escape`,foreground:"d7ba7d"}]},Ff={wordPattern:/(-?\d*\.\d\w*)|([^`~!@#%^$&*()\-=+[{\]}\\|;:'",.<>/?\s][^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]*)/,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};class kf{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,_e.yu)(kf,{pureType:(0,_e.Ru)(),pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),text:(0,_e.Ru)(),requiredClassProperties:(0,_e.jt)((0,_e.pb)((0,_e.Ru)()))});class jf{pureType;pureName;owner;ownerPureType}(0,_e.yu)(jf,{pureType:(0,_e.Ru)(),pureName:(0,_e.Ru)(),owner:(0,_e.Ru)(),ownerPureType:(0,_e.Ru)()});class Uf{pureId;pureName;requiredClassProperties=[]}(0,_e.yu)(Uf,{pureId:(0,_e.Ru)(),pureName:(0,_e.Ru)(),requiredClassProperties:(0,_e.jt)((0,_e.pb)((0,_e.Ru)()))});class Gf{name}(0,_e.yu)(Gf,{name:(0,_e.Ru)()});const Vf="Diagram",$f="Diagram",Bf=()=>{const e=[];return e.push({label:{label:"/copyright",description:"(copyright header)"},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`// Copyright \${1:${(new Date).getFullYear()}} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n`,range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e},zf=e=>({label:{label:e.pureName,description:e.pureId},kind:Cp.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),Hf=(e,t)=>{const s=e.pureType,i=s===Np.FUNCTION||s===Np.NATIVE_FUNCTION?((e,t,s)=>{const i=pu(t),n=F((()=>i.substring(i.indexOf("_"),i.length-1))),a=n?.split("__")??[];return a.pop(),s&&a.shift(),`${e}(${a.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,n=s===Np.PACKAGE?Cp.languages.CompletionItemKind.Folder:s===Np.CLASS?Cp.languages.CompletionItemKind.Class:s===Np.FUNCTION?Cp.languages.CompletionItemKind.Function:s===Np.ENUMERATION?Cp.languages.CompletionItemKind.Enum:s===Np.PROFILE?Cp.languages.CompletionItemKind.Module:s===Np.ASSOCIATION?Cp.languages.CompletionItemKind.Interface:Cp.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:n,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===Np.PACKAGE?`zzzz_${e.text}`:e.text}},Yf=/(?<incompletePath>(?:\w[\w$]*::)+$)/,Wf=/->\s*(?:\w[\w$]*::)+$/,Kf=/\^\s*(?:\w[\w$]*::)+$/,Xf=/^\s*import\s+(?:(?<importPath>(?:(?:\w[\w$]*)::)*\w[\w$]*)::*)/,Zf=(e,t)=>{const s=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=`${la}${dg.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(la))).lastIndexOf(!0)).map((e=>e.match(Xf)?.groups?.importPath)).filter(j)},qf=/->\s*(?:\w[\w$]*)?$/,Jf=/\^\s*(?:\w[\w$]*)?$/,Qf=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,eT=(e,t)=>({label:e.name,kind:Cp.languages.CompletionItemKind.Variable,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:t?e.name:`zzzz_${e.name}`,insertText:e.name}),tT=/^\w[\w$]*$/,sT=(0,Nt.Pi)((e=>{const{renameConceptState:t}=e,s=Ut(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,kt.useState)(n),o=(0,kt.useRef)(null),l=Boolean(a.match(tT)),c=n===a,d=l?void 0:"Invalid concept name",h=()=>{(0,Re.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(It.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Rename"})]})]})})})),iT=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=(0,kt.useRef)(void 0),i=(0,kt.useRef)(void 0),n=(0,kt.useRef)(void 0),a=(0,kt.useRef)(null),[r,o]=(0,kt.useState)(),[l,c]=(0,kt.useState)(!1),d=lE(),h=Ut(),{ref:u,width:p,height:m}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{if(!r&&a.current){const e=a.current,s=Cp.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,language:Tp.PURE,theme:fp.LEGEND,wordSeparators:"`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",wordWrap:t.textEditorState.wrapText?"on":"off",readOnly:t.file.RO,contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,Re.fl)(d.executeNavigation(new Lp(t.filePath,e.lineNumber,e.column))).catch(h.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>c(!0))),s.addAction({id:Hp.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Lp(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Hp.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Lp(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Hp.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){if(!t.textEditorState.model.getWordAtPosition(s))return;const e=new Lp(t.filePath,s.lineNumber,s.column);(0,Re.fl)(t.setConceptToRenameState(e)).catch(d.applicationStore.alertUnhandledError)}}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),o(s)}}),[d,h,t,r]),s.current?.dispose(),s.current=Cp.languages.registerDefinitionProvider(Tp.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),n=Cp.editor.tokenize(i,Tp.PURE)[0];if(!n)return[];let a,r;for(let e=1;e<=n.length;++e){const t=e===n.length?i.length:G(n[e]).offset;if(t+1>s.column){a=G(n[e-1]),r={startLineNumber:s.lineNumber,startColumn:a.offset+1,endLineNumber:s.lineNumber,endColumn:t+1};break}}return a&&r&&bf(a.type,[Df.TYPE,Df.VARIABLE,Df.PROPERTY,Df.PARAMETER,Df.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:r}]:[]}}),i.current?.dispose(),i.current=Cp.languages.registerCompletionItemProvider(Tp.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let n=[];if(i.triggerKind===Cp.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":n=n.concat(Bf());break;case"#":n=n.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${la}${e.text}`,description:e.description},kind:Cp.languages.CompletionItemKind.Keyword,insertText:`${la}${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:dg.PURE,description:"(core Pure)",insertText:dg.PURE},{text:dg.MAPPING,description:"(dsl)",insertText:dg.MAPPING},{text:dg.CONNECTION,description:"(dsl)",insertText:dg.CONNECTION},{text:dg.RUNTIME,description:"(dsl)",insertText:dg.RUNTIME},{text:dg.RELATIONAL,description:"(external store)",insertText:dg.RELATIONAL},{text:Vf,description:"(dsl)",insertText:$f}]));break;case":":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Yf);if(i?.groups?.incompletePath){const n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Wf)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Kf));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-2),a?[Np.CLASS]:n?[Np.FUNCTION,Np.NATIVE_FUNCTION]:[])).map((e=>(0,_e.vB)(kf,e)))}catch{}return r.map((e=>a?zf(e):Hf(e,{preferArrowFunctionForm:n})))}return[]})(s,e,d));break;case">":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForIdentifier(i,[Np.FUNCTION,Np.NATIVE_FUNCTION])).map((e=>(0,_e.vB)(kf,e)))}catch{}return n.map((e=>Hf(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Qf),n=Zf(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(n,i.groups.owner)).map((e=>(0,_e.vB)(jf,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===Np.PROPERTY||t===Np.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===Np.PROPERTY?Cp.languages.CompletionItemKind.Property:t===Np.QUALIFIED_PROPERTY?Cp.languages.CompletionItemKind.Method:t===Np.TAG?Cp.languages.CompletionItemKind.Constant:t===Np.STEREOTYPE?Cp.languages.CompletionItemKind.Value:t===Np.ENUM_VALUE?Cp.languages.CompletionItemKind.Enum:Cp.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,_e.vB)(Uf,e)))}catch{}return n.map((e=>zf(e)))})(s,e,d));break;case"@":n=n.concat(await(async(e,t,s)=>{const i=Zf(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,_e.vB)(Uf,e)))}catch{}return n.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:Cp.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":n=n.concat(await(async(e,t,s,i)=>{let n=[];try{n=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,_e.vB)(Gf,e)))}catch{}const a=new Set;let r=!1;for(let s=e.lineNumber-1;s>Math.max(0,e.lineNumber-1-10)&&!r;--s){const i=t.getLineContent(s+1);(i.match(/^\s*function\s+/)||i.match(/^\s*###\w+/))&&(r=!0);const n=G(Cp.editor.tokenize(t.getLineContent(s+1),Tp.PURE)[0]);n.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&bf(i.type,[Df.VARIABLE,Df.PARAMETER],!0)&&a.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===n.length-1?Number.MAX_SAFE_INTEGER:G(n[r+1]).offset+1}))}))}const o=n.map((e=>e.name));return n.map((e=>eT(e,!0))).concat(Array.from(a).filter((e=>!o.includes(e))).map((e=>{const t=new Gf;return t.name=e,t})).map((e=>eT(e,!1))))})(s,e,t.filePath,d))}return{suggestions:n}}}),n.current?.dispose(),n.current=Cp.languages.registerCompletionItemProvider(Tp.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===Cp.languages.CompletionTriggerKind.Invoke&&(i=i.concat(Bf()),i=i.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${la}${dg.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(la))),o=(e=>{if(e.startsWith(la))return e.substring(3).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case dg.PURE:return[{text:lg.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:lg.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:lg.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:lg.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:lg.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:lg.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:lg.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:lg.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:lg.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case dg.MAPPING:return[{text:lg.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:lg.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:lg.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:lg.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case dg.RELATIONAL:return[{text:lg.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case Vf:return[{text:$f,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n{\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n}"}];default:return[]}})(e)))),i=i.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:Cp.languages.CompletionItemKind.Snippet,insertTextRules:Cp.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"},{text:"NULL",description:"(nullish value)",insertText:"[]"}])),i=i.concat(await(async(e,t,s)=>{const i=Zf(e,t),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(qf)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Jf));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,a?[Np.CLASS]:n?[Np.FUNCTION,Np.NATIVE_FUNCTION]:[])).map((e=>(0,_e.vB)(kf,e)))}catch{}return r.map((e=>a?zf(e):Hf(e,{preferArrowFunctionForm:n})))})(t,e,d))),{suggestions:i}}}),Rf(t),(0,kt.useEffect)((()=>{if(l){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}c(!1)}}),[l]),(0,kt.useEffect)((()=>{void 0!==p&&void 0!==m&&r?.layout({width:p,height:m})}),[r,p,m]),(0,kt.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(Sp(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,kt.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),n.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel editor-group file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(zs,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(sT,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(Lf,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:u,className:"code-editor__container",children:(0,T.jsx)("div",{className:"code-editor__body",ref:a})})})]})}));var nT=s(8533);const aT=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,kt.useRef)(null),[h,u]=(0,kt.useState)(null);return(0,kt.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,T.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,T.jsx)(ki,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},rT=(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Ut(),n=s.diagram,a=t,{width:r,height:o}=(0,Hi.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,kt.useEffect)((()=>{const e=new Yg(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render({initial:!0})}),[a,s,n]),(0,kt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.render({initial:!0})}),[s,s.isDiagramRendererInitialized]),(0,kt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,kt.useCallback)(((e,t)=>{if(e instanceof yp){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Pu(n.x,n.y))):void 0;(0,Re.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,nT.L)((()=>({accept:df.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,T.jsx)("div",{ref:a,className:(0,Ot.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),oT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=lE(),i=Ut(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_LEFT),children:(0,T.jsx)(ui,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_CENTER),children:(0,T.jsx)(pi,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_RIGHT),children:(0,T.jsx)(mi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_TOP),children:(0,T.jsx)(ci,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_MIDDLE),children:(0,T.jsx)(di,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.ALIGN_BOTTOM),children:(0,T.jsx)(hi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.SPACE_HORIZONTALLY),children:(0,T.jsx)(_i,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align($g.SPACE_VERTICALLY),children:(0,T.jsx)(gi,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(aT,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(Vi,{}),zg.map((e=>(0,T.jsxs)(Gi,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,T.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,T.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,T.jsx)(ts,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,Re.fl)(s.loadFile(t.filePath,new Lp(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Hs,{className:"diagram-editor__icon--go-to-file"})})})]})})),lT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,T.jsxs)("div",{className:"diagram-editor__tools",children:[(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.LAYOUT}),tabIndex:-1,onClick:i(Gg.LAYOUT,Vg.NONE),title:"View Tool (V)",children:(0,T.jsx)(Si,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.PAN}),tabIndex:-1,onClick:i(Gg.PAN,Vg.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(xi,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Gg.ZOOM_IN,Vg.NONE),children:(0,T.jsx)(Ni,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,Ot.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Gg.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Gg.ZOOM_OUT,Vg.NONE),children:(0,T.jsx)(vi,{className:"diagram-editor__icon--zoom-out"})})]})})),cT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,kt.useRef)(null);return Rf(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(oT,{diagramEditorState:t})}),(0,T.jsx)("div",{className:"diagram-editor__content",children:(0,T.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,T.jsx)(lT,{diagramEditorState:t}),(0,T.jsx)(rT,{diagramEditorState:t,ref:s})]})})]})}));var dT=s(98533),hT=s(84153);(0,Nt.Pi)((0,kt.forwardRef)((function(e,t){const{children:s,placeholder:i,showPlaceholder:n,className:a}=e;return(0,T.jsxs)("div",{ref:t,className:(0,Ot.clsx)("dnd__entry__container",a),children:[n&&(0,T.jsx)("div",{className:"dnd__entry__placeholder",children:i?(0,T.jsx)(T.Fragment,{children:i}):(0,T.jsx)("div",{className:"dnd__entry__placeholder__content"})}),(0,T.jsx)(T.Fragment,{children:s})]})})));const uT=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,T.jsx)("div",{className:(0,Ot.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,T.jsx)(T.Fragment,{children:t})};function pT(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,dT.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,T.jsx)(St.Z,{children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const mT=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},_T=(0,Nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(Ui,{children:[(0,T.jsx)(Gi,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Gi,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Gi,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),gT=(0,Nt.Pi)((e=>{const t=(0,kt.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,kt.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,nT.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,VE.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,kt.useEffect)((()=>{e((0,hT.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,Ot.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,T.jsx)(uT,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(ji,{content:(0,T.jsx)(_T,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,T.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,T.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,T.jsx)(qt,{})})]})})});var h})),ET=(0,Nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(aT,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(Ui,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Gi,{className:(0,Ot.clsx)("tab-manager__menu__item",{"tab-manager__menu__item--active":e===t.currentTab}),onClick:()=>t.openTab(e),children:[(0,T.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,T.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,T.jsx)(qt,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(ti,{})})})),fT=(0,Nt.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,T.jsxs)("div",{className:"tab-manager",children:[(0,T.jsxs)("div",{className:"tab-manager__content",onWheel:mT,children:[t.tabs.map((e=>(0,T.jsx)(gT,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(pT,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(ET,{managerTabState:t})]})})),TT=()=>{const[e,t]=(0,kt.useState)(!1),{ref:s,width:i,height:n}=(0,Hi.NB)();return(0,kt.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,T.jsx)("div",{ref:s,className:"editor-group__splash-screen",children:(0,T.jsxs)("div",{className:(0,Ot.clsx)("editor-group__splash-screen__content",{"editor-group__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Run the go() function"}),(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"editor-group__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"editor-group__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Qt,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},CT=(0,Nt.Pi)((()=>{const e=lE(),t=e.tabManagerState.currentTab;return t?(0,T.jsxs)("div",{className:"panel editor-group",children:[(0,T.jsxs)("div",{className:"panel__header editor-group__header",children:[(0,T.jsx)("div",{className:"editor-group__header__tabs",children:(0,T.jsx)(fT,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof Zp){const s=e.tabManagerState.tabs.filter((e=>e instanceof Zp&&e.fileName===t.fileName)).length>1;return(0,T.jsxs)("div",{className:"editor-group__header__tab",children:[(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(Rs,{className:"editor-group__header__tab__icon--file"})}),(0,T.jsx)("div",{className:"editor-group__header__tab__label",children:t.fileName}),s&&(0,T.jsx)("div",{className:"editor-group__header__tab__path",children:t.filePath}),t.file.RO&&(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(Zt,{className:"editor-group__header__tab__icon--readonly"})})]})}if(t instanceof Wg){const s=e.tabManagerState.tabs.filter((e=>e instanceof Wg&&e.diagramName===t.diagramName)).length>1;return(0,T.jsxs)("div",{className:"editor-group__header__tab",children:[(0,T.jsx)("div",{className:"editor-group__header__tab__icon",children:(0,T.jsx)(QE,{})}),(0,T.jsx)("div",{className:"editor-group__header__tab__label",children:t.diagramName}),s&&(0,T.jsx)("div",{className:"editor-group__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,T.jsx)("div",{className:"panel__header__actions"})]}),(0,T.jsx)("div",{className:"panel__content editor-group__content",children:t instanceof Zp?t.textEditorState.language===Tp.PURE?(0,T.jsx)(iT,{editorState:t}):(0,T.jsx)(Pf,{editorState:t}):t instanceof Wg?(0,T.jsx)(cT,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(TT,{})}));var ST=s(50166),xT=s(97493);xT.Select.createFilter;const NT=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,kt.useRef)(null);return(0,kt.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(ST.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,T.jsx)("div",{style:t,children:i[e]})}):(0,T.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},vT="selector-input",AT="selector-input--dark",IT=()=>(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__loading-indicator ${AT}__loading-indicator`,children:(0,T.jsx)(fs,{})}),OT=()=>(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__dropdown-indicator`,children:(0,T.jsx)(ts,{})}),yT=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${vT}__indicator ${vT}__clear-indicator`,children:(0,T.jsx)(qt,{})})})},RT=e=>(0,T.jsx)(xT.Select.components.Input,{...e,isHidden:!1}),wT=(0,kt.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?xT.CreatableSelect.default:xT.Select.default,u=l?AT:vT;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:yT,DropdownIndicator:OT,LoadingIndicator:IT,MenuList:NT,Input:RT,...r},...{...d,darkMode:l,noMatchMessage:n}})})),LT=(e,t)=>e.label.localeCompare(t.label),PT=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,n=(0,kt.useRef)(null),a=(0,kt.useMemo)((()=>(0,tn.Z)((()=>{(0,Re.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(It.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Open file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)(wT,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(LT),onChange:s=>{s?.value&&(r(),i.reset(),(0,Re.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,Ot.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.setRegExp(!i.isRegExp),children:(0,T.jsx)(Ws,{})})]})]})})}));var bT;!function(e){e.MODE="mode",e.FAST_COMPILE="fastCompile"}(bT=bT||(bT={}));const DT=(MT=(0,Nt.Pi)((()=>{const e=lE(),t=Ut(),{ref:s,width:i,height:n}=(0,Hi.NB)(),a=TE(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=TE(0===e.panelGroupDisplayState.size,{onStopResize:t=>e.panelGroupDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.panelGroupDisplayState.size}),o=TE(e.panelGroupDisplayState.isMaximized);return(0,kt.useEffect)((()=>{s.current&&e.panelGroupDisplayState.setMaxSize(s.current.offsetHeight)}),[e,s,n,i]),(0,kt.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,kt.useEffect)((()=>{(0,Re.fl)(e.initialize(!1,void 0,t.navigationService.navigator.getCurrentLocationParameterValue(bT.MODE),t.navigationService.navigator.getCurrentLocationParameterValue(bT.FAST_COMPILE))).catch(t.alertUnhandledError)}),[e,t]),(0,kt.useEffect)((()=>(t.navigationService.navigator.blockNavigation([()=>!0],void 0,(()=>t.notificationService.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigationService.navigator.unblockNavigation()})),[e,t]),Rf(e),(0,T.jsxs)("div",{className:"ide",children:[(0,T.jsxs)("div",{className:"ide__body",children:[(0,T.jsx)(If,{}),(0,T.jsx)("div",{className:"ide__content-container",ref:s,children:(0,T.jsx)("div",{className:"ide__content",children:(0,T.jsxs)(EE,{orientation:"vertical",children:[(0,T.jsx)(CE,{...a.collapsiblePanel,direction:1,children:(0,T.jsx)(vf,{})}),(0,T.jsx)(SE,{}),(0,T.jsx)(CE,{...a.remainingPanel,minSize:300,children:(0,T.jsxs)(EE,{orientation:"horizontal",children:[(0,T.jsx)(CE,{...o.collapsiblePanel,...0===e.panelGroupDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(CT,{})}),(0,T.jsx)(SE,{children:(0,T.jsx)(xE,{color:e.panelGroupDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(CE,{...r.collapsiblePanel,...e.panelGroupDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)(GE,{})})]})})]})})})]}),(0,T.jsx)(yf,{}),(0,T.jsx)(PT,{})]})})),function(){return(0,T.jsx)(oE,{children:(0,T.jsx)(MT,{})})});var MT;const FT=(0,Nt.Pi)((e=>{const{children:t}=e,s=G((0,kt.useContext)(dp),"Can't find application platform in context"),i=Ut();return(0,kt.useEffect)((()=>{i.initialize(s).catch(i.alertUnhandledError)}),[i,s]),i.initState.hasSucceeded?(0,T.jsx)(un,{children:t}):(0,T.jsx)(T.Fragment,{})}));class kT{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager}}const jT=(0,kt.createContext)(void 0),UT=({children:e})=>{const t=Ut(),s=(0,Nt.fv)((()=>new kT(t)));return(0,T.jsx)(jT.Provider,{value:s,children:e})},GT=({children:e})=>(0,T.jsx)(FT,{children:(0,T.jsx)(UT,{children:e})}),VT=e=>{const{baseUrl:t}=e;return(0,T.jsx)(up,{baseUrl:t,children:(0,T.jsx)(GT,{children:(0,T.jsx)(DT,{})})})},$T=JSON.parse('{"i8":"8.0.5","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class BT extends Hn{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class zT extends BT{static NAME=$T.Rw.p;constructor(){super(zT.NAME,$T.i8)}getExtraApplicationSetups(){return[async e=>{await(async e=>{const t=`Monospaced font '${Je}' has not been loaded properly, code editor might not display properly`;await Promise.all([400,700].map((e=>document.fonts.load(`${e} 1em ${Je}`)))).then((()=>{document.fonts.check(`1em ${Je}`)?Cp.editor.remeasureFonts():e.logService.error(h.create(me.APPLICATION_SETUP__FAILURE),t)})).catch((()=>e.logService.error(h.create(me.APPLICATION_SETUP__FAILURE),t)));const s="legend.code-editor.override-default-keybinding";Cp.editor.registerCommand(s,((t,...s)=>{e.keyboardShortcutsService.dispatch(s[0])}));const i=[[Cp.KeyCode.F1,"F1"],[Cp.KeyCode.F8,"F8"],[Cp.KeyCode.F9,"F9"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyG,"Control+KeyG"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyB,"Control+KeyB"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyO,"Control+KeyO"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyD,"Control+KeyD"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.KeyP,"Control+KeyP"],[Cp.KeyMod.Shift|Cp.KeyCode.F10,"Shift+F10"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.F2,"Control+F2"],[Cp.KeyMod.WinCtrl|Cp.KeyCode.F12,"Control+F12"]];Cp.editor.addKeybindingRules(i.map((([e,t])=>({keybinding:e,command:s,commandArgs:t}))))})(e),function(e){var t,s;Cp.editor.defineTheme(fp.LEGEND,Mf),Cp.languages.register({id:Tp.PURE}),Cp.languages.setLanguageConfiguration(Tp.PURE,Ff),Cp.languages.setMonarchTokensProvider(Tp.PURE,(t=e?.extraKeywords??[],s=e?.extraParserKeywords??[],{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",lg.CLASS,lg.ASSOCIATION,lg.ENUMERATION,lg.MEASURE,lg.PROFILE,lg.FUNCTION,lg.MAPPING,lg.RUNTIME,lg.CONNECTION,lg.FILE_GENERATION,lg.GENERATION_SPECIFICATION,lg.DATA_ELEMENT,cg.JSON_MODEL_CONNECTION,cg.MODEL_CHAIN_CONNECTION,cg.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",lg.SERVICE,lg.FLAT_DATA,lg.DATABASE,cg.FLAT_DATA_CONNECTION,cg.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[dg.PURE,dg.CONNECTION,dg.RUNTIME,dg.MAPPING,dg.SERVICE,dg.FLATDATA,dg.RELATIONAL,dg.GENERATION_SPECIFICATION,dg.FILE_GENERATION_SPECIFICATION,dg.DATA].concat(s).map((e=>`${la}${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:[a-zA-Z0-9]+(?:\.\.(?:[a-zA-Z0-9]+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/(?:(?:<\w+>)|(?:<[^:.@^()]+[^-]>))/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Df.PARSER,"@default":Df.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Df.LANGUAGE_STRUCT,"@keywords":`${Df.KEYWORD}.$0`,"([a-zA-Z_$][\\w$]*)_((\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))__)*(\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))_":Df.TYPE,"@default":Df.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Df.OPERATOR,"@default":Df.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Df.DELIMITER],[/'([^'\\]|\\.)*$/,`${Df.STRING}.invalid`],[/'/,Df.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Df.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Df.PACKAGE,Df.TYPE,Df.GENERICS,Df.WHITESPACE,Df.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Df.PACKAGE,Df.TYPE,Df.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Df.TYPE}.operator`,Df.WHITESPACE,Df.PACKAGE,Df.TYPE,Df.GENERICS,Df.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Df.DELIMITER,Df.PROPERTY]],[/(@identifier)(\s*=)/,[Df.PROPERTY,Df.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Df.TYPE,Df.OPERATOR,Df.PROPERTY]],[/(@identifier)(\s*:)/,[Df.PARAMETER,Df.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[Df.KEYWORD,Df.WHITESPACE,Df.VARIABLE,Df.OPERATOR]],[/(\$@identifier)/,[`${Df.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${Df.DATE}.latest`]],[/(@date)/,[Df.DATE]],[/(@time)/,[`${Df.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Df.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Df.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Df.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Df.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Df.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Df.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Df.NUMBER}.float`],[/(@digits)[lL]?/,Df.NUMBER]],whitespace:[[/[ \t\r\n]+/,Df.WHITESPACE],[/\/\*\*(?!\/)/,`${Df.COMMENT}.doc`,"@doc"],[/\/\*/,Df.COMMENT,"@comment"],[/\/\/.*$/,Df.COMMENT]],comment:[[/[^/*]+/,Df.COMMENT],[/\*\//,Df.COMMENT,"@pop"],[/[/*]/,Df.COMMENT]],doc:[[/[^/*]+/,`${Df.COMMENT}.doc`],[/\/\*/,`${Df.COMMENT}.doc.invalid`],[/\*\//,`${Df.COMMENT}.doc`,"@pop"],[/[/*]/,`${Df.COMMENT}.doc`]],string:[[/[^\\']+/,Df.STRING],[/@escapes/,`${Df.STRING}.escape`],[/\\./,`${Df.STRING}.escape.invalid`],[/'/,Df.STRING,"@pop"]],characters:[[/'[^\\']'/,Df.STRING],[/(')(@escapes)(')/,[Df.STRING,`${Df.STRING}.escape`,Df.STRING]],[/'/,`${Df.STRING}.invalid`]]}}))}({extraKeywords:[$f],extraParserKeywords:[Vf]})}]}getExtraKeyedCommandConfigEntries(){return[$p,Yp,zp].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class HT extends $n{static create(){const e=new HT(Zn.create());return e.withBasePlugins([new Yn,new zT]),e.withBasePresets([new ip]),e}async configureApplication(e){return new Kn(e)}async loadApplication(e){(0,C.s)((()=>{let e=document.getElementsByTagName(Bn).length?document.getElementsByTagName(Bn)[0]:void 0;return e||(e=document.createElement(Bn),document.body.appendChild(e)),e.setAttribute("style","height: 100%; width: 100%; display: block"),e})()).render((0,T.jsx)(Gt,{store:e,children:(0,T.jsx)(VT,{baseUrl:this.baseAddress})}))}}class YT{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){HT.create().setup({baseAddress:e}).withPresets(YT.getPresetCollection()).withPlugins(YT.getPluginCollection()).start().catch((e=>{throw e}))}}YT.run("/ide/")},97493:(e,t,s)=>{const i=s(54319),n=s(31776);e.exports={CreatableSelect:i,Select:n}},44524:(e,t,s)=>{const i=s(18978),n=s(1553),a=s(65186),r=s(49385),o=s(70563),l=s(16636),c=s(91914),d=s(8799),h=s(77245),u=s(30924),p=s(34543),m=s(75100),_=s(58920),g=s(52742);e.exports={FA:i,GI:n,MD:a,VSC:r,GO:o,SI:l,IO5:c,BS:d,BI:h,CG:u,FI:p,RI:m,TB:_,HI:g}},81931:(e,t,s)=>{const i=s(71659);e.exports={Fuse:i}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{14:"6a7e96d2",135:"3b62eae4",246:"63a82c7f",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(15411)));l=o.O(l)})();
|
2
|
+
//# sourceMappingURL=index.c97923cb.js.map
|