@finos/legend-application-pure-ide-deployment 9.5.0 → 9.7.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.426c21a1.js +2 -0
- package/dist/ide/static/index.426c21a1.js.map +1 -0
- package/dist/ide/static/{index.c44fd781.css → index.b19a4500.css} +6 -6
- package/dist/ide/static/{index.c44fd781.css.map → index.b19a4500.css.map} +1 -1
- package/dist/ide/version.json +1 -1
- package/package.json +2 -2
- package/dist/ide/static/index.047ebafb.js +0 -2
- package/dist/ide/static/index.047ebafb.js.map +0 -1
@@ -0,0 +1,2 @@
|
|
1
|
+
(()=>{"use strict";var e,t,s,i,a,n={30661:(e,t,s)=>{const i=JSON.parse('{"i8":"8.0.2","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var a,n=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,n.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,n.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"}(a=a||(a={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=a.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=a.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=a.INFO&&this._info(e,...t)}warn(e,...t){this.level<=a.WARN&&this._warn(e,...t)}error(e,...t){this.level<=a.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:_,info:m,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){m(`[${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(80075),x=s(90361);const N="Roboto Mono";var A,I;!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(A=A||(A={})),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"}(I=I||(I={}));var v=s(85928),O=s(21112);const y=e=>e.constructor,R=()=>()=>{},w=e=>e.length?e[0]:void 0,L=e=>e.length?e[e.length-1]:void 0,P=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),b=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),D=(e,t,s,i=((e,t)=>e===t))=>{const a=e.findIndex((e=>i(e,t))),n=e.findIndex((e=>i(e,s)));return-1!==a&&-1!==n&&(e[a]=s,e[n]=t,!0)},M=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class F extends Error{uuid=(0,n.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class k 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 U extends k{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class j extends k{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,v.Z)(i,(e=>void 0!==e)));var i;return(0,O.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function G(e){if(!(e instanceof Error))throw new U("Expected error to be thrown")}const V=e=>{try{return e()}catch{return}};class B extends k{constructor(e,t){super("Assertion Error",e,t)}}const $=e=>null!=e;function z(e,t=""){if(null==e)throw new B(t||"Value is nullable")}const H=(e,t="")=>(z(e,t),e),Y=e=>t=>((e,t)=>e instanceof t)(t,e);function W(e,t,s=""){if(!(e instanceof t))throw new B(s||`Value is expected to be of type '${t.name}'`)}const K=(e,t,s="")=>(W(e,t,s),e);function X(e,t=""){if(""===H(e,t))throw new B(t||"Expected string value to be non-empty")}function Z(e,t=""){return X(e,t),e}function q(e,t=""){if(!e)throw new B(t||"Expected predicate to be truthy")}const J=e=>"string"==typeof e,Q=e=>"number"==typeof e&&!isNaN(e),ee=e=>"boolean"==typeof e,te=e=>"object"==typeof e&&null!==e;var se=s(39391),ie=s(33654),ae=s(18247),ne=s(72659);const re=se.W,oe="charset=utf-8";var le,ce,de;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(le=le||(le={})),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="*/*"}(ce=ce||(ce={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(de=de||(de={}));const he={mode:"cors",credentials:"include",redirect:"manual"},ue=(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 pe 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:a}=e,n=`Received response with status ${s} (${i}) for ${a}`;this.message=(t?(e=>{if(te(e))return J(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&J(t.message)?t.message:e})(t).substring(0,5e3):"")||n,this.payload=t}}const _e=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 pe(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===re.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ce.APPLICATION_JSON:return e.json();case ce.TEXT_PLAIN:return e.text();default:return Promise.reject(new pe(e,`Can't process response for request with Content-Type '${i}'`))}},me=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME",i=document.getElementById(s);i?.remove();const a=document.createElement("iframe");a.id=s,a.src=e,a.style.display="none",a.addEventListener("load",(()=>{a.remove(),t()})),document.body.appendChild(a)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>_e(e,t,s))):fetch(e,t).then((e=>_e(e,t,s))),ge=(e,t)=>{const s={};return s.Accept=ce.APPLICATION_JSON,e!==de.GET&&(s[le.CONTENT_TYPE]=`${ce.APPLICATION_JSON};${oe}`),ue(s,t)};class Ee{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...he,...e?.options??{}}}async get(e,t={},s,i,a,n){return this.request(de.GET,e,void 0,t,s,i,a,n)}async put(e,t={},s={},i,a,n,r){return this.request(de.PUT,e,t,s,i,a,n,r)}async post(e,t={},s={},i,a,n,r){return this.request(de.POST,e,t,s,i,a,n,r)}async delete(e,t={},s={},i,a,n,r){return this.request(de.DELETE,e,t,s,i,a,n,r)}async request(e,t,s,i,a,n,r,o){const l=((e,t,s)=>{if(!e&&!V((()=>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($).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,n??{});let c;if((J(s)||te(s))&&r?.enableCompression&&(q(e!==de.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,ie.Wt)(te(e)?JSON.stringify(e):e)]))(s),a=ue(a,{[le.CONTENT_TYPE]:`${ce.APPLICATION_ZLIB};${oe}`})),void 0!==s)if(J(s)||s instanceof Blob)c=s;else{if(!te(s))throw new B("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:ge(e,a)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===re.UNAUTHORIZED)(e)?me(l,d,o):_e(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?me(l,d,o):Promise.reject(e)))}}const fe=(e,t,s)=>{const i=new Blob([t],{type:s}),a=URL.createObjectURL(i),n=document.createElement("a");"string"==typeof n.download?(document.body.appendChild(n),n.download=e,n.href=a,n.click(),document.body.removeChild(n)):location.replace(a)};var Te;!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.LOAD_TEXT_EDITOR_FONT__SUCCESS="application.load.font.success",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"}(Te=Te||(Te={}));const Ce="::",Se="###",xe=["$implicit"];var Ne,Ae,Ie,ve,Oe;(Oe=Ne=Ne||(Ne={})).CORE="CORE",Oe.MAIN="ROOT",Oe.MODEL_GENERATION="MODEL_GENERATION_ROOT",Oe.SYSTEM="SYSTEM_ROOT",Oe.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(ve=Ae=Ae||(Ae={})).STRING="String",ve.BOOLEAN="Boolean",ve.BINARY="Binary",ve.NUMBER="Number",ve.INTEGER="Integer",ve.FLOAT="Float",ve.DECIMAL="Decimal",ve.DATE="Date",ve.STRICTDATE="StrictDate",ve.DATETIME="DateTime",ve.STRICTTIME="StrictTime",ve.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ie=Ie||(Ie={}));const ye=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Re,we,Le,Pe,be,De,Me,Fe,ke,Ue;(we=Re=Re||(Re={})).ANY="meta::pure::metamodel::type::Any",we.NIL="meta::pure::metamodel::type::Nil",we.PROFILE_DOC="meta::pure::profiles::doc",we.PROFILE_TEMPORAL="meta::pure::profiles::temporal",we.PROFILE="meta::pure::metamodel::extension::Profile",we.ENUMERATION="meta::pure::metamodel::type::Enumeration",we.MEASURE="meta::pure::metamodel::type::Measure",we.CLASS="meta::pure::metamodel::type::Class",we.ASSOCIATION="meta::pure::metamodel::relationship::Association",we.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",we.FLAT_DATA="meta::flatData::metamodel::FlatData",we.DATABASE="meta::relational::metamodel::Database",we.MAPPING="meta::pure::mapping::Mapping",we.SERVICE="meta::legend::service::metamodel::Service",we.CONNECTION="meta::pure::runtime::PackageableConnection",we.RUNTIME="meta::pure::runtime::PackageableRuntime",we.EXECUTION_ENVIRONMENT="meta::legend::service::metamodel::ExecutionEnvironmentInstance",we.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",we.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",we.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",we.DATA_ELEMENT="meta::pure::data::DataElement",we.TDS_ROW="meta::pure::tds::TDSRow",we.TDS_TABULARDATASET="meta::pure::tds::TabularDataSet",we.TDS_COLUMN="meta::pure::tds::TDSColumn",(De=Le=Le||(Le={})).BUSINESS_TEMPORAL="businesstemporal",De.PROCESSING_TEMPORAL="processingtemporal",De.BITEMPORAL="bitemporal",(be=Pe=Pe||(Pe={})).ALL_VERSIONS="AllVersions",be.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(Fe=Me=Me||(Me={})).CLASS="CLASS",Fe.STORE="STORE",Fe.MAPPING="MAPPING",Fe.RUNTIME="RUNTIME",Fe.FILE_GENERATION="FILE_GENERATION",Fe.SERVICE="SERVICE",(Ue=ke=ke||(ke={})).TODAY="meta::pure::functions::date::today",Ue.NOW="meta::pure::functions::date::now",Ue.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Ue.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Ue.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Ue.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Ue.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Ue.IS_ON_DAY="meta::pure::functions::date::isOnDay",Ue.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Ue.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Ue.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Ue.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Ue.MINUS="meta::pure::functions::math::minus",Ue.ADJUST="meta::pure::functions::date::adjust",Ue.LET="meta::pure::functions::lang::letFunction";const je="yyyy-MM-dd'T'HH:mm:ssxxxx";var Ge,Ve,Be;!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"}(Ge=Ge||(Ge={})),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"}(Ve=Ve||(Ve={})),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"}(Be=Be||(Be={}));const $e=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var ze;!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"}(ze=ze||(ze={}));const He={base:"vs-dark",inherit:!0,colors:{},rules:[{token:ze.IDENTIFIER,foreground:"dcdcaa"},{token:ze.NUMBER,foreground:"b5cea8"},{token:ze.DATE,foreground:"b5cea8"},{token:ze.COLOR,foreground:"b5cea8"},{token:ze.PACKAGE,foreground:"808080"},{token:ze.PARSER,foreground:"c586c0"},{token:ze.LANGUAGE_STRUCT,foreground:"c586c0"},{token:ze.MULTIPLICITY,foreground:"2d796b"},{token:ze.GENERICS,foreground:"2d796b"},{token:ze.PROPERTY,foreground:"9cdcfe"},{token:ze.PARAMETER,foreground:"9cdcfe"},{token:ze.VARIABLE,foreground:"4fc1ff"},{token:ze.TYPE,foreground:"3dc9b0"},{token:`${ze.STRING}.escape`,foreground:"d7ba7d"}]},Ye={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>))")}}};var We=s(79013);class Ke{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,We.qC)(this.schema,e)}fromJson(e){return(0,We.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,v.Z)(t,(e=>null!==e))):e);var t}}const Xe=e=>(0,We.PG)((t=>void 0===t?We.AM:(0,We.qC)(e,t)),(t=>(0,We.vB)(e,t))),Ze=e=>(0,We.PG)((()=>e),(()=>e)),qe=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?We.AM:[],Je=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?We.AM:[]:We.AM,Qe=(e,t)=>(0,We.PG)((s=>Je(s,(t=>(0,We.qC)(e,t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:t?.INTERNAL__forceReturnEmptyInTest})),(t=>qe(t,(t=>(0,We.vB)(e,t)),{skipIfEmpty:!1}))),et=(e,t,s)=>(0,We.PG)((t=>Je(t,(t=>e(t)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:s?.INTERNAL__forceReturnEmptyInTest})),(e=>qe(e,(e=>t(e)),{skipIfEmpty:!1})));var tt=s(4e4);class st{_documentationKey;markdownText;title;text;url;related;static serialization=new Ke((0,We.yu)(st,{markdownText:(0,We.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,We.jt)((0,We.pb)((0,We.Ru)())),title:(0,We.jt)((0,We.Ru)()),text:(0,We.jt)((0,We.Ru)()),url:(0,We.jt)((0,We.Ru)())}));static create(e,t){const s=st.serialization.fromJson(e);return s._documentationKey=t,s}}const it=e=>Object.entries(e).map((e=>({key:e[0],content:st.create(e[1],e[0])})));class at{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(Te.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,tt.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(Te.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(Te.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]=st.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class nt{}class rt extends nt{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 ot{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new rt}setup(e){return this.baseUrl=Z(e.baseUrl,"Can't setup application: 'baseUrl' 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 Ee;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){G(e),this.logger.error(h.create(Te.APPLICATION_CONFIGURATION__FAILURE),e)}z(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){G(e),this.logger.error(h.create(Te.APPLICATION_CONFIGURATION__FAILURE),e)}return z(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseUrl: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 Ee(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(Z(e.url,"Can't load documentation registry: 'url' field is missing or empty"));z(i.entries,"Can't load documentation registry data: 'entries' field is missing");const a=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{a&&!a.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){G(e),this.logger.warn(h.create(Te.DOCUMENTATION_FETCH__FAILURE),e)}}))),e.keyedDocumentationEntries=[...it(t),...e.keyedDocumentationEntries]}async start(){z(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseUrl);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]),await this.loadApplication(),await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(this.pluginManager)))),this.logger.info(h.create(Te.APPLICATION_LOAD__SUCCESS),"Legend application loaded")}catch(e){throw G(e),this.logger.error(h.create(Te.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),e}}}const lt=JSON.parse('{"i8":"13.0.3","Rw":{"j":"@finos/legend-application-plugin-core"}}');var ct;!function(e){e.DEFAULT_DARK="default-dark",e.LEGACY_LIGHT="legacy-light",e.HIGH_CONTRAST_LIGHT="hc-light"}(ct=ct||(ct={}));const dt={name:"Default Dark (default)",key:ct.DEFAULT_DARK,TEMPORARY__globalCSSClassName:"theme__default-dark"},ht={name:"Legacy Light",key:ct.LEGACY_LIGHT,TEMPORARY__globalCSSClassName:"theme__legacy-light"},ut={name:"High-Contrast Light",key:ct.HIGH_CONTRAST_LIGHT,TEMPORARY__globalCSSClassName:"theme__hc-light"};var pt;!function(e){e.COLOR_THEME="application.layout.colorTheme"}(pt=pt||(pt={}));const _t={[pt.COLOR_THEME]:{defaultValue:ct.DEFAULT_DARK}};class mt extends o{}var gt=s(65741);class Et{get localStorage(){return H(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 ft{storeIndex;storageService;data;constructor(e,t){this.storageService=e,this.storeIndex=t;const s=this.storageService.storage.getItem(this.storeIndex);if(s){const e=JSON.parse(s);this.data=e}else this.data={}}getValue(e){return this.data[e]}getNumericValue(e){const t=this.getValue(e);return void 0!==t?((e,t="")=>(function(e,t=""){if(!Q(e))throw new B(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(!J(e))throw new B(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(!ee(e))throw new B(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(!te(e))throw new B(t||"Value is expected to be a object")}(e,t),e))(t):void 0}hasValue(e){return $(this.data[e])}persistValue(e,t){void 0!==t?this.data[e]=t:delete this.data[e],this.storageService.storage.setItem(this.storeIndex,JSON.stringify(this.data))}}class Tt{applicationStore;storage;constructor(e){this.applicationStore=e,this.storage=new Et}}class Ct{applicationStore;storage;registry=new Map;constructor(e){this.applicationStore=e,this.storage=new ft(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(Te.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(Q(t))return t;this.applicationStore.logService.warn(h.create(Te.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(J(t))return t;this.applicationStore.logService.warn(h.create(Te.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(ee(t))return t;this.applicationStore.logService.warn(h.create(Te.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(te(t))return t;this.applicationStore.logService.warn(h.create(Te.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,gt.Z)(s,t)?void 0:t)}}class St extends mt{static NAME=lt.Rw.j;constructor(){super(St.NAME,lt.i8)}install(e){e.registerApplicationPlugin(this)}getExtraColorThemes(){return[ht,ut]}getExtraSettingConfigurationEntries(){return e=_t,Object.entries(e).map((e=>({key:e[0],...e[1]})));var e}}var xt=s(74926),Nt=s(34309),At=s(2784);class It{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,S.rC)(this,{_isNavigationBlocked:S.LO,isNavigationBlocked:S.Fl,blockNavigation:S.aD,unblockNavigation:S.aD}),this.historyAPI=e}get window(){return H(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")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}getAddressParameters(){const e={},t=((e,t=!1)=>t?ae.Z.parseUrl(e).query:ae.Z.parse(e))((s=this.getCurrentAddress(),(0,ne.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}getAddressParameterValue(e){return this.getAddressParameters()[e]}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}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}}var vt=s(40979);const Ot=(0,At.createContext)(void 0),yt=({children:e})=>{const t=(0,vt.k6)(),s=(0,Nt.fv)((()=>new It(t)));return(0,T.jsx)(Ot.Provider,{value:s,children:e})};var Rt;!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"}(Rt=Rt||(Rt={}));class wt{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 Lt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const a=new wt;return e&&a.setup(this.plugins.map((a=>{const n=a.createClientSpan(e);return{clientSpan:n,serverSpan:a.createServerSpan(n,t,s,i),plugin:a}}))),a}}const Pt=s(94174).Fuse.default;var bt,Dt,Mt;!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(bt||(bt={}));class Ft{state;_message;_messageFormatter;constructor(){this.state=bt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=bt.INITIAL,this}inProgress(){return this.state=bt.IN_PROGRESS,this}fail(){return this.state=bt.FAILED,this}pass(){return this.state=bt.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===bt.INITIAL}get isInProgress(){return this.state===bt.IN_PROGRESS}get hasFailed(){return this.state===bt.FAILED}get hasSucceeded(){return this.state===bt.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,S.rC)(new Ft,{state:S.LO,_message:S.LO,reset:S.aD,inProgress:S.aD,pass:S.aD,fail:S.aD,complete:S.aD,setMessage:S.aD,sync:S.aD,isInInitialState:S.Fl,isInProgress:S.Fl,hasFailed:S.Fl,hasSucceeded:S.Fl,hasCompleted:S.Fl,message:S.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(Dt=Dt||(Dt={}));class kt{currentMode=Dt.STANDARD;onSearchModeChange;constructor(e){(0,S.rC)(this,{currentMode:S.LO,isAdvancedSearchActive:S.Fl,setCurrentMode:S.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==Dt.STANDARD}generateSearchText(e){switch(this.currentMode){case Dt.INCLUDE:return`'"${e}"`;case Dt.EXACT:return`="${e}"`;case Dt.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(Mt=Mt||(Mt={}));class Ut{uuid=(0,n.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,S.rC)(this,{isOpen:S.LO,setIsOpen:S.aD}),this.documentationKey=e._documentationKey,this.title=Z(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class jt{uuid=(0,n.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 Gt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Vt{applicationStore;panelRenderingKey=(0,n.Z)();isHidden=!1;isOpen=!1;selectedTab=Mt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=Ft.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,S.rC)(this,{isHidden:S.LO,isOpen:S.LO,panelRenderingKey:S.LO,isOverSearchLimit:S.LO,selectedTab:S.LO,searchText:S.LO,searchResults:S.LO,currentDocumentationEntry:S.LO,showSearchConfigurationMenu:S.LO,currentContextualDocumentationEntry:S.Fl,setIsHidden:S.aD,setIsOpen:S.aD,setSelectedTab:S.aD,setSearchText:S.aD,resetSearch:S.aD,search:S.aD,openDocumentationEntry:S.aD,refreshPanelRendering:S.aD,setShowSearchConfigurationMenu:S.aD}),this.applicationStore=e,this.searchEngine=new Pt(this.applicationStore.documentationService.getAllDocEntries().filter(Gt),{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 kt((()=>{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 jt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter($).filter(Gt).map((e=>new Ut(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getAllDocEntries().find((t=>t._documentationKey===e));t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new Ut(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}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,n.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 Ut(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 Bt{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}var $t;!function(e){e.GRAPH_BUILDER_DESERIALIZE_ELEMENTS__SUCCESS="graph-manager.graph-builder.deserialization.success",e.GRAPH_BUILDER_INDEX_ELEMENTS__SUCCESS="graph-manager.graph-builder.indexing.success",e.GRAPH_BUILDER_BUILD_SECTION_INDICES__SUCCESS="graph-manager.graph-builder.build-section-indices.success",e.GRAPH_BUILDER_BUILD_DOMAIN_MODELS__SUCCESS="graph-manager.graph-builder.build-domain-models.success",e.GRAPH_BUILDER_BUILD_STORES__SUCCESS="graph-manager.graph-builder.build-store.success",e.GRAPH_BUILDER_BUILD_MAPPINGS__SUCCESS="graph-manager.graph-builder.build-mappings.success",e.GRAPH_BUILDER_BUILD_CONNECTIONS_AND_RUNTIMES__SUCCESS="graph-manager.graph-builder.build-connections-and-runtimes.success",e.GRAPH_BUILDER_BUILD_SERVICES__SUCCESS="graph-manager.graph-builder.build-services.success",e.GRAPH_BUILDER_BUILD_DATA_ELEMENTS__SUCCESS="graph-manager.graph-builder.build-data.success",e.GRAPH_BUILDER_BUILD_OTHER_ELEMENTS__SUCCESS="graph-manager.graph-builder.build-other-elements.success",e.GRAPH_BUILDER_BUILD_GRAPH__SUCCESS="graph-manager.graph-builder.success",e.INITIALIZE_GRAPH__SUCCESS="graph-manager.graph-initialization.success",e.INITIALIZE_GRAPH_SYSTEM__SUCCESS="graph-manager.system-initialization.success",e.FETCH_GRAPH_DEPENDENCIES__SUCCESS="graph-manager.fetch-dependencies.success",e.FETCH_GRAPH_ENTITIES__SUCCESS="graph-manager.entities-dependencies.success",e.TRANSFORM_GRAPH_META_MODEL_TO_PROTOCOL__SUCCESS="graph-manager.transformation.success",e.COLLECT_GRAPH_COMPILE_CONTEXT__SUCCESS="graph-manager.build-graph-compile-context.success",e.SERIALIZE_GRAPH_PROTOCOL__SUCCESS="graph-manager.graph-serialization.success",e.SERIALIZE_GRAPH_CONTEXT_PROTOCOL__SUCCESS="graph-manager.graph-context-serialization.success",e.UPDATE_AND_REBUILD_GRAPH__SUCCESS="graph-manager.rebuild.success",e.TRANSFORM_GRAPH_META_MODEL_TO_GRAMMAR__SUCCESS="graph-manager.grammar.composing.success",e.TRANSOFMR_GRAPH_GRAMMAR_TO_META_MODEL__SUCCESS="graph-manager.grammar.parsing.success",e.V1_ENGINE_OPERATION_SERVER_CALL__SUCCESS="graph-manager.v1.engine-operation.server-call.success",e.V1_ENGINE_OPERATION_INPUT__SUCCESS="graph-manager.v1.engine-operation.graph.collect-input.success",e.GRAPH_BUILDER_FAILURE="graph-manager.graph-builder.failure",e.EXECUTION_FAILURE="graph-manager.execution.failure",e.COMPILATION_FAILURE="graph-manager.compilation.failure",e.PARSING_FAILURE="graph-manager.grammar.parsing.failure",e.GRAPH_MANAGER_FAILURE="graph-manager.failure",e.CACHE_MANAGER_FAILURE="graph-manager.cache.failure"}($t=$t||($t={}));class zt{static logEvent_ApplicationInitializationSucceeded(e,t){e.logEvent(Te.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(Te.APPLICATION_CONTEXT__ACCESS,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(Te.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS,t)}static logEvent_GraphInitializationSucceeded(e,t){e.logEvent($t.INITIALIZE_GRAPH__SUCCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(Te.APPLICATION_USAGE__INTERRUPT,{})}}class Ht{applicationStore;contextStack=[];constructor(e){(0,S.rC)(this,{contextStack:S.LO,currentContext:S.Fl,push:S.aD,pop:S.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 U(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&zt.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 Yt{applicationStore;commandRegistry=new Map;constructor(e){(0,S.rC)(this,{commandRegistry:S.LO,registerCommand:S.aD,deregisterCommand:S.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(Te.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 Wt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,S.rC)(this,{keyMap:S.LO,commandKeyMap:S.LO,isHotkeysBlocked:S.LO,addHotkey:S.aD,blockGlobalHotkeys:S.aD,unblockGlobalHotkeys:S.aD}),this.applicationStore=e,this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{const t=[e.content.defaultKeyboardShortcut,...e.content.additionalKeyboardShortcuts??[]].filter($);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 Kt,Xt=s(77289),Zt=s(73678),qt=s(78440),Jt=s(51919),Qt=s(85399),es=s(89358);!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"}(Kt=Kt||(Kt={}));const ts=(e,t)=>`[${e};${t}H`;class ss{searchInput;searchText="";useRegex=!1;matchWholeWord=!1;matchCaseSensitive=!1;resultCount;currentResultIndex;constructor(){(0,S.rC)(this,{searchText:S.LO,useRegex:S.LO,matchWholeWord:S.LO,matchCaseSensitive:S.LO,resultCount:S.LO,currentResultIndex:S.LO})}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}}class is{applicationStore;searchConfig=new ss;constructor(e){(0,S.rC)(this,{setSearchText:S.aD,setSearchRegex:S.aD,setSearchWholeWord:S.aD,setSearchCaseSensitive:S.aD,setSearchResultCount:S.aD,setSearchCurrentResultIndex:S.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 as extends is{preserveLog=!1;commandRegistry=new Map;constructor(e){super(e),(0,S.rC)(this,{preserveLog:S.LO,setPreserveLog:S.aD})}setPreserveLog(e){this.preserveLog=e}showHelp(){}showCommonANSIEscapeSequences(){}}var ns=s(1367),rs=s(67295),os=s(72531);s(90286);const ls=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,cs=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],ds=e=>{if(!e)return"";if(e.includes("_")||e.toUpperCase()===e&&e.length>2)return(e=>(e=>(e??"").trim().replace(/^(?:\w+)\b/u,(e=>ls(e))))((e??"").toLowerCase()).replace(/_(?:\w)/gu,(e=>e.toUpperCase())).replace(/_/gu," ").trim())(e);let t=e.trim();return t=t.charAt(0).toUpperCase()+t.slice(1),t.split(/(?<id>[A-Z][a-z]+|[0-9]+)/).filter((e=>e)).join(" ")},hs=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,rs.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,os.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var us;function ps(e){return e.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=H(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"}(us=us||(us={}));const _s=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![us.SHIFT,us.META,us.ALT,us.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),ms=(e,t)=>_s(e,H(ps(t)[0]));var gs=s(4707),Es=s(3493),fs=s(53908);const Ts=(0,gs.Z)({transitions:{create:()=>"none"}}),Cs=e=>{const{children:t}=e;return(0,T.jsx)(Es.Z,{injectFirst:!0,children:(0,T.jsx)(fs.Z,{theme:Ts,children:t})})};var Ss=s(83820),xs=s(96242),Ns=s(12238),As=s(78683),Is=s(81934),vs=s(6277);const Os=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,vs.clsx)(t,i),children:s})};return s.displayName=e,s},ys=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,vs.clsx)("modal",{"modal--dark":s},i),children:t})},Rs=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,vs.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:(a=t,(a??"").trim().replace(/\b(?:\w+)\b/gu,(e=>cs.includes(e.toLowerCase())?e.toLowerCase():ls(e))).replace(/^(?:\w+)\b/u,(e=>ls(e))).replace(/\b(?:\w+)$/u,(e=>ls(e))))})]});var a},ws=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,vs.clsx)("modal__header",i),children:(0,T.jsx)(Rs,{title:t})}):(0,T.jsx)("div",{className:(0,vs.clsx)("modal__header",i),children:s})},Ls=(Os("ModalHeaderActions","modal__header__actions"),Os("ModalBody","modal__body")),Ps=Os("ModalFooter","modal__footer");var bs,Ds;Os("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(bs=bs||(bs={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Ds=Ds||(Ds={}));class Ms{applicationStore;blockingAlertInfo;actionAlertInfo;constructor(e){(0,S.rC)(this,{blockingAlertInfo:S.LO,actionAlertInfo:S.LO,setBlockingAlert:S.aD,setActionAlertInfo:S.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}}const Fs=e=>{switch(e){case Ds.PROCEED_WITH_CAUTION:return"btn--caution";case Ds.PROCEED:case Ds.STANDARD:default:return"btn--dark"}},ks=(0,Nt.Pi)((e=>{const{info:t}=e,s=An(),{title:i,message:a,prompt:n,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.alertService.setActionAlertInfo(void 0)};return(0,T.jsx)(Is.Z,{open:Boolean(s.alertService.actionAlertInfo),onClose:R,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??bs.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(ws,{title:i}),(0,T.jsxs)(Ls,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:a}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:n})]}),(0,T.jsxs)(Ps,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Fs(e.type??Ds.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"})]})]})})})),Us=(0,Nt.Pi)((()=>{const e=An().alertService.actionAlertInfo;return e?(0,T.jsx)(ks,{info:e}):null})),js=e=>{const{isLoading:t}=e,s=(0,At.useRef)(null);return(0,At.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")})},Gs=(0,Nt.Pi)((()=>{const e=An().alertService.blockingAlertInfo;return e?(0,T.jsx)(Is.Z,{open:Boolean(e),onClose:R,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(ys,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(js,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(Ls,{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 Vs=s(90498);const Bs=Vs.FA,$s=Bs.FaHistory,zs=Bs.FaCrosshairs,Hs=(Bs.FaLayerGroup,Bs.FaGhost,Bs.FaLock),Ys=(Bs.FaMask,Bs.FaFile,Bs.FaLongArrowAltRight,Bs.FaTimes),Ws=Bs.FaTimesCircle,Ks=Bs.FaPlus,Xs=Bs.FaCog,Zs=(Bs.FaEye,Bs.FaCaretDown),qs=(Bs.FaFire,Bs.FaSave,Bs.FaSquare,Bs.FaRegSquare,Bs.FaCheckSquare,Bs.FaHashtag,Bs.FaHammer),Js=(Bs.FaClock,Bs.FaRegClock,Bs.FaToggleOn,Bs.FaQuestion),Qs=Bs.FaQuestionCircle,ei=Bs.FaInfoCircle,ti=Bs.FaCompress,si=Bs.FaMap,ii=Bs.FaPlay,ai=(Bs.FaGripVertical,Bs.FaRobot,Bs.FaArrowLeft,Bs.FaArrowRight,Bs.FaArrowAltCircleDown,Bs.FaArrowAltCircleRight),ni=(Bs.FaArrowCircleRight,Bs.FaUser,Bs.FaShapes),ri=(Bs.FaEnvelope,Bs.FaSkull,Bs.FaDollarSign,Bs.FaSearch),oi=(Bs.FaStar,Bs.FaKey,Bs.FaExternalLinkAlt,Bs.FaExternalLinkSquareAlt,Bs.FaLightbulb,Bs.FaRegLightbulb,Bs.FaList),li=Bs.FaCircle,ci=Bs.FaTrash,di=(Bs.FaRegCircle,Bs.FaShieldAlt,Bs.FaTag,Bs.FaTags,Bs.FaBolt,Bs.FaCheckCircle),hi=Bs.FaExclamationTriangle,ui=Bs.FaBug,pi=Bs.FaCircleNotch,_i=(Bs.FaRegKeyboard,Bs.FaUserSecret,Bs.FaBuffer,Bs.FaSitemap,Bs.FaExpand),mi=(Bs.FaExpandArrowsAlt,Bs.FaSortAlphaDown,Bs.FaSort,Bs.FaSortAlphaDownAlt,Bs.FaFolderPlus,Bs.FaCaretRight,Bs.FaWrench),gi=Bs.FaArrowDown,Ei=Bs.FaArrowUp,fi=Bs.FaTerminal,Ti=(Bs.FaTruckLoading,Bs.FaFolderOpen),Ci=Bs.FaFolder,Si=(Bs.FaFileCode,Bs.FaCodeBranch,Bs.FaArrowAltCircleUp,Bs.FaArrowAltCircleLeft,Bs.FaRegStopCircle,Bs.FaAsterisk,Bs.FaFilter,Bs.FaExclamationCircle),xi=(Bs.FaRocket,Bs.FaCheck,Bs.FaBan),Ni=(Bs.FaFileImport,Bs.FaUserFriends,Bs.FaDownload,Bs.FaUpload,Bs.FaRegWindowRestore,Bs.FaPauseCircle,Bs.FaShare,Bs.FaRegCopy),Ai=Bs.FaFileAlt,Ii=(Bs.FaEdit,Bs.FaArrowsAltH,Bs.FaRegWindowMaximize,Bs.FaWindowMaximize,Bs.FaLongArrowAltDown,Bs.FaLongArrowAltUp,Bs.FaMeteor,Bs.FaPiedPiperSquare,Bs.FaPuzzlePiece,Bs.FaToggleOn,Bs.FaToggleOff,Bs.FaMapMarkerAlt),vi=Bs.FaHatWizard,Oi=Bs.FaRegLaughWink,yi=Bs.FaRegSadTear,Ri=(Bs.FaBusinessTime,Bs.FaDatabase),wi=(Bs.FaServer,Bs.FaTable,Bs.FaArchive,Bs.FaBrain,Bs.FaBookOpen,Bs.FaLevelDownAlt,Vs.GI),Li=(wi.GiWaterDrop,wi.GiBeard),Pi=wi.GiSunglasses,bi=(wi.GiHouseKeys,Vs.MD),Di=(bi.MdManageSearch,bi.MdModeEdit,bi.MdTextFields,bi.MdMoreVert,bi.MdMoreHoriz,bi.MdWrapText,bi.MdVerticalAlignBottom,bi.MdRefresh),Mi=(bi.MdFunctions,bi.MdCompareArrows,bi.MdPlaylistAddCheck,bi.MdAdd,bi.MdEdit,bi.MdSubject),Fi=bi.MdViewHeadline,ki=bi.MdAssistant,Ui=(bi.MdSettingsEthernet,bi.MdLink,bi.MdWindow,bi.MdReviews,Vs.VSC),ji=(Ui.VscError,Ui.VscWarning,Ui.VscWordWrap),Gi=Ui.VscGoToFile,Vi=Ui.VscClose,Bi=(Ui.VscRunAll,Ui.VscRunErrors,Ui.VscOpenPreview,Ui.VscDiff,Ui.VscRegex),$i=(Ui.VscVersions,Ui.VscCaseSensitive),zi=Ui.VscWholeWord,Hi=Ui.VscReferences,Yi=Ui.VscWand,Wi=Ui.VscCollapseAll,Ki=Ui.VscExpandAll,Xi=Vs.GO,Zi=Xi.GoChevronDown,qi=Xi.GoChevronUp,Ji=(Xi.GoChevronLeft,Xi.GoChevronRight),Qi=(Xi.GoFileBinary,Xi.GoGitPullRequest,Xi.GoGitMerge,Xi.GoCloudDownload,Xi.GoCloudUpload,Xi.GoSync,Xi.GoGitBranch,Xi.GoX),ea=(Xi.GoPlug,Vs.SI.SiSwagger,Vs.IO5),ta=(ea.IoResize,ea.IoFileTrayFullOutline,ea.IoMenuOutline,ea.IoBeaker,ea.IoFlaskSharp),sa=Vs.BS,ia=(sa.BsDisplayFill,sa.BsChevronDown,sa.BsFillTriangleFill,sa.BsFillFileEarmarkSpreadsheetFill,sa.BsBoxSeam,sa.BsGripVertical),aa=sa.BsAlignTop,na=sa.BsAlignMiddle,ra=sa.BsAlignBottom,oa=sa.BsAlignStart,la=sa.BsAlignCenter,ca=sa.BsAlignEnd,da=sa.BsDistributeHorizontal,ha=sa.BsDistributeVertical,ua=Vs.BI,pa=(ua.BiShapeTriangle,ua.BiAtom),_a=(Vs.CG.CgOptions,Vs.FI),ma=_a.FiPackage,ga=(_a.FiMinus,_a.FiMousePointer),Ea=_a.FiMove,fa=(_a.FiPlusCircle,_a.FiSidebar,_a.FiTriangle,_a.FiZoomIn),Ta=_a.FiZoomOut,Ca=(_a.FiGitMerge,Vs.RI),Sa=(Ca.RiShapeLine,Ca.RiTestTubeFill,Ca.RiRobotFill,Vs.TB),xa=(Sa.TbArrowsJoin2,Sa.TbArrowsSplit2,Sa.TbMathFunction);Sa.TbBook,Vs.HI.HiCode;var Na=s(73882),Aa=s(53083);const Ia=6e3;var va;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(va=va||(va={}));class Oa{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class ya{notification;constructor(){(0,S.rC)(this,{notification:S.LO,setNotification:S.aD,notify:S.aD,notifySuccess:S.aD,notifyWarning:S.aD,notifyIllegalState:S.aD,notifyError:S.aD})}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new Oa(va.INFO,e,t??[],null===s?void 0:s??Ia))}notifySuccess(e,t,s){this.setNotification(new Oa(va.SUCCESS,e,t??[],null===s?void 0:s??Ia))}notifyWarning(e,t,s){this.setNotification(new Oa(va.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Ia))}notifyError(e,t){let s;e instanceof F?s=e.detail:e instanceof Error?s=e.message:(q(J(e),"Can't display error"),s=e),s&&this.setNotification(new Oa(va.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new Oa(va.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Ia))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return G(e),this.notifyIllegalState(e.message),t}}}const Ra=(0,Nt.Pi)((()=>{const e=An(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",a=t?.severity??va.INFO,[n,r]=(0,At.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(ei,{})});switch(a){case va.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(ui,{})});break;case va.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Ws,{})});break;case va.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(hi,{})});break;case va.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(di,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(Na.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Ia,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Aa.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,vs.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":n}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",onClick:()=>r(!n),tabIndex:-1,title:n?"Collapse":"Expand",children:n?(0,T.jsx)(Zi,{}):(0,T.jsx)(qi,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(Ys,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var wa=s(17954);const La=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(wa.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Pa=e=>{const{className:t,children:s,menuProps:i,content:a,disabled:n,onClose:r,onOpen:o}=e,l=(0,At.useRef)(null),[c,d]=(0,At.useState)(!1),[h,u]=(0,At.useState)(),[p,_]=(0,At.useState)(0),[m,g]=(0,At.useState)(0),E=()=>{u(void 0),d(!1),g(0),_(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!n&&(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:a,clientY:n,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(a,n).some((e=>e===c))&&s<=a&&a<=s+t.width&&i<=n&&n<=i+t.height))return E(),void r?.();u(c),d(!0),g(n),_(a)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(La,{open:c,anchorPosition:{left:p,top:m},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:a},`${p}, ${m}`)]})},ba=(0,At.forwardRef)((function(e,t){const{className:s,children:i,...a}=e;return(0,T.jsx)("div",{ref:t,className:(0,vs.clsx)("menu",s),...a,children:i})})),Da=e=>{const{className:t,onClick:s,title:i,disabled:a,children:n,...r}=e;return(0,T.jsx)("button",{className:(0,vs.clsx)("menu__item",t),disabled:Boolean(a),title:i,onClick:s,...r,children:n})},Ma=Os("MenuContentDivider","menu__divider");Os("MenuContentItemIcon","menu__item__icon"),Os("MenuContentItemLabel","menu__item__label");var Fa=s(95081),ka=s(53019);const Ua=e=>(0,T.jsx)(Fa.D,{className:(0,vs.clsx)("markdown-content",e.className),remarkPlugins:[ka.Z],children:e.value.value});var ja=s(62515);const Ga=e=>{const{children:t}=e,{ref:s,width:i,height:a}=(0,ja.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[n,r]=(0,At.useState)(!1),{ref:o,width:l,height:c}=(0,ja.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,At.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(a??0)+40)}),[l,c,i,a]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,vs.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!n}),children:t})})};var Va=s(33207);const Ba=e=>{const{children:t,...s}=e;return(0,T.jsx)(Va.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var $a=s(13474),za=s(65068),Ha=s(41327),Ya=s(85688),Wa=s(28019),Ka=s(8978);const Xa=e=>{const{children:t,options:s,size:i,className:a,...n}=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,vs.clsx)("mui-radio-group",a),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ya.Z,{className:"mui-radio-group__group",...n,children:e.map((e=>(0,T.jsx)(Wa.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Ka.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 Za;!function(e){e.TUTORIAL_QUERY_BUILDER="tutorial.query.builder",e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax",e.QUESTION_WHEN_TO_CONFIGURE_PLATFORM_VERSIONS="question.when-to-configure-project-platform-dependencies-versions",e.QUESTION_HOW_TO_WRITE_A_SERVICE_TEST="question.how-to-write-a-service-test",e.QUESTION_WHY_DO_I_SEE_ERROR_WITH_ASSOCIATION_PROPERTY_TYPE="question.why-do-i-see-error-with-association-property-type",e.QUESTION_HOW_TO_ADD_PARAMETERS_TO_QUERY="question.how-to-add-parameters-to-query",e.QUESTION_HOW_TO_ADD_CONSTANTS_TO_QUERY="question.how-to-add-constants-to-query",e.QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA="question.how-to-write-service-connection-test-data",e.QUESTION_HOW_TO_CREATE_A_DATA_ELEMENT="question.how-to-create-a-data-element"}(Za=Za||(Za={}));const qa=(0,Nt.Pi)((e=>{const{configState:t}=e,s=An();return(0,T.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,T.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,T.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(Za.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(ei,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(Xa,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[Dt.STANDARD,Dt.INCLUDE,Dt.EXACT,Dt.INVERSE],size:1})})]})})),Ja=(0,Nt.Pi)((e=>{const{entry:t}=e,s=An(),i=()=>{t.isOpen||zt.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},a=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(Pa,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(ba,{children:(0,T.jsx)(Da,{onClick:a,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,vs.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)(Zi,{}):(0,T.jsx)(Ji,{})}),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:()=>{zt.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:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,T.jsx)(Ua,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Qa=(0,Nt.Pi)((()=>{const e=An(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),a=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(Pa,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(ba,{children:[(0,T.jsx)(Da,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Da,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Da,{onClick:a,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:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(Ua,{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)(Ja,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Ga,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Oi,{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!"})]})})]})})),en=(0,Nt.Pi)((()=>{const e=An(),t=(0,At.useRef)(null),s=(0,At.useRef)(null),i=e.assistantService,a=i.searchText,n=(0,At.useMemo)((()=>(0,$a.Z)((()=>i.search()),100)),[i]);return(0,At.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&&i.refreshPanelRendering()},className:(0,vs.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":a}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),n()},value:a,placeholder:"Ask me a question"}),a&&(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,T.jsx)("button",{ref:s,className:(0,vs.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":i.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":i.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>i.setShowSearchConfigurationMenu(!i.showSearchConfigurationMenu),title:(i.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,T.jsx)(Xs,{})}),a?(0,T.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{i.resetSearch(),i.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,T.jsx)(Ys,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(ri,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(js,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,vs.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,T.jsx)(qa,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(Ja,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,T.jsxs)(T.Fragment,{children:[Boolean(i.searchResults.length)&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,T.jsx)(Ja,{entry:e},e.uuid)))}),a&&!i.searchResults.length&&(0,T.jsx)(Ga,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(yi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!a&&!i.searchResults.length&&(0,T.jsx)(Pa,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(ba,{children:[(0,T.jsx)(Da,{onClick:()=>{fe(`documentation-registry_${(0,za.Z)(new Date(Date.now()),je)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ce.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(Da,{onClick:()=>{fe(`documentation-registry_${(0,za.Z)(new Date(Date.now()),je)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ce.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)(vi,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(Pi,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Li,{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?"})]})})]})]})]})})),tn=(0,Nt.Pi)((e=>{const{triggerElement:t}=e,s=An().assistantService,i=s.currentContextualDocumentationEntry,a=s.selectedTab;return(0,T.jsx)(Ba,{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,vs.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Mt.SEARCH}),onClick:()=>s.setSelectedTab(Mt.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(ri,{})})}),(0,T.jsx)("div",{className:(0,vs.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Mt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(Mt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(Ii,{}),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)(Vi,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[a===Mt.SEARCH&&(0,T.jsx)(en,{}),a===Mt.CONTEXTUAL_SUPPORT&&(0,T.jsx)(Qa,{})]})]})},s.panelRenderingKey)})),sn=(0,Nt.Pi)((()=>{const[e,t]=(0,At.useState)(!1),[s,i]=(0,At.useState)((0,n.Z)()),a=An(),r=(0,At.useRef)(null),o=a.assistantService,l=o.currentContextualDocumentationEntry;return(0,At.useEffect)((()=>{o.isHidden&&i((0,n.Z)())}),[o.isHidden]),(0,T.jsx)(Ha,{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,vs.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(Mt.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)(Vi,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(li,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(Pa,{className:(0,vs.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)(ba,{children:[(0,T.jsx)(Da,{onClick:()=>{o.setIsOpen(!1),i((0,n.Z)())},children:"Reset Position"}),(0,T.jsx)(Da,{onClick:()=>a.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)(ia,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(tn,{triggerElement:r.current})]})},s)}));var an;!function(e){e.TOP_LEVEL_CONTAINER="application.top-level-container",e.BACKDROP_CONTAINER="application.backdrop-container"}(an||(an={}));const nn=["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"],rn=e=>(0,T.jsx)("div",{className:"backdrop__container","data-elementid":e.elementId}),on=(0,Nt.Pi)((e=>{const{children:t}=e,s=An(),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:nn,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{nn.includes(e)&&t.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,At.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&((0,ns.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,a=ps(e.combination);if(!a.length)return;const n=t.get(s)??a,r=H(n[0]);_s(i,r)?n.length>1?t.set(s,n.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,At.useEffect)((()=>{const e=()=>{document.hidden&&(zt.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(Cs,{children:[(0,T.jsx)(Gs,{}),(0,T.jsx)(Us,{}),(0,T.jsx)(Ra,{}),s.layoutService.showBackdrop&&(0,T.jsx)(Ss.Z,{container:s.layoutService.getElementByID(s.layoutService.backdropContainerElementID??an.BACKDROP_CONTAINER)??null,children:(0,T.jsx)(xs.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(Ns.W,{backend:As.PD,children:(0,T.jsxs)("div",{className:"app__container","data-elementid":an.TOP_LEVEL_CONTAINER,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(rn,{elementId:an.BACKDROP_CONTAINER}),(0,T.jsx)(sn,{}),t]})})]})})),ln={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"},cn={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},dn=`\n${Kt.BOLD}${Kt.BRIGHT_BLUE}$purist${Kt.RESET}\n${Kt.BOLD}${Kt.MAGENTA}❯${Kt.RESET} `,hn="❯ ";class un extends as{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=Ft.create();constructor(e){super(e),this.instance=new Xt.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${N}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:ln,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new qt.FitAddon,this.searcher=new Jt.SearchAddon,this.renderer=new es.WebglAddon}setup(e){if(this.setupState.hasCompleted)throw new U("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 Qt.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>ms(e,"Control+KeyF")||ms(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(ms(e,"Control+KeyC")&&this.instance.hasSelection()||ms(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new Zt.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new Zt.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(Te.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(ms(t,"Control+KeyD")||ms(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(an.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=`${hn}${this.command}`,i=`${hn}${this.command.substring(0,t-hn.length)}${this.command.length<t-hn.length?" ".repeat(t-this.command.length-hn.length):""}`;let a=0,n=0;for(let s=e.baseY+e.cursorY;s>-1;--s){if(H(e.getLine(s)).translateToString()===i){a=s,n+=(s===e.baseY+e.cursorY?e.cursorX:t)-hn.length;break}n+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:a,startX:hn.length,endY:a+(s.length-s.length%t)/t,endX:s.length%t,cursorIdx:n}}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,a=this.instance.rows,n=this.getCommandRange(),r=t?e<0?n.cursorIdx:this.command.length-n.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,a-1));const h=d>s.viewportY+a?d-(s.viewportY+a):d<s.viewportY?d-s.viewportY:0;return{seq:ts(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),a=this.computeCursorMovement(e.length,!1);this.instance.scrollLines(a.scroll),this.instance.write(e+i+a.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 a,n,r;if(0===e)return;e<0?(a=this.command.slice(0,t.cursorIdx-i),n=this.command.slice(t.cursorIdx,this.command.length),r=-i):(a=this.command.slice(0,t.cursorIdx),n=this.command.slice(t.cursorIdx+i,this.command.length),r=0);const o=this.computeCursorMovement(r);this.instance.scrollLines(o.scroll),this.instance.write(ts(t.startY+1,t.startX+1)+a+n+" ".repeat(i)+o.seq),this.setCommand(a+n)}get isSetup(){return this.setupState.hasCompleted}isFocused(){return document.activeElement===this.instance.textarea}mount(e){if(!this.setupState.hasCompleted)throw new U("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(ts(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(ts(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(dn),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${Kt.DIM}(system: ${e})\n${Kt.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=H(e.getLine(s)).translateToString();if(i.trim()){t=i!==hn;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(Kt.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${Kt.BRIGHT_BLACK}+-------------------------------------------------------+${Kt.RESET}\n${Kt.BRIGHT_BLACK}|${Kt.RESET} ${Kt.BRIGHT_GREEN}[@@]${Kt.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${Kt.BRIGHT_BLACK}|${Kt.RESET}\n${Kt.BRIGHT_BLACK}|${Kt.RESET} ${Kt.BRIGHT_GREEN}/|__|\\${Kt.RESET} ${Kt.BRIGHT_BLACK}|${Kt.RESET}\n${Kt.BRIGHT_BLACK}+--${Kt.RESET} ${Kt.BRIGHT_GREEN}d b${Kt.RESET} ${Kt.BRIGHT_BLACK}-----------------------------------------------+${Kt.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,ns.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${Kt.BRIGHT_GREEN}${e.command.padEnd(30)}${Kt.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${Kt.DIM}${e.usage}${Kt.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(Kt).map((([e,t])=>`${t}${ds(e).padEnd(20)}${Kt.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${Kt.RED}${e}${Kt.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:cn,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:cn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:cn,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=H(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 pn{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new un(e)}}const _n="(unknown)";class mn{applicationStore;currentUser=_n;constructor(e){(0,S.rC)(this,{currentUser:S.LO,setCurrentUser:S.aD}),this.applicationStore=e}get isAnonymous(){return this.currentUser===_n}setCurrentUser(e){this.currentUser=e}}class gn{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 En{timestamp=Date.now();interruptions=[];recordUsageInterruption(){this.interruptions.push(Date.now())}finalizeTimingsRecord(e,t){const s=e.elapsed,i=e.startTime,a=i+s,n={...t??{},...Object.fromEntries(e.records),total:s};let r=0;for(const e of this.interruptions)if(e>=i&&e<=a)r++;else if(e>a)break;return r>0?{...n,__numberOfInteruptions:r}:n}}class fn{applicationStore;backdropContainerElementID;showBackdrop=!1;colorThemeRegistry=new Map;currentColorTheme;constructor(e){(0,S.rC)(this,{currentColorTheme:S.LO.ref,TEMPORARY__isLightColorThemeEnabled:S.Fl,backdropContainerElementID:S.LO,showBackdrop:S.LO,setBackdropContainerElementID:S.aD,setShowBackdrop:S.aD,setColorTheme:S.aD}),this.applicationStore=e,this.colorThemeRegistry.set(ct.DEFAULT_DARK,dt),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraColorThemes?.()??[])).forEach((e=>{this.colorThemeRegistry.has(e.key)?this.applicationStore.logService.warn(h.create(Te.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(pt.COLOR_THEME)??dt.key;this.currentColorTheme=this.colorThemeRegistry.get(t)??dt,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!==dt}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(pt.COLOR_THEME,e)}}class Tn{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class Cn{navigator;constructor(e){this.navigator=e}}class Sn{uuid=(0,n.Z)();config;pluginManager;timeService;logService;storageService;settingService;alertService;notificationService;identityService;commandService;keyboardShortcutsService;layoutService;clipboardService;terminalService;navigationService;navigationContextService;documentationService;assistantService;eventService;telemetryService;tracerService;constructor(e,t,s){this.config=e,this.pluginManager=s,this.timeService=new En,this.logService=new p,this.logService.registerPlugins(s.getLoggerPlugins()),this.storageService=new Tt(this),this.settingService=new Ct(this),this.alertService=new Ms(this),this.notificationService=new ya,this.identityService=new mn(this),this.layoutService=new fn(this),this.clipboardService=new Tn(this),this.terminalService=new pn(this),this.commandService=new Yt(this),this.keyboardShortcutsService=new Wt(this),this.navigationService=new Cn(t),this.navigationContextService=new Ht(this),this.documentationService=new at(this),this.assistantService=new Vt(this),this.eventService=new Bt,this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins()),this.telemetryService=new gn(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.telemetryService.setup(),this.tracerService=new Lt,this.tracerService.registerPlugins(s.getTracerServicePlugins())}alertUnhandledError=e=>{this.logService.error(h.create(Te.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notificationService.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)}}const xn=(0,At.createContext)(void 0),Nn=({children:e,config:t,pluginManager:s})=>{const i=H((0,At.useContext)(Ot),"Can't find web application navigator in context"),a=(0,Nt.fv)((()=>new Sn(t,i,s)));return(0,T.jsx)(xn.Provider,{value:a,children:e})},An=()=>H((0,At.useContext)(xn),"Can't find application store in context");class In{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=Z(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=Z(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=it(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=H(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=H(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=H(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class vn extends In{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Z(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))}}class On 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 yn extends On{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new yn}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 Rn=JSON.parse('{"i8":"7.1.43","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 wn extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Ln=e=>t=>(0,S.bi)(t)?t:e(t),Pn=e=>(t,s)=>(0,S.bi)(t)?t:e(t,s),bn=e=>{(0,S.rC)(e,{_isDeleted:S.LO,_isDisposed:S.LO,name:S.LO,package:S.LO,isDeleted:S.Fl,path:S.Fl,_elementHashCode:S.Fl,hashCode:S.Fl,setIsDeleted:S.aD,dispose:S.aD})},Dn=Ln((e=>(0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl})));var Mn=s(34485),Fn=s(3096);const kn=e=>Mn.sha1().update(e).digest("hex"),Un=e=>kn(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?kn(e):e.hashCode)).join(","));var jn,Gn;(Gn=jn=jn||(jn={})).PACKAGE="PACKAGE",Gn.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Gn.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Gn.PROFILE="PROFILE",Gn.TAG_POINTER="TAG_POINTER",Gn.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Gn.TAGGED_VALUE="TAGGED_VALUE",Gn.ENUMERATION="ENUMERATION",Gn.ENUM_VALUE="ENUM_VALUE",Gn.CLASS="CLASS",Gn.PROPERTY="PROPERTY",Gn.PROPERTY_POINTER="PROPERTY_POINTER",Gn.MULTIPLICITY="MULTIPLICITY",Gn.CONSTRAINT="CONSTRAINT",Gn.DERIVED_PROPERTY="DERIVED_PROPERTY",Gn.ASSOCIATION="ASSOCIATION",Gn.FUNCTION="FUNCTION",Gn.MEASURE="MEASURE",Gn.UNIT="UNIT",Gn.ASSERT_FAIL="ASSERT_FAIL",Gn.ASSERT_PASS="ASSERT_PASS",Gn.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Gn.EQUAL_TO="EQUAL_TO",Gn.EQUAL_TO_JSON="EQUAL_TO_JSON",Gn.EQUAL_TO_TDS="EQUAL_TO_TDS",Gn.TEST_RESULT="TEST_RESULT",Gn.TEST_ERROR="TEST_ERROR",Gn.TEST_FAILED="TEST_FAILED",Gn.TEST_PASSED="TEST_PASSED",Gn.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Gn.SECTION_INDEX="SECTION_INDEX",Gn.SECTION="SECTION",Gn.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Gn.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Gn.RAW_LAMBDA="RAW_LAMBDA",Gn.RAW_VARIABLE="RAW_VARIABLE",Gn.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Gn.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Gn.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Gn.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Gn.EXPRESSION="EXPRESSION",Gn.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Gn.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Gn.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Gn.INSTANCE_VALUE="INSTANCE_VALUE",Gn.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Gn.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Gn.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Gn.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Gn.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Gn.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Gn.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Gn.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Gn.FUNCTION_TYPE="FUNCTION_TYPE",Gn.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Gn.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Gn.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Gn.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Gn.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Gn.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Gn.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Gn.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE",Gn.MAPPING="MAPPING",Gn.MAPPING_INCLUDE="MAPPING_INCLUDE",Gn.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Gn.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Gn.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Gn.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Gn.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Gn.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Gn.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Gn.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Gn.PROPERTY_MAPPING="PROPERTY_MAPPING",Gn.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Gn.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Gn.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Gn.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Gn.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Gn.MAPPING_TEST="MAPPING_TEST",Gn.STORE_TEST_DATA="STORE_TEST_DATA",Gn.INPUT_DATA="INPUT_DATA",Gn.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Gn.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Gn.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Gn.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Gn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Gn.FILTER_MAPPING="FILTER_MAPPING",Gn.COLUMN_MAPPING="COLUMN_MAPPING",Gn.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Gn.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Gn.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Gn.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Gn.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Gn.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Gn.RUNTIME="RUNTIME",Gn.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Gn.ENGINE_RUNTIME="ENGINE_RUNTIME",Gn.LEGACY_RUNTIME="LEGACY_RUNTIME",Gn.RUNTIME_POINTER="RUNTIME_POINTER",Gn.STORE_CONNECTIONS="STORE_CONNECTIONS",Gn.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Gn.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Gn.CONNECTION_POINTER="CONNECTION_POINTER",Gn.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Gn.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Gn.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Gn.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Gn.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Gn.GENERATION_TREE="GENERATION_TREE",Gn.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Gn.FILE_GENERATION="FILE_GENERATION",Gn.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Gn.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Gn.MODEL_STORE_DATA="MODEL_STORE_DATA",Gn.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Gn.DATA_ELEMENT="DATA_ELEMENT",Gn.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Gn.RELATIONAL_TDS="RELATIONAL_TDS",Gn.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Gn.BINDING="BINDING",Gn.SCHEMA_SET="SCHEMA_SET",Gn.SCHEMA="SCHEMA",Gn.MODEL_UNIT="MODEL_UNIT",Gn.URL_STREAM="URL_STREAM",Gn.EXTERNAL_FORMAT_CONNECTION="EXTERNAL_FORMAT_CONNECTION",Gn.SERVICE="SERVICE",Gn.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Gn.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Gn.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Gn.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Gn.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Gn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Gn.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Gn.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Gn.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Gn.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Gn.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Gn.SERVICE_TEST="SERVICE_TEST",Gn.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Gn.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Gn.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Gn.EXECUTION_ENVIRONMENT_INSTANCE="EXECUTION_ENVIRONMENT_INSTANCE",Gn.SINGLE_EXECUTION_PARAMETER="SINGLE_EXECUTION_PARAMETER",Gn.MULTI_EXECUTION_PARAMETER="MULTI_EXECUTION_PARAMETER",Gn.DATABASE="DATABASE",Gn.DATABASE_SCHEMA="DATABASE_SCHEMA",Gn.DATABASE_JOIN="DATABASE_JOIN",Gn.DATABASE_FILTER="DATABASE_FILTER",Gn.DATBASE_VIEW="DATBASE_VIEW",Gn.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Gn.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Gn.RELATIONAL="RELATIONAL",Gn.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Gn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Gn.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Gn.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Gn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Gn.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Gn.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Gn.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Gn.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Gn.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Gn.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Gn.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Gn.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Gn.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Gn.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Gn.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Gn.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Gn.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Gn.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Gn.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Gn.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Gn.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Gn.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Gn.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Gn.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Gn.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Gn.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Gn.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Gn.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Gn.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Gn.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Gn.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Gn.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Gn.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Gn.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Gn.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Gn.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Gn.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Gn.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Gn.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Gn.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Gn.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Gn.TRINO_DATASOURCE_SPECIFICATION="TRINO_DATASOURCE_SPECIFICATION",Gn.TRINO_SSL_SPECIFICATION="TRINO_SSL_SPECIFICATION",Gn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Gn.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Gn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Gn.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Gn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Gn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Gn.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Gn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Gn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Gn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY="TRINO_KEREBEROS_AUTHENTICATION_STRATEGY",Gn.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Gn.SCHEMA_MAPPER="SCHEMA_MAPPER",Gn.TABLE_MAPPER="TABLE_MAPPER",Gn.FLAT_DATA="FLAT_DATA",Gn.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Gn.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Gn.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Gn.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Gn.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Gn.FLAT_DATA_STRING="FLAT_DATA_STRING",Gn.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Gn.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Gn.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Gn.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Gn.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Gn.FLAT_DATA_DATE="FLAT_DATA_DATE",Gn.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Gn.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Gn.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Gn.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Gn.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Gn.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Gn.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Gn.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER";const Vn=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(te(t=e),"Can't hash non-object value"),Fn(t,s);var t,s},Bn=(e,t)=>Un([e?Vn(e):"",t?Vn(t):""]),$n=(e,t)=>[jn.PACKAGEABLE_ELEMENT_POINTER,e,t].map(kn).join(",");class zn{stereotypes=[];taggedValues=[]}class Hn extends zn{name}class Yn extends Hn{_UUID=(0,n.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}${Ce}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return Un([jn.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new U(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class Wn extends Yn{}class Kn extends Wn{_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 Un([jn.CLASS,this.path,Un(this.properties),Un(this.derivedProperties),Un(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Un(this.constraints),Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class Xn extends Wn{}class Zn extends Xn{values=[];get _elementHashCode(){return Un([jn.ENUMERATION,this.path,Un(this.values),Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class qn extends Xn{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Un([jn.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}}class Jn extends Wn{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Un([jn.MEASURE,this.path,this.canonicalUnit??"",Un(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class Qn extends Yn{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class er{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Un([jn.SECTION,this.parserName,Un(this.elements.map((e=>e.valueForSerialization??"")))])}}class tr extends er{imports=[];get hashCode(){return Un([jn.IMPORT_AWARE_CODE_SECTION,super.hashCode,Un(this.imports.map((e=>e.valueForSerialization??"")))])}}class sr extends er{get hashCode(){return Un([jn.DEFAULT_CODE_SECTION,super.hashCode])}}class ir{_UUID=(0,n.Z)()}class ar extends ir{ownerReference;constructor(e){super(),this.ownerReference=e}}class nr extends ir{value;constructor(e){super(),this.value=e}}class rr extends nr{constructor(e){super(e)}static create(e){return new rr(e)}get valueForSerialization(){return this.value.path}}const or=Ln((e=>(0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}))),lr=Ln((e=>(bn(e),(0,S.rC)(e,{type:S.LO,generationOutputPath:S.LO,scopeElements:S.LO,configurationProperties:S.LO,_elementHashCode:S.KG}),e.scopeElements.forEach((e=>{e instanceof nr&&Dn(e)})),e.configurationProperties.forEach(or),e))),cr=Ln((e=>((0,S.rC)(e,{id:S.LO,hashCode:S.Fl}),Dn(e.generationElement),e))),dr=Ln((e=>(bn(e),(0,S.rC)(e,{generationNodes:S.LO,fileGenerations:S.LO,_elementHashCode:S.KG}),e.generationNodes.forEach(cr),e.fileGenerations.forEach(Dn),e)));class hr{}class ur extends hr{expectedOutput;constructor(e){super(),this.expectedOutput=hs(e)}get hashCode(){return Un([jn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class pr{}class _r extends pr{mappings=[];connections=[];get hashCode(){return Un([jn.ENGINE_RUNTIME,Un(this.mappings.map((e=>$n(Me.MAPPING,e.valueForSerialization??"")))),Un(this.connections.filter((e=>e.storeConnections.length)))])}}class mr extends pr{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Un([jn.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class gr{}class Er extends gr{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Un([jn.FLAT_DATA_INPUT_DATA,$n(Me.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var fr,Tr,Cr;(Cr=fr=fr||(fr={})).JSON="JSON",Cr.XML="XML";class Sr extends gr{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===fr.JSON?hs(s):s}get hashCode(){return Un([jn.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Tr=Tr||(Tr={}));class xr extends gr{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Un([jn.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Nr=Ln((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),Dn(e.type),e))),Ar=Ln((e=>(0,S.rC)(e,{body:S.LO.ref,parameters:S.LO.ref,hashCode:S.Fl}))),Ir=Ln((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,hashCode:S.Fl}),Dn(e.type),e)));class vr{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Ar(e)}visit_RawVariableExpression(e){Ir(e)}visit_RawPrimitiveInstanceValue(e){Nr(e)}}Pn(((e,t)=>(e.accept_RawValueSpecificationVisitor(new vr(t)),e)));class Or{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class yr extends Or{trueString;falseString;get hashCode(){return Un([jn.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Rr extends Or{get hashCode(){return Un([jn.FLAT_DATA_STRING])}}class wr extends Or{get hashCode(){return Un([jn.FLAT_DATA_NUMBER])}}class Lr extends Or{dateFormat;timeZone;get hashCode(){return Un([jn.FLAT_DATA_DATE,this.dateFormat?Un(this.dateFormat):"",this.timeZone??""])}}class Pr extends Or{fields=[];get hashCode(){return Un([jn.FLAT_DATA_RECORD_TYPE,Un(this.fields)])}}const br=Pn(((e,t)=>(gd(e,t),(0,S.rC)(e,{flatData:S.LO,sectionName:S.LO,hashCode:S.Fl}),e))),Dr=Ln((e=>((0,S.rC)(e,{label:S.LO,flatDataDataType:S.LO,optional:S.LO,address:S.LO,hashCode:S.Fl}),(e=>{e instanceof yr?(0,S.rC)(e,{trueString:S.LO,falseString:S.LO,hashCode:S.Fl}):e instanceof Rr||e instanceof wr?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof Lr?(0,S.rC)(e,{dateFormat:S.LO,timeZone:S.LO,hashCode:S.Fl}):e instanceof Pr&&Ln(Mr)(e)})(e.flatDataDataType),e)));function Mr(e){return(0,S.rC)(e,{fields:S.LO,hashCode:S.Fl}),e.fields.forEach(Dr),e}Ln(Mr);const Fr=Ln(Mr),kr=Ln((e=>((0,S.rC)(e,{name:S.LO,value:S.LO,hashCode:S.Fl}),e))),Ur=Ln((e=>((0,S.rC)(e,{driverId:S.LO,name:S.LO,sectionProperties:S.LO,recordType:S.LO,hashCode:S.Fl}),e.sectionProperties.forEach(kr),e.recordType&&Fr(e.recordType),e))),jr=(Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Dn(e.ownerReference),e))),Ln((e=>(bn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(Ur),e)))),Gr=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),Vr=Pn(((e,t)=>(Ad(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),Gr(e.sourceRootRecordType),e.filter&&Ar(e.filter),e))),Br=Pn(((e,t)=>(gd(e,t),Ad(e,t),(0,S.rC)(e,{rootInstanceSetImplementation:S.LO,hashCode:S.Fl}),e))),$r=Pn(((e,t)=>(gd(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,hashCode:S.Fl}),Ar(e.transform),e))),zr=Ln((e=>((0,S.rC)(e,{data:S.LO,hashCode:S.Fl}),Dn(e.sourceFlatData),e))),Hr=Ln((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e)));class Yr{}class Wr extends Yr{serverPrincipal;get hashCode(){return Un([jn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class Kr extends Yr{get hashCode(){return Un([jn.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class Xr extends Yr{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Un([jn.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class Zr extends Yr{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Un([jn.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class qr extends Yr{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Un([jn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class Jr extends Yr{get hashCode(){return Un([jn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class Qr extends Yr{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Un([jn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Un(this.additionalGcpScopes)])}}class eo extends Yr{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Un([jn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class to extends Yr{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Un([jn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class so extends Yr{kerberosRemoteServiceName;kerberosUseCanonicalHostname;constructor(e,t){super(),this.kerberosRemoteServiceName=e,this.kerberosUseCanonicalHostname=t}get hashCode(){return Un([jn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY,this.kerberosRemoteServiceName,this.kerberosUseCanonicalHostname.toString()])}}class io{}class ao extends io{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Un([jn.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class no extends io{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 Un([jn.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class ro extends io{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Un([jn.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class oo extends io{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Un([jn.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Un(this.testDataSetupSqls)])}}class lo extends io{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 Un([jn.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 co extends io{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,a,n){super(),this.clusterID=a,this.region=n,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return Un([jn.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class ho extends io{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Un([jn.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class uo extends io{projectId;instanceId;databaseId;proxyHost;proxyPort;constructor(e,t,s,i,a){super(),this.projectId=e,this.instanceId=t,this.databaseId=s,this.proxyHost=i,this.proxyPort=a}get hashCode(){return Un([jn.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class po extends io{host;port;sslSpecification;catalog;schema;clientTags;constructor(e,t,s){super(),this.host=e,this.port=t,this.sslSpecification=s}get hashCode(){return Un([jn.TRINO_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.sslSpecification,this.catalog??"",this.schema??"",this.clientTags??""])}}class _o{}class mo extends _o{_UUID=(0,n.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Un([this.from,this.to])}}class go extends mo{get hashCode(){return Un([super.hashCode,jn.SCHEMA_MAPPER])}}class Eo extends mo{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Un([super.hashCode,jn.TABLE_MAPPER,this.schema])}}class fo{_UUID=(0,n.Z)()}class To extends fo{mappers=[];get hashCode(){return Un([jn.MAPPER_POST_PROCESSOR,Un(this.mappers)])}}const Co="{target}",So="default";class xo{}class No extends xo{}class Ao extends No{}class Io extends Ao{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Un([jn.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Un(this.parameters)])}}var vo;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(vo=vo||(vo={}));const Oo=e=>[e].concat(e.children.length?Oo(e.children[0]):[]);class yo extends xo{relationalOperationElement;joinTreeNode;get hashCode(){return Un([jn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Un(this.joinTreeNode?Oo(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Ro extends xo{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new j}}class wo extends xo{alias;column;columnName;get hashCode(){return Un([jn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Co:this.alias.name,this.column.value.name])}}class Lo extends xo{value;constructor(e){super(),this.value=e}get hashCode(){return Un([jn.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Po extends xo{values=[];get hashCode(){return Un([jn.RELATIONAL_OPERATION_LITERAL_LIST,Un(this.values)])}}class bo extends xo{owner;name;type;nullable;get hashCode(){return Un([jn.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Do{}class Mo extends Do{infinityDate}class Fo{}class ko extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_BIGINT])}}class Uo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_SMALLINT])}}class jo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_TINYINT])}}class Go extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_INTEGER])}}class Vo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_FLOAT])}}class Bo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_DOUBLE])}}class $o extends Fo{size;constructor(e){super(),this.size=e}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class zo extends Fo{size;constructor(e){super(),this.size=e}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Ho extends Fo{size;constructor(e){super(),this.size=e}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Yo extends Fo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Wo extends Fo{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Ko extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_TIMESTAMP])}}class Xo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_VARCHAR])}}class Zo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_BIT])}}class qo extends Fo{size;constructor(e){super(),this.size=e}get hashCode(){return Un([jn.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class Jo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_REAL])}}class Qo extends Fo{get hashCode(){return Un([jn.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class el extends ar{ownerReference;constructor(e){super(e),this.ownerReference=e}}class tl extends el{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[jn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(kn).join(",")}get selfJoinPointerHashCode(){return[jn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",So,Co].map(kn).join(",")}}class sl extends el{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[jn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(kn).join(",")}get selfJoinPointerHashCode(){return[jn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",So,Co].map(kn).join(",")}}const il=Ln((e=>((0,S.rC)(e,{packageableElementIncludes:S.LO,packageableElementExcludes:S.LO,hashCode:S.Fl}),e.packageableElementIncludes.forEach(Dn),e.packageableElementExcludes.forEach(Dn),e))),al=(Ln((e=>(cd(e),(0,S.rC)(e,{schemaSet:S.LO,schemaId:S.LO,contentType:S.LO,modelUnit:S.LO,_elementHashCode:S.KG}),e.schemaSet&&Dn(e.schemaSet),il(e.modelUnit),e))),Ln((e=>((0,S.rC)(e,{binding:S.LO,hashCode:S.Fl}),Dn(e.binding),e)))),nl=Ln((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e))),rl=(Ln((e=>(Bd(e),(0,S.rC)(e,{externalSource:S.LO,hashCode:S.Fl}),nl(e.externalSource),e))),Ln((e=>(0,S.rC)(e,{id:S.LO,location:S.LO,content:S.LO,hashCode:S.Fl})))),ol=(Ln((e=>(bn(e),(0,S.rC)(e,{format:S.LO,schemas:S.LO,_elementHashCode:S.KG}),e.schemas.forEach(rl),e))),Ln((e=>e instanceof ko||e instanceof Uo||e instanceof jo||e instanceof Go||e instanceof Vo||e instanceof Bo||e instanceof Ko||e instanceof Date||e instanceof Xo||e instanceof Zo||e instanceof Jo||e instanceof Qo?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof $o||e instanceof zo||e instanceof Ho||e instanceof qo?(0,S.rC)(e,{size:S.LO,hashCode:S.Fl}):e instanceof Yo||e instanceof Wo?(0,S.rC)(e,{precision:S.LO,scale:S.LO,hashCode:S.Fl}):e))),ll=Ln((e=>((0,S.rC)(e,{name:S.LO,type:S.LO,nullable:S.LO,hashCode:S.Fl}),ol(e.type),e))),cl=Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Dn(e.ownerReference),e))),dl=Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Dn(e.ownerReference),e))),hl=Ln((e=>((0,S.rC)(e,{relation:S.LO,name:S.LO,database:S.LO,isSelfJoinTarget:S.LO}),(e=>{e instanceof sl?dl(e):e instanceof tl&&cl(e)})(e.relation),e))),ul=Ln((e=>((0,S.rC)(e,{name:S.LO,parameters:S.LO,hashCode:S.Fl}),e.parameters.forEach(Cl),e))),pl=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),_l=Ln((e=>((0,S.rC)(e,{alias:S.LO,column:S.LO,columnName:S.LO,hashCode:S.Fl}),hl(e.alias),pl(e.column),e))),ml=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),gl=Ln((e=>((0,S.rC)(e,{alias:S.LO,children:S.LO,joinType:S.LO,hashCode:S.Fl}),e.alias&&hl(e.alias),e.children.forEach(gl),ml(e.join),e))),El=Ln((e=>((0,S.rC)(e,{relationalOperationElement:S.LO,joinTreeNode:S.LO,hashCode:S.Fl}),e.relationalOperationElement&&Cl(e.relationalOperationElement),e.joinTreeNode&&gl(e.joinTreeNode),e))),fl=Ln((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),e.value instanceof xo&&Cl(e.value),e))),Tl=Ln((e=>((0,S.rC)(e,{values:S.LO,hashCode:S.Fl}),e.values.forEach(fl),e)));function Cl(e){return e instanceof Io?ul(e):e instanceof Ro?hl(e):e instanceof wo?_l(e):e instanceof bo?ll(e):e instanceof Lo?fl(e):e instanceof Po?Tl(e):e instanceof yo?El(e):e}const Sl=Ln((e=>e)),xl=Pn(((e,t)=>{if(e instanceof Mo)return Sl(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})),Nl=Ln((e=>((0,S.rC)(e,{columnName:S.LO,relationalOperationElement:S.LO,hashCode:S.Fl}),Cl(e.relationalOperationElement),e))),Al=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),Il=Ln((e=>((0,S.rC)(e,{joinTreeNode:S.LO,database:S.LO,filterName:S.LO,hashCode:S.Fl}),e.joinTreeNode&&gl(e.joinTreeNode),Al(e.filter),e))),vl=Ln((e=>((0,S.rC)(e,{columns:S.LO}),e.columns.forEach(Cl),e))),Ol=e=>{(0,S.rC)(e,{columns:S.LO,name:S.LO})},yl=Pn(((e,t)=>(Ol(e),(0,S.rC)(e,{primaryKey:S.LO,hashCode:S.Fl}),e.primaryKey.forEach(ll),e.milestoning.forEach((e=>xl(e,t))),e))),Rl=Pn(((e,t)=>(Ol(e),(0,S.rC)(e,{primaryKey:S.LO,columnMappings:S.LO,filter:S.LO,distinct:S.LO,groupBy:S.LO,hashCode:S.Fl}),e.primaryKey.forEach(ll),e.columnMappings.forEach(Nl),e.filter&&Il(e.filter),e.groupBy&&vl(e.groupBy),e))),wl=Pn(((e,t)=>((0,S.rC)(e,{name:S.LO,tables:S.LO,views:S.LO,hashCode:S.Fl}),e.tables.forEach((e=>yl(e,t))),e.views.forEach((e=>Rl(e,t))),e))),Ll=Ln((e=>((0,S.rC)(e,{name:S.LO,operation:S.LO,hashCode:S.Fl}),Cl(e.operation),e))),Pl=Ln((e=>((0,S.rC)(e,{name:S.LO,target:S.LO,aliases:S.LO,operation:S.LO,hashCode:S.Fl}),e.target&&hl(e.target),Cl(e.operation),e))),bl=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{schemas:S.LO,joins:S.LO,filters:S.LO,_elementHashCode:S.KG}),e.schemas.forEach((e=>wl(e,t))),e.joins.forEach(Pl),e.filters.forEach(Ll),e))),Dl=Pn(((e,t)=>(gd(e,t),(0,S.rC)(e,{transformer:S.LO,relationalOperation:S.LO.ref,bindingTransformer:S.LO,hashCode:S.Fl}),e.bindingTransformer&&al(e.bindingTransformer),e))),Ml=(e,t)=>(Ad(e,t),gd(e,t),(0,S.rC)(e,{id:S.LO,rootInstanceSetImplementation:S.LO,primaryKey:S.LO}),e.primaryKey.forEach(Cl),e),Fl=Pn(Ml),kl=Pn(((e,t)=>(Ml(e,t),(0,S.rC)(e,{inlineSetImplementation:S.LO}),Ld(e.inlineSetImplementation,t),e))),Ul=Pn(((e,t)=>(Ml(e,t),(0,S.rC)(e,{otherwisePropertyMapping:S.LO,hashCode:S.Fl}),Td(e.otherwisePropertyMapping,t),e))),jl=Pn(((e,t)=>(Ad(e,t),(0,S.rC)(e,{primaryKey:S.LO}),e.primaryKey.forEach(Cl),e))),Gl=Pn(((e,t)=>(Ad(e,t),(0,S.rC)(e,{columnMappings:S.LO,filter:S.LO,distinct:S.LO,groupBy:S.LO,mainTableAlias:S.LO,superSetImplementationId:S.LO,hashCode:S.Fl}),e.columnMappings.forEach(Nl),e.filter&&Il(e.filter),e.groupBy&&vl(e.groupBy),e.mainTableAlias&&hl(e.mainTableAlias),e))),Vl=Ln((e=>((0,S.rC)(e,{data:S.LO,inputType:S.LO,hashCode:S.Fl}),Dn(e.database),e))),Bl=Ln((e=>(0,S.rC)(e,{host:S.LO,port:S.LO,databaseName:S.LO,hashCode:S.Fl}))),$l=Ln((e=>(0,S.rC)(e,{hostname:S.LO,port:S.LO,protocol:S.LO,httpPath:S.LO,hashCode:S.Fl}))),zl=Ln((e=>(0,S.rC)(e,{databaseName:S.LO,directory:S.LO,autoServerMode:S.LO,hashCode:S.Fl}))),Hl=Ln((e=>(0,S.rC)(e,{testDataSetupCsv:S.LO,testDataSetupSqls:S.LO,hashCode:S.Fl}))),Yl=Ln((e=>(0,S.rC)(e,{accountName:S.LO,region:S.LO,warehouseName:S.LO,databaseName:S.LO,cloudType:S.LO,quotedIdentifiersIgnoreCase:S.LO,proxyHost:S.LO,proxyPort:S.LO,nonProxyHosts:S.LO,organization:S.LO,accountType:S.LO,role:S.LO,hashCode:S.Fl}))),Wl=Ln((e=>(0,S.rC)(e,{databaseName:S.LO,endpointURL:S.LO,port:S.LO,region:S.LO,clusterID:S.LO,host:S.LO,hashCode:S.Fl}))),Kl=Ln((e=>(0,S.rC)(e,{projectId:S.LO,defaultDataset:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),Xl=Ln((e=>(0,S.rC)(e,{projectId:S.LO,instanceId:S.LO,databaseId:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),Zl=Ln((e=>(0,S.rC)(e,{ssl:S.LO,trustStorePathVaultReference:S.LO,trustStorePasswordVaultReference:S.LO,hashCode:S.Fl}))),ql=Ln((e=>((0,S.rC)(e,{host:S.LO,port:S.LO,catalog:S.LO,schema:S.LO,clientTags:S.LO,hashCode:S.Fl}),Zl(e.sslSpecification),e))),Jl=Ln((e=>(0,S.rC)(e,{serverPrincipal:S.LO,hashCode:S.Fl}))),Ql=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl}))),ec=Ln((e=>(0,S.rC)(e,{apiToken:S.LO,hashCode:S.Fl}))),tc=Ln((e=>(0,S.rC)(e,{oauthKey:S.LO,scopeName:S.LO,hashCode:S.Fl}))),sc=Ln((e=>(0,S.rC)(e,{privateKeyVaultReference:S.LO,passPhraseVaultReference:S.LO,publicUserName:S.LO,hashCode:S.Fl}))),ic=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl}))),ac=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl,userNameVaultReference:S.LO,passwordVaultReference:S.LO,baseVaultReference:S.LO}))),nc=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl,serviceAccountEmail:S.LO,additionalGcpScopes:S.LO}))),rc=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl,vaultReference:S.LO}))),oc=Ln((e=>(0,S.rC)(e,{hashCode:S.Fl,kerberosRemoteServiceName:S.LO,kerberosUseCanonicalHostname:S.LO}))),lc=e=>{(0,S.rC)(e,{from:S.LO,to:S.LO,hashCode:S.Fl})},cc=Ln((e=>(lc(e),e))),dc=Ln((e=>(lc(e),(0,S.rC)(e,{schema:S.LO}),cc(e.schema),e))),hc=Pn(((e,t)=>((e=>{Bd(e),(0,S.rC)(e,{type:S.LO,timeZone:S.LO,quoteIdentifiers:S.LO})})(e),(0,S.rC)(e,{datasourceSpecification:S.LO,authenticationStrategy:S.LO,postProcessors:S.LO,hashCode:S.Fl}),((e,t)=>{if(e instanceof ao)return Bl(e);if(e instanceof no)return $l(e);if(e instanceof ro)return zl(e);if(e instanceof oo)return Hl(e);if(e instanceof lo)return Yl(e);if(e instanceof co)return Wl(e);if(e instanceof ho)return Kl(e);if(e instanceof uo)return Xl(e);if(e instanceof po)return ql(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 Wr)return Jl(e);if(e instanceof Kr)return Ql(e);if(e instanceof Xr)return ec(e);if(e instanceof Zr)return tc(e);if(e instanceof qr)return sc(e);if(e instanceof Jr)return ic(e);if(e instanceof eo)return ac(e);if(e instanceof Qr)return nc(e);if(e instanceof to)return rc(e);if(e instanceof so)return oc(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 To)return(e=>((e=>{(0,S.rC)(e,{hashCode:S.Fl})})(e),(0,S.rC)(e,{mappers:S.LO}),e.mappers.forEach((e=>{(e=>{e instanceof go?cc(e):e instanceof Eo&&dc(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 uc{id}class pc extends uc{__parent;assertions=[]}class _c extends uc{__parent;tests=[]}class mc extends pc{query;get hashCode(){return Un([jn.MAPPING_TEST,this.query,this.id,Un(this.assertions)])}}class gc extends _c{mappingStoreTestDatas=[];get hashCode(){return Un([jn.MAPPING_TEST_SUITE,Un(this.mappingStoreTestDatas),this.id,Un(this.tests)])}}class Ec extends pc{serializationFormat;parameters=[];keys=[];get hashCode(){return Un([jn.SERVICE_TEST,this.id,Un(this.assertions),Un(this.parameters),Un(this.keys),this.serializationFormat??""])}}class fc extends _c{testData;get hashCode(){return Un([jn.SERVICE_TEST_SUITE,this.id,Un(this.tests),this.testData])}}class Tc{id;parentTest}class Cc extends Tc{expected;get hashCode(){return Un([jn.EQUAL_TO,this.id,Vn(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class Sc extends Tc{expected;get hashCode(){return Un([jn.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class xc extends Tc{expected;get hashCode(){return Un([jn.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Nc{}class Ac extends Nc{dataElement;get hashCode(){return Un([jn.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Ic extends Nc{contentType;data;get hashCode(){return Un([jn.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class vc extends Nc{instances;get hashCode(){return Un([jn.MODEL_STORE_DATA,Un(Array.from(this.instances.keys()).map((e=>e.path))),Vn(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class Oc extends Nc{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Un([jn.RELATIONAL_CSV_DATA_TABLE,Un(this.tables)])}}const yc=Ln((e=>((0,S.rC)(e,{contentType:S.LO,data:S.LO,hashCode:S.Fl}),e))),Rc=Ln((e=>((0,S.rC)(e,{dataElement:S.LO,hashCode:S.Fl}),e))),wc=Ln((e=>((0,S.rC)(e,{instances:S.LO,hashCode:S.Fl}),e))),Lc=Ln((e=>((0,S.rC)(e,{values:S.LO,table:S.LO,schema:S.LO,hashCode:S.Fl}),e))),Pc=Ln((e=>((0,S.rC)(e,{tables:S.LO,hashCode:S.Fl}),e.tables.forEach(Lc),e)));function bc(e,t){if(e instanceof Ac)return Rc(e);if(e instanceof Ic)return yc(e);if(e instanceof vc)return wc(e);if(e instanceof Oc)return Pc(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 Dc=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{stereotypes:S.LO,taggedValues:S.LO,data:S.LO,_elementHashCode:S.KG}),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),bc(e.data,t),e)));class Mc{}class Fc extends Mc{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Un([jn.SERVICE_PURE_EXECUTION,this.func])}}class kc extends Fc{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Un([jn.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Uc extends Fc{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Un([jn.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Un(this.executionParameters)])}}class jc{_OWNER;constructor(e){this._OWNER=e}}class Gc extends jc{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Un([jn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Un(this.asserts)])}}class Vc extends jc{tests=[];get hashCode(){return Un([jn.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Un(this.tests)])}}const Bc=Pn(((e,t)=>((0,S.rC)(e,{connectionId:S.LO,testData:S.LO,hashCode:S.Fl}),bc(e.testData,t),e))),$c=Ln((e=>((0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}),e))),zc=Ln((e=>((0,S.rC)(e,{assertion:S.LO,hashCode:S.Fl,id:S.LO}),Ar(e.assertion),e))),Hc=Ln((e=>((0,S.rC)(e,{assertions:S.LO,description:S.LO,parameters:S.LO,hashCode:S.Fl}),e.assertions.forEach(zc),e.parameters.forEach(Ar),e))),Yc=Pn(((e,t)=>((0,S.rC)(e,{connectionsTestData:S.LO,hashCode:S.Fl}),e.connectionsTestData.forEach((e=>Bc(e,t))),e))),Wc=Ln((e=>((0,S.rC)(e,{id:S.LO,serializationFormat:S.LO,assertions:S.LO,parameters:S.LO,keys:S.LO,hashCode:S.Fl}),e.parameters.forEach($c),e.assertions.forEach(ld),e))),Kc=Pn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,testData:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>od(e,t))),Yc(e.testData,t),e))),Xc=Ln((e=>((0,S.rC)(e,{parametersValues:S.LO,assert:S.LO,singleExecutionTestParent:S.LO,hashCode:S.Fl}),Ar(e.assert),e))),Zc=Ln((e=>((0,S.rC)(e,{data:S.LO,asserts:S.LO,hashCode:S.Fl}),e.asserts.forEach(Xc),e))),qc=Ln((e=>(Zc(e),(0,S.rC)(e,{key:S.LO}),e))),Jc=Ln((e=>((0,S.rC)(e,{tests:S.LO,hashCode:S.Fl}),e.tests.forEach(qc),e))),Qc=e=>{(0,S.rC)(e,{func:S.LO}),Ar(e.func)},ed=Pn(((e,t)=>(Qc(e),(0,S.rC)(e,{runtime:S.LO,hashCode:S.Fl}),e.mapping&&Dn(e.mapping),e.runtime&&eh(e.runtime,t),e))),td=Pn(((e,t)=>((0,S.rC)(e,{key:S.LO,runtime:S.LO,hashCode:S.Fl}),Dn(e.mapping),eh(e.runtime,t),e))),sd=Pn(((e,t)=>(Qc(e),(0,S.rC)(e,{executionKey:S.LO,executionParameters:S.LO,hashCode:S.Fl}),e.executionParameters.forEach((e=>td(e,t))),e))),id=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{pattern:S.LO,owners:S.LO,documentation:S.LO,autoActivateUpdates:S.LO,execution:S.LO,test:S.LO,tests:S.LO,postValidations:S.LO,patternParameters:S.Fl,_elementHashCode:S.KG}),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),((e,t)=>{e instanceof kc?ed(e,t):e instanceof Uc&&sd(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Gc?Zc(e):e instanceof Vc&&Jc(e)})(e.test),e.tests.forEach((e=>Kc(e,t))),e.postValidations.forEach((e=>Hc(e))),e))),ad=Ln((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),e))),nd=Ln((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),yc(e.expected),e))),rd=Ln((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),yc(e.expected),e)));function od(e,t){if(e instanceof Ec)return Wc(e);if(e instanceof mc)return hd(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 ld(e){return e instanceof Cc?ad(e):e instanceof Sc?rd(e):e instanceof xc?nd(e):e}const cd=e=>{bn(e),(0,S.rC)(e,{includes:S.LO}),e.includes.forEach(Dn)},dd=Pn(((e,t)=>((0,S.rC)(e,{store:S.LO,data:S.LO,hashCode:S.Fl}),bc(e.data,t),e))),hd=Ln((e=>((0,S.rC)(e,{id:S.LO,query:S.LO,assertions:S.LO,hashCode:S.Fl}),e.assertions.forEach(ld),e))),ud=Pn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,mappingStoreTestDatas:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>od(e,t))),e.mappingStoreTestDatas.forEach((e=>dd(e,t))),e))),pd=Ln((e=>((0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl}),Dn(e.ownerReference),e))),_d=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),md=Ln((e=>((0,S.rC)(e,{localMappingProperty:S.LO,localMappingPropertyType:S.LO,localMappingPropertyMultiplicity:S.LO,hashCode:S.Fl}),Dn(e.localMappingPropertyType),e))),gd=(e,t)=>{(0,S.rC)(e,{sourceSetImplementation:S.LO,targetSetImplementation:S.LO}),Nh(e.property),_d(e.sourceSetImplementation),e.targetSetImplementation&&_d(e.targetSetImplementation),e.localMappingProperty&&md(e.localMappingProperty)},Ed=Pn(((e,t)=>(gd(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,explodeProperty:S.LO,hashCode:S.Fl}),e.transformer&&pd(e.transformer),Ar(e.transform),e)));class fd{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){Ed(e,this.observerContext)}visit_FlatDataPropertyMapping(e){$r(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){Br(e,this.observerContext)}visit_RelationalPropertyMapping(e){Dl(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){br(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Fl(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){kl(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Ul(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Td=(e,t)=>(e.accept_PropertyMappingVisitor(new fd(t)),e),Cd=Ln((e=>(0,S.rC)(e,{isDefault:S.Fl,valueForSerialization:S.Fl}))),Sd=Ln((e=>(0,S.rC)(e,{valueForSerialization:S.Fl}))),xd=e=>{(0,S.rC)(e,{root:S.LO}),Dn(e.class),Cd(e.id),Sd(e.root)},Nd=Ln((e=>((0,S.rC)(e,{setImplementation:S.LO,class:S.LO,properties:S.LO}),e))),Ad=(e,t)=>{xd(e),(0,S.rC)(e,{mappingClass:S.LO,propertyMappings:S.LO}),e.mappingClass&&Nd(e.mappingClass),e.propertyMappings.forEach((e=>Td(e,t)))},Id=Ln((e=>((0,S.rC)(e,{}),_d(e.setImplementation),e))),vd=e=>{xd(e),(0,S.rC)(e,{parameters:S.LO,operation:S.LO,hashCode:S.Fl}),e.parameters.forEach(Id)},Od=Ln((e=>(vd(e),e))),yd=Ln((e=>(vd(e),(0,S.rC)(e,{validationFunction:S.LO}),Ar(e.validationFunction),e))),Rd=Pn(((e,t)=>(Ad(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),e.srcClass&&Dn(e.srcClass),e.filter&&Ar(e.filter),e)));class wd{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){yd(e)}visit_OperationSetImplementation(e){Od(e)}visit_PureInstanceSetImplementation(e){Rd(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Vr(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){jl(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Gl(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Ld=(e,t)=>(e.accept_SetImplementationVisitor(new wd(t)),e),Pd=Ln((e=>((0,S.rC)(e,{original:S.LO,substitute:S.LO}),Dn(e.original),Dn(e.substitute),e))),bd=Ln((e=>((0,S.rC)(e,{included:S.LO,storeSubstitutions:S.LO}),Dn(e.included),e.storeSubstitutions.forEach(Pd),e))),Dd=Ln((e=>(0,S.rC)(e,{value:S.LO}))),Md=Ln((e=>((0,S.rC)(e,{sourceValues:S.LO,hashCode:S.Fl}),Eh(e.enum),e.sourceValues.forEach(Dd),e))),Fd=Ln((e=>((0,S.rC)(e,{sourceType:S.LO,enumValueMappings:S.LO,hashCode:S.Fl}),Dn(e.enumeration),Cd(e.id),e.sourceType&&Dn(e.sourceType),e.enumValueMappings.forEach(Md),e))),kd=Pn(((e,t)=>((0,S.rC)(e,{id:S.LO,stores:S.LO,propertyMappings:S.LO,hashCode:S.Fl}),Dn(e.association),Cd(e.id),e.stores.forEach(Dn),e.propertyMappings.forEach((e=>Td(e,t))),e))),Ud=Ln((e=>((0,S.rC)(e,{inputType:S.LO,data:S.LO,hashCode:S.Fl}),Dn(e.sourceClass),e))),jd=Ln((e=>(0,S.rC)(e,{expectedOutput:S.LO,hashCode:S.Fl}))),Gd=Pn(((e,t)=>((0,S.rC)(e,{name:S.LO,query:S.LO,inputData:S.LO,assert:S.LO,hashCode:S.Fl}),Ar(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Sr)return Ud(e);if(e instanceof Er)return zr(e);if(e instanceof xr)return Vl(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 ur&&jd(e)})(e.assert),e))),Vd=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{includes:S.LO,classMappings:S.LO,enumerationMappings:S.LO,associationMappings:S.LO,test:S.LO,tests:S.LO,_elementHashCode:S.KG}),e.includes.forEach(bd),e.classMappings.forEach((e=>Ld(e,t))),e.enumerationMappings.forEach(Fd),e.associationMappings.forEach((e=>kd(e,t))),e.test.forEach((e=>Gd(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof fc?Kc(e,t):e instanceof gc?ud(e,t):e}(e,t))),e))),Bd=e=>{(0,S.rC)(e,{store:S.LO}),Dn(e.store)},$d=Ln((e=>(Bd(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),zd=Ln((e=>(Bd(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Dn(e.class),e))),Hd=Ln((e=>(Bd(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Dn(e.class),e))),Yd=Ln((e=>(Bd(e),(0,S.rC)(e,{mappings:S.LO,hashCode:S.Fl}),e.mappings.forEach(Dn),e)));class Wd{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){$d(e)}visit_ModelChainConnection(e){Yd(e)}visit_JsonModelConnection(e){zd(e)}visit_XmlModelConnection(e){Hd(e)}visit_FlatDataConnection(e){Hr(e)}visit_RelationalDatabaseConnection(e){hc(e,this.observerContext)}}const Kd=(e,t)=>(e.accept_ConnectionVisitor(new Wd(t)),e),Xd=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{connectionValue:S.LO,_elementHashCode:S.KG}),Kd(e.connectionValue,t),e))),Zd=Pn(((e,t)=>((0,S.rC)(e,{id:S.LO,connection:S.LO,hashCode:S.Fl}),Kd(e.connection,t),e))),qd=Pn(((e,t)=>((0,S.rC)(e,{storeConnections:S.LO,hashCode:S.Fl}),Dn(e.store),e.storeConnections.forEach((e=>Zd(e,t))),e))),Jd=Pn(((e,t)=>((0,S.rC)(e,{mappings:S.LO,connections:S.LO,hashCode:S.Fl}),e.mappings.forEach(Dn),e.connections.forEach((e=>qd(e,t))),e))),Qd=Ln((e=>((0,S.rC)(e,{hashCode:S.Fl}),Dn(e.packageableRuntime),e))),eh=(e,t)=>e instanceof mr?Qd(e):e instanceof _r?Jd(e,t):e,th=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{runtimeValue:S.LO,_elementHashCode:S.KG}),Jd(e.runtimeValue,t),e))),sh=Pn(((e,t)=>(bn(e),(0,S.rC)(e,{_elementHashCode:S.KG}),e)));class ih{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){nh(e,this.observerContext)}visit_SectionIndex(e){uh(e)}visit_PrimitiveType(e){}visit_Profile(e){mh(e)}visit_Enumeration(e){fh(e)}visit_Measure(e){Ch(e)}visit_Class(e){Ih(e)}visit_Association(e){vh(e)}visit_ConcreteFunctionDefinition(e){Oh(e)}visit_FlatData(e){jr(e)}visit_Database(e){bl(e,this.observerContext)}visit_Mapping(e){Vd(e,this.observerContext)}visit_Service(e){id(e,this.observerContext)}visit_ExecutionEnvironmentInstance(e){sh(e,this.observerContext)}visit_PackageableRuntime(e){th(e,this.observerContext)}visit_PackageableConnection(e){Xd(e,this.observerContext)}visit_FileGenerationSpecification(e){lr(e)}visit_GenerationSpecification(e){dr(e)}visit_DataElement(e){Dc(e,this.observerContext)}}const ah=Pn(((e,t)=>(e.accept_PackageableElementVisitor(new ih(t)),e))),nh=Pn(((e,t)=>((e=>{bn(e),(0,S.rC)(e,{children:S.LO,hashCode:S.KG})})(e),e.children.forEach((e=>{e instanceof Qn?nh(e,t):ah(e,t)})),e))),rh=Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Dn(e.ownerReference),e))),oh=Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),e))),lh=Ln((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),oh(e.tag),e))),ch=Ln((e=>(0,S.rC)(e,{rawType:S.LO}))),dh=Ln((e=>((0,S.rC)(e,{value:S.LO}),ch(e.value),Dn(e.ownerReference),e))),hh=Ln((e=>((0,S.rC)(e,{parserName:S.LO,elements:S.LO}),e instanceof tr?(0,S.rC)(e,{imports:S.LO,hashCode:S.Fl}):e instanceof sr&&(0,S.rC)(e,{hashCode:S.Fl}),e))),uh=Ln((e=>(bn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(hh),e))),ph=Ln((e=>(0,S.rC)(e,{value:S.LO}))),_h=Ln((e=>(0,S.rC)(e,{value:S.LO}))),mh=Ln((e=>(bn(e),(0,S.rC)(e,{p_stereotypes:S.LO,p_tags:S.LO,_elementHashCode:S.KG}),e.p_stereotypes.forEach(ph),e.p_tags.forEach(_h),e))),gh=Ln((e=>((0,S.rC)(e,{name:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),Eh=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),fh=Ln((e=>(bn(e),(0,S.rC)(e,{values:S.LO,stereotypes:S.LO,taggedValues:S.LO,_elementHashCode:S.KG}),e.values.forEach(gh),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),Th=Ln((e=>((0,S.rC)(e,{measure:S.LO,conversionFunction:S.LO,hashCode:S.Fl}),e.conversionFunction&&Ar(e.conversionFunction),e))),Ch=Ln((e=>(bn(e),(0,S.rC)(e,{canonicalUnit:S.LO,nonCanonicalUnits:S.LO,_elementHashCode:S.KG}),e.canonicalUnit&&Th(e.canonicalUnit),e.nonCanonicalUnits.forEach(Th),e))),Sh=Ln((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),dh(e.genericType),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),xh=Ln((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,stereotypes:S.LO,taggedValues:S.LO,body:S.LO.ref,parameters:S.LO.ref,hashCode:S.Fl}),dh(e.genericType),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),Nh=Ln((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Dn(e.ownerReference),e))),Ah=Ln((e=>((0,S.rC)(e,{name:S.LO,functionDefinition:S.LO,externalId:S.LO,enforcementLevel:S.LO,messageFunction:S.LO,hashCode:S.Fl}),Ar(e.functionDefinition),e.messageFunction&&Ar(e.messageFunction),e))),Ih=Ln((e=>(bn(e),(0,S.rC)(e,{_subclasses:S.LO,properties:S.LO,propertiesFromAssociations:S.LO,derivedProperties:S.LO,generalizations:S.LO,constraints:S.LO,stereotypes:S.LO,taggedValues:S.LO,dispose:S.KG,_elementHashCode:S.KG}),e.properties.forEach(Sh),e.propertiesFromAssociations.forEach(Sh),e.derivedProperties.forEach(xh),e.generalizations.forEach(dh),e.constraints.forEach(Ah),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),vh=Ln((e=>(bn(e),(0,S.rC)(e,{properties:S.LO,stereotypes:S.LO,taggedValues:S.LO,derivedProperties:S.LO,_elementHashCode:S.KG}),e.properties.forEach(Sh),e.derivedProperties.forEach(xh),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),Oh=Ln((e=>(bn(e),(0,S.rC)(e,{functionName:S.LO,returnMultiplicity:S.LO,parameters:S.LO.shallow,expressionSequence:S.LO.ref,stereotypes:S.LO,taggedValues:S.LO,_elementHashCode:S.KG}),e.parameters.forEach(Ir),Dn(e.returnType),e.stereotypes.forEach(rh),e.taggedValues.forEach(lh),e))),yh=Ln((e=>e instanceof Zn?fh(e):e instanceof qn?Th(e):e instanceof Kn?Ih(e):e instanceof Jn?Ch(e):e)),Rh=(Ln((e=>e instanceof Zn?fh(e):e instanceof qn?Th(e):e)),Ln((e=>(0,S.rC)(e,{_dummyObservable:S.LO})))),wh=Ln((e=>((0,S.rC)(e,{value:S.LO}),Dn(e.ownerReference),e))),Lh=Ln((e=>(Rh(e),(0,S.rC)(e,{id:S.LO,hideProperties:S.LO,hideTaggedValues:S.LO,hideStereotypes:S.LO,hashCode:S.Fl}),Dn(e.class),e))),Ph=Ln((e=>(wh(e.classView),e))),bh=Ln((e=>((0,S.rC)(e,{path:S.LO,pathForSerialization:S.Fl}),Ph(e.from),Ph(e.to),e))),Dh=Ln((e=>(bh(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),Mh=Ln((e=>(bh(e),(0,S.rC)(e,{hashCode:S.Fl}),Nh(e.property),Dn(e.association),e))),Fh=Ln((e=>(bh(e),(0,S.rC)(e,{hashCode:S.Fl}),Nh(e.property),e))),kh=Ln((e=>(bn(e),(0,S.rC)(e,{classViews:S.LO,associationViews:S.LO,generalizationViews:S.LO,propertyViews:S.LO,_elementHashCode:S.KG}),e.classViews.forEach(Lh),e.associationViews.forEach(Mh),e.generalizationViews.forEach(Dh),e.propertyViews.forEach(Fh),e)));var Uh;!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"}(Uh=Uh||(Uh={}));class jh extends Yn{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Un([Uh.DIAGRAM,this.path,Un(this.classViews),Un(this.generalizationViews),Un(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Gh="Diagram";class Vh extends wn{constructor(){super(Rn.Rw.LW,Rn.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Gh]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof jh)return Gh}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof jh)return kh(e)}]}}class Bh{package;name;get path(){return`${this.package}${Ce}${this.name}`}get hashCode(){return Un([jn.PACKAGEABLE_ELEMENT,this.path])}}class $h extends Bh{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Un([Uh.DIAGRAM,this.path,Un(this.classViews),Un(this.generalizationViews),Un(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class zh{rectangle;position;get hashCode(){return Un([Uh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Hh extends zh{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Un([Uh.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Yh{x;y;get hashCode(){return Un([Uh.POINT,this.x.toString(),this.y.toString()])}}class Wh{width;height;get hashCode(){return Un([Uh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Kh{points=[]}class Xh{sourceView;targetView;line;get hashCode(){return Un([Uh.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Un(this.line.points)])}}class Zh extends Xh{property;get hashCode(){return Un([Uh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class qh extends Zh{get hashCode(){return Un([Uh.PROPERTY_VIEW,super.hashCode])}}class Jh extends Xh{get hashCode(){return Un([Uh.GENERALIZATION_VIEW,super.hashCode])}}class Qh{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Un([jn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Qh(0,0);static ZERO_ONE=new Qh(0,1);static ZERO_MANY=new Qh(0,void 0);static ONE=new Qh(1,1);static ONE_MANY=new Qh(1,void 0)}new Ke((0,We.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,We.Ru)(),startLine:(0,We.Ru)(),startColumn:(0,We.Ru)(),endLine:(0,We.Ru)(),endColumn:(0,We.Ru)()})),(0,We.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Un([jn.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,We.Ru)(),type:(0,We.Ru)()});const eu=(0,We.yu)(Qh,{lowerBound:(0,We.Ru)(),upperBound:(0,We.jt)((0,We.Ru)())});class tu{class;property;get hashCode(){return Un([jn.PROPERTY_POINTER,this.property,this.class??""])}}class su{}class iu{queryTimeOutInSeconds=null;enableConstraints=!0}var au,nu;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(au||(au={})),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"}(nu=nu||(nu={})),(0,We.yu)(class extends iu{},{_type:Ze(au.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,We.Ru)(),enableConstraints:(0,We.Ru)()});const ru=(0,We.yu)(class extends su{body;parameters;get hashCode(){return Un([jn.RAW_LAMBDA,Bn(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(nu.LAMBDA),body:(0,We.LZ)(),parameters:(0,We.LZ)()}),ou=(0,We.yu)(class extends su{class;name;multiplicity;get hashCode(){return Un([jn.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(nu.VARIABLE),class:(0,We.Ru)(),multiplicity:Xe(eu),name:(0,We.Ru)()});(0,We.yu)(class extends su{multiplicity=Qh.ONE;type;value;get hashCode(){return Un([jn.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,We.bm)("_type",(0,We.PG)((e=>{switch(e){case Ae.INTEGER:return nu.CINTEGER;case Ae.DECIMAL:return nu.CDECIMAL;case Ae.STRING:return nu.CSTRING;case Ae.BOOLEAN:return nu.CBOOLEAN;case Ae.FLOAT:return nu.CFLOAT;case Ae.DATETIME:return nu.CDATETIME;case Ae.STRICTDATE:return nu.CSTRICTDATE;case Ae.STRICTTIME:return nu.CSTRICTTIME;case Ae.LATESTDATE:return nu.CLATESTDATE;default:throw new j(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case nu.CINTEGER:return Ae.INTEGER;case nu.CDECIMAL:return Ae.DECIMAL;case nu.CSTRING:return Ae.STRING;case nu.CBOOLEAN:return Ae.BOOLEAN;case nu.CFLOAT:return Ae.FLOAT;case nu.CDATETIME:return Ae.DATETIME;case nu.CSTRICTDATE:return Ae.STRICTDATE;case nu.CSTRICTTIME:return Ae.STRICTTIME;case nu.CLATESTDATE:return Ae.LATESTDATE;default:throw new j(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,We.jt)((0,We.Ru)())});const lu=(0,We.yu)(tu,{class:(0,We.jt)((0,We.Ru)()),property:(0,We.Ru)()}),cu=(0,We.yu)(class{profile;value;get hashCode(){return Un([jn.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),du=(0,We.yu)(class{profile;value;get hashCode(){return Un([jn.TAG_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),hu=(0,We.yu)(class{tag;value;get hashCode(){return Un([jn.TAGGED_VALUE,this.tag,this.value])}},{tag:Xe(du),value:(0,We.Ru)()}),uu=((0,We.yu)(class extends Bh{stereotypes=[];tags=[];get hashCode(){return Un([jn.PROFILE,this.path,Un(this.stereotypes),Un(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ze("profile"),name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ru)()),tags:(0,We.pb)((0,We.Ru)())}),(0,We.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Un([jn.ENUM_VALUE,this.value,Un(this.stereotypes),Un(this.taggedValues)])}},{stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0}),value:(0,We.Ru)()})),pu=((0,We.yu)(class extends Bh{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Un([jn.ENUMERATION,this.path,Un(this.values),Un(this.stereotypes),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0}),values:(0,We.pb)(Xe(uu))}),(0,We.yu)(class extends Bh{measure;conversionFunction;get hashCode(){return Un([jn.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}},{_type:Ze("unit"),conversionFunction:(0,We.jt)(Xe(ru)),measure:(0,We.Ru)(),name:(0,We.Ru)(),package:(0,We.Ru)()})),_u=((0,We.yu)(class extends Bh{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Un([jn.MEASURE,this.path,this.canonicalUnit??"",Un(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,We.jt)(Xe(pu)),name:(0,We.Ru)(),nonCanonicalUnits:(0,We.pb)(Xe(pu)),package:(0,We.Ru)()}),(0,We.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Un([jn.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Un(this.stereotypes),Un(this.taggedValues)])}},{aggregation:(0,We.jt)((0,We.Ru)()),multiplicity:Xe(eu),name:(0,We.Ru)(),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0}),type:(0,We.Ru)()})),mu=(0,We.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Un([jn.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Un(this.stereotypes),Un(this.taggedValues),Bn(this.parameters,this.body)])}},{body:(0,We.LZ)(),name:(0,We.Ru)(),parameters:(0,We.LZ)(),returnMultiplicity:Xe(eu),returnType:(0,We.Ru)(),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0})}),gu=(0,We.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Un([jn.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,We.jt)((0,We.Ru)()),externalId:(0,We.jt)((0,We.Ru)()),functionDefinition:Xe(ru),messageFunction:(0,We.jt)(Xe(ru)),name:(0,We.Ru)()});var Eu;(0,We.yu)(class extends Bh{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Un([jn.CLASS,this.path,Un(this.properties),Un(this.derivedProperties),Un(this.superTypes),Un(this.constraints),Un(this.stereotypes),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:Qe(gu,{INTERNAL__forceReturnEmptyInTest:!0}),name:(0,We.Ru)(),originalMilestonedProperties:et((()=>We.AM),(()=>We.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,We.Ru)(),properties:Qe(_u,{INTERNAL__forceReturnEmptyInTest:!0}),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(mu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),superTypes:(Eu={INTERNAL__forceReturnEmptyInTest:!0},et((e=>e),(e=>e),Eu)),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends Bh{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Un([jn.ASSOCIATION,this.path,Un(this.properties),Un(this.derivedProperties),Un(this.stereotypes),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ze("association"),name:(0,We.Ru)(),originalMilestonedProperties:et((()=>We.AM),(()=>We.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,We.Ru)(),properties:(0,We.pb)(Xe(_u)),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(mu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends Bh{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Un([jn.FUNCTION,this.path,Un(this.parameters),this.returnType,Un(this.taggedValues),Un(this.stereotypes),Bn(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ze("function"),body:(0,We.pb)((0,We.LZ)()),name:(0,We.Ru)(),package:(0,We.Ru)(),parameters:(0,We.pb)(Xe(ou)),postConstraints:(0,We.pb)((0,We.Ru)()),preConstraints:(0,We.pb)((0,We.Ru)()),returnMultiplicity:Xe(eu),returnType:(0,We.Ru)(),stereotypes:Qe(cu,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(hu,{INTERNAL__forceReturnEmptyInTest:!0})});const fu="diagram",Tu=(0,We.yu)(Yh,{x:(0,We.Ru)(),y:(0,We.Ru)()}),Cu=(0,We.yu)(Wh,{height:(0,We.Ru)(),width:(0,We.Ru)()}),Su=(0,We.yu)(Kh,{points:(0,We.pb)(Xe(Tu))}),xu=(0,We.yu)(Hh,{class:(0,We.Ru)(),hideProperties:(0,We.jt)((0,We.Ru)()),hideStereotypes:(0,We.jt)((0,We.Ru)()),hideTaggedValues:(0,We.jt)((0,We.Ru)()),id:(0,We.Ru)(),position:Xe(Tu),rectangle:Xe(Cu)}),Nu=(0,We.yu)(qh,{line:Xe(Su),property:Xe(lu),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),Au=(0,We.yu)(Jh,{line:Xe(Su),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),Iu=(0,We.yu)($h,{_type:Ze(fu),classViews:(0,We.pb)(Xe(xu)),generalizationViews:(0,We.pb)(Xe(Au)),name:(0,We.Ru)(),package:(0,We.Ru)(),propertyViews:(0,We.pb)(Xe(Nu))});class vu extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Ou=s(95903);const yu=e=>H((0,Ou.Z)(e.split(Ce))),Ru=e=>{const t=e.lastIndexOf(Ce);return-1===t?void 0:e.substring(0,t)},wu=(e,t)=>{const s=e.lastIndexOf(Ce);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+Ce.length,e.length)]},Lu=(e,t)=>`${e?`${e}${Ce}`:""}${t}`,Pu=(e,t)=>{e.children.push(t),t.package=e},bu=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Du=(e,t,s,i)=>{const a=t.indexOf(Ce),n=-1===a?t:t.substring(0,a);let r;if(r=e.children.find((e=>e instanceof Qn&&e.name===n)),!r){if(!s)throw new B(`Can't find child package '${n}' in package '${e.path}'`);q(!xe.includes(n),`Can't create package with reserved name '${n}'`),r=new Qn(n),r.package=e,e.children.push(r)}return i&&i.set(Lu(e.path,n),r),-1!==a?Du(r,t.substring(a+Ce.length),s,i):r},Mu=(e,t,s,i)=>{if(i){const a=i.get(Lu(e.path,t));if(a)return a;let n=t;for(;""!==n;){const a=Lu(e.path,n),r=i.get(a);if(r)return Du(r,t.substring(n.length+Ce.length,t.length),s,i);const o=n.lastIndexOf(Ce);n=-1!==o?n.substring(0,o):""}}return Du(e,t,s,i)},Fu=(e,t,s)=>(X(t,"Package path is required"),Mu(e.root,t,!0,s)),ku=(e,t)=>K(e.rawType,t),Uu=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=ku(e.value,Kn);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},ju=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Gu=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Vu=(e,t)=>`${H(e,"Package path is required")}${Ce}${H(t,"Name is required")}`;class Bu{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){X(e.package,"Element 'package' field is missing or empty"),X(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new B(`Element '${e}' already exists`);s.add(e)}else q(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Vu(e.package,e.name),t,i);const a=this.firstPass(e,t);return Pu(Fu(t.currentSubGraph,e.package,s),a),a}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 $u=e=>e.classView.value.id,zu=e=>{const t=new qh,s=new Kh;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new tu;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=$u(e.from),t.targetView=$u(e.to),t},Hu=e=>{const t=new Jh,s=new Kh;return s.points=e.pathForSerialization,t.line=s,t.sourceView=$u(e.from),t.targetView=$u(e.to),t},Yu=e=>{const t=new Hh;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 Yh;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Wh;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Wu{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Un([Uh.POINT,this.x.toString(),this.y.toString()])}}class Ku{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Un([Uh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Xu{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Wu(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 Xu(new Wu(e.position.x+e.rectangle.width,e.position.y),new Ku(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Xu(new Wu(e.position.x,e.position.y+e.rectangle.height),new Ku(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Un([Uh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Zu extends Xu{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Wu(0,0),new Ku(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Un([Uh.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class qu{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class Ju extends ar{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Qu extends Ju{ownerReference;constructor(e){const t=rr.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Qu(e)}}class ep{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new qu(Qu.create(t)),this.to=new qu(Qu.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),a=i.x+(e._offsetX??0),n=i.y+(e._offsetY??0);return s.contains(a,n)?new Wu(a,n):(t&&(e._offsetX=0,e._offsetY=0),new Wu(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)=>{if(!e.length)return[];let i=0,a=e[i];for(;i<e.length-1&&t.contains(a.x,a.y);)i++,a=e[i];let n=e.length-1,r=e[n];for(;n>0&&s.contains(r.x,r.y);)n--,r=e[n];return e.slice(i-1,n+2)};get pathForSerialization(){return ep.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Un([Uh.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Un(this.pathForSerialization)])}}class tp extends ep{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Un([Uh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class sp extends tp{get hashCode(){return Un([Uh.PROPERTY_VIEW,super.hashCode])}}class ip extends ep{get hashCode(){return Un([Uh.GENERALIZATION_VIEW,super.hashCode])}}class ap{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new ap(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new ap(this.x/e,this.y/e)}normal(e){return new ap(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const np=(e,t)=>e.classViews.find((e=>e.id===t)),rp=(e,t)=>{e.path=t},op=e=>{const t=e.buildFullPath(),s=ep.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=s[0].x-t.x,e.from._offsetY=s[0].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=ap.fromPoints(s[e+1],s[e]).unit(),a=ap.fromPoints(s[e+1],s[e+2]).unit(),n=t.dotProduct(a),r=180*Math.acos(n)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}rp(e,i)},lp=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),cp=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),dp=e=>new Wu(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),hp=e=>{const t=dp(e);return new Xu(new Wu(t.x-5,t.y-5),new Ku(10,10))},up=(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)),pp=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new Wu(t,s)};class _p extends vu{constructor(){super(Rn.Rw.zE,Rn.i8)}V1_getExtraElementBuilders(){return[new Bu({elementClassName:"Diagram",_class:$h,firstPass:(e,t)=>{W(e,$h);const s=new jh(e.name),i=Vu(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,jh),s},secondPass:(e,t)=>{W(e,$h);const s=(i=Vu(e.package,e.name),a=t.currentSubGraph,H(a.getOwnNullableExtensionElement(i,jh),`Can't find diagram '${i}'`));var i,a;s.classViews=e.classViews.map((e=>((e,t,s)=>{X(e.class,"Class view 'class' field is missing or empty"),X(e.id,"Class view 'id' field is missing or empty"),z(e.rectangle,"Class view 'rectangle' field is missing"),z(e.position,"Class view 'position' field is missing");const i=new Zu(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=H(e.width,"Rectangle 'width' is missing"),s=H(e.height,"Rectangle 'height' is missing");return new Ku(t,s)})(e.rectangle),i.position=pp(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{z(e.property,"Property view 'property' field is missing"),z(e.line,"Property view 'line' field is missing");const i=H(np(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),a=H(np(s,H(e.targetView)),"Property view 'targetView' field is missing"),n=t.resolveOwnProperty(e.property),r=new sp(s,n,i,a);return r.path=e.line.points.map((e=>pp(e))),op(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{z(e.line,"Generalization view 'line' field is missing");const s=H(np(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=H(np(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),a=new ip(t,s,i);return a.path=e.line.points.map((e=>pp(e))),op(a),a})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof $h)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof $h)return(0,We.qC)(Iu,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===fu)return(0,We.vB)(Iu,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof jh)return(e=>{const t=new $h;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Yu),t.generalizationViews=e.generalizationViews.map(Hu),t.propertyViews=e.propertyViews.map(zu),t})(e)}]}}class mp extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class gp extends mp{constructor(){super(Rn.Rw.f1,Rn.i8)}getExtraPureGraphExtensionClasses(){return[jh]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(jh).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Kn?ju(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>M(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>M(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=>M(e.generalizationViews,t)))})(t,e)))}]}}class Ep extends c{constructor(){super(Rn.Rw.NA,Rn.i8,[new gp,new Vh,new _p])}}class fp{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Tp=(0,At.createContext)(void 0),Cp=({children:e})=>{const t=An(),s=(0,Nt.fv)((()=>new fp(t)));return(0,T.jsx)(Tp.Provider,{value:s,children:e})},Sp="/welcome.pure",xp="/",Np="::";var Ap,Ip;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(Ap=Ap||(Ap={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Ip=Ip||(Ip={}));const vp=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Op="dummy_problem_marker_owner";var yp;!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"}(yp=yp||(yp={}));class Rp{pureId;pureType;pureName;get id(){return this.pureId}}class wp extends Rp{deprecated}(0,We.yu)(wp,{pureId:(0,We.Ru)(),pureType:(0,We.Ru)(),deprecated:(0,We.Ru)()});class Lp extends Rp{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,We.yu)(Lp,{pureId:(0,We.Ru)(),pureName:(0,We.Ru)(),pureType:(0,We.Ru)(),RO:(0,We.Ru)(),classPath:(0,We.Ru)(),file:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)()});class Pp extends Rp{RO;notpublic;user;file;line;column}(0,We.yu)(Pp,{pureId:(0,We.Ru)(),pureName:(0,We.jt)((0,We.Ru)()),pureType:(0,We.Ru)(),RO:(0,We.Ru)(),notpublic:(0,We.Ru)(),user:(0,We.Ru)(),file:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)()});class bp{li_attr;id;text;icon;children;state;getNodeAttribute(e){return K(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,We.yu)(bp,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.classPath?(0,We.vB)(Lp,e):e.file?(0,We.vB)(Pp,e):(0,We.vB)(wp,e))),id:(0,We.Ru)(),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const Dp=e=>e.startsWith("/")?e.substring(1,e.length):e;class Mp{content;RO;constructor(){(0,S.rC)(this,{content:S.LO,hashCode:S.Fl,setContent:S.aD})}setContent(e){this.content=e}get hashCode(){return kn(this.content)}}(0,We.yu)(Mp,{content:(0,We.Ru)(),RO:(0,We.Ru)()});class Fp{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class kp extends Fp{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var Up;!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_"}(Up=Up||(Up={}));const jp=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Gp{source;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(Gp,{source:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),startLine:(0,We.Ru)(),startColumn:(0,We.Ru)(),endLine:(0,We.Ru)(),endColumn:(0,We.Ru)()});class Vp{first;second}(0,We.yu)(Vp,{first:(0,We.Ru)(),second:(0,We.pb)((0,We.Ry)(Gp))});class Bp{uuid=(0,n.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class $p{currentTab;tabs=[];constructor(){(0,S.rC)(this,{currentTab:S.LO,tabs:S.LO,setCurrentTab:S.aD,closeTab:S.aD,closeAllTabs:S.aD,closeAllOtherTabs:S.aD,openTab:S.aD,swapTabs:S.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){z(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){D(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(q(-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 zp extends Bp{editorStore;constructor(e){super(),this.editorStore=e}}class Hp extends $p{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof t_&&e.hasChanged?this.editorStore.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:bs.CAUTION,actions:[{label:"Proceed",type:Ds.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Ds.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ds.PROCEED,default:!0}]}):super.closeTab(e)}}var Yp;!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-auxiliary-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"}(Yp=Yp||(Yp={}));const Wp={[Yp.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Yp.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Yp.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Yp.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Yp.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Yp.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Yp.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Yp.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Yp.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Kp;!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"}(Kp=Kp||(Kp={}));const Xp={[Kp.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Kp.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Kp.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Kp.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Zp;!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"}(Zp=Zp||(Zp={}));const qp={[Zp.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Zp.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Zp.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Zp.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Zp.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Zp.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Zp.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Zp.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var Jp;!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"}(Jp=Jp||(Jp={}));class Qp{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,S.rC)(this,{viewState:S.LO.ref,editor:S.LO.ref,_dummyCursorObservable:S.LO.ref,forcedCursorPosition:S.LO.ref,wrapText:S.LO,cursorObserver:S.Fl,notifyCursorObserver:S.aD,setViewState:S.aD,setEditor:S.aD,setForcedCursorPosition:S.aD,setWrapText:S.aD}),this.language=(e=>{switch(L(e.split("."))){case"pure":return I.PURE;case"java":return I.JAVA;case"md":return I.MARKDOWN;case"sql":return I.SQL;case"json":return I.JSON;case"xml":return I.XML;case"yml":case"yaml":return I.YAML;case"graphql":return I.GRAPHQL;default:return I.TEXT}})(e.filePath),this.model=x.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 e_{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class t_ extends zp{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,S.rC)(this,{_currentHashCode:S.LO,file:S.LO,renameConceptState:S.LO,showGoToLinePrompt:S.LO,hasChanged:S.Fl,resetChangeDetection:S.aD,setFile:S.aD,setShowGoToLinePrompt:S.aD,setConceptToRenameState:S.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new Qp(this)}get label(){return Dp(this.filePath)}get description(){return`File: ${Dp(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return H(L(this.filePath.split("/")))}match(e){return e instanceof t_&&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.editorStore.applicationStore.notificationService.notifyWarning("Can't rename concept: source is not compiled");const t=yield this.editorStore.getConceptInfo(e);this.renameConceptState=t?new e_(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,x.editor.setModelMarkers(t,i??Op,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:x.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,x.editor.removeAllMarkers(e??Op)}registerCommands(){this.textEditorState.language===I.PURE&&(this.editorStore.applicationStore.commandService.registerCommand({key:Zp.GO_TO_DEFINITION,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,S.fl)(this.editorStore.executeNavigation(new Fp(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.GO_BACK,action:()=>{(0,S.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.REVEAL_CONCEPT_IN_TREE,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.editorStore.revealConceptInTree(new Fp(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.FIND_USAGES,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Fp(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.RENAME_CONCEPT,trigger:()=>this.editorStore.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 Fp(this.filePath,e.lineNumber,e.column);(0,S.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.DELETE_LINE,trigger:()=>this.editorStore.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.editorStore.applicationStore.commandService.registerCommand({key:Zp.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.TOGGLE_TEXT_WRAP,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.textEditorState.setWrapText(!this.textEditorState.wrapText)}})}findConceptUsages(e){const t=()=>{(0,S.fl)(this.editorStore.findUsagesFromCoordinate(e)).catch(this.editorStore.applicationStore.alertUnhandledError)};this.hasChanged?this.editorStore.applicationStore.alertService.setActionAlertInfo({message:"Source is not compiled, finding concept usages might be inaccurate. Do you want compile to proceed?",type:bs.CAUTION,actions:[{label:"Compile and Proceed",type:Ds.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ds.PROCEED,default:!0}]}):t()}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.editorStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.editorStore.findConceptUsages(t.pureType===yp.ENUM_VALUE?Up.ENUM:t.pureType===yp.PROPERTY||t.pureType===yp.QUALIFIED_PROPERTY?Up.PROPERTY:Up.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,S.fl)(this.editorStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){G(e),this.editorStore.applicationStore.notificationService.notifyError(e)}finally{this.editorStore.applicationStore.alertService.setBlockingAlert(void 0)}}deregisterCommands(){this.textEditorState.language===I.PURE&&[Zp.GO_TO_DEFINITION,Zp.GO_BACK,Zp.REVEAL_CONCEPT_IN_TREE,Zp.FIND_USAGES,Zp.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e))),[Zp.GO_TO_LINE,Zp.TOGGLE_TEXT_WRAP].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class s_{editorStore;treeData;selectedNode;loadInitialDataState=Ft.create();refreshDataState=Ft.create();constructor(e){(0,S.rC)(this,{treeData:S.LO.ref,loadInitialDataState:S.LO,refreshDataState:S.LO,initialize:S.ls,expandNode:S.ls,openNode:S.ls,refreshTreeData:S.ls,setTreeData:S.aD,setSelectedNode:S.aD}),this.editorStore=e}getTreeData(){return H(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.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){G(e),this.editorStore.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({...H(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){G(e),this.editorStore.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 G(e),this.editorStore.applicationStore.notificationService.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>H(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(H(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,S.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>H(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class i_{id;path;RO}class a_ extends i_{file;statusType}(0,We.yu)(a_,{id:(0,We.Ru)(),path:(0,We.Ru)(),file:(0,We.Ru)(),statusType:(0,We.Ru)(),RO:(0,We.Ru)()});class n_ extends i_{repo}(0,We.yu)(n_,{id:(0,We.Ru)(),path:(0,We.Ru)(),repo:(0,We.Ru)(),RO:(0,We.Ru)()});class r_{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof n_}get isFileNode(){return this.li_attr instanceof a_}get isRepoNode(){return this.li_attr instanceof n_&&Boolean(this.li_attr.repo)}getNodeAttribute(e){return K(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,We.yu)(r_,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.file?(0,We.vB)(a_,e):(0,We.vB)(n_,e))),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const o_=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},l_=e=>`file_${e}`;class c_ extends s_{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,S.rC)(this,{nodeForCreateNewFile:S.LO,nodeForCreateNewDirectory:S.LO,nodeForRenameFile:S.LO,setNodeForCreateNewFile:S.aD,setNodeForCreateNewDirectory:S.aD,setNodeForRenameFile:S.aD,revealPath:S.ls})}setNodeForCreateNewFile=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{q(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,We.vB)(r_,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.editorStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,We.vB)(r_,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,S.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t){t?.forceOpenExplorerPanel&&this.editorStore.setActiveActivity(Ap.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=o_(i);for(const e of s){const s=H(this.getTreeData().nodes.get(l_(e)),`Can't find node with path '${e}'`);if(s.data.isFolderNode)yield(0,S.fl)(this.expandNode(s));else{if(t?.directoryOnly)throw new Error("Can't reveal non-directory path");yield(0,S.fl)(this.editorStore.loadFile(e,t?.coordinate))}}this.setSelectedNode(H(this.getTreeData().nodes.get(l_(e)),`Can't find node with path '${e}'`))}}const d_=e=>{const t=e.trim(),s=t.lastIndexOf(Ce);if(!(s<=0))return t.substring(0,s)};class h_ extends s_{loadConceptActivity=Ft.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,S.rC)(this,{statusText:S.LO,nodeForRenameConcept:S.LO,nodeForMoveElement:S.LO,setStatusText:S.aD,setNodeForRenameConcept:S.aD,setNodeForMoveElement:S.aD,pullConceptsActivity:S.aD,pollConceptsActivity:S.ls,revealConcept:S.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,S.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,We.vB)(bp,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.editorStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,We.vB)(bp,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const a=t.li_attr.id;i.push(a),s.nodes.set(a,{data:t,id:a,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof Lp||e.data.li_attr instanceof Pp)&&("Diagram"===e.data.li_attr.pureType?yield(0,S.fl)(this.editorStore.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,S.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Fp(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.editorStore.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.editorStore.setActiveActivity(Ap.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=d_(i);for(const e of s){const s=H(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`);if(s.data.li_attr instanceof wp)yield(0,S.fl)(this.expandNode(s));else if(t?.packageOnly)throw new Error("Can't reveal non-package path")}this.setSelectedNode(H(this.getTreeData().nodes.get(e),`Can't find node with path '${e}'`))}async movePackageableElements(e,t){let s=[];try{s=(await this.editorStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,We.vB)(Vp,e)))}catch{return void this.editorStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.alertService.setBlockingAlert(void 0)}const i=[];q(s.length===e.length,"Can't find matching usages for packageable elements");for(let a=0;a<s.length;++a){const n=H(e[a]);i.push({pureName:n.pureName,pureType:n.pureType,sourcePackage:H(Ru(n.pureId)),destinationPackage:t,usages:H(s[a]).second})}await(0,S.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let a=[];try{switch(this.editorStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case yp.PROPERTY:case yp.QUALIFIED_PROPERTY:W(s,Lp),a=await this.editorStore.findConceptUsages(Up.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case yp.PACKAGE:{let e=[],s=[];try{s=await this.editorStore.client.getChildPackageableElements(i),e=(await this.editorStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,We.vB)(Vp,e)))}catch{return void this.editorStore.applicationStore.notificationService.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.alertService.setBlockingAlert(void 0)}const a=[];q(e.length===s.length,"Can't find matching usages for child packageable elements");const n=Ru(i)?.concat(Ce).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(Ru(r.pureId)),l=n.concat(o.substring(o.indexOf(i)+i.length));a.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:H(e[t]).second})}return void await(0,S.fl)(this.editorStore.movePackageableElements(a))}default:a=await this.editorStore.findConceptUsages(Up.ELEMENT,[`'${s.pureId}'`])}}catch(e){return G(e),void this.editorStore.applicationStore.notificationService.notifyError(e)}finally{this.editorStore.applicationStore.alertService.setBlockingAlert(void 0)}await(0,S.fl)(this.editorStore.renameConcept(i,t,s.pureType,a))}}class u_{cached;datamarts;text}(0,We.yu)(u_,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)()});class p_ extends u_{error;sessionError}(0,We.yu)(p_,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)(),error:(0,We.Ru)(),sessionError:(0,We.Ru)()});class __ extends p_{RO;line;column;source}(0,We.yu)(__,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)(),RO:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),source:(0,We.Ru)(),error:(0,We.Ru)(),sessionError:(0,We.Ru)()});class m_{text;reinit}class g_ extends m_{cache;modifiedFiles=[]}(0,We.yu)(g_,{text:(0,We.Ru)(),cache:(0,We.Ru)(),modifiedFiles:(0,We.pb)((0,We.Ru)()),reinit:(0,We.Ru)()});class E_ extends m_{RO;line;column;source;error;sessionError}(0,We.yu)(E_,{text:(0,We.Ru)(),RO:(0,We.Ru)(),line:(0,We.jt)((0,We.Ru)()),column:(0,We.jt)((0,We.Ru)()),source:(0,We.jt)((0,We.Ru)()),error:(0,We.Ru)(),sessionError:(0,We.Ru)()});class f_{RO;line;column;source}(0,We.yu)(f_,{RO:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),source:(0,We.Ru)()});class T_ extends m_{jumpTo}(0,We.yu)(T_,{text:(0,We.Ru)(),jumpTo:(0,We.Ry)(f_)});class C_{uuid=(0,n.Z)();sourceID;line;column;foundName}(0,We.yu)(C_,{sourceID:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),foundName:(0,We.Ru)()});class S_{uuid=(0,n.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,We.yu)(S_,{sourceID:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),foundName:(0,We.Ru)(),add:(0,We.Ru)(),messageToBeModified:(0,We.Ru)(),fileToBeModified:(0,We.Ru)(),lineToBeModified:(0,We.Ru)(),columnToBeModified:(0,We.Ru)()});class x_ extends E_{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,We.yu)(x_,{candidateName:(0,We.Ru)(),candidatesWithPackageImported:(0,We.pb)((0,We.Ry)(C_)),candidatesWithPackageNotImported:(0,We.pb)((0,We.Ry)(S_))});class N_ extends E_{candidateName;candidates=[]}(0,We.yu)(N_,{candidateName:(0,We.Ru)(),candidates:(0,We.pb)((0,We.Ry)(S_))});class A_{id;parentId;file;line;column}(0,We.yu)(A_,{id:(0,We.Ru)(),parentId:(0,We.Ru)(),file:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)()});class I_{children=[];li_attr;text;type}(0,We.yu)(I_,{children:(0,We.pb)((0,We.Ry)(I_)),li_attr:(0,We.Ry)(A_),text:(0,We.Ru)(),type:(0,We.Ru)()});class v_ extends m_{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,We.yu)(v_,{count:(0,We.Ru)(),filterPaths:(0,We.pb)((0,We.Ru)()),path:(0,We.Ru)(),relevantTestsOnly:(0,We.Ru)(),runnerId:(0,We.Ru)(),tests:(0,We.pb)((0,We.Ry)(I_))});class O_{uuid=(0,n.Z)()}class y_{before;found;after}(0,We.yu)(y_,{after:(0,We.Ru)(),before:(0,We.Ru)(),found:(0,We.Ru)()});class R_{uuid=(0,n.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,a){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=a}}(0,We.yu)(R_,{sourceId:(0,We.Ru)(),startLine:(0,We.Ru)(),startColumn:(0,We.Ru)(),endLine:(0,We.Ru)(),endColumn:(0,We.Ru)(),preview:(0,We.jt)((0,We.Ry)(y_))});class w_ extends O_{sourceId;coordinates=[];isExpanded=!0;constructor(){super(),(0,S.rC)(this,{coordinates:S.LO,isExpanded:S.LO,setIsExpanded:S.aD,dismissCoordinate:S.aD})}setCoordinates(e){this.coordinates=e}setIsExpanded(e){this.isExpanded=e}dismissCoordinate(e){M(this.coordinates,e)}}var L_,P_,b_;(0,We.yu)(w_,{sourceId:(0,We.Ru)(),coordinates:(0,We.pb)((0,We.Ry)(R_))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(L_=L_||(L_={}));class D_{status;test}class M_ extends D_{test=[]}(0,We.yu)(M_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)())});class F_{text;RO;line;column;source;error}(0,We.yu)(F_,{text:(0,We.Ru)(),RO:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),source:(0,We.Ru)(),error:(0,We.Ru)()});class k_ extends D_{test=[];error}(0,We.yu)(k_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)()),error:(0,We.Ry)(F_)});class U_{}class j_ extends U_{finished;tests=[]}(0,We.yu)(j_,{finished:(0,We.Ru)(),tests:(0,We.pb)((0,We.PG)((()=>We.AM),(e=>e.error?(0,We.vB)(k_,e):(0,We.vB)(M_,e))))});class G_ extends U_{error;text}(0,We.yu)(G_,{error:(0,We.Ru)(),text:(0,We.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(P_=P_||(P_={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(b_=b_||(b_={}));class V_{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,S.rC)(this,{total:S.LO,time:S.LO,passedTests:S.LO,failedTests:S.LO,testsWithError:S.LO,notRunTests:S.LO,results:S.LO,passed:S.Fl,error:S.Fl,failed:S.Fl,passedTestIds:S.Fl,failedTestIds:S.Fl,testWithErrorIds:S.Fl,notRunTestIds:S.Fl,numberOfTestsRun:S.Fl,runPercentage:S.Fl,suiteStatus:S.Fl,setTime:S.aD,addResult:S.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?P_.FAILED:this.passed?P_.PASSED:P_.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case L_.PASSED:this.passedTests.add(t);break;case L_.FAILED:this.failedTests.set(t,K(e,k_));break;case L_.ERROR:this.testsWithError.set(t,K(e,k_));break;default:throw new j(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class B_{editorStore;testExecutionResult;checkTestRunnerState=Ft.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=Ft.create();treeData;viewAsList=!1;constructor(e,t){(0,S.rC)(this,{testResultInfo:S.LO.ref,allTests:S.LO,selectedTestId:S.LO,treeData:S.LO.ref,viewAsList:S.LO,setViewAsList:S.aD,setSelectedTestId:S.aD,setTestResultInfo:S.aD,setTreeData:S.aD,refreshTree:S.aD,collapseTree:S.aD,expandTree:S.aD,buildTreeDataByLayer:S.aD,pullTestRunnerResult:S.aD,buildTestTreeData:S.ls,pollTestRunnerResult:S.ls,rerunTestSuite:S.ls,cancelTestRun:S.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return H(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({...H(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,a)=>setTimeout((()=>{const n=e.li_attr.id,r={id:n,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(n,e),t.nodes.set(n,r),"Root"!==e.li_attr.parentId)try{const s=H(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?b(s.childrenIds,n):s.childrenIds=[n]}catch(e){return void a(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{q(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 V_(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.editorStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,We.vB)(G_,s):(0,We.vB)(j_,s);var s;return t instanceof j_?(await Promise.all(t.tests.map((t=>P((()=>{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){G(e),this.editorStore.applicationStore.notificationService.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.editorStore.testRunState.isInProgress||(yield(0,S.fl)(this.editorStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.editorStore.testRunState.isInProgress&&(yield this.editorStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.editorStore.applicationStore.notificationService.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}class $_{}class z_ extends $_{error;errorDialog;text}(0,We.yu)(z_,{error:(0,We.Ru)(),errorDialog:(0,We.Ru)(),text:(0,We.Ru)()});class H_{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return H(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}'`:`'${Np}'`,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:Up.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 Y_{_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,S.rC)(this,{_tempSize:S.LO,size:S.LO,defaultSize:S.LO,snapSize:S.LO,maxSize:S.LO,isOpen:S.Fl,isMaximizable:S.Fl,isMaximized:S.Fl,setSize:S.aD,open:S.aD,close:S.aD,toggle:S.aD,setMaxSize:S.aD,maximize:S.aD,minimize:S.aD,toggleMaximize:S.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 W_{_UUID=(0,n.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 Un([jn.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues),Bn(this.parameters,this.body)])}}class K_ extends ar{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class X_ extends K_{ownerReference;constructor(e){const t=rr.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new X_(e)}}class Z_{_UUID=(0,n.Z)();rawType;constructor(e){this.rawType=e}}class q_{_UUID=(0,n.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 Un([jn.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues)])}}class J_{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Un([jn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new J_(0,0);static ZERO_ONE=new J_(0,1);static ZERO_MANY=new J_(0,void 0);static ONE=new J_(1,1);static ONE_MANY=new J_(1,void 0)}class Q_ extends ar{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[jn.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(kn).join(",")}}class em extends Q_{ownerReference;constructor(e){const t=rr.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new em(e)}}class tm extends Xn{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new tm(Ae.STRING);static BOOLEAN=new tm(Ae.BOOLEAN);static BINARY=new tm(Ae.BINARY);static NUMBER=new tm(Ae.NUMBER);static INTEGER=new tm(Ae.INTEGER);static FLOAT=new tm(Ae.FLOAT);static DECIMAL=new tm(Ae.DECIMAL);static DATE=new tm(Ae.DATE);static STRICTDATE=new tm(Ae.STRICTDATE);static DATETIME=new tm(Ae.DATETIME);static STRICTTIME=new tm(Ae.STRICTTIME);static LATESTDATE=new tm(Ae.LATESTDATE)}var sm;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(sm=sm||(sm={}));class im extends tp{association;constructor(e,t,s,i,a){super(e,s,i,a),this.association=t}get hashCode(){return Un([Uh.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const am=()=>new Kn(""),nm=(e,t)=>new q_("",J_.ONE,X_.create(new Z_(e)),t),rm=(0,S.aD)(((e,t)=>{e.value=t})),om=((0,S.aD)(((e,t)=>{M(e.properties,t)})),(0,S.aD)(((e,t)=>{b(e.properties,Sh(t))}))),lm=((0,S.aD)(((e,t,s)=>{D(e.properties,t,s)})),(0,S.aD)(((e,t)=>{M(e.derivedProperties,t)})),(0,S.aD)(((e,t)=>{b(e.derivedProperties,xh(t))})),(0,S.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,S.aD)(((e,t)=>{b(e.constraints,Ah(t))})),(0,S.aD)(((e,t)=>{M(e.constraints,t)})),(0,S.aD)(((e,t,s)=>{D(e.constraints,t,s)})),(0,S.aD)(((e,t)=>{b(e.generalizations,dh(t))}))),cm=((0,S.aD)(((e,t)=>{M(e.generalizations,t)})),(0,S.aD)(((e,t,s)=>{D(e.generalizations,t,s)})),(0,S.aD)(((e,t)=>{b(e._subclasses,t)})),(0,S.aD)(((e,t)=>{M(e._subclasses,t)})),(0,S.aD)(((e,t)=>{dh(e),ch(t),e.value=t,e.ownerReference.value=t.rawType}))),dm=((0,S.aD)(((e,t)=>{e.name=t})),(0,S.aD)(((e,t)=>{cm(e.genericType,ch(t))})),(0,S.aD)(((e,t)=>{e.multiplicity=t})),(0,S.aD)(((e,t)=>{e.aggregation=t})),(0,S.aD)(((e,t)=>{e.value=ph(t),rm(e.ownerReference,t._OWNER)})),(0,S.aD)(((e,t)=>{b(e.taggedValues,lh(t))})),(0,S.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,S.aD)(((e,t)=>{b(e.stereotypes,rh(t))})),(0,S.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,S.aD)(((e,t)=>{e.tag.value=_h(t),e.tag.ownerReference.value=t._OWNER})),(0,S.aD)(((e,t)=>{e.value=t})),(0,S.aD)(((e,t)=>{e.value=t})),(0,S.aD)(((e,t,s)=>{D(e.taggedValues,t,s)})),(0,S.aD)(((e,t,s)=>{D(e.stereotypes,t,s)})),(0,S.aD)(((e,t)=>{e.name=t})),(0,S.aD)(((e,t)=>{e.functionDefinition=Ar(t)})),(0,S.aD)(((e,t)=>{b(e.p_tags,_h(t))})),(0,S.aD)(((e,t)=>{M(e.p_tags,t)})),(0,S.aD)(((e,t)=>{b(e.p_stereotypes,ph(t))})),(0,S.aD)(((e,t)=>{M(e.p_stereotypes,t)})),(0,S.aD)(((e,t,s)=>{D(e.p_tags,t,s)})),(0,S.aD)(((e,t,s)=>{D(e.p_stereotypes,t,s)})),(0,S.aD)(((e,t)=>{M(e.parameters,t)})),(0,S.aD)(((e,t)=>{b(e.parameters,Ir(t))})),(0,S.aD)(((e,t)=>{rm(e.returnType,yh(t))})),(0,S.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,S.aD)(((e,t,s)=>{D(e.parameters,t,s)})),(0,S.aD)(((e,t)=>{e.name=t})),(0,S.aD)(((e,t)=>{b(e.values,gh(t))})),(0,S.aD)(((e,t)=>{M(e.values,t)})),(0,S.aD)(((e,t,s)=>{D(e.values,t,s)})),(0,S.aD)(((e,t)=>{e.value=gh(t),rm(e.ownerReference,t._OWNER)})),(0,S.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return q(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),H(e.properties[(s+1)%2])})(e,t),a=K(t.genericType.ownerReference.value,Kn,`Association property '${t.name}' must be of type 'class'`);var n;((n=a).package||n.name)&&q(M(a.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${a.path}'`),b(s.propertiesFromAssociations,i);const r=new Z_(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,S.aD)(((e,t)=>{e.canonicalUnit=Th(t)})),(0,S.aD)(((e,t)=>{e.conversionFunction=Ar(t)})),(0,S.aD)(((e,t)=>{e.classViews=t.map(Lh)}))),hm=(0,S.aD)(((e,t)=>{b(e.classViews,Lh(t))})),um=(0,S.aD)(((e,t)=>{M(e.classViews,t)})),pm=(0,S.aD)(((e,t)=>{e.associationViews=t.map(Mh)})),_m=(0,S.aD)(((e,t)=>{M(e.associationViews,t)})),mm=(0,S.aD)(((e,t)=>{e.generalizationViews=t.map(Dh)})),gm=(0,S.aD)(((e,t)=>{b(e.generalizationViews,Dh(t))})),Em=(0,S.aD)(((e,t)=>{M(e.generalizationViews,t)})),fm=(0,S.aD)(((e,t)=>{e.propertyViews=t.map(Fh)})),Tm=(0,S.aD)(((e,t)=>{b(e.propertyViews,Fh(t))})),Cm=(0,S.aD)(((e,t)=>{M(e.propertyViews,t)})),Sm=(0,S.aD)(((e,t)=>{e.hideProperties=t})),xm=(0,S.aD)(((e,t)=>{e.hideStereotypes=t})),Nm=(0,S.aD)(((e,t)=>{e.hideTaggedValues=t})),Am=(0,S.aD)(((e,t)=>{e._offsetX=t})),Im=(0,S.aD)(((e,t)=>{e._offsetY=t})),vm=(0,S.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const a=e.findIndex((e=>i(e,t)));-1!==a&&(e[a]=s)})(e.path,t,s)})),Om=(0,S.aD)(op),ym=(0,S.aD)(((e,t,s,i,a)=>{for(const a of e.path)if(Math.sqrt((t-a.x)*(t-a.x)+(s-a.y)*(s-a.y))<10/i)return a;const n=e.buildFullPath(a),r=[];let o;for(let e=0;e<n.length-1;e++){const a=n[e],l=n[e+1],c=new ap(a.x,a.y).normal(new ap(l.x,l.y)).unit(),d=ap.fromPoints(a,new Wu(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(a.x<l.x?a.x:l.x)-5/i,n=(a.x<l.x?l.x:a.x)+5/i,c=(a.y<l.y?a.y:l.y)-5/i,d=(a.y<l.y?l.y:a.y)+5/i;e<=t&&t<=n&&c<=s&&s<=d&&(o=new Wu(t,s),r.push(o))}e<n.length-2&&r.push(n[e+1])}return o&&a&&rp(e,r),o})),Rm=(0,S.aD)(rp),wm=(0,S.aD)(((e,t)=>{e.rectangle=t})),Lm=(0,S.aD)(((e,t)=>{e.position=t})),Pm=(0,S.aD)((e=>{e._dummyObservable={}}));var bm,Dm,Mm;!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"}(bm=bm||(bm={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Dm=Dm||(Dm={})),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"}(Mm=Mm||(Mm={}));const Fm=.05,km=[50,75,90,100,110,125,150,200,250,300,400],Um=e=>(e instanceof W_?"/ ":"")+e.name;class jm{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,S.rC)(this,{isReadOnly:S.LO,enableLayoutAutoAdjustment:S.LO,interactionMode:S.LO,relationshipMode:S.LO,zoom:S.LO,mouseOverClassView:S.LO,mouseOverClassName:S.LO,mouseOverClassCorner:S.LO,mouseOverClassProperty:S.LO,mouseOverPropertyHolderViewLabel:S.LO,selectionStart:S.LO,selectedClassCorner:S.LO,selectedClasses:S.LO,selectedPropertyOrAssociation:S.LO,selectedInheritance:S.LO,leftClick:S.LO,middleClick:S.LO,rightClick:S.LO,changeMode:S.aD,setIsReadOnly:S.aD,setEnableLayoutAutoAdjustment:S.aD,setMouseOverClassView:S.aD,setMouseOverClassName:S.aD,setMouseOverClassCorner:S.aD,setMouseOverClassProperty:S.aD,setMouseOverPropertyHolderViewLabel:S.aD,setSelectionStart:S.aD,setSelectedClassCorner:S.aD,setSelectedClasses:S.aD,setSelectedPropertyOrAssociation:S.aD,setSelectedInheritance:S.aD,setLeftClick:S.aD,setMiddleClick:S.aD,setRightClick:S.aD,setZoomLevel:S.aD,align:S.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new Ku(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wu(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 Wu(0,0),this.virtualScreen=new Xu(new Wu(0,0),new Ku(0,0)),this.zoom=1,this.triangle=[new Wu(0,0),new Wu(-15,-10),new Wu(-15,10)],this.diamond=[new Wu(0,0),new Wu(-10,-5),new Wu(-20,0),new Wu(-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=bm.LAYOUT,this.relationshipMode=Dm.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 Wu(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Wu(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(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new Ku(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wu(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 Wu(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case bm.LAYOUT:case bm.PAN:case bm.ZOOM_IN:case bm.ZOOM_OUT:case bm.ADD_CLASS:if(t!==Dm.NONE)throw new U(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case bm.ADD_RELATIONSHIP:if(t===Dm.NONE)throw new U("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new j(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===bm.ADD_RELATIONSHIP)switch(t){case Dm.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Uu(e.class.value).includes(t.class.value)||Uu(t.class.value).includes(e.class.value)||lm(e.class.value,X_.create(new Z_(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new ip(this.diagram,e,t);return gm(this.diagram,s),s}};break;case Dm.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new q_(`property_${e.class.value.properties.length+1}`,J_.ONE,X_.create(new Z_(t.class.value)),e.class.value);if(om(e.class.value,s),e!==t){const i=new sp(this.diagram,em.create(s),e,t);return Tm(this.diagram,i),i}};break;default:throw new j(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Mm.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Lm(t,new Wu(e,t.position.y))));break}case Mm.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=>Lm(t,new Wu(e-t.rectangle.width/2,t.position.y))));break}case Mm.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=>Lm(t,new Wu(e-t.rectangle.width,t.position.y))));break}case Mm.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Lm(t,new Wu(t.position.x,e))));break}case Mm.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=>Lm(t,new Wu(t.position.x,e-t.rectangle.height/2))));break}case Mm.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=>Lm(t,new Wu(t.position.x,e-t.rectangle.height))));break}case Mm.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];Lm(s,new Wu(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],a=e[s];t.push(a.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],a=e[t];Lm(a,new Wu(i.position.x+i.rectangle.width+s,a.position.y))}}break}case Mm.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];Lm(s,new Wu(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],a=e[s];t.push(a.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],a=e[t];Lm(a,new Wu(a.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-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new Wu((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 Wu((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)}eventCoordinateToCanvasCoordinate(e){return new Wu(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Wu(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(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 Wu(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=H(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,a=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),a=Math.max(a,e.position.y+e.rectangle.height);const n=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of n){const n=ep.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof sp){const r=this.drawLinePropertyText(n[n.length-2],n[n.length-1],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,dp(r).x),a=Math.max(a,dp(r).y)}for(const n of e.path)t=Math.min(t,n.x),s=Math.min(s,n.y),i=Math.max(i,n.x),a=Math.max(a,n.y)}this.virtualScreen=new Xu(new Wu(t,s),new Ku(i-t,a-s))}else this.setZoomLevel(1),this.screenOffset=new Wu(0,0),this.virtualScreen=new Xu(new Wu(this.canvasDimension.width/2,this.canvasDimension.height/2),new Ku(0,0))}executeZoom(e,t){e=Math.max(e,Fm);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Wu(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Fm)),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)),Fm))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,n.Z)();for(;s.includes(i);)i=(0,n.Z)();const a=new Zu(this.diagram,i,rr.create(e));return Lm(a,t??this.canvasCoordinateToModelCoordinate(new Wu(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),hm(this.diagram,a),Pm(a),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)&&gm(this.diagram,new ip(this.diagram,a,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&gm(this.diagram,new ip(this.diagram,t,a)),ju(e).forEach((e=>{e.genericType.value.rawType===s&&Tm(this.diagram,new sp(this.diagram,em.create(e),a,t))})),ju(s).forEach((s=>{s.genericType.value.rawType===e&&Tm(this.diagram,new sp(this.diagram,em.create(s),t,a))}))})),this.drawClassView(a),this.drawScreen(),a}}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 a=0;for(let n=e;n<e+s-2*this.screenPadding;n+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${a}`,n+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+a)}]`,n+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(n,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(n,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),a+=this.screenGridSpacingX;let n=0;for(let a=t;a<t+i-2*this.screenPadding;a+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${n}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,a+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+n)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,a+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,a),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,a),this.ctx.stroke(),n+=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 a=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(a)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),a+=this.canvasGridSpacingX;let n=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(n)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),n+=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,a){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(a?1:this.zoom)}px ${this.fontFamily}`:`${a?"bold":""} ${(this.fontSize-1)*(a?1:this.zoom)}px ${this.fontFamily}`;const n=Um(t);let r=this.ctx.measureText(`${n} : `).width;a||(this.ctx.fillText(`${n} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof Zn&&(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)*(a?1:this.zoom)}px ${this.fontFamily}`;const o=$e(t.multiplicity.lowerBound,t.multiplicity.upperBound);return a||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)} >>`,a=this.ctx.measureText(e).width;t=Math.max(t,a),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)} }`,a=this.ctx.measureText(e).width;t=Math.max(t,a),s+=this.lineHeight}}if(e.hideProperties||(ju(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const a=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,a),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,a=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;wm(e,new Ku(i,a))}}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,a=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let n=a;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)} >>`,a=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-a)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(n+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),n+=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,(n+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),n+=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)} }`,a=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-a)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(n+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),n+=this.lineHeight}if(n+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(a+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 ju(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof W_?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof tm?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,a=(n+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,a,!1),n+=this.lineHeight}}Pm(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,a,n){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Um(e),o=$e(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 Wu(t(l),s(l)));n||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=a(c),m=this.modelCoordinateToCanvasCoordinate(new Wu(i(c),a(c)));n||this.ctx.fillText(o,m.x,m.y);const g=new Wu(Math.min(d,p),Math.min(h,_));return new Xu(g,new Ku(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,_)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,a){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const n=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=n+(o-n)/(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),a)}else{const e=n+(o-n)/(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),a)}if(n<o){const e=r+(l-r)/(o-n)*(s.position.x-n);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),a)}else{const e=r+(l-r)/(o-n)*(s.position.x+s.rectangle.width-n);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),a)}return new Xu(new Wu(0,0),new Ku(0,0))}drawPropertyOrAssociation(e){const t=ep.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],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 q_){const i=t[1],a=t[0],n=i.x,r=i.y,o=a.x,l=a.y,c=e.from;let d=0,h=0;if(l>r){const e=n+(o-n)/(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=n+(o-n)/(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>n){const e=r+(l-r)/(o-n)*(c.classView.value.position.x-n);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-n)*(c.classView.value.position.x+c.classView.value.rectangle.width-n);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===sm.COMPOSITE||s.aggregation===sm.SHARED){let e=Math.atan((l-r)/(o-n));e=o>=n?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+lp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+cp(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+lp(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+cp(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+lp(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+cp(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+lp(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+cp(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+lp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+cp(this.diamond[0],e))*this.zoom),s.aggregation===sm.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===sm.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=ep.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,a=s[s.length-2].y,n=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>a){const s=i+(n-i)/(r-a)*(e.to.classView.value.position.y-a);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+(n-i)/(r-a)*(e.to.classView.value.position.y+t.height-a);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(n>i){const s=a+(r-a)/(n-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=a+(r-a)/(n-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-a)/(n-i));c=n>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+lp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cp(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lp(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+cp(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lp(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+cp(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cp(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)&&Rm(e,e.path.map((e=>new Wu(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=w(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!==bm.ZOOM_IN?bm.ZOOM_IN:bm.ZOOM_OUT,Dm.NONE)}switchToViewMode(){this.changeMode(bm.LAYOUT,Dm.NONE)}switchToPanMode(){this.changeMode(bm.PAN,Dm.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(bm.ADD_RELATIONSHIP,Dm.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(bm.ADD_RELATIONSHIP,Dm.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(bm.ADD_CLASS,Dm.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Kn&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wu(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Kn&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{um(this.diagram,e),pm(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),mm(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),fm(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof im?_m(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof sp&&Cm(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Em(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=>{Sm(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{xm(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Nm(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=>hm(this.diagram,e))),t[1].forEach((e=>gm(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,ns.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Zu(this.diagram,(0,n.Z)(),rr.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=>hm(this.diagram,e))),t[1].forEach((e=>gm(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case bm.LAYOUT:this.diagram.generalizationViews.forEach((e=>Om(e))),this.diagram.associationViews.forEach((e=>Om(e))),this.diagram.propertyViews.forEach((e=>Om(e)));break;case bm.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(bm.LAYOUT,Dm.NONE);break}case bm.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=km[0]-10?10*Math.floor(t/10)+10:t>=km[km.length-1]?100*Math.floor(t/100)+100:H(km.find((e=>e>t))),this.zoomPoint(s/100,new Wu(e.x,e.y));break}case bm.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=km[0]?10*Math.ceil(t/10)-10:t>=km[km.length-1]+100?100*Math.ceil(t/100)-100:H((0,Ou.Z)(km,(e=>e<t))),this.zoomPoint(s/100,new Wu(e.x,e.y));break}case bm.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&(Am(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Im(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Am(e.to,-(s.position.x+s.rectangle.width/2-t.x)),Im(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(bm.LAYOUT,Dm.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([bm.ADD_RELATIONSHIP,bm.ADD_CLASS,bm.ZOOM_IN,bm.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(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 t=this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case bm.PAN:return void(this.positionBeforeLastMove=new Wu(e.x,e.y));case bm.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(hp(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||dm(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const a=this.diagram.classViews[i];if(a.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(a)||this.setSelectedClasses([a]),this.isReadOnly||dm(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Wu(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=ym(e,s.x,s.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=ym(e,s.x,s.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=ym(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case bm.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(bm.LAYOUT,Dm.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Wu(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Wu(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Wu(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Wu(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===bm.PAN)this.screenOffset=new Wu(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Wu(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case bm.LAYOUT:if(this.selectedClassCorner&&(wm(this.selectedClassCorner,new Ku(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Pm(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,a)=>{const n=this._selectedClassesInitialPositions.length>a?this._selectedClassesInitialPositions[a]:void 0;if(n){const a=t.x/this.zoom-this.screenOffset.x-(this.clickX-n.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-n.oldPos.y);e=i.position.x-a,s=i.position.y-r,Lm(i,new Wu(a,r)),Pm(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?vm(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&vm(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new Xu(new Wu(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Ku(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(up(this.selection,e)||up(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case bm.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new Wu(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),hp(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let a=e.position.y+this.classViewSpaceY;a+=e.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const n=this.computeClassNameWidth(e);new Xu(this.modelCoordinateToCanvasCoordinate(new Wu(e.position.x+(e.rectangle.width-n)/2,a)),new Ku(n,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),a+=this.lineHeight,a+=e.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,a+=2*this.classViewSpaceY;for(const s of ju(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Xu(this.modelCoordinateToCanvasCoordinate(new Wu(e.position.x+this.classViewSpaceX,a)),new Ku(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),a+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=ep.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const a=(0,ns.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Zu(t,(0,n.Z)(),rr.create(ku(e.value,Kn))))))),(e=>e.class.value));if(a.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const n=this.getSuperTypeLevels(a,t,s+1,i);return n.push(e),n}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,a)=>{let n=0,r=0,o=0,l=0;if(a>0){const t=e[a-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,n=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+n/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||a>0)&&(Lm(t[0],new Wu(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Lm(e,new Wu(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 ip(t,s,e):[]))))))]}}class Gm{_UUID=(0,n.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Un([jn.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class Vm extends ar{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[jn.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(kn).join(",")}}class Bm extends Vm{ownerReference;constructor(e){const t=rr.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Bm(e)}}class $m extends ar{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[jn.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(kn).join(",")}}class zm extends $m{ownerReference;constructor(e){const t=rr.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new zm(e)}}class Hm extends Yn{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[nm(am(),am()),nm(am(),am())];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 Kn&&t.genericType.value.rawType instanceof Kn){const s=K(e.genericType.value.rawType,Kn),i=K(t.genericType.value.rawType,Kn);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return Un([jn.ASSOCIATION,this.path,Un(this.properties),Un(this.derivedProperties),Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Ym extends Yn{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Un([jn.MAPPING,this.path,Un(this.classMappings),Un(this.enumerationMappings),Un(this.associationMappings),Un(this.test),Un(this.includes),Un(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class Wm extends Yn{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Un([jn.PROFILE,this.path,Un(this.p_stereotypes.map((e=>e.value))),Un(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class Km extends Yn{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,tt.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Un([jn.SERVICE,Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues),this.path,this.pattern,Un(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Un(this.tests),Un(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class Xm extends Yn{functionName;constructor(e){super(e),this.functionName=e}}class Zm extends Xm{}class qm extends Zm{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Un([jn.FUNCTION,this.path,Un(this.parameters),this.returnType.valueForSerialization??"",Un(this.taggedValues),Un(this.stereotypes.map((e=>e.pointerHashCode))),Bn(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class Jm extends Yn{includes=[]}class Qm extends Jm{sections=[];get _elementHashCode(){return Un([jn.FLAT_DATA,this.path,Un(this.includes.map((e=>e.valueForSerialization??""))),Un(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class eg extends Yn{runtimeValue;get _elementHashCode(){return Un([jn.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class tg extends Yn{connectionValue;get _elementHashCode(){return Un([jn.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class sg extends Yn{}class ig extends sg{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Un([jn.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Un(this.scopeElements.map((e=>e instanceof nr?e.valueForSerialization??"":e))),Un(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class ag extends Yn{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Un([jn.GENERATION_TREE,this.path,Un(this.generationNodes),Un(this.fileGenerations.map((e=>$n(Me.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class ng extends Jm{schemas=[];joins=[];filters=[];get _elementHashCode(){return Un([jn.DATABASE,this.path,Un(this.includes.map((e=>e.valueForSerialization??""))),Un(this.schemas),Un(this.joins),Un(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class rg{_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 og extends Yn{data;get hashCode(){return Un([jn.DATA_ELEMENT,this.path,Un(this.stereotypes.map((e=>e.pointerHashCode))),Un(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}class lg extends Yn{executionParameters=[];get _elementHashCode(){return Un([jn.EXECUTION_ENVIRONMENT_INSTANCE,this.path,Un(this.executionParameters)])}accept_PackageableElementVisitor(e){return e.visit_ExecutionEnvironmentInstance(this)}}const cg=new Set([Yn,Wn,Xn,tm,Kn,Hm,Zn,qm,Wm,Jn,qn,og,Jm,Ym,tg,eg,ag,ig,Km,lg,class extends Yn{sections=[];get _elementHashCode(){return Un([jn.SECTION_INDEX,this.path,Un(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}}]);class dg{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 Qn(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(cg.has(e))throw new U("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new rg(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(Y(Zn))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(Jn))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(Kn))}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(Y(Qm))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(ng))}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 U("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 j("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new U("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 Kn?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof Zn?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof Jn?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=>H(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>H(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>H(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>H(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>H(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>H(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>H(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>H(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>H(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>K(this.getOwnNullableStore(e),ng,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),Qm,`Can't find flat-data store '${e}'`);getOwnMapping=e=>H(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>H(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>H(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>H(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>H(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>H(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnExecutionEnvironment=e=>H(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=>P((()=>{e.dispose()})))))}getNullablePackage=e=>e?V((()=>Mu(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){Pu(t?Fu(this,t,void 0):this.root,e),e instanceof Ym?this.setOwnMapping(e.path,e):e instanceof Jm?this.setOwnStore(e.path,e):e instanceof Wn?this.setOwnType(e.path,e):e instanceof Hm?this.setOwnAssociation(e.path,e):e instanceof Wm?this.setOwnProfile(e.path,e):e instanceof qm?this.setOwnFunction(e.path,e):e instanceof Km?this.setOwnService(e.path,e):e instanceof tg?this.setOwnConnection(e.path,e):e instanceof eg?this.setOwnRuntime(e.path,e):e instanceof ig?this.setOwnFileGeneration(e.path,e):e instanceof ag?this.setOwnGenerationSpecification(e.path,e):e instanceof og?this.setOwnDataElement(e.path,e):e instanceof lg?this.setOwnExecutionEnvironment(e.path,e):e instanceof Qn||this.getExtensionForElementClass(y(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&bu(e.package,e),e instanceof Ym?this.mappingsIndex.delete(e.path):e instanceof Jm?this.storesIndex.delete(e.path):e instanceof Wn?(this.typesIndex.delete(e.path),e instanceof Jn&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof Hm?this.associationsIndex.delete(e.path):e instanceof Wm?this.profilesIndex.delete(e.path):e instanceof qm?this.functionsIndex.delete(e.path):e instanceof Km?this.servicesIndex.delete(e.path):e instanceof eg?this.runtimesIndex.delete(e.path):e instanceof tg?this.connectionsIndex.delete(e.path):e instanceof ig?this.fileGenerationsIndex.delete(e.path):e instanceof ag?this.generationSpecificationsIndex.delete(e.path):e instanceof og?this.dataElementsIndex.delete(e.path):e instanceof lg?this.executionEnvironmentIndex.delete(e.path):e instanceof Qn?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(y(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new j(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof Qn&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof Qn)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new j(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new j(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,a]=wu(s);if(!(e instanceof Qn)){const t=this.getNullablePackage(i)??(""!==i?Fu(this,i,void 0):this.root);e.name=a,e instanceof qm&&(e.functionName=(n=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Gu(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Gu(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(n))))),e.package!==t&&(e.package&&bu(e.package,e),Pu(t,e))}var n,r;if(e instanceof Ym)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof Jm)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof Wn)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof Jn&&(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 Hm)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof Wm)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof qm)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof Km)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof eg)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof tg)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof ig)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof og)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof lg)this.executionEnvironmentIndex.delete(t),this.executionEnvironmentIndex.set(s,e);else if(e instanceof ag)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof Qn){const n=new Map;if(e.children.forEach((e=>{n.set(e.path,e)})),e.name=a,!e.package)throw new U("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){bu(r,e);const t=""!==i?Fu(this,i,void 0):this.root;Pu(t,e)}n.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(y(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 hg{}class ug extends hg{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class pg extends dg{constructor(e,t,s){super(t.name,e,s),this.root=t}}const _g=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class mg{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new Qn(e);this.roots.push(s),this.projectDependencyModelsIndex.set(e,new pg(this.extensionElementClasses,s,new ug(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=_g(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=_g(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=_g(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=_g(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=_g(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=_g(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=_g(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=_g(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=_g(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=_g(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=_g(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=_g(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=_g(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=_g(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=_g(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=_g(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnExecutionEnvironment=_g(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 H(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 gg extends Jm{static NAME="ModelStore";static INSTANCE=new gg;constructor(){super(gg.NAME)}accept_PackageableElementVisitor(e){throw new j}}class Eg extends dg{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Ne.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(gg.NAME,gg.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[tm.STRING,tm.BOOLEAN,tm.BINARY,tm.NUMBER,tm.INTEGER,tm.FLOAT,tm.DECIMAL,tm.DATE,tm.STRICTDATE,tm.DATETIME,tm.STRICTTIME,tm.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class fg extends dg{autoImports=[];constructor(e){super(Ne.SYSTEM,e)}initializeAutoImports(){this.autoImports=ye.map((e=>K(this.getOwnNullableElement(e,!0),Qn,`Can't find auto-import package '${e}'`)))}}class Tg extends dg{constructor(e){super(Ne.MODEL_GENERATION,e)}}class Cg extends dg{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(Ne.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Tg(i),this.dependencyManager=new mg(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=>H(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>H(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=>H(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>K(this.getType(e),Zn,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),Jn,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),qn,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),Kn,`Can't find class '${e}'`);getAssociation=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??K(this.getType(e),Kn),`Can't find property owner '${e}'`);getFunction=e=>K(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),qm,`Can't find function '${e}'`);getStore=e=>H(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=>K(this.getStore(e),Qm,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),ng,`Can't find database store '${e}'`);getMapping=e=>H(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>H(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>H(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>H(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>H(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>H(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 H(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)=>H(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>V((()=>this.getClass(e)));getNullableMapping=e=>V((()=>this.getMapping(e)));getNullableService=e=>V((()=>this.getService(e)));getNullableRuntime=e=>V((()=>this.getRuntime(e)));getNullableFileGeneration=e=>V((()=>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=J_.ONE:0===e&&1===t?s=J_.ZERO_ONE:0===e&&void 0===t?s=J_.ZERO_MANY:1===e&&void 0===t?s=J_.ONE_MANY:0===e&&0===t&&(s=J_.ZERO),s??new J_(e,t)}addElement(e,t){const s=Lu(t??"",e.name);if(this.getNullableElement(s,!1))throw new U(`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 U(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Sg{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class xg{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ng{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(Ng,{column:(0,We.Ru)(),endLine:(0,We.Ru)(),endColumn:(0,We.Ru)(),line:(0,We.Ru)(),sourceId:(0,We.Ru)(),startLine:(0,We.Ru)(),startColumn:(0,We.Ru)()});const Ag=(0,We.PG)((()=>We.AM),(e=>(e.sourceId=e.source,(0,We.vB)(Ng,e))));class Ig{package;name;tags=[];stereotypes=[]}(0,We.yu)(Ig,{name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ru)()),tags:(0,We.pb)((0,We.Ru)())});class vg{profile;value}(0,We.yu)(vg,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class Og{profile;value}(0,We.yu)(Og,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class yg{tag;value}(0,We.yu)(yg,{tag:(0,We.Ry)(Og),value:(0,We.Ru)()});class Rg{rawType;typeParameter}(0,We.yu)(Rg,{rawType:(0,We.jt)((0,We.Ru)()),typeParameter:(0,We.jt)((0,We.Ru)())});class wg{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,We.yu)(wg,{aggregation:(0,We.Ru)(),genericType:(0,We.Ry)(Rg),multiplicity:(0,We.Ru)(),name:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ry)(vg)),taggedValues:(0,We.pb)((0,We.Ry)(yg))});class Lg{package;name;sourceInformation}(0,We.yu)(Lg,{name:(0,We.Ru)(),package:(0,We.Ru)(),sourceInformation:Ag});class Pg{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,We.yu)(Pg,{generalizations:(0,We.pb)((0,We.Ry)(Rg)),name:(0,We.Ru)(),package:(0,We.Ru)(),properties:(0,We.pb)((0,We.Ry)(wg)),qualifiedProperties:(0,We.pb)((0,We.Ry)(wg)),sourceInformation:Ag,stereotypes:(0,We.pb)((0,We.Ry)(vg)),taggedValues:(0,We.pb)((0,We.Ry)(yg))});class bg{package;name;enumValues=[]}(0,We.yu)(bg,{name:(0,We.Ru)(),package:(0,We.Ru)(),enumValues:(0,We.pb)((0,We.Ru)())});class Dg{x;y}(0,We.yu)(Dg,{x:(0,We.Ru)(),y:(0,We.Ru)()});class Mg{height;width}(0,We.yu)(Mg,{height:(0,We.Ru)(),width:(0,We.Ru)()});class Fg{points=[]}(0,We.yu)(Fg,{points:(0,We.pb)((0,We.Ry)(Dg))});class kg{id;source;target;geometry}(0,We.yu)(kg,{geometry:(0,We.Ry)(Fg),id:(0,We.Ru)(),source:(0,We.Ru)(),target:(0,We.Ru)()});class Ug{name;owningType}(0,We.yu)(Ug,{name:(0,We.Ru)(),owningType:(0,We.Ru)()});class jg{id;source;target;property;geometry}(0,We.yu)(jg,{geometry:(0,We.Ry)(Fg),id:(0,We.Ru)(),property:(0,We.Ry)(Ug),source:(0,We.Ru)(),target:(0,We.Ru)()});class Gg{id;type;position;rectangleGeometry}(0,We.yu)(Gg,{id:(0,We.Ru)(),position:(0,We.Ry)(Dg),rectangleGeometry:(0,We.Ry)(Mg),type:(0,We.Ru)()});class Vg{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,We.yu)(Vg,{name:(0,We.Ru)(),generalizationViews:(0,We.pb)((0,We.Ry)(kg)),package:(0,We.Ru)(),propertyViews:(0,We.pb)((0,We.Ry)(jg)),sourceInformation:Ag,stereotypes:(0,We.pb)((0,We.Ry)(vg)),taggedValues:(0,We.pb)((0,We.Ry)(yg)),typeViews:(0,We.pb)((0,We.Ry)(Gg))});class Bg{classes=[];enumerations=[];profiles=[]}(0,We.yu)(Bg,{classes:(0,We.pb)((0,We.Ry)(Pg)),enumerations:(0,We.pb)((0,We.Ry)(bg)),profiles:(0,We.pb)((0,We.Ry)(Ig))});class $g{name;diagram;domainInfo}(0,We.yu)($g,{diagram:(0,We.Ry)(Vg),name:(0,We.Ru)(),domainInfo:(0,We.jt)((0,We.Ry)(Bg))});class zg{class;enumerations=[];profiles=[];specializations=[]}(0,We.yu)(zg,{class:(0,We.Ry)(Pg),enumerations:(0,We.pb)((0,We.Ry)(bg)),profiles:(0,We.pb)((0,We.Ry)(Ig)),specializations:(0,We.pb)((0,We.Ry)(Lg))});const Hg=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}`},Yg=(e,t,s,i)=>{const a=t.getOwnNullableClass(e);if(!a){const[a,n]=wu(e),r=new Kn(n);return Pu(Mu(t.root,a,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return a},Wg=e=>{if("*"===e)return new J_(0,void 0);{const t=e.split("..");if(1===t.length)return new J_(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new J_(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},Kg=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,a;b(e.taggedValues,new Gm(Bm.create((i=s.getProfile(t.tag.profile),a=t.tag.value,H(i.p_tags.find((e=>e.value===a)),`Can't find tag '${a}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,a;b(e.stereotypes,zm.create((i=s.getProfile(t.profile),a=t.value,H(i.p_stereotypes.find((e=>e.value===a)),`Can't find stereotype '${a}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const a=Yg(H(t.rawType),s,i,void 0);b(e.generalizations,X_.create(new Z_(a))),b(a._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const a=new q_(t.name,Wg(t.multiplicity),X_.create(new Z_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Yg(H(t.genericType.rawType),s,i,void 0))),e);a.aggregation="Composite"===t.aggregation?sm.COMPOSITE:"Shared"===t.aggregation?sm.SHARED:void 0,b(e.properties,a)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new W_(t.name,Wg(t.multiplicity),X_.create(new Z_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Yg(H(t.genericType.rawType),s,i,void 0))),e))}))},Xg=e=>{const t=new Cg(new Eg([]),new fg([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Kn(e.name);Pu(Mu(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 Wm(e.name);Pu(Mu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Sg(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new xg(s,e))))})),i.enumerations.forEach((e=>{const s=new Zn(e.name);Pu(Mu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":Ce}${e.name}`,a=t.getClass(i);Kg(a,e,t,s)}))}const i=e.diagram,a=new jh(i.name);return Pu(Mu(t.root,i.package,!0,new Map),a),i.typeViews.forEach((e=>{const s=new Zu(a,e.id,rr.create(t.getClass(e.type)));s.position=new Wu(e.position.x,e.position.y),s.rectangle=new Ku(e.rectangleGeometry.width,e.rectangleGeometry.height),b(a.classViews,s)})),i.propertyViews.forEach((e=>{const s=new sp(a,em.create((i=t.getClass(e.property.owningType),n=e.property.name,H(i instanceof Kn?ju(i).find((e=>e.name===n)):i.properties.find((e=>e.name===n)),`Can't find property '${n}' of '${i.path}'`))),H(a.classViews.find((t=>t.id===e.source))),H(a.classViews.find((t=>t.id===e.target))));var i,n;s.path=e.geometry.points.map((e=>new Wu(e.x,e.y))),op(s),b(a.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new ip(a,H(a.classViews.find((t=>t.id===e.source))),H(a.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Wu(e.x,e.y))),op(t),b(a.generalizationViews,t)})),[a,t,s]};class Zg extends zp{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,a,n){super(e),(0,S.rC)(this,{_renderer:S.LO,diagram:S.LO,diagramInfo:S.LO,diagramName:S.Fl,diagramCursorClass:S.Fl,addClassView:S.ls,rebuild:S.aD,setRenderer:S.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=a,this.fileColumn=n,this.diagramInfo=t;const[r,o,l]=Xg(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Dp(this.diagramPath)}get description(){return`Diagram: ${Dp(this.diagramPath)}`}get diagramName(){return yu(this.diagramPath)}match(e){return e instanceof Zg&&this.diagramPath===e.diagramPath}get renderer(){return H(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 bm.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case bm.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case bm.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case bm.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]=Xg(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 Fp(t.sourceId,t.startLine,t.startColumn);(0,S.fl)(this.editorStore.executeNavigation(e)).catch(this.editorStore.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?"":Ce}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new Wm(e.name);Pu(Mu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Sg(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new xg(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":Ce}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new Zn(e.name);Pu(Mu(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,a=`${i.package}${""===i.package?"":Ce}${i.name}`;let n=t.getOwnNullableClass(a);n||(n=new Kn(i.name),Pu(Mu(t.root,i.package,!0,new Map),n),t.setOwnType(n.path,n));const r=s.get(n.path)?.isStubbed??!0;return s.set(n.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=H(n),a=Yg(H(`${e.package}${""===e.package?"":Ce}${e.name}`),t,s,e.sourceInformation);b(i._subclasses,a),a.generalizations.map((e=>e.value.rawType)).includes(i)||b(a.generalizations,X_.create(new Z_(i)))})),r&&Kg(n,i,t,s),n})((0,We.vB)(zg,yield this.editorStore.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.editorStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.editorStore.applicationStore.commandService.registerCommand({key:Kp.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandService.registerCommand({key:Kp.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Kp.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Kp.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Kp.RECENTER,Kp.USE_ZOOM_TOOL,Kp.USE_VIEW_TOOL,Kp.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class qg{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,S.rC)(this,{text:S.LO,isCaseSensitive:S.LO,isRegExp:S.LO,reset:S.aD,setText:S.aD,setCaseSensitive:S.aD,setRegExp:S.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 Jg extends F{}const Qg=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,eE=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,tE=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class sE{editorStore;constructor(e){this.editorStore=e}}class iE extends sE{result;constructor(e,t){super(e),this.result=t}}class aE extends sE{result;constructor(e,t){super(e),this.result=t}}class nE{editorStore;usageConcept;searchEntries=[];constructor(e,t,s,i){(0,S.rC)(this,{searchEntries:S.LO,numberOfFiles:S.Fl,numberOfResults:S.Fl}),this.editorStore=e,this.usageConcept=t;const a=new Map;s.forEach(((e,t)=>{let s;a.has(e.source)?s=H(a.get(e.source)):(s=new w_,s.sourceId=e.source,a.set(e.source,s));const n=new R_(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);n.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(n)})),this.searchEntries=Array.from(a.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=H(a.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))}dismissSearchEntry(e){M(this.searchEntries,e),this.searchEntries.length||this.editorStore.setReferenceUsageResult(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class rE{searchState;searchEntries=[];constructor(e,t){(0,S.rC)(this,{searchEntries:S.LO,numberOfFiles:S.Fl,numberOfResults:S.Fl}),this.searchState=e,this.searchEntries=t}dismissSearchEntry(e){M(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 oE{editorStore;loadState=Ft.create();searchInput;text="";isCaseSensitive=!1;isRegExp=!1;result;constructor(e){(0,S.rC)(this,{text:S.LO,isCaseSensitive:S.LO,isRegExp:S.LO,result:S.LO,setText:S.aD,setCaseSensitive:S.aD,setRegExp:S.aD,setResult:S.aD,search:S.ls}),this.editorStore=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.editorStore.client.searchText(this.text,this.isCaseSensitive,this.isRegExp)).map((e=>(e=>(0,We.vB)(w_,e))(e)));this.setResult(new rE(this,e)),this.loadState.pass()}catch(e){G(e),this.editorStore.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 lE{applicationStore;initState=Ft.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Ip.TERMINAL;auxPanelDisplayState=new Y_({initial:0,default:300,snap:100});activeActivity=Ap.CONCEPT_EXPLORER;sideBarDisplayState=new Y_({initial:300,default:300,snap:150});tabManagerState=new Hp(this);executionState=Ft.create();navigationStack=[];fileSearchCommandLoadState=Ft.create();fileSearchCommandState=new qg;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=Ft.create();referenceUsageResult;textSearchState;testRunState=Ft.create();testRunnerState;constructor(e){var t;(0,S.rC)(this,{isMaxAuxPanelSizeSet:S.LO,activeAuxPanelMode:S.LO,activeActivity:S.LO,navigationStack:S.LO,openFileSearchCommand:S.LO,fileSearchCommandResults:S.LO,fileSearchCommandState:S.LO,codeFixSuggestion:S.LO,referenceUsageResult:S.LO,testRunnerState:S.LO,setCodeFixSuggestion:S.aD,setReferenceUsageResult:S.aD,setOpenFileSearchCommand:S.aD,setActiveAuxPanelMode:S.aD,setActiveActivity:S.aD,setTestRunnerState:S.aD,pullInitializationActivity:S.aD,pullExecutionStatus:S.aD,initialize:S.ls,checkIfSessionWakingUp:S.ls,loadDiagram:S.ls,loadFile:S.ls,execute:S.ls,executeGo:S.ls,manageExecuteGoResult:S.ls,executeTests:S.ls,executeFullTestSuite:S.ls,executeNavigation:S.ls,navigateBack:S.ls,fullReCompile:S.ls,command:S.ls,findUsagesFromCoordinate:S.ls,findUsages:S.ls,renameConcept:S.ls,movePackageableElements:S.ls,updateFileUsingSuggestionCandidate:S.ls,updateFile:S.ls,searchFile:S.ls,createNewDirectory:S.ls,createNewFile:S.ls,renameFile:S.ls,deleteDirectoryOrFile:S.ls}),this.applicationStore=e,this.textSearchState=new oE(this),this.directoryTreeState=new c_(this),this.conceptTreeState=new h_(this),this.client=new H_(new Ee({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(tE);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,S.fl)(t.loadFile(i.groups.path_sourceId,new Fp(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:tE},commands:[{command:Jp.GO,description:"Run the go() function in welcome file",usage:"go",aliases:["compile","executeGo"],handler:async e=>(0,S.fl)(t.executeGo()).catch(t.applicationStore.alertUnhandledError)},{command:Jp.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=w(e);!s||s.match(Qg)?await(0,S.fl)(t.executeTests(s??Np)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:Jp.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=w(e);s?.match(eE)?await(0,S.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:Jp.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(eE))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(eE)?await(0,S.fl)(t.renameFile(s,i)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid new file path")}},{command:Jp.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(eE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:Jp.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(eE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:Jp.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,S.fl)(t.loadFile(Sp)).catch(t.applicationStore.alertUnhandledError)}},{command:Jp.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(Qg)?await(0,S.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:Jp.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(eE)||s.match(Qg)))try{s.match(Qg)?await(0,S.fl)(t.conceptTreeState.revealConcept(s,{forceOpenExplorerPanel:!0,packageOnly:!0})):await(0,S.fl)(t.directoryTreeState.revealPath(s,{forceOpenExplorerPanel:!0,directoryOnly:!0}))}catch(e){G(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or concept path")}},{command:Jp.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(eE)||s.match(Qg)||[xp,Np].includes(s)))try{s.match(Qg)||s===Np?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,We.vB)(bp,e))).map((e=>e.li_attr instanceof wp?`${Kt.BRIGHT_CYAN}${e.text}${Kt.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,We.vB)(r_,e))).map((e=>e.isFolderNode?`${Kt.BRIGHT_CYAN}${e.text}${Kt.RESET}`:e.text)).join("\n"))}catch(e){G(e),t.applicationStore.terminalService.terminal.fail(e.message)}else t.applicationStore.terminalService.terminal.fail("command requires a valid directory or package path")}},{command:Jp.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:Jp.ECHO,description:"Print text",usage:"echo 'some string'",handler:async(e,s,i)=>{const a=i.substring(i.indexOf(s)+s.length).trim();t.applicationStore.terminalService.terminal.output(a.replaceAll(/\\u001b/g,""))}},{command:Jp.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:Jp.HELP,description:"Show help",usage:"help",handler:async e=>(t.applicationStore.terminalService.terminal.showHelp(),Promise.resolve())}]})}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=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=>{G(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,S.fl)(this.loadFile(Sp)),n=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(a=yield s).error?a.source?(0,We.vB)(__,a):(0,We.vB)(p_,a):(0,We.vB)(u_,a);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActiveAuxPanelMode(Ip.TERMINAL),this.auxPanelDisplayState.open()),o instanceof p_?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof __&&(yield(0,S.fl)(this.loadFile(o.source,new kp(o.source,o.line,o.column,new Jg((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,n,r])),this.initState.pass()}catch(e){G(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:bs.CAUTION,actions:[{label:"Compile to debug",type:Ds.PROCEED_WITH_CAUTION,default:!0,handler:()=>{(0,S.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}]})}finally{this.applicationStore.terminalService.terminal.clear()}var a}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:Yp.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Yp.SEARCH_TEXT,action:()=>{this.setActiveAuxPanelMode(Ip.SEARCH),this.auxPanelDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Yp.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof t_&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Yp.TOGGLE_TERMINAL_PANEL,action:()=>{this.auxPanelDisplayState.isOpen?this.activeAuxPanelMode!==Ip.TERMINAL?(this.setActiveAuxPanelMode(Ip.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.auxPanelDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActiveAuxPanelMode(Ip.TERMINAL),this.auxPanelDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Yp.EXECUTE,action:()=>{(0,S.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Yp.FULL_RECOMPILE,action:()=>{(0,S.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Yp.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,S.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Yp.RUN_ALL_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Yp.RUN_RELAVANT_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Yp.SEARCH_FILE,Yp.SEARCH_TEXT,Yp.GO_TO_FILE,Yp.TOGGLE_TERMINAL_PANEL,Yp.EXECUTE,Yp.FULL_RECOMPILE,Yp.FULL_RECOMPILE_WITH_FULL_INIT,Yp.RUN_ALL_TESTS,Yp.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 a=this.tabManagerState.tabs.find((e=>e instanceof Zg&&e.diagramPath===t));a||(yield(0,S.fl)(this.checkIfSessionWakingUp()),a=new Zg(this,(0,We.vB)($g,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(a)}*loadFile(e,t){try{let s=this.tabManagerState.tabs.find((t=>t instanceof t_&&t.filePath===e));s||(yield(0,S.fl)(this.checkIfSessionWakingUp()),s=new t_(this,(0,We.vB)(Mp,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof kp&&s.showError(t))}catch(t){G(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 t_&&s.filePath===e)s.setFile((0,We.vB)(Mp,await this.client.getFile(e)));else if(s instanceof Zg&&s.filePath===e)try{s.rebuild((0,We.vB)($g,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,a,n){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(Y(t_)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof t_?{path:e.filePath,code:e.file.content}:e instanceof Zg?{diagram:e.diagramPath,code:Hg(e.diagram)}:void 0)).filter($),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=H(h)).error?o.candidateName&&o.PureUnmatchedFunctionException?(0,We.vB)(x_,o):o.candidateName&&o.candidates?(0,We.vB)(N_,o):(0,We.vB)(E_,o):o.jumpTo?(0,We.vB)(T_,o):o.tests?(0,We.vB)(v_,o):(0,We.vB)(g_,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof E_?(this.applicationStore.notificationService.notifyError("Execution failed"+(p.text?`: ${p.text}`:"")),this.applicationStore.terminalService.terminal.fail(p.text,{systemCommand:a??"execute"}),p.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:p.sessionError}):yield(0,S.fl)(i(p,r))):(n?.silentTerminalOnSuccess||this.applicationStore.terminalService.terminal.output(p.text??"",{clear:n?.clearTerminal,systemCommand:a??"execute"}),p instanceof g_?(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,S.fl)(this.initialize(!1,(()=>(0,S.fl)(this.execute(e,t,s,i,a))),this.client.mode,this.client.compilerMode))):yield(0,S.fl)(i(p,r))):yield(0,S.fl)(i(p,r)))}catch(e){G(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:a??"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,S.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,S.fl)(this.manageExecuteGoResult(e,t))),Jp.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(Y(t_)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof E_)e.source&&(yield(0,S.fl)(this.loadFile(e.source,new kp(e.source,e.line,e.column,new Jg(e.text.split("\n").filter(Boolean)[0]))))),e instanceof x_?(this.setCodeFixSuggestion(new iE(this,e)),this.setActiveAuxPanelMode(Ip.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()):e instanceof N_&&(this.setCodeFixSuggestion(new aE(this,e)),this.setActiveAuxPanelMode(Ip.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof g_){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,S.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,S.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof E_)e.source&&await(0,S.fl)(this.loadFile(e.source,new kp(e.source,e.line,e.column,new Jg(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Ip.TERMINAL),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof v_){this.setActiveAuxPanelMode(Ip.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new B_(this,e);this.setTestRunnerState(t),await(0,S.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,S.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}),`${Jp.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,S.fl)(this.executeTests(Np,e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,S.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof T_&&await(0,S.fl)(this.loadFile(e.jumpTo.source,new Fp(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,S.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:bs.CAUTION,actions:[{label:"Perform full re-compile",type:Ds.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,S.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(Ap.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ds.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(t_)).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!==Ap.CONCEPT_EXPLORER&&this.setActiveActivity(Ap.CONCEPT_EXPLORER);const e=t.path.split(Ce);let s=H(e[0]),i=H(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${Ce}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,S.fl)(this.conceptTreeState.expandNode(i)),i=H(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,We.vB)(z_,s):new $_;return!(i instanceof z_&&(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 G(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,We.vB)(Gp,e)))}*findUsagesFromCoordinate(e){const t=yield this.getConceptInfo(e);t&&(yield(0,S.fl)(this.findUsages(t)))}*findUsages(e){try{this.referenceUsageLoadState.inProgress(),this.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${jp(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===yp.ENUM_VALUE?Up.ENUM:e.pureType===yp.PROPERTY||e.pureType===yp.QUALIFIED_PROPERTY?Up.PROPERTY:Up.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,We.qC)(R_,new R_(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,We.vB)(R_,e)));this.setReferenceUsageResult(new nE(this,e,t,s)),this.setActiveAuxPanelMode(Ip.REFERENCES),this.auxPanelDisplayState.open()}catch(e){G(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 a=i.map((e=>e.source));for(const e of a)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){G(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,tt.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){G(e),this.applicationStore.notificationService.notifyError(`Can't move packageable elements:\n${e.message}`)}}*updateFileUsingSuggestionCandidate(e){this.setCodeFixSuggestion(void 0),yield(0,S.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Ip.TERMINAL),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,a){try{const n=yield this.client.updateSource([{path:e,line:t,column:s,message:a,add:i}]);if(n.modifiedFiles.length)for(const e of n.modifiedFiles)yield this.reloadFile(e);this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){G(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,S.fl)(this.command((()=>this.client.createFolder(Dp(e))),Jp.NEW_DIRECTORY)),yield(0,S.fl)(this.directoryTreeState.refreshTreeData())}catch(e){G(e),this.applicationStore.notificationService.notifyError(e)}}*createNewFile(e){try{const t=yield(0,S.fl)(this.command((()=>this.client.createFile(Dp(e))),Jp.NEW_FILE));yield(0,S.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,S.fl)(this.loadFile(e)))}catch(e){G(e),this.applicationStore.notificationService.notifyError(e)}}*renameFile(e,t){try{yield(0,S.fl)(this.command((()=>this.client.renameFile(e,t)),Jp.MOVE)),yield(0,S.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof t_&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){G(e),this.applicationStore.notificationService.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,S.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Dp(e))),Jp.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof t_&&(void 0===t||t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,S.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:bs.CAUTION,actions:[{label:"Delete anyway",type:Ds.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ds.PROCEED,default:!0}]})}}const cE=(0,At.createContext)(void 0),dE=({children:e})=>{const t=An(),s=(0,Nt.fv)((()=>new lE(t)));return(0,T.jsx)(cE.Provider,{value:s,children:e})},hE=()=>H((0,At.useContext)(cE),"Can't find editor store in context"),uE=(0,Nt.Pi)((()=>{const e=hE(),t=An().terminalService.terminal,s=(0,At.useRef)(null),{ref:i,width:a,height:n}=(0,ja.NB)();(0,At.useEffect)((()=>(s.current&&t.searchConfig.setSearchInput(s.current),()=>t.searchConfig.setSearchInput(void 0))),[t]),(0,At.useEffect)((()=>{i.current&&t.mount(i.current)}),[t,i]),(0,At.useEffect)((()=>{e.auxPanelDisplayState.isOpen&&e.activeAuxPanelMode===Ip.TERMINAL&&t.focus()}),[t,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,At.useEffect)((()=>{t.autoResize()}),[t,a,n]);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)(Vi,{})}),(0,T.jsx)("button",{className:(0,vs.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)($i,{})}),(0,T.jsx)("button",{className:(0,vs.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)(zi,{})}),(0,T.jsx)("button",{className:(0,vs.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)(Bi,{})})]})]}),(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)(Ei,{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)(gi,{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,vs.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)($s,{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)(Ni,{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)(ci,{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)(Qs,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(Pa,{className:"terminal-panel__content",content:(0,T.jsxs)(ba,{children:[(0,T.jsx)(Da,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Da,{onClick:o,children:"Copy All"}),(0,T.jsx)(Da,{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)(Ga,{children:"Terminal is not set up yet"})})})),pE=(0,Nt.Pi)((e=>{const{searchResult:t,result:s}=e,i=hE(),a=An(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Fp(s.sourceId,e.startLine,e.startColumn))).catch(a.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)(Zi,{}):(0,T.jsx)(Ji,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(Ai,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:Dp(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)(Ys,{})})]})]}),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:n(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)(Ys,{})})})]},e.uuid)))})]})})),_E=(0,Nt.Pi)((e=>{const{searchResult:t}=e,s=hE(),i=An(),a=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,S.fl)(s.textSearchState.search()).catch(i.alertUnhandledError)},children:(0,T.jsx)(Di,{})}),(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)(Vi,{})}),!a&&(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)(Wi,{})}),a&&(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)(Ki,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(pE,{searchResult:t,result:e},e.uuid)))})]})})),mE=(0,Nt.Pi)((()=>{const e=hE(),t=(0,At.useRef)(null),s=e.textSearchState,i=(0,At.useMemo)((()=>(0,$a.Z)((()=>s.search()),300)),[s]);return(0,At.useEffect)((()=>(t.current&&s.setSearchInput(t.current),()=>s.setSearchInput(void 0))),[s]),(0,At.useEffect)((()=>{e.auxPanelDisplayState.isOpen&&e.activeAuxPanelMode===Ip.SEARCH&&s.focus()}),[s,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(js,{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,vs.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)($i,{})}),(0,T.jsx)("button",{className:(0,vs.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)(Bi,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(_E,{searchResult:e.textSearchState.result})]})})),gE=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:a,onNodeSelect:n}=e;return(0,T.jsxs)("div",{className:(0,vs.clsx)("tree-view__node__container",{[`${a}__tree-view__node__container`]:a}),onClick:()=>n?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,vs.clsx)("tree-view__node__icon",{[`${a}__tree-view__node__icon`]:a}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(Zi,{}):(0,T.jsx)(Ji,{}))}),(0,T.jsx)("div",{className:(0,vs.clsx)("tree-view__node__label",{[`${a}__tree-view__node__label`]:a}),children:t.label})]})},EE=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:a,classPrefix:n,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:EE,TreeNodeContainer:gE},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,vs.clsx)("tree-view__node__block",{[`${n}__tree-view__node__block`]:n}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:n,onNodeSelect:i,innerProps:l}),t.isOpen&&a(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:n,onNodeSelect:i,getChildNodes:a,innerProps:l},e.id)))]})},fE=e=>{const{treeData:t,className:s,classPrefix:i,components:a,onNodeSelect:n,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter($),d={TreeNodeView:EE,TreeNodeContainer:gE},h=a?{...d,...a}:d;return(0,T.jsx)("div",{className:(0,vs.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:n,classPrefix:i,innerProps:l},e.id)))})};var TE=s(410);const CE=TE.gs,SE="resizable-panel--collapsed",xE=(e,t)=>({collapsiblePanel:{className:(0,vs.clsx)(...t?.classes??[],{[SE]:e}),onStartResize:e=>{e.domElement.classList.remove(SE),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}}),NE=TE.jW,AE=TE.nN,IE=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var vE=s(48845);const OE=(0,Nt.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:a,innerProps:n}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=n,h=hE(),u=An(),p=r.testResultInfo,_=!t.data.type,m=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)?b_.PASSED:t.failedTests.has(e)?b_.FAILED:t.testsWithError.has(e)?b_.ERROR:b_.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?b_.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?b_.RUNNING:b_.PASSED})(t,p):void 0){case b_.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)(di,{})});break;case b_.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)(Si,{})});break;case b_.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)(Ws,{})});break;case b_.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)(pi,{})});break;default:g=(0,T.jsx)(Qs,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,vs.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":m}),onClick:e=>{e.stopPropagation(),e.preventDefault(),a?.(t),_?E():o(t)},onDoubleClick:()=>{_?E():(0,S.fl)(h.loadFile(t.data.li_attr.file,new Fp(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:_?t.isOpen?(0,T.jsx)(Zi,{}):(0,T.jsx)(Ji,{}):(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})]})})),yE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),a=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(Ce),(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($).map((e=>(0,T.jsx)(OE,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:a,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),RE=(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)(Ga,{children:"No tests found"}),!i&&(0,T.jsx)(fE,{components:{TreeNodeContainer:OE},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter($),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),wE=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,LE=e=>{const{wrapText:t,result:s}=e,i=hE(),a=An(),[n,r]=(0,At.useState)(),o=(0,At.useRef)(void 0),l=(0,At.useRef)(null),{ref:c,width:d,height:h}=(0,ja.NB)();return(0,At.useEffect)((()=>{void 0!==d&&void 0!==h&&n?.layout({width:d,height:h})}),[n,d,h]),(0,At.useEffect)((()=>{if(!n&&l.current){const e=l.current,t=x.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:A.LEGEND,language:I.TEXT});r(t)}}),[a,n]),o.current?.dispose(),o.current=x.languages.registerLinkProvider(I.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(wE)).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,S.fl)(i.loadFile(t.sourceId,new Fp(t.sourceId,Number.parseInt(t.line,10),Number.parseInt(t.column,10)))).catch(i.applicationStore.alertUnhandledError)}}),(0,At.useEffect)((()=>{void 0!==d&&void 0!==h&&n?.layout({width:d,height:h})}),[n,d,h]),(0,At.useEffect)((()=>{if(n){const e=s instanceof M_?"Test passed!":s instanceof k_?s.error.text:"Running...";n.setValue(e),(s instanceof M_||s instanceof k_)&&n.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof M_?"test-runner-panel__result__content--success":"test-runner-panel__result__content--failure"}}])}}),[n,s]),(0,At.useEffect)((()=>{n&&n.updateOptions({wordWrap:t?"on":"off"})}),[n,t]),(0,At.useEffect)((()=>()=>{n&&(e=>{e.dispose(),e.getModel()?.dispose()})(n),o.current?.dispose()}),[n]),(0,T.jsx)("div",{ref:c,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:l})})},PE=(0,Nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,a=hE(),n=An(),[r,o]=(0,At.useState)(!1),l=i.results.get(s),c=H(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,vs.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(ji,{className:"test-runner-panel__result__header__icon--text-wrap"})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,S.fl)(a.loadFile(c.li_attr.file,new Fp(c.li_attr.file,Number.parseInt(c.li_attr.line,10),Number.parseInt(c.li_attr.column,10)))).catch(n.alertUnhandledError)},children:(0,T.jsx)(Gi,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(LE,{result:l,wrapText:r})})]})})),bE=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=hE(),i=An(),a=t.testExecutionResult.count,n=t.testResultInfo,r=n?.suiteStatus??P_.NONE,o=n?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(CE,{orientation:"vertical",children:[(0,T.jsx)(NE,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(js,{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:[a," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[n?.passed??0," ",(0,T.jsx)(di,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[n?.failed??0," ",(0,T.jsx)(Si,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[n?.error??0," ",(0,T.jsx)(Ws,{})]})]}),n&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[n.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)(Mi,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(Fi,{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)(_i,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(ti,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,S.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(xi,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,S.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(ii,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,S.fl)(t.cancelTestRun()).catch(i.alertUnhandledError).finally((()=>{s.setTestRunnerState(void 0)}))},title:"Reset",children:(0,T.jsx)(Ys,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(vE.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)(RE,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(yE,{testRunnerState:t})]})})]})}),(0,T.jsx)(AE,{children:(0,T.jsx)(IE,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(NE,{minSize:400,children:[t.selectedTestId&&!n&&(0,T.jsx)("div",{}),t.selectedTestId&&n&&(0,T.jsx)(PE,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:n}),!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)(Ga,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),DE=(0,Nt.Pi)((()=>{const e=hE().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Ga,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,T.jsxs)("div",{className:"auxiliary-panel__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)(Ks,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(bE,{testRunnerState:e})]})})),ME=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=hE(),i=An(),a=()=>{(0,S.fl)(s.loadFile(t.sourceID,new Fp(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:a,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:`${Dp(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:a,children:(0,T.jsx)(ai,{})})})]})})),FE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=hE(),i=An();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,S.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:`${Dp(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,S.fl)(s.loadFile(t.sourceID,new Fp(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(ai,{})})})]})})),kE=(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)(ME,{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)(FE,{candidate:e},e.uuid)))})]})]})})),UE=(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)(FE,{candidate:e},e.uuid)))})]})]})})),jE=(0,Nt.Pi)((()=>{const e=hE();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof iE&&(0,T.jsx)(kE,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof aE&&(0,T.jsx)(UE,{suggestionState:e.codeFixSuggestion})]})})),GE=(0,Nt.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=hE(),a=An(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Fp(s.sourceId,e.startLine,e.startColumn))).catch(a.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)(Zi,{}):(0,T.jsx)(Ji,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(Ai,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:Dp(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)(Ys,{})})]})]}),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:n(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)(Ys,{})})})]},e.uuid)))})]})})),VE=(0,Nt.Pi)((e=>{const{referenceUsageState:t}=e,s=hE(),i=An(),a=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 ${jp(t.usageConcept)}`:`No usages found for ${jp(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,S.fl)(s.findUsages(t.usageConcept)).catch(i.alertUnhandledError)},children:(0,T.jsx)(Di,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(Vi,{})}),!a&&(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)(Wi,{})}),a&&(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)(Ki,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(GE,{referenceUsageResult:t,result:e},e.uuid)))})]})})),BE=(0,Nt.Pi)((()=>{const e=hE();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(js,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Ga,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Find Concept References"}),(0,T.jsxs)("div",{className:"auxiliary-panel__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)(Ks,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)(VE,{referenceUsageState:e.referenceUsageResult})]})})),$E=(0,Nt.Pi)((()=>{const e=hE(),t={[Ip.TERMINAL]:{mode:Ip.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(fi,{className:"auxiliary-panel__header__tab__icon--terminal"}),isVisible:!0},[Ip.SEARCH]:{mode:Ip.SEARCH,name:"SEARCH",icon:(0,T.jsx)(ri,{className:"auxiliary-panel__header__tab__icon--search"}),isVisible:!0},[Ip.TEST_RUNNER]:{mode:Ip.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(ta,{className:"auxiliary-panel__header__tab__icon--test"}),isVisible:!0},[Ip.REFERENCES]:{mode:Ip.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(Hi,{className:"auxiliary-panel__header__tab__icon--references"}),isVisible:!0},[Ip.CODE_FIX_SUGGESTION]:{mode:Ip.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(Yi,{className:"auxiliary-panel__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Ip).filter((e=>$(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,At.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Ip.TERMINAL)}),[e,s,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter($).map((t=>{return(0,T.jsxs)("button",{tabIndex:-1,className:(0,vs.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,T.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,T.jsx)(Zi,{}):(0,T.jsx)(qi,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(Qi,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Ip.TERMINAL)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(uE,{})}),i(Ip.SEARCH)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(mE,{})}),i(Ip.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(DE,{})}),i(Ip.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(jE,{})}),i(Ip.REFERENCES)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(BE,{})})]})]})}));var zE=s(42689);const HE=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(ma,{})}),YE=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),WE=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),KE=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),XE=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),ZE=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),qE=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(xa,{})}),JE=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(si,{})}),QE=()=>(0,T.jsx)("div",{children:(0,T.jsx)(Js,{})}),ef=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(xa,{})}),tf=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(pa,{})}),sf=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(ni,{})}),af=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(Ri,{})}),nf=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),rf=e=>{switch(e){case yp.PACKAGE:return(0,T.jsx)(HE,{});case yp.PROFILE:return(0,T.jsx)(ZE,{});case yp.CLASS:return(0,T.jsx)(YE,{});case yp.ASSOCIATION:return(0,T.jsx)(nf,{});case yp.PROPERTY:case yp.QUALIFIED_PROPERTY:return(0,T.jsx)(tf,{});case yp.ENUMERATION:return(0,T.jsx)(WE,{});case yp.MEASURE:return(0,T.jsx)(KE,{});case yp.UNIT:return(0,T.jsx)(XE,{});case yp.FUNCTION:return(0,T.jsx)(qE,{});case yp.NATIVE_FUNCTION:return(0,T.jsx)(ef,{});case yp.DIAGRAM:return(0,T.jsx)(sf,{});case yp.DATABASE:return(0,T.jsx)(af,{});case yp.MAPPING:return(0,T.jsx)(JE,{});default:return(0,T.jsx)(QE,{})}},of=/^\w[\w$]*$/,lf=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,cf=(0,Nt.Pi)((e=>{const{node:t}=e,s=hE(),i=An(),a=t.data.li_attr.pureName??t.data.li_attr.pureId,n=t.data.li_attr.pureType===yp.PACKAGE,[r,o]=(0,At.useState)(n?yu(a):a),l=(0,At.useRef)(null),c=Boolean(r.match(n?lf:of)),d=(n?yu(a):a)===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)(Is.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"})]})]})})})),df=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,hf=(0,Nt.Pi)((e=>{const{node:t}=e,s=hE(),i=An(),a=Ru(t.data.li_attr.pureId)??"",[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(df)),c=a===n,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([K(t.data.li_attr,Pp)],n).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Is.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:n,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"})]})]})})})),uf=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,a=s.data.li_attr,n=a.pureType,r=hE(),o=An();return(0,T.jsxs)(ba,{ref:t,children:[a.pureType!==yp.PROPERTY&&a.pureType!==yp.QUALIFIED_PROPERTY&&(0,T.jsx)(Da,{onClick:()=>{o.clipboardService.copyTextToClipboard(a.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),n===yp.PACKAGE&&(0,T.jsx)(Da,{onClick:()=>{(0,S.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),n===yp.FUNCTION&&(0,T.jsx)(Da,{onClick:()=>{o.navigationService.navigator.visitAddress(`${r.client.baseUrl}/execute?func=${a.pureId}&mode=${r.client.mode}`)},children:"Service (JSON)"}),(a instanceof Lp||a instanceof Pp)&&(0,T.jsx)(Da,{onClick:()=>{(a instanceof Pp||a instanceof Lp)&&r.findUsagesFromCoordinate(new Fp(a.file,Number.parseInt(a.line,10),Number.parseInt(a.column,10)))},children:"Find Usages"}),n!==yp.PACKAGE&&(0,T.jsx)(Da,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(Ma,{}),(0,T.jsx)(Da,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),a instanceof Pp&&(0,T.jsx)(Da,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var pf;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(pf=pf||(pf={}));const _f=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:a,innerProps:n}=e,[r,o]=(0,At.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=n,u=t.parent&&t.data.li_attr instanceof Lp&&t.data.li_attr.classPath!==t.parent.id,p=[yp.PACKAGE,yp.CLASS].includes(t.data.li_attr.pureType),_=t.data.li_attr.pureType===yp.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:yu(K(t.data.li_attr,Lp).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,m=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,zE.c)((()=>({type:"Class"===t.data.li_attr.pureType?pf.CLASS:pf.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(Pa,{content:(0,T.jsx)(uf,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,vs.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(),a?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&m(),a?.(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)(pi,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:p?t.isOpen?(0,T.jsx)(Zi,{}):(0,T.jsx)(Ji,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,vs.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:rf(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:_})]})})},mf=(0,Nt.Pi)((()=>{const e=hE(),t=An(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(fE,{components:{TreeNodeContainer:_f},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter($),innerProps:{onNodeOpen:e=>{(0,S.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,S.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:s=>{const i=s.data.li_attr;(i instanceof Pp||i instanceof Lp)&&(0,S.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Fp(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(cf,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(hf,{node:s.nodeForMoveElement})]})})),gf=(0,Nt.Pi)((()=>{const e=hE(),t=An(),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,S.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Di,{})}),(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)(ti,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(js,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(mf,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ga,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),Ef=/^\w+(?:\.\w+)*$/,ff=(0,Nt.Pi)((e=>{const{node:t}=e,s=hE(),i=An(),[a,n]=(0,At.useState)("untitled.pure"),r=(0,At.useRef)(null),o=Boolean(a.match(Ef)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===a)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,S.fl)(s.createNewFile(`${t.data.li_attr.path}/${a}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Is.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=>n(e.target.value),value:a,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"})]})]})})})),Tf=/^\w+$/,Cf=(0,Nt.Pi)((e=>{const{node:t}=e,s=hE(),i=An(),[a,n]=(0,At.useState)("untitled"),r=(0,At.useRef)(null),o=Boolean(a.match(Tf)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===a)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,S.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${a}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Is.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=>n(e.target.value),value:a,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"})]})]})})})),Sf=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,xf=(0,Nt.Pi)((e=>{const{node:t}=e,s=hE(),i=An(),[a,n]=(0,At.useState)(t.data.li_attr.path),r=(0,At.useRef)(null),o=Boolean(a.match(Sf)),l=t.data.li_attr.path===a,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,S.fl)(s.renameFile(t.data.li_attr.path,a)).catch(i.alertUnhandledError))};return(0,T.jsx)(Is.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=>n(e.target.value),value:a,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"})]})]})})})),Nf=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s}=e,i=An(),a=hE(),n=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(ba,{ref:t,children:[(0,T.jsx)(Da,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(Ma,{}),n&&(0,T.jsx)(Da,{onClick:()=>a.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),n&&(0,T.jsx)(Da,{onClick:()=>a.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!n&&(0,T.jsx)(Da,{onClick:()=>a.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Da,{disabled:Boolean(s.data instanceof r_&&s.data.children),onClick:()=>{(0,S.fl)(a.deleteDirectoryOrFile(s.data.li_attr.path,n,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),Af=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:a,innerProps:n}=e,[r,o]=(0,At.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=n,h=t.data instanceof r_&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,_=t.data instanceof r_&&!t.data.children,m=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(mi,{className:"explorer__icon--readonly"}):p?_?(0,T.jsx)(Ci,{className:(0,vs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(Ti,{className:(0,vs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Ci,{className:(0,vs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Ai,{className:(0,vs.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{_||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(Pa,{content:(0,T.jsx)(Nf,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,vs.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(),a?.(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)(pi,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||_?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(Zi,{}):(0,T.jsx)(Ji,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:m})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},If=(0,Nt.Pi)((()=>{const e=hE(),t=An(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(fE,{components:{TreeNodeContainer:Af},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter($),innerProps:{onNodeOpen:e=>{(0,S.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,S.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(ff,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(Cf,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(xf,{node:s.nodeForRenameFile})]})})),vf=(0,Nt.Pi)((()=>{const e=hE(),t=An(),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,S.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Di,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof t_&&(0,S.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(zs,{})}),(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)(ti,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(js,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(If,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ga,{children:"Failed to build directory tree"})]})]})})]})})),Of=(0,Nt.Pi)((()=>{const e=hE();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,vs.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Ap.CONCEPT_EXPLORER:return(0,T.jsx)(gf,{});case Ap.FILE_EXPLORER:return(0,T.jsx)(vf,{});default:return null}})()},e.activeActivity)})})),yf=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,vs.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"})})]})})},Rf=(0,Nt.Pi)((()=>{const e=hE(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Ap.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(oi,{})},{mode:Ap.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(Ai,{})}].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)(yf,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,vs.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)))})]})})),wf=(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)`:""}`})})})),Lf=(0,Nt.Pi)((()=>{const e=hE(),t=An();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 t_&&(0,T.jsx)(wf,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,vs.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,S.fl)(e.executeGo()).catch(t.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(qs,{})}),(0,T.jsx)("button",{className:(0,vs.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(e.auxPanelDisplayState.isOpen)}),onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel",children:(0,T.jsx)(fi,{})}),(0,T.jsx)("button",{className:(0,vs.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)(ki,{})})]})]})})),Pf=e=>{(0,At.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},bf=/[0-9]+(?::[0-9]+)?/,Df=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,At.useState)(""),a=(0,At.useRef)(null),n=Boolean(s.match(bf)),r=t.textEditorState.editor?.getPosition(),[o,l]=(e=>{const t=e.split(":");return t.length<1||t.length>2?[1,void 0]:[V((()=>parseInt(H(w(t)))))??1,V((()=>parseInt(H(L(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=n?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)(Is.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>a.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:a,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"})]})]})})})),Mf=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=hE(),i=An(),a=(0,At.useRef)(null),[n,r]=(0,At.useState)(),{ref:o,width:l,height:c}=(0,ja.NB)();return(0,At.useEffect)((()=>{if(!n&&a.current){const e=a.current,s=x.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,theme:A.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,n]),Pf(t),(0,At.useEffect)((()=>{void 0!==l&&void 0!==c&&n?.layout({width:l,height:c})}),[n,l,c]),(0,At.useEffect)((()=>{n&&t.textEditorState.forcedCursorPosition&&(vp(n,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[n,t,t.textEditorState.forcedCursorPosition]),(0,At.useEffect)((()=>()=>{n&&(t.textEditorState.setViewState(n.saveViewState()??void 0),n.dispose())}),[t,n]),(0,T.jsxs)("div",{className:"panel edit-panel 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,vs.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)(ji,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(Df,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:o,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:a})})})]})})),Ff=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=H(w(e.split(".")));return t.includes(i)};class kf{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,We.yu)(kf,{pureType:(0,We.Ru)(),pureId:(0,We.Ru)(),pureName:(0,We.Ru)(),text:(0,We.Ru)(),requiredClassProperties:(0,We.jt)((0,We.pb)((0,We.Ru)()))});class Uf{pureType;pureName;owner;ownerPureType}(0,We.yu)(Uf,{pureType:(0,We.Ru)(),pureName:(0,We.Ru)(),owner:(0,We.Ru)(),ownerPureType:(0,We.Ru)()});class jf{pureId;pureName;requiredClassProperties=[]}(0,We.yu)(jf,{pureId:(0,We.Ru)(),pureName:(0,We.Ru)(),requiredClassProperties:(0,We.jt)((0,We.pb)((0,We.Ru)()))});class Gf{name}(0,We.yu)(Gf,{name:(0,We.Ru)()});const Vf="Diagram",Bf="Diagram",$f=()=>{const e=[];return e.push({label:{label:"/copyright",description:"(copyright header)"},kind:x.languages.CompletionItemKind.Snippet,insertTextRules:x.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:x.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),Hf=(e,t)=>{const s=e.pureType,i=s===yp.FUNCTION||s===yp.NATIVE_FUNCTION?((e,t,s)=>{const i=yu(t),a=V((()=>i.substring(i.indexOf("_"),i.length-1))),n=a?.split("__")??[];return n.pop(),s&&n.shift(),`${e}(${n.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,a=s===yp.PACKAGE?x.languages.CompletionItemKind.Folder:s===yp.CLASS?x.languages.CompletionItemKind.Class:s===yp.FUNCTION?x.languages.CompletionItemKind.Function:s===yp.ENUMERATION?x.languages.CompletionItemKind.Enum:s===yp.PROFILE?x.languages.CompletionItemKind.Module:s===yp.ASSOCIATION?x.languages.CompletionItemKind.Interface:x.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:a,filterText:e.pureName,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===yp.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=`${Se}${Be.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(Se))).lastIndexOf(!0)).map((e=>e.match(Xf)?.groups?.importPath)).filter($)},qf=/->\s*(?:\w[\w$]*)?$/,Jf=/\^\s*(?:\w[\w$]*)?$/,Qf=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,eT=(e,t)=>({label:e.name,kind:x.languages.CompletionItemKind.Variable,insertTextRules:x.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=An(),i=t.fileEditorState,a=t.concept.pureName,[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(tT)),c=a===n,d=l?void 0:"Invalid concept name",h=()=>{(0,S.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(n).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Is.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:n,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,At.useRef)(void 0),i=(0,At.useRef)(void 0),a=(0,At.useRef)(void 0),n=(0,At.useRef)(null),[r,o]=(0,At.useState)(),[l,c]=(0,At.useState)(!1),d=hE(),h=An(),{ref:u,width:p,height:_}=(0,ja.NB)();return(0,At.useEffect)((()=>{if(!r&&n.current){const e=n.current,s=x.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,language:I.PURE,theme:A.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,S.fl)(d.executeNavigation(new Fp(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:Zp.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Fp(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Zp.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Fp(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Zp.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 Fp(t.filePath,s.lineNumber,s.column);(0,S.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=x.languages.registerDefinitionProvider(I.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),a=x.editor.tokenize(i,I.PURE)[0];if(!a)return[];let n,r;for(let e=1;e<=a.length;++e){const t=e===a.length?i.length:H(a[e]).offset;if(t+1>s.column){n=H(a[e-1]),r={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t+1};break}}return n&&r&&Ff(n.type,[ze.TYPE,ze.VARIABLE,ze.PROPERTY,ze.PARAMETER,ze.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:r}]:[]}}),i.current?.dispose(),i.current=x.languages.registerCompletionItemProvider(I.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let a=[];if(i.triggerKind===x.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":a=a.concat($f());break;case"#":a=a.concat(((e,t,s)=>{const i=[],a=t.getWordUntilPosition(e),n={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:a.endColumn};var r;return r=t.getValueInRange(n).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${Se}${e.text}`,description:e.description},kind:x.languages.CompletionItemKind.Keyword,insertText:`${Se}${e.insertText}\n`,range:n,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:Be.PURE,description:"(core Pure)",insertText:Be.PURE},{text:Be.MAPPING,description:"(dsl)",insertText:Be.MAPPING},{text:Be.CONNECTION,description:"(dsl)",insertText:Be.CONNECTION},{text:Be.RUNTIME,description:"(dsl)",insertText:Be.RUNTIME},{text:Be.RELATIONAL,description:"(external store)",insertText:Be.RELATIONAL},{text:Vf,description:"(dsl)",insertText:Bf}]));break;case":":a=a.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Yf);if(i?.groups?.incompletePath){const a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Wf)),n=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-Ce.length),n?[yp.CLASS]:a?[yp.FUNCTION,yp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(kf,e)))}catch{}return r.map((e=>n?zf(e):Hf(e,{preferArrowFunctionForm:a})))}return[]})(s,e,d));break;case">":a=a.concat(await(async(e,t,s)=>{const i=Zf(e,t);let a=[];try{a=(await s.client.getSuggestionsForIdentifier(i,[yp.FUNCTION,yp.NATIVE_FUNCTION])).map((e=>(0,We.vB)(kf,e)))}catch{}return a.map((e=>Hf(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":a=a.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Qf),a=Zf(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(a,i.groups.owner)).map((e=>(0,We.vB)(Uf,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===yp.PROPERTY||t===yp.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===yp.PROPERTY?x.languages.CompletionItemKind.Property:t===yp.QUALIFIED_PROPERTY?x.languages.CompletionItemKind.Method:t===yp.TAG?x.languages.CompletionItemKind.Constant:t===yp.STEREOTYPE?x.languages.CompletionItemKind.Value:t===yp.ENUM_VALUE?x.languages.CompletionItemKind.Enum:x.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":a=a.concat(await(async(e,t,s)=>{const i=Zf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(jf,e)))}catch{}return a.map((e=>zf(e)))})(s,e,d));break;case"@":a=a.concat(await(async(e,t,s)=>{const i=Zf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(jf,e)))}catch{}return a.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:x.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":a=a.concat(await(async(e,t,s,i)=>{let a=[];try{a=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,We.vB)(Gf,e)))}catch{}const n=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 a=H(x.editor.tokenize(t.getLineContent(s+1),I.PURE)[0]);a.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&Ff(i.type,[ze.VARIABLE,ze.PARAMETER],!0)&&n.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===a.length-1?Number.MAX_SAFE_INTEGER:H(a[r+1]).offset+1}))}))}const o=a.map((e=>e.name));return a.map((e=>eT(e,!0))).concat(Array.from(n).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:a}}}),a.current?.dispose(),a.current=x.languages.registerCompletionItemProvider(I.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===x.languages.CompletionTriggerKind.Invoke&&(i=i.concat($f()),i=i.concat(((e,t,s)=>{const i=[],a=t.getWordUntilPosition(e),n=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${Se}${Be.PURE}\n${n}`.split("\n").filter((e=>e.startsWith(Se))),o=(e=>{if(e.startsWith(Se))return e.substring(Se.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:x.languages.CompletionItemKind.Snippet,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:a.startColumn,endLineNumber:e.lineNumber,endColumn:a.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 Be.PURE:return[{text:Ge.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:Ge.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:Ge.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:Ge.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:Ge.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:Ge.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:Ge.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:Ge.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:Ge.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Be.MAPPING:return[{text:Ge.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:Ge.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:Ge.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:Ge.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 Be.RELATIONAL:return[{text:Ge.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:Bf,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:x.languages.CompletionItemKind.Snippet,insertTextRules:x.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),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(qf)),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Jf));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,n?[yp.CLASS]:a?[yp.FUNCTION,yp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(kf,e)))}catch{}return r.map((e=>n?zf(e):Hf(e,{preferArrowFunctionForm:a})))})(t,e,d))),{suggestions:i}}}),Pf(t),(0,At.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,At.useEffect)((()=>{void 0!==p&&void 0!==_&&r?.layout({width:p,height:_})}),[r,p,_]),(0,At.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(vp(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,At.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),a.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel edit-panel 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,vs.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)(ji,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(sT,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(Df,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:u,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:n})})})]})}));var aT=s(8533);const nT=e=>{const{open:t,className:s,children:i,menuProps:a,content:n,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,At.useRef)(null),[h,u]=(0,At.useState)(null);return(0,At.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)(La,{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,...a,children:n})]})},rT=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=An(),a=s.diagram,n=t,{width:r,height:o}=(0,ja.NB)({refreshMode:"debounce",refreshRate:50,targetRef:n});(0,At.useEffect)((()=>{const e=new jm(n.current,a);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}),[n,s,a]),(0,At.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,At.useCallback)(((e,t)=>{if(e instanceof bp){const a=t.getClientOffset(),n=a?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Wu(a.x,a.y))):void 0;(0,S.fl)(s.addClassView(e.li_attr.pureId,n)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,aT.L)((()=>({accept:pf.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(n),(0,T.jsx)("div",{ref:n,className:(0,vs.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),oT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=hE(),i=An(),a=e=>()=>{t.renderer.zoomCenter(e/100)},n=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:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_LEFT),children:(0,T.jsx)(oa,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_CENTER),children:(0,T.jsx)(la,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_RIGHT),children:(0,T.jsx)(ca,{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:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_TOP),children:(0,T.jsx)(aa,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_MIDDLE),children:(0,T.jsx)(na,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.ALIGN_BOTTOM),children:(0,T.jsx)(ra,{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:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.SPACE_HORIZONTALLY),children:(0,T.jsx)(da,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(Mm.SPACE_VERTICALLY),children:(0,T.jsx)(ha,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(nT,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(ba,{children:[(0,T.jsx)(Da,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(Ma,{}),km.map((e=>(0,T.jsxs)(Da,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:a(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)(Zs,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,S.fl)(s.loadFile(t.filePath,new Fp(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Gi,{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,vs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===bm.LAYOUT}),tabIndex:-1,onClick:i(bm.LAYOUT,Dm.NONE),title:"View Tool (V)",children:(0,T.jsx)(ga,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,vs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===bm.PAN}),tabIndex:-1,onClick:i(bm.PAN,Dm.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(Ea,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,vs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===bm.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(bm.ZOOM_IN,Dm.NONE),children:(0,T.jsx)(fa,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,vs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===bm.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(bm.ZOOM_OUT,Dm.NONE),children:(0,T.jsx)(Ta,{className:"diagram-editor__icon--zoom-out"})})]})})),cT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,At.useRef)(null);return Pf(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);const uT=e=>{const{children:t,label:s,showPlaceholder:i,className:a}=e;return i?(0,T.jsx)("div",{className:(0,vs.clsx)(["dnd__entry-dropzone__placeholder",a]),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:a,isDragging:n,currentPosition:r}=(0,dT.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return n&&a&&i&&s.includes(i.toString())?(0,T.jsx)(Ss.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(a)})})}):null}const _T=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)},mT=(0,Nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(ba,{children:[(0,T.jsx)(Da,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Da,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Da,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),gT=(0,Nt.Pi)((e=>{const t=(0,At.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:a}=e,n=(0,At.useCallback)(((e,a)=>{const n=e.tab,r=i,o=s.tabs.findIndex((e=>e===n)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(a.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(n,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,aT.L)((()=>({accept:[s.dndType],hover:(e,t)=>n(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[n]),l=i===r,[,c,d]=(0,zE.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,At.useEffect)((()=>{e((0,hT.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,vs.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)(Pa,{content:(0,T.jsx)(mT,{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:a?.(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)(Ys,{})})]})})});var h})),ET=(0,Nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(nT,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(ba,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Da,{className:(0,vs.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)(Ys,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(Zi,{})})})),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:_T,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,At.useState)(!1),{ref:s,width:i,height:a}=(0,ja.NB)();return(0,At.useEffect)((()=>{t((i??0)>300&&(a??0)>150)}),[i,a]),(0,T.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,T.jsxs)("div",{className:(0,vs.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"edit-panel__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)(Ks,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},CT=(0,Nt.Pi)((()=>{const e=hE(),t=e.tabManagerState.currentTab;return t?(0,T.jsxs)("div",{className:"panel edit-panel",children:[(0,T.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,T.jsx)("div",{className:"edit-panel__header__tabs",children:(0,T.jsx)(fT,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof t_){const s=e.tabManagerState.tabs.filter((e=>e instanceof t_&&e.fileName===t.fileName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(Ai,{className:"edit-panel__header__tab__icon--file"})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.fileName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.filePath}),t.file.RO&&(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(Hs,{className:"edit-panel__header__tab__icon--readonly"})})]})}if(t instanceof Zg){const s=e.tabManagerState.tabs.filter((e=>e instanceof Zg&&e.diagramName===t.diagramName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(sf,{})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.diagramName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,T.jsx)("div",{className:"panel__header__actions"})]}),(0,T.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof t_?t.textEditorState.language===I.PURE?(0,T.jsx)(iT,{editorState:t}):(0,T.jsx)(Mf,{editorState:t}):t instanceof Zg?(0,T.jsx)(cT,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(TT,{})}));var ST=s(50166),xT=s(35247);xT.Select.createFilter;const NT=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:a,selectProps:n}=e,[r]=a(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,At.useRef)(null);return(0,At.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(ST.t7,{className:n.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 "+(n.darkMode?"selector-menu--dark":""),children:n.noMatchMessage??"No match found"})},AT="selector-input",IT="selector-input--dark",vT=()=>(0,T.jsx)("div",{className:`${AT}__indicator ${AT}__loading-indicator ${IT}__loading-indicator`,children:(0,T.jsx)(pi,{})}),OT=()=>(0,T.jsx)("div",{className:`${AT}__indicator ${AT}__dropdown-indicator`,children:(0,T.jsx)(Zs,{})}),yT=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${AT}__indicator ${AT}__clear-indicator`,children:(0,T.jsx)(Ys,{})})})},RT=e=>(0,T.jsx)(xT.Select.components.Input,{...e,isHidden:!1}),wT=(0,At.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:a,disabled:n,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?xT.CreatableSelect.default:xT.Select.default,u=l?IT:AT;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(n),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:yT,DropdownIndicator:OT,LoadingIndicator:vT,MenuList:NT,Input:RT,...r},...{...d,darkMode:l,noMatchMessage:a}})})),LT=(e,t)=>e.label.localeCompare(t.label),PT=(0,Nt.Pi)((()=>{const e=hE(),t=An(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,a=(0,At.useRef)(null),n=(0,At.useMemo)((()=>(0,$a.Z)((()=>{(0,S.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(Is.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{a.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:a,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(LT),onChange:s=>{s?.value&&(r(),i.reset(),(0,S.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),n.cancel(),n()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,vs.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)(Bi,{})})]})]})})}));var bT;!function(e){e.MODE="mode",e.FAST_COMPILE="fastCompile"}(bT=bT||(bT={}));const DT=(MT=(0,Nt.Pi)((()=>{const e=hE(),t=An(),{ref:s,width:i,height:a}=(0,ja.NB)(),n=xE(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=xE(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),o=xE(e.auxPanelDisplayState.isMaximized);return(0,At.useEffect)((()=>{s.current&&e.auxPanelDisplayState.setMaxSize(s.current.offsetHeight)}),[e,s,a,i]),(0,At.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,At.useEffect)((()=>{(0,S.fl)(e.initialize(!1,void 0,t.navigationService.navigator.getAddressParameterValue(bT.MODE),t.navigationService.navigator.getAddressParameterValue(bT.FAST_COMPILE))).catch(t.alertUnhandledError)}),[e,t]),(0,At.useEffect)((()=>(t.navigationService.navigator.blockNavigation([()=>!0],void 0,(()=>t.notificationService.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigationService.navigator.unblockNavigation()})),[e,t]),Pf(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(Rf,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:s,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(CE,{orientation:"vertical",children:[(0,T.jsx)(NE,{...n.collapsiblePanel,direction:1,children:(0,T.jsx)(Of,{})}),(0,T.jsx)(AE,{}),(0,T.jsx)(NE,{...n.remainingPanel,minSize:300,children:(0,T.jsxs)(CE,{orientation:"horizontal",children:[(0,T.jsx)(NE,{...o.collapsiblePanel,...0===e.auxPanelDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(CT,{})}),(0,T.jsx)(AE,{children:(0,T.jsx)(IE,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(NE,{...r.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)($E,{})})]})})]})})})]}),(0,T.jsx)(Lf,{}),(0,T.jsx)(PT,{})]})})),function(){return(0,T.jsx)(dE,{children:(0,T.jsx)(MT,{})})});var MT;const FT=()=>(0,T.jsx)(Cp,{children:(0,T.jsx)(on,{children:(0,T.jsx)(DT,{})})}),kT=JSON.parse('{"i8":"7.0.3","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class UT extends mt{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class jT extends UT{static NAME=kT.Rw.p;constructor(){super(jT.NAME,kT.i8)}getExtraKeyedCommandConfigEntries(){return[Wp,qp,Xp].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class GT extends ot{static create(){const e=new GT(yn.create());return e.withBasePlugins([new St,new jT]),e.withBasePresets([new Ep]),e}async configureApplication(e){return new vn(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;x.editor.defineTheme(A.LEGEND,He),x.editor.addKeybindingRules([{keybinding:x.KeyMod.WinCtrl|x.KeyCode.KeyG,command:null},{keybinding:x.KeyMod.WinCtrl|x.KeyCode.KeyB,command:null},{keybinding:x.KeyMod.WinCtrl|x.KeyCode.KeyO,command:null},{keybinding:x.KeyMod.WinCtrl|x.KeyCode.KeyD,command:null},{keybinding:x.KeyMod.WinCtrl|x.KeyCode.KeyP,command:null},{keybinding:x.KeyCode.F1,command:null},{keybinding:x.KeyCode.F8,command:null},{keybinding:x.KeyCode.F9,command:null},{keybinding:x.KeyMod.CtrlCmd|x.KeyCode.F2,command:null},{keybinding:x.KeyMod.Shift|x.KeyCode.F10,command:null},{keybinding:x.KeyMod.CtrlCmd|x.KeyCode.F12,command:null}]),x.languages.register({id:I.PURE}),x.languages.setLanguageConfiguration(I.PURE,Ye),x.languages.setMonarchTokensProvider(I.PURE,(t=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarKeywords?.()??[])),s=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarParserNames?.()??[])),{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",Ge.CLASS,Ge.ASSOCIATION,Ge.ENUMERATION,Ge.MEASURE,Ge.PROFILE,Ge.FUNCTION,Ge.MAPPING,Ge.RUNTIME,Ge.CONNECTION,Ge.FILE_GENERATION,Ge.GENERATION_SPECIFICATION,Ge.DATA_ELEMENT,Ve.JSON_MODEL_CONNECTION,Ve.MODEL_CHAIN_CONNECTION,Ve.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",Ge.SERVICE,Ge.FLAT_DATA,Ge.DATABASE,Ve.FLAT_DATA_CONNECTION,Ve.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Be.PURE,Be.CONNECTION,Be.RUNTIME,Be.MAPPING,Be.SERVICE,Be.FLATDATA,Be.RELATIONAL,Be.GENERATION_SPECIFICATION,Be.FILE_GENERATION_SPECIFICATION,Be.DATA].concat(s).map((e=>`${Se}${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":ze.PARSER,"@default":ze.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":ze.LANGUAGE_STRUCT,"@keywords":`${ze.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]+\\$)))_":ze.TYPE,"@default":ze.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":ze.OPERATOR,"@default":ze.IDENTIFIER}}],{include:"@number"},[/[;,.]/,ze.DELIMITER],[/'([^'\\]|\\.)*$/,`${ze.STRING}.invalid`],[/'/,ze.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[ze.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[ze.PACKAGE,ze.TYPE,ze.GENERICS,ze.WHITESPACE,ze.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[ze.PACKAGE,ze.TYPE,ze.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${ze.TYPE}.operator`,ze.WHITESPACE,ze.PACKAGE,ze.TYPE,ze.GENERICS,ze.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[ze.DELIMITER,ze.PROPERTY]],[/(@identifier)(\s*=)/,[ze.PROPERTY,ze.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[ze.TYPE,ze.OPERATOR,ze.PROPERTY]],[/(@identifier)(\s*:)/,[ze.PARAMETER,ze.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[ze.KEYWORD,ze.WHITESPACE,ze.VARIABLE,ze.OPERATOR]],[/(\$@identifier)/,[`${ze.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${ze.DATE}.latest`]],[/(@date)/,[ze.DATE]],[/(@time)/,[`${ze.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[ze.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${ze.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${ze.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${ze.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${ze.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${ze.NUMBER}.binary`],[/(@digits)[fFdD]/,`${ze.NUMBER}.float`],[/(@digits)[lL]?/,ze.NUMBER]],whitespace:[[/[ \t\r\n]+/,ze.WHITESPACE],[/\/\*\*(?!\/)/,`${ze.COMMENT}.doc`,"@doc"],[/\/\*/,ze.COMMENT,"@comment"],[/\/\/.*$/,ze.COMMENT]],comment:[[/[^/*]+/,ze.COMMENT],[/\*\//,ze.COMMENT,"@pop"],[/[/*]/,ze.COMMENT]],doc:[[/[^/*]+/,`${ze.COMMENT}.doc`],[/\/\*/,`${ze.COMMENT}.doc.invalid`],[/\*\//,`${ze.COMMENT}.doc`,"@pop"],[/[/*]/,`${ze.COMMENT}.doc`]],string:[[/[^\\']+/,ze.STRING],[/@escapes/,`${ze.STRING}.escape`],[/\\./,`${ze.STRING}.escape.invalid`],[/'/,ze.STRING,"@pop"]],characters:[[/'[^\\']'/,ze.STRING],[/(')(@escapes)(')/,[ze.STRING,`${ze.STRING}.escape`,ze.STRING]],[/'/,`${ze.STRING}.invalid`]]}}))})(e);const s=`Monospaced font '${N}' has not been loaded properly, text editor display problems might occur`;await Promise.all([400,700].map((e=>document.fonts.load(`${e} 1em ${N}`)))).then((()=>{document.fonts.check(`1em ${N}`)?(x.editor.remeasureFonts(),t.info(h.create(Te.LOAD_TEXT_EDITOR_FONT__SUCCESS),`Monospaced font '${N}' has been loaded`)):t.error(h.create(Te.APPLICATION_SETUP__FAILURE),s)})).catch((()=>t.error(h.create(Te.APPLICATION_SETUP__FAILURE),s))),(0,S.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,C.s)((()=>{let e=document.getElementsByTagName("root").length?document.getElementsByTagName("root")[0]:void 0;return e||(e=document.createElement("root"),document.body.appendChild(e)),e})()).render((0,T.jsx)(xt.VK,{basename:this.baseUrl,children:(0,T.jsx)(yt,{children:(0,T.jsx)(Nn,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(FT,{})})})}))}}class VT{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){GT.create().setup({baseUrl:e}).withPresets(VT.getPresetCollection()).withPlugins(VT.getPluginCollection()).start().catch((e=>{throw e}))}}VT.run("/ide/")},94174:(e,t,s)=>{const i=s(71659);e.exports={Fuse:i}},90498:(e,t,s)=>{const i=s(18978),a=s(1553),n=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),_=s(75100),m=s(58920),g=s(52742);e.exports={FA:i,GI:a,MD:n,VSC:r,GO:o,SI:l,IO5:c,BS:d,BI:h,CG:u,FI:p,RI:_,TB:m,HI:g}},35247:(e,t,s)=>{const i=s(54319),a=s(31776);e.exports={CreatableSelect:i,Select:a}}},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 n[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=n,o.amdO={},e=[],o.O=(t,s,i,a)=>{if(!s){var n=1/0;for(d=0;d<e.length;d++){for(var[s,i,a]=e[d],r=!0,l=0;l<s.length;l++)(!1&a||n>=a)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,a<n&&(n=a));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[s,i,a]},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 a=Object.create(null);o.r(a);var n={};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=>n[t]=()=>e[t]));return n.default=()=>e,o.d(a,n),a},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:"b63f5ea7",135:"3b62eae4",246:"ff0363bc",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={},a="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,n)=>{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")==a+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",a+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var a=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),a&&a.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 a=new Promise(((s,a)=>i=e[t]=[s,a]));s.push(i[2]=a);var n=o.p+o.u(t),r=new Error;o.l(n,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",r.name="ChunkLoadError",r.type=a,r.request=n,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,a,[n,r,l]=s,c=0;if(n.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<n.length;c++)a=n[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=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(30661)));l=o.O(l)})();
|
2
|
+
//# sourceMappingURL=index.426c21a1.js.map
|