@finos/legend-application-pure-ide-deployment 9.14.0 → 9.15.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.
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e,t,s,i,a,n={23607:(e,t,s)=>{const i=JSON.parse('{"i8":"8.0.5","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,v;!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"}(v=v||(v={}));var I=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,I.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,ve,Ie,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",(Ie=Ae=Ae||(Ae={})).STRING="String",Ie.BOOLEAN="Boolean",Ie.BINARY="Binary",Ie.NUMBER="Number",Ie.INTEGER="Integer",Ie.FLOAT="Float",Ie.DECIMAL="Decimal",Ie.DATE="Date",Ie.STRICTDATE="StrictDate",Ie.DATETIME="DateTime",Ie.STRICTTIME="StrictTime",Ie.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(ve=ve||(ve={}));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",Ue.NEW="meta::pure::functions::meta::new";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,I.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.10","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 vt{navigator;constructor(e){this.navigator=e}}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")}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}updateCurrentLocation(e){this.historyAPI.push(e)}updateCurrentZone(e){this.window.location.hash="#"+e}resetZone(){this.updateCurrentLocation(this.getCurrentLocation())}getCurrentBaseAddress(e){return e?.withAppRoot?this.generateAddress(""):this.window.location.origin}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}getCurrentLocationParameters(){const e={},t=((e,t=!1)=>t?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}getCurrentLocationParameterValue(e){return this.getCurrentLocationParameters()[e]}getCurrentZone(){return this.window.location.hash.substring("#".length)}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 Ot=s(40979);const yt=(0,At.createContext)(void 0),Rt=({children:e})=>{const t=(0,Ot.k6)(),s=(0,Nt.fv)((()=>new It(t)));return(0,T.jsx)(yt.Provider,{value:s,children:e})};var wt;!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"}(wt=wt||(wt={}));class Lt{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 Pt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const a=new Lt;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 bt=s(94174).Fuse.default;var Dt,Mt,Ft;!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(Dt||(Dt={}));class kt{state;_message;_messageFormatter;constructor(){this.state=Dt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=Dt.INITIAL,this}inProgress(){return this.state=Dt.IN_PROGRESS,this}fail(){return this.state=Dt.FAILED,this}pass(){return this.state=Dt.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===Dt.INITIAL}get isInProgress(){return this.state===Dt.IN_PROGRESS}get hasFailed(){return this.state===Dt.FAILED}get hasSucceeded(){return this.state===Dt.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 kt,{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"}(Mt=Mt||(Mt={}));class Ut{currentMode=Mt.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!==Mt.STANDARD}generateSearchText(e){switch(this.currentMode){case Mt.INCLUDE:return`'"${e}"`;case Mt.EXACT:return`="${e}"`;case Mt.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(Ft=Ft||(Ft={}));class jt{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 Gt{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 Vt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Bt{applicationStore;panelRenderingKey=(0,n.Z)();isHidden=!1;isOpen=!1;selectedTab=Ft.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=kt.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 bt(this.applicationStore.documentationService.getAllDocEntries().filter(Vt),{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 Ut((()=>{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 Gt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter($).filter(Vt).map((e=>new jt(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 jt(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 jt(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 $t{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}var zt;!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"}(zt=zt||(zt={}));class Ht{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(zt.INITIALIZE_GRAPH__SUCCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(Te.APPLICATION_USAGE__INTERRUPT,{})}}class Yt{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)&&Ht.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 Wt{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 Kt{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 Xt,Zt=s(77289),qt=s(73678),Jt=s(78440),Qt=s(51919),es=s(85399),ts=s(89358);!function(e){e.RESET="",e.BOLD="",e.DIM="",e.ITALIC="",e.UNDERLINE="",e.BLINKING="",e.STRIKETHROUGH="",e.BLACK="",e.RED="",e.GREEN="",e.YELLOW="",e.BLUE="",e.MAGENTA="",e.CYAN="",e.WHITE="",e.BRIGHT_BLACK="",e.BRIGHT_RED="",e.BRIGHT_GREEN="",e.BRIGHT_YELLOW="",e.BRIGHT_BLUE="",e.BRIGHT_MAGENTA="",e.BRIGHT_CYAN="",e.BRIGHT_WHITE="",e.DIMMED_BLACK="",e.DIMMED_RED="",e.DIMMED_GREEN="",e.DIMMED_YELLOW="",e.DIMMED_BLUE="",e.DIMMED_MAGENTA="",e.DIMMED_CYAN="",e.DIMMED_WHITE="",e.BLACK_BG="",e.RED_BG="",e.GREEN_BG="",e.YELLOW_BG="",e.BLUE_BG="",e.MAGENTA_BG="",e.CYAN_BG="",e.WHITE_BG="",e.BRIGHT_BLACK_BG="",e.BRIGHT_RED_BG="",e.BRIGHT_GREEN_BG="",e.BRIGHT_YELLOW_BG="",e.BRIGHT_BLUE_BG="",e.BRIGHT_MAGENTA_BG="",e.BRIGHT_CYAN_BG="",e.BRIGHT_WHITE_BG="",e.DIMMED_BLACK_BG="",e.DIMMED_RED_BG="",e.DIMMED_GREEN_BG="",e.DIMMED_YELLOW_BG="",e.DIMMED_BLUE_BG="",e.DIMMED_MAGENTA_BG="",e.DIMMED_CYAN_BG="",e.DIMMED_WHITE_BG=""}(Xt=Xt||(Xt={}));const ss=(e,t)=>`[${e};${t}H`;class is{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 as{applicationStore;searchConfig=new is;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 ns extends as{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 rs=s(1367),os=s(67295),ls=s(72531);s(90286);const cs=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ds=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],hs=e=>(e??"").trim().replace(/\b(?:\w+)\b/gu,(e=>ds.includes(e.toLowerCase())?e.toLowerCase():cs(e))).replace(/^(?:\w+)\b/u,(e=>cs(e))).replace(/\b(?:\w+)$/u,(e=>cs(e))),us=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,os.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,ls.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var ps;function _s(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"}(ps=ps||(ps={}));const ms=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ps.SHIFT,ps.META,ps.ALT,ps.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),gs=(e,t)=>ms(e,H(_s(t)[0]));var Es=s(4707),fs=s(3493),Ts=s(53908);const Cs=(0,Es.Z)({transitions:{create:()=>"none"}}),Ss=e=>{const{children:t}=e;return(0,T.jsx)(fs.Z,{injectFirst:!0,children:(0,T.jsx)(Ts.Z,{theme:Cs,children:t})})};var xs=s(83820),Ns=s(96242),As=s(12238),vs=s(78683),Is=s(81934),Os=s(6277);const ys=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Os.clsx)(t,i),children:s})};return s.displayName=e,s},Rs=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Os.clsx)("modal",{"modal--dark":s},i),children:t})},ws=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,Os.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:hs(t)})]})},Ls=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,Os.clsx)("modal__header",i),children:(0,T.jsx)(ws,{title:t})}):(0,T.jsx)("div",{className:(0,Os.clsx)("modal__header",i),children:s})},Ps=(ys("ModalHeaderActions","modal__header__actions"),ys("ModalBody","modal__body")),bs=ys("ModalFooter","modal__footer");var Ds,Ms;ys("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Ds=Ds||(Ds={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Ms=Ms||(Ms={}));class Fs{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 ks=e=>{switch(e){case Ms.PROCEED_WITH_CAUTION:return"btn--caution";case Ms.PROCEED:case Ms.STANDARD:default:return"btn--dark"}},Us=(0,Nt.Pi)((e=>{const{info:t}=e,s=vn(),{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??Ds.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(Ls,{title:i}),(0,T.jsxs)(Ps,{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)(bs,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${ks(e.type??Ms.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"})]})]})})})),js=(0,Nt.Pi)((()=>{const e=vn().alertService.actionAlertInfo;return e?(0,T.jsx)(Us,{info:e}):null})),Gs=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")})},Vs=(0,Nt.Pi)((()=>{const e=vn().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)(Rs,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(Gs,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(Ps,{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 Bs=s(90498);const $s=Bs.FA,zs=$s.FaHistory,Hs=$s.FaCrosshairs,Ys=($s.FaLayerGroup,$s.FaGhost,$s.FaLock),Ws=($s.FaMask,$s.FaFile,$s.FaLongArrowAltRight,$s.FaTimes),Ks=$s.FaTimesCircle,Xs=$s.FaPlus,Zs=$s.FaCog,qs=($s.FaEye,$s.FaCaretDown),Js=($s.FaFire,$s.FaSave,$s.FaSquare,$s.FaRegSquare,$s.FaCheckSquare,$s.FaHashtag,$s.FaHammer),Qs=($s.FaClock,$s.FaRegClock,$s.FaToggleOn,$s.FaQuestion),ei=$s.FaQuestionCircle,ti=$s.FaInfoCircle,si=$s.FaCompress,ii=$s.FaMap,ai=$s.FaPlay,ni=($s.FaGripVertical,$s.FaRobot,$s.FaArrowLeft,$s.FaArrowRight,$s.FaArrowAltCircleDown,$s.FaArrowAltCircleRight),ri=($s.FaArrowCircleRight,$s.FaUser,$s.FaShapes),oi=($s.FaEnvelope,$s.FaSkull,$s.FaDollarSign,$s.FaSearch),li=($s.FaStar,$s.FaKey,$s.FaExternalLinkAlt,$s.FaExternalLinkSquareAlt,$s.FaLightbulb,$s.FaRegLightbulb,$s.FaList),ci=$s.FaCircle,di=$s.FaTrash,hi=($s.FaRegCircle,$s.FaShieldAlt,$s.FaTag,$s.FaTags,$s.FaBolt,$s.FaCheckCircle),ui=$s.FaExclamationTriangle,pi=$s.FaBug,_i=$s.FaCircleNotch,mi=($s.FaRegKeyboard,$s.FaUserSecret,$s.FaBuffer,$s.FaSitemap,$s.FaExpand),gi=($s.FaExpandArrowsAlt,$s.FaSortAlphaDown,$s.FaSort,$s.FaSortAlphaDownAlt,$s.FaFolderPlus,$s.FaCaretRight,$s.FaWrench),Ei=$s.FaArrowDown,fi=$s.FaArrowUp,Ti=$s.FaTerminal,Ci=($s.FaTruckLoading,$s.FaFolderOpen),Si=$s.FaFolder,xi=($s.FaFileCode,$s.FaCodeBranch,$s.FaArrowAltCircleUp,$s.FaArrowAltCircleLeft,$s.FaRegStopCircle,$s.FaAsterisk,$s.FaFilter,$s.FaExclamationCircle),Ni=($s.FaRocket,$s.FaCheck,$s.FaBan),Ai=($s.FaFileImport,$s.FaUserFriends,$s.FaDownload,$s.FaUpload,$s.FaRegWindowRestore,$s.FaPauseCircle,$s.FaShare,$s.FaRegCopy),vi=$s.FaFileAlt,Ii=($s.FaEdit,$s.FaArrowsAltH,$s.FaRegWindowMaximize,$s.FaWindowMaximize,$s.FaLongArrowAltDown,$s.FaLongArrowAltUp,$s.FaMeteor,$s.FaPiedPiperSquare,$s.FaPuzzlePiece,$s.FaToggleOn,$s.FaToggleOff,$s.FaMapMarkerAlt),Oi=$s.FaHatWizard,yi=$s.FaRegLaughWink,Ri=$s.FaRegSadTear,wi=($s.FaBusinessTime,$s.FaDatabase),Li=($s.FaServer,$s.FaTable,$s.FaArchive,$s.FaBrain,$s.FaBookOpen,$s.FaLevelDownAlt,Bs.GI),Pi=(Li.GiWaterDrop,Li.GiBeard),bi=Li.GiSunglasses,Di=(Li.GiHouseKeys,Bs.MD),Mi=(Di.MdManageSearch,Di.MdModeEdit,Di.MdTextFields,Di.MdMoreVert,Di.MdMoreHoriz,Di.MdWrapText,Di.MdVerticalAlignBottom,Di.MdRefresh),Fi=(Di.MdFunctions,Di.MdCompareArrows,Di.MdPlaylistAddCheck,Di.MdAdd,Di.MdEdit,Di.MdSubject),ki=Di.MdViewHeadline,Ui=Di.MdAssistant,ji=(Di.MdSettingsEthernet,Di.MdLink,Di.MdWindow,Di.MdReviews,Di.MdCalculate,Di.MdRocketLaunch,Di.MdOutlineDataset,Di.MdVerified,Di.MdQueryStats,Bs.VSC),Gi=(ji.VscError,ji.VscWarning,ji.VscWordWrap),Vi=ji.VscGoToFile,Bi=ji.VscClose,$i=(ji.VscRunAll,ji.VscRunErrors,ji.VscOpenPreview,ji.VscDiff,ji.VscRegex),zi=(ji.VscVersions,ji.VscCaseSensitive),Hi=ji.VscWholeWord,Yi=ji.VscReferences,Wi=ji.VscWand,Ki=ji.VscCollapseAll,Xi=ji.VscExpandAll,Zi=(ji.VscJson,Bs.GO),qi=Zi.GoChevronDown,Ji=Zi.GoChevronUp,Qi=(Zi.GoChevronLeft,Zi.GoChevronRight),ea=(Zi.GoFileBinary,Zi.GoGitPullRequest,Zi.GoGitMerge,Zi.GoCloudDownload,Zi.GoCloudUpload,Zi.GoSync,Zi.GoGitBranch,Zi.GoX),ta=(Zi.GoPlug,Bs.SI.SiSwagger,Bs.IO5),sa=(ta.IoResize,ta.IoFileTrayFullOutline,ta.IoMenuOutline,ta.IoBeaker,ta.IoFlaskSharp),ia=(ta.IoSyncCircleSharp,Bs.BS),aa=(ia.BsDisplayFill,ia.BsChevronDown,ia.BsFillTriangleFill,ia.BsFillFileEarmarkSpreadsheetFill,ia.BsBoxSeam,ia.BsGripVertical),na=ia.BsAlignTop,ra=ia.BsAlignMiddle,oa=ia.BsAlignBottom,la=ia.BsAlignStart,ca=ia.BsAlignCenter,da=ia.BsAlignEnd,ha=ia.BsDistributeHorizontal,ua=ia.BsDistributeVertical,pa=(ia.BsDatabaseFillLock,ia.BsDatabaseFillCheck,ia.BsChevronRight,ia.BsChevronLeft,Bs.BI),_a=(pa.BiShapeTriangle,pa.BiAtom),ma=(Bs.CG.CgOptions,Bs.FI),ga=ma.FiPackage,Ea=(ma.FiMinus,ma.FiMousePointer),fa=ma.FiMove,Ta=(ma.FiPlusCircle,ma.FiSidebar,ma.FiTriangle,ma.FiZoomIn),Ca=ma.FiZoomOut,Sa=(ma.FiGitMerge,ma.FiLink,Bs.RI),xa=(Sa.RiShapeLine,Sa.RiTestTubeFill,Sa.RiRobotFill,Sa.RiGovernmentFill,Sa.RiMoneyDollarCircleFill,Bs.TB),Na=(xa.TbArrowsJoin2,xa.TbArrowsSplit2,xa.TbMathFunction),Aa=(xa.TbBook,Bs.HI);Aa.HiCode,Aa.HiHome;var va=s(73882),Ia=s(53083);const Oa=6e3;var ya;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(ya=ya||(ya={}));class Ra{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class wa{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 Ra(ya.INFO,e,t??[],null===s?void 0:s??Oa))}notifySuccess(e,t,s){this.setNotification(new Ra(ya.SUCCESS,e,t??[],null===s?void 0:s??Oa))}notifyWarning(e,t,s){this.setNotification(new Ra(ya.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Oa))}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 Ra(ya.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new Ra(ya.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Oa))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return G(e),this.notifyIllegalState(e.message),t}}}const La=(0,Nt.Pi)((()=>{const e=vn(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",a=t?.severity??ya.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)(ti,{})});switch(a){case ya.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(pi,{})});break;case ya.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Ks,{})});break;case ya.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(ui,{})});break;case ya.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(hi,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(va.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Oa,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Ia.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,Os.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)(qi,{}):(0,T.jsx)(Ji,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(Ws,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Pa=s(17954);const ba=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(Pa.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Da=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)(ba,{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}`)]})},Ma=(0,At.forwardRef)((function(e,t){const{className:s,children:i,...a}=e;return(0,T.jsx)("div",{ref:t,className:(0,Os.clsx)("menu",s),...a,children:i})})),Fa=e=>{const{className:t,onClick:s,title:i,disabled:a,children:n,...r}=e;return(0,T.jsx)("button",{className:(0,Os.clsx)("menu__item",t),disabled:Boolean(a),title:i,onClick:s,...r,children:n})},ka=ys("MenuContentDivider","menu__divider");ys("MenuContentItemIcon","menu__item__icon"),ys("MenuContentItemLabel","menu__item__label");var Ua=s(95081),ja=s(53019);const Ga=e=>(0,T.jsx)(Ua.D,{className:(0,Os.clsx)("markdown-content",e.className),remarkPlugins:[ja.Z],components:e.components??{},children:e.value.value});var Va=s(62515);const Ba=e=>{const{children:t}=e,{ref:s,width:i,height:a}=(0,Va.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[n,r]=(0,At.useState)(!1),{ref:o,width:l,height:c}=(0,Va.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,Os.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!n}),children:t})})};var $a=s(33207);const za=e=>{const{children:t,...s}=e;return(0,T.jsx)($a.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var Ha=s(13474),Ya=s(65068),Wa=s(41327),Ka=s(85688),Xa=s(28019),Za=s(8978);const qa=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,Os.clsx)("mui-radio-group",a),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ka.Z,{className:"mui-radio-group__group",...n,children:e.map((e=>(0,T.jsx)(Xa.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Za.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 Ja;!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"}(Ja=Ja||(Ja={}));const Qa=(0,Nt.Pi)((e=>{const{configState:t}=e,s=vn();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(Ja.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(ti,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(qa,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[Mt.STANDARD,Mt.INCLUDE,Mt.EXACT,Mt.INVERSE],size:1})})]})})),en=(0,Nt.Pi)((e=>{const{entry:t}=e,s=vn(),i=()=>{t.isOpen||Ht.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},a=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(Da,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(Ma,{children:(0,T.jsx)(Fa,{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,Os.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)(qi,{}):(0,T.jsx)(Qi,{})}),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:()=>{Ht.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)(Ga,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),tn=(0,Nt.Pi)((()=>{const e=vn(),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)(Da,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Fa,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Fa,{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)(Ga,{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)(en,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Ba,{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 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!"})]})})]})})),sn=(0,Nt.Pi)((()=>{const e=vn(),t=(0,At.useRef)(null),s=(0,At.useRef)(null),i=e.assistantService,a=i.searchText,n=(0,At.useMemo)((()=>(0,Ha.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,Os.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,Os.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)(Zs,{})}),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)(Ws,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(oi,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(Gs,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,Os.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)(en,{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)(en,{entry:e},e.uuid)))}),a&&!i.searchResults.length&&(0,T.jsx)(Ba,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Ri,{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)(Da,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>{fe(`documentation-registry_${(0,Ya.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)(Fa,{onClick:()=>{fe(`documentation-registry_${(0,Ya.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)(Oi,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(bi,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Pi,{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?"})]})})]})]})]})})),an=(0,Nt.Pi)((e=>{const{triggerElement:t}=e,s=vn().assistantService,i=s.currentContextualDocumentationEntry,a=s.selectedTab;return(0,T.jsx)(za,{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,Os.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Ft.SEARCH}),onClick:()=>s.setSelectedTab(Ft.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(oi,{})})}),(0,T.jsx)("div",{className:(0,Os.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Ft.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(Ft.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)(Bi,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[a===Ft.SEARCH&&(0,T.jsx)(sn,{}),a===Ft.CONTEXTUAL_SUPPORT&&(0,T.jsx)(tn,{})]})]})},s.panelRenderingKey)})),nn=(0,Nt.Pi)((()=>{const[e,t]=(0,At.useState)(!1),[s,i]=(0,At.useState)((0,n.Z)()),a=vn(),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)(Wa,{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,Os.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(Ft.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)(Bi,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(ci,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(Da,{className:(0,Os.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)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>{o.setIsOpen(!1),i((0,n.Z)())},children:"Reset Position"}),(0,T.jsx)(Fa,{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)(aa,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(an,{triggerElement:r.current})]})},s)}));var rn;!function(e){e.TOP_LEVEL_CONTAINER="application.top-level-container",e.BACKDROP_CONTAINER="application.backdrop-container"}(rn||(rn={}));const on=["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"],ln=e=>(0,T.jsx)("div",{className:"backdrop__container","data-elementid":e.elementId}),cn=(0,Nt.Pi)((e=>{const{children:t}=e,s=vn(),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:on,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{on.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,rs.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=_s(e.combination);if(!a.length)return;const n=t.get(s)??a,r=H(n[0]);ms(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&&(Ht.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(Ss,{children:[(0,T.jsx)(Vs,{}),(0,T.jsx)(js,{}),(0,T.jsx)(La,{}),(0,T.jsx)(nn,{}),s.layoutService.showBackdrop&&(0,T.jsx)(xs.Z,{container:s.layoutService.getElementByID(s.layoutService.backdropContainerElementID??rn.BACKDROP_CONTAINER)??null,children:(0,T.jsx)(Ns.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(As.W,{backend:vs.PD,children:(0,T.jsxs)("div",{className:"app__container","data-elementid":rn.TOP_LEVEL_CONTAINER,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(ln,{elementId:rn.BACKDROP_CONTAINER}),t]})})]})})),dn={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"},hn={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},un=`\n${Xt.BOLD}${Xt.BRIGHT_BLUE}$purist${Xt.RESET}\n${Xt.BOLD}${Xt.MAGENTA}❯${Xt.RESET} `,pn="❯ ";class _n extends ns{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=kt.create();constructor(e){super(e),this.instance=new Zt.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${N}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:dn,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new Jt.FitAddon,this.searcher=new Qt.SearchAddon,this.renderer=new ts.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 es.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>gs(e,"Control+KeyF")||gs(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(gs(e,"Control+KeyC")&&this.instance.hasSelection()||gs(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new qt.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new qt.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(gs(t,"Control+KeyD")||gs(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(rn.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=`${pn}${this.command}`,i=`${pn}${this.command.substring(0,t-pn.length)}${this.command.length<t-pn.length?" ".repeat(t-this.command.length-pn.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)-pn.length;break}n+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:a,startX:pn.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:ss(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(ss(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(ss(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(ss(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(un),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${Xt.DIM}(system: ${e})\n${Xt.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!==pn;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(Xt.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${Xt.BRIGHT_BLACK}+-------------------------------------------------------+${Xt.RESET}\n${Xt.BRIGHT_BLACK}|${Xt.RESET} ${Xt.BRIGHT_GREEN}[@@]${Xt.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${Xt.BRIGHT_BLACK}|${Xt.RESET}\n${Xt.BRIGHT_BLACK}|${Xt.RESET} ${Xt.BRIGHT_GREEN}/|__|\\${Xt.RESET} ${Xt.BRIGHT_BLACK}|${Xt.RESET}\n${Xt.BRIGHT_BLACK}+--${Xt.RESET} ${Xt.BRIGHT_GREEN}d b${Xt.RESET} ${Xt.BRIGHT_BLACK}-----------------------------------------------+${Xt.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,rs.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${Xt.BRIGHT_GREEN}${e.command.padEnd(30)}${Xt.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${Xt.DIM}${e.usage}${Xt.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(Xt).map((([e,t])=>`${t}${(e=>e?e.trim().match(/^[A-Z_]+$/)?hs(e.trim().replace(/_+/gu," ").toLowerCase()):cs(e.trim()).split(/(?<chunk>[A-Z][a-z]+|[0-9]+)/).map((e=>e.toUpperCase()===e?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).filter(Boolean).join(" ").replace(/_+/gu," ").replace(/\s+/gu," "):"")(e).padEnd(20)}${Xt.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${Xt.RED}${e}${Xt.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:hn,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:hn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:hn,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 mn{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new _n(e)}}const gn="(unknown)";class En{applicationStore;currentUser=gn;constructor(e){(0,S.rC)(this,{currentUser:S.LO,setCurrentUser:S.aD}),this.applicationStore=e}get isAnonymous(){return this.currentUser===gn}setCurrentUser(e){this.currentUser=e}}class fn{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 Tn{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 Cn{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)??ct.DEFAULT_DARK;this.currentColorTheme=H(this.colorThemeRegistry.get(t)),this.TEMPORARY__syncGlobalCSSClassName(this.currentColorTheme,void 0)}getElementByID(e){return document.querySelector(`[data-elementid='${e}']`)??void 0}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}get TEMPORARY__isLightColorThemeEnabled(){return this.currentColorTheme.key!==ct.DEFAULT_DARK}TEMPORARY__syncGlobalCSSClassName(e,t){t&&document.body.classList.remove(t.TEMPORARY__globalCSSClassName),document.body.classList.add(e.TEMPORARY__globalCSSClassName)}setColorTheme(e,t){const s=this.colorThemeRegistry.get(e);if(e===this.currentColorTheme.key||!s)return;const i=this.currentColorTheme;this.currentColorTheme=s,this.TEMPORARY__syncGlobalCSSClassName(s,i),t?.persist&&this.applicationStore.settingService.persistValue(pt.COLOR_THEME,e)}}class Sn{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class xn{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 Tn,this.logService=new p,this.logService.registerPlugins(s.getLoggerPlugins()),this.storageService=new Tt(this),this.settingService=new Ct(this),this.alertService=new Fs(this),this.notificationService=new wa,this.identityService=new En(this),this.layoutService=new Cn(this),this.clipboardService=new Sn(this),this.terminalService=new mn(this),this.commandService=new Wt(this),this.keyboardShortcutsService=new Kt(this),this.navigationService=new vt(t),this.navigationContextService=new Yt(this),this.documentationService=new at(this),this.assistantService=new Bt(this),this.eventService=new $t,this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins()),this.telemetryService=new fn(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.telemetryService.setup(),this.tracerService=new Pt,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 Nn=(0,At.createContext)(void 0),An=({children:e,config:t,pluginManager:s})=>{const i=H((0,At.useContext)(yt),"Can't find web application navigator in context"),a=(0,Nt.fv)((()=>new xn(t,i,s)));return(0,T.jsx)(Nn.Provider,{value:a,children:e})},vn=()=>H((0,At.useContext)(Nn),"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")}static resolveAbsoluteUrl(e){return e.trim().startsWith("/")?window.location.origin+e:e}}class On extends In{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=In.resolveAbsoluteUrl(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 yn 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 Rn extends yn{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Rn}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 wn=JSON.parse('{"i8":"7.1.50","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 Ln extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Pn=e=>t=>(0,S.bi)(t)?t:e(t),bn=e=>(t,s)=>(0,S.bi)(t)?t:e(t,s),Dn=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})},Mn=Pn((e=>(0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl})));var Fn=s(34485),kn=s(3096);const Un=e=>Fn.sha1().update(e).digest("hex"),jn=e=>Un(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Un(e):e.hashCode)).join(","));var Gn,Vn;(Vn=Gn=Gn||(Gn={})).PACKAGE="PACKAGE",Vn.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Vn.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Vn.PROFILE="PROFILE",Vn.TAG_POINTER="TAG_POINTER",Vn.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Vn.TAGGED_VALUE="TAGGED_VALUE",Vn.ENUMERATION="ENUMERATION",Vn.ENUM_VALUE="ENUM_VALUE",Vn.CLASS="CLASS",Vn.PROPERTY="PROPERTY",Vn.PROPERTY_POINTER="PROPERTY_POINTER",Vn.MULTIPLICITY="MULTIPLICITY",Vn.CONSTRAINT="CONSTRAINT",Vn.DERIVED_PROPERTY="DERIVED_PROPERTY",Vn.ASSOCIATION="ASSOCIATION",Vn.FUNCTION="FUNCTION",Vn.MEASURE="MEASURE",Vn.UNIT="UNIT",Vn.ASSERT_FAIL="ASSERT_FAIL",Vn.ASSERT_PASS="ASSERT_PASS",Vn.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Vn.EQUAL_TO="EQUAL_TO",Vn.EQUAL_TO_JSON="EQUAL_TO_JSON",Vn.EQUAL_TO_TDS="EQUAL_TO_TDS",Vn.TEST_RESULT="TEST_RESULT",Vn.TEST_ERROR="TEST_ERROR",Vn.TEST_FAILED="TEST_FAILED",Vn.TEST_PASSED="TEST_PASSED",Vn.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Vn.SECTION_INDEX="SECTION_INDEX",Vn.SECTION="SECTION",Vn.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Vn.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Vn.RAW_LAMBDA="RAW_LAMBDA",Vn.RAW_VARIABLE="RAW_VARIABLE",Vn.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Vn.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Vn.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Vn.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Vn.EXPRESSION="EXPRESSION",Vn.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Vn.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Vn.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Vn.INSTANCE_VALUE="INSTANCE_VALUE",Vn.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Vn.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Vn.KEY_EXPRESSION_INSTANCE_VALUE="KEY_EXPRESSION_INSTANCE_VALUE",Vn.KEY_EXPRESSION_VALUE="KEY_EXPRESSION_VALUE",Vn.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Vn.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Vn.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Vn.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Vn.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Vn.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Vn.FUNCTION_TYPE="FUNCTION_TYPE",Vn.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Vn.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Vn.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Vn.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Vn.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Vn.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Vn.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Vn.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE",Vn.MAPPING="MAPPING",Vn.MAPPING_INCLUDE="MAPPING_INCLUDE",Vn.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Vn.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Vn.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Vn.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Vn.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Vn.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Vn.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Vn.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Vn.PROPERTY_MAPPING="PROPERTY_MAPPING",Vn.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Vn.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Vn.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Vn.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Vn.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Vn.MAPPING_TEST="MAPPING_TEST",Vn.STORE_TEST_DATA="STORE_TEST_DATA",Vn.INPUT_DATA="INPUT_DATA",Vn.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Vn.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Vn.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Vn.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Vn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Vn.FILTER_MAPPING="FILTER_MAPPING",Vn.COLUMN_MAPPING="COLUMN_MAPPING",Vn.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Vn.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Vn.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Vn.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Vn.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Vn.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Vn.RUNTIME="RUNTIME",Vn.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Vn.ENGINE_RUNTIME="ENGINE_RUNTIME",Vn.LEGACY_RUNTIME="LEGACY_RUNTIME",Vn.RUNTIME_POINTER="RUNTIME_POINTER",Vn.STORE_CONNECTIONS="STORE_CONNECTIONS",Vn.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Vn.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Vn.CONNECTION_POINTER="CONNECTION_POINTER",Vn.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Vn.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Vn.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Vn.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Vn.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Vn.GENERATION_TREE="GENERATION_TREE",Vn.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Vn.FILE_GENERATION="FILE_GENERATION",Vn.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Vn.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Vn.MODEL_STORE_DATA="MODEL_STORE_DATA",Vn.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Vn.DATA_ELEMENT="DATA_ELEMENT",Vn.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Vn.RELATIONAL_TDS="RELATIONAL_TDS",Vn.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Vn.BINDING="BINDING",Vn.SCHEMA_SET="SCHEMA_SET",Vn.SCHEMA="SCHEMA",Vn.MODEL_UNIT="MODEL_UNIT",Vn.URL_STREAM="URL_STREAM",Vn.EXTERNAL_FORMAT_CONNECTION="EXTERNAL_FORMAT_CONNECTION",Vn.SERVICE="SERVICE",Vn.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Vn.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Vn.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Vn.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Vn.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Vn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Vn.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Vn.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Vn.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Vn.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Vn.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Vn.SERVICE_TEST="SERVICE_TEST",Vn.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Vn.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Vn.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Vn.EXECUTION_ENVIRONMENT_INSTANCE="EXECUTION_ENVIRONMENT_INSTANCE",Vn.SINGLE_EXECUTION_PARAMETER="SINGLE_EXECUTION_PARAMETER",Vn.MULTI_EXECUTION_PARAMETER="MULTI_EXECUTION_PARAMETER",Vn.DATABASE="DATABASE",Vn.DATABASE_SCHEMA="DATABASE_SCHEMA",Vn.DATABASE_JOIN="DATABASE_JOIN",Vn.DATABASE_FILTER="DATABASE_FILTER",Vn.DATBASE_VIEW="DATBASE_VIEW",Vn.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Vn.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Vn.RELATIONAL="RELATIONAL",Vn.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Vn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Vn.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Vn.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Vn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Vn.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Vn.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Vn.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Vn.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Vn.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Vn.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Vn.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Vn.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Vn.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Vn.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Vn.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Vn.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Vn.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Vn.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Vn.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Vn.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Vn.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Vn.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Vn.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Vn.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Vn.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Vn.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Vn.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Vn.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Vn.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Vn.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Vn.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Vn.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Vn.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Vn.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Vn.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Vn.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Vn.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Vn.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Vn.TRINO_DATASOURCE_SPECIFICATION="TRINO_DATASOURCE_SPECIFICATION",Vn.TRINO_SSL_SPECIFICATION="TRINO_SSL_SPECIFICATION",Vn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Vn.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Vn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Vn.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Vn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Vn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Vn.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Vn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Vn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Vn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY="TRINO_KEREBEROS_AUTHENTICATION_STRATEGY",Vn.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Vn.SCHEMA_MAPPER="SCHEMA_MAPPER",Vn.TABLE_MAPPER="TABLE_MAPPER",Vn.FLAT_DATA="FLAT_DATA",Vn.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Vn.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Vn.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Vn.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Vn.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Vn.FLAT_DATA_STRING="FLAT_DATA_STRING",Vn.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Vn.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Vn.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Vn.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Vn.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Vn.FLAT_DATA_DATE="FLAT_DATA_DATE",Vn.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Vn.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Vn.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Vn.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Vn.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Vn.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Vn.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Vn.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER";const Bn=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(te(t=e),"Can't hash non-object value"),kn(t,s);var t,s},$n=(e,t)=>jn([e?Bn(e):"",t?Bn(t):""]),zn=(e,t)=>[Gn.PACKAGEABLE_ELEMENT_POINTER,e??"",t].map(Un).join(",");class Hn{stereotypes=[];taggedValues=[]}class Yn extends Hn{name}class Wn extends Yn{_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 jn([Gn.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new U(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class Kn extends Wn{}class Xn extends Kn{_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 jn([Gn.CLASS,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),jn(this.constraints),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class Zn extends Kn{}class qn extends Zn{values=[];get _elementHashCode(){return jn([Gn.ENUMERATION,this.path,jn(this.values),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class Jn extends Zn{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return jn([Gn.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}}class Qn extends Kn{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return jn([Gn.MEASURE,this.path,this.canonicalUnit??"",jn(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class er extends Wn{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class tr{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return jn([Gn.SECTION,this.parserName,jn(this.elements.map((e=>e.valueForSerialization??"")))])}}class sr extends tr{imports=[];get hashCode(){return jn([Gn.IMPORT_AWARE_CODE_SECTION,super.hashCode,jn(this.imports.map((e=>e.valueForSerialization??"")))])}}class ir extends tr{get hashCode(){return jn([Gn.DEFAULT_CODE_SECTION,super.hashCode])}}class ar{_UUID=(0,n.Z)()}class nr extends ar{ownerReference;constructor(e){super(),this.ownerReference=e}}class rr extends ar{value;constructor(e){super(),this.value=e}}class or extends rr{constructor(e){super(e)}static create(e){return new or(e)}get valueForSerialization(){return this.value.path}}const lr=Pn((e=>(0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}))),cr=Pn((e=>(Dn(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 rr&&Mn(e)})),e.configurationProperties.forEach(lr),e))),dr=Pn((e=>((0,S.rC)(e,{id:S.LO,hashCode:S.Fl}),Mn(e.generationElement),e))),hr=Pn((e=>(Dn(e),(0,S.rC)(e,{generationNodes:S.LO,fileGenerations:S.LO,_elementHashCode:S.KG}),e.generationNodes.forEach(dr),e.fileGenerations.forEach(Mn),e)));class ur{}class pr extends ur{expectedOutput;constructor(e){super(),this.expectedOutput=us(e)}get hashCode(){return jn([Gn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class _r{}class mr extends _r{mappings=[];connections=[];get hashCode(){return jn([Gn.ENGINE_RUNTIME,jn(this.mappings.map((e=>zn(Me.MAPPING,e.valueForSerialization??"")))),jn(this.connections.filter((e=>e.storeConnections.length)))])}}class gr extends _r{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return jn([Gn.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Er{}class fr extends Er{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return jn([Gn.FLAT_DATA_INPUT_DATA,zn(Me.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Tr,Cr,Sr;(Sr=Tr=Tr||(Tr={})).JSON="JSON",Sr.XML="XML";class xr extends Er{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Tr.JSON?us(s):s}get hashCode(){return jn([Gn.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Cr=Cr||(Cr={}));class Nr extends Er{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return jn([Gn.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Ar=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),Mn(e.type),e))),vr=Pn((e=>(0,S.rC)(e,{body:S.LO.ref,parameters:S.LO.ref,hashCode:S.Fl}))),Ir=Pn((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,hashCode:S.Fl}),Mn(e.type),e)));class Or{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){vr(e)}visit_RawVariableExpression(e){Ir(e)}visit_RawPrimitiveInstanceValue(e){Ar(e)}}bn(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Or(t)),e)));class yr{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Rr extends yr{trueString;falseString;get hashCode(){return jn([Gn.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class wr extends yr{get hashCode(){return jn([Gn.FLAT_DATA_STRING])}}class Lr extends yr{get hashCode(){return jn([Gn.FLAT_DATA_NUMBER])}}class Pr extends yr{dateFormat;timeZone;get hashCode(){return jn([Gn.FLAT_DATA_DATE,this.dateFormat?jn(this.dateFormat):"",this.timeZone??""])}}class br extends yr{fields=[];get hashCode(){return jn([Gn.FLAT_DATA_RECORD_TYPE,jn(this.fields)])}}const Dr=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{flatData:S.LO,sectionName:S.LO,hashCode:S.Fl}),e))),Mr=Pn((e=>((0,S.rC)(e,{label:S.LO,flatDataDataType:S.LO,optional:S.LO,address:S.LO,hashCode:S.Fl}),(e=>{e instanceof Rr?(0,S.rC)(e,{trueString:S.LO,falseString:S.LO,hashCode:S.Fl}):e instanceof wr||e instanceof Lr?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof Pr?(0,S.rC)(e,{dateFormat:S.LO,timeZone:S.LO,hashCode:S.Fl}):e instanceof br&&Pn(Fr)(e)})(e.flatDataDataType),e)));function Fr(e){return(0,S.rC)(e,{fields:S.LO,hashCode:S.Fl}),e.fields.forEach(Mr),e}Pn(Fr);const kr=Pn(Fr),Ur=Pn((e=>((0,S.rC)(e,{name:S.LO,value:S.LO,hashCode:S.Fl}),e))),jr=Pn((e=>((0,S.rC)(e,{driverId:S.LO,name:S.LO,sectionProperties:S.LO,recordType:S.LO,hashCode:S.Fl}),e.sectionProperties.forEach(Ur),e.recordType&&kr(e.recordType),e))),Gr=(Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),Pn((e=>(Dn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(jr),e)))),Vr=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Br=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),Vr(e.sourceRootRecordType),e.filter&&vr(e.filter),e))),$r=bn(((e,t)=>(Ed(e,t),vd(e,t),(0,S.rC)(e,{rootInstanceSetImplementation:S.LO,hashCode:S.Fl}),e))),zr=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,hashCode:S.Fl}),vr(e.transform),e))),Hr=Pn((e=>((0,S.rC)(e,{data:S.LO,hashCode:S.Fl}),Mn(e.sourceFlatData),e))),Yr=Pn((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e)));class Wr{}class Kr extends Wr{serverPrincipal;get hashCode(){return jn([Gn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class Xr extends Wr{get hashCode(){return jn([Gn.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class Zr extends Wr{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return jn([Gn.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class qr extends Wr{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return jn([Gn.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class Jr extends Wr{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return jn([Gn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class Qr extends Wr{get hashCode(){return jn([Gn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class eo extends Wr{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return jn([Gn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,jn(this.additionalGcpScopes)])}}class to extends Wr{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return jn([Gn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class so extends Wr{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return jn([Gn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class io extends Wr{kerberosRemoteServiceName;kerberosUseCanonicalHostname;constructor(e,t){super(),this.kerberosRemoteServiceName=e,this.kerberosUseCanonicalHostname=t}get hashCode(){return jn([Gn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY,this.kerberosRemoteServiceName,this.kerberosUseCanonicalHostname.toString()])}}class ao{}class no extends ao{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return jn([Gn.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class ro extends ao{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 jn([Gn.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class oo extends ao{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return jn([Gn.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class lo extends ao{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return jn([Gn.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",jn(this.testDataSetupSqls)])}}class co extends ao{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 jn([Gn.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 ho extends ao{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 jn([Gn.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class uo extends ao{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return jn([Gn.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class po extends ao{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 jn([Gn.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class _o extends ao{host;port;sslSpecification;catalog;schema;clientTags;constructor(e,t,s){super(),this.host=e,this.port=t,this.sslSpecification=s}get hashCode(){return jn([Gn.TRINO_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.sslSpecification,this.catalog??"",this.schema??"",this.clientTags??""])}}class mo{}class go extends mo{_UUID=(0,n.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return jn([this.from,this.to])}}class Eo extends go{get hashCode(){return jn([super.hashCode,Gn.SCHEMA_MAPPER])}}class fo extends go{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return jn([super.hashCode,Gn.TABLE_MAPPER,this.schema])}}class To{_UUID=(0,n.Z)()}class Co extends To{mappers=[];get hashCode(){return jn([Gn.MAPPER_POST_PROCESSOR,jn(this.mappers)])}}const So="{target}",xo="default";class No{}class Ao extends No{}class vo extends Ao{}class Io extends vo{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return jn([Gn.RELATIONAL_OPERATION_DYNA_FUNC,this.name,jn(this.parameters)])}}var Oo;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Oo=Oo||(Oo={}));const yo=e=>[e].concat(e.children.length?yo(e.children[0]):[]);class Ro extends No{relationalOperationElement;joinTreeNode;get hashCode(){return jn([Gn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,jn(this.joinTreeNode?yo(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class wo extends No{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new j}}class Lo extends No{alias;column;columnName;get hashCode(){return jn([Gn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?So:this.alias.name,this.column.value.name])}}class Po extends No{value;constructor(e){super(),this.value=e}get hashCode(){return jn([Gn.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class bo extends No{values=[];get hashCode(){return jn([Gn.RELATIONAL_OPERATION_LITERAL_LIST,jn(this.values)])}}class Do extends No{owner;name;type;nullable;get hashCode(){return jn([Gn.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Mo{}class Fo extends Mo{infinityDate}class ko{}class Uo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BIGINT])}}class jo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_SMALLINT])}}class Go extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_TINYINT])}}class Vo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_INTEGER])}}class Bo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_FLOAT])}}class $o extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_DOUBLE])}}class zo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Ho extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Yo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Wo extends ko{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Ko extends ko{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Xo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_TIMESTAMP])}}class Zo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARCHAR])}}class qo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BIT])}}class Jo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class Qo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_REAL])}}class el extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class tl extends nr{ownerReference;constructor(e){super(e),this.ownerReference=e}}class sl extends tl{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Un).join(",")}get selfJoinPointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",xo,So].map(Un).join(",")}}class il extends tl{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Un).join(",")}get selfJoinPointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",xo,So].map(Un).join(",")}}const al=Pn((e=>((0,S.rC)(e,{packageableElementIncludes:S.LO,packageableElementExcludes:S.LO,hashCode:S.Fl}),e.packageableElementIncludes.forEach(Mn),e.packageableElementExcludes.forEach(Mn),e))),nl=(Pn((e=>(dd(e),(0,S.rC)(e,{schemaSet:S.LO,schemaId:S.LO,contentType:S.LO,modelUnit:S.LO,_elementHashCode:S.KG}),e.schemaSet&&Mn(e.schemaSet),al(e.modelUnit),e))),Pn((e=>((0,S.rC)(e,{binding:S.LO,hashCode:S.Fl}),Mn(e.binding),e)))),rl=Pn((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e))),ol=(Pn((e=>($d(e),(0,S.rC)(e,{externalSource:S.LO,hashCode:S.Fl}),rl(e.externalSource),e))),Pn((e=>(0,S.rC)(e,{id:S.LO,location:S.LO,content:S.LO,hashCode:S.Fl})))),ll=(Pn((e=>(Dn(e),(0,S.rC)(e,{format:S.LO,schemas:S.LO,_elementHashCode:S.KG}),e.schemas.forEach(ol),e))),Pn((e=>e instanceof Uo||e instanceof jo||e instanceof Go||e instanceof Vo||e instanceof Bo||e instanceof $o||e instanceof Xo||e instanceof Date||e instanceof Zo||e instanceof qo||e instanceof Qo||e instanceof el?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof zo||e instanceof Ho||e instanceof Yo||e instanceof Jo?(0,S.rC)(e,{size:S.LO,hashCode:S.Fl}):e instanceof Wo||e instanceof Ko?(0,S.rC)(e,{precision:S.LO,scale:S.LO,hashCode:S.Fl}):e))),cl=Pn((e=>((0,S.rC)(e,{name:S.LO,type:S.LO,nullable:S.LO,hashCode:S.Fl}),ll(e.type),e))),dl=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Mn(e.ownerReference),e))),hl=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Mn(e.ownerReference),e))),ul=Pn((e=>((0,S.rC)(e,{relation:S.LO,name:S.LO,database:S.LO,isSelfJoinTarget:S.LO}),(e=>{e instanceof il?hl(e):e instanceof sl&&dl(e)})(e.relation),e))),pl=Pn((e=>((0,S.rC)(e,{name:S.LO,parameters:S.LO,hashCode:S.Fl}),e.parameters.forEach(Sl),e))),_l=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),ml=Pn((e=>((0,S.rC)(e,{alias:S.LO,column:S.LO,columnName:S.LO,hashCode:S.Fl}),ul(e.alias),_l(e.column),e))),gl=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),El=Pn((e=>((0,S.rC)(e,{alias:S.LO,children:S.LO,joinType:S.LO,hashCode:S.Fl}),e.alias&&ul(e.alias),e.children.forEach(El),gl(e.join),e))),fl=Pn((e=>((0,S.rC)(e,{relationalOperationElement:S.LO,joinTreeNode:S.LO,hashCode:S.Fl}),e.relationalOperationElement&&Sl(e.relationalOperationElement),e.joinTreeNode&&El(e.joinTreeNode),e))),Tl=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),e.value instanceof No&&Sl(e.value),e))),Cl=Pn((e=>((0,S.rC)(e,{values:S.LO,hashCode:S.Fl}),e.values.forEach(Tl),e)));function Sl(e){return e instanceof Io?pl(e):e instanceof wo?ul(e):e instanceof Lo?ml(e):e instanceof Do?cl(e):e instanceof Po?Tl(e):e instanceof bo?Cl(e):e instanceof Ro?fl(e):e}const xl=Pn((e=>e)),Nl=bn(((e,t)=>{if(e instanceof Fo)return xl(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})),Al=Pn((e=>((0,S.rC)(e,{columnName:S.LO,relationalOperationElement:S.LO,hashCode:S.Fl}),Sl(e.relationalOperationElement),e))),vl=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Il=Pn((e=>((0,S.rC)(e,{joinTreeNode:S.LO,database:S.LO,filterName:S.LO,hashCode:S.Fl}),e.joinTreeNode&&El(e.joinTreeNode),vl(e.filter),e))),Ol=Pn((e=>((0,S.rC)(e,{columns:S.LO}),e.columns.forEach(Sl),e))),yl=e=>{(0,S.rC)(e,{columns:S.LO,name:S.LO})},Rl=bn(((e,t)=>(yl(e),(0,S.rC)(e,{primaryKey:S.LO,hashCode:S.Fl}),e.primaryKey.forEach(cl),e.milestoning.forEach((e=>Nl(e,t))),e))),wl=bn(((e,t)=>(yl(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(cl),e.columnMappings.forEach(Al),e.filter&&Il(e.filter),e.groupBy&&Ol(e.groupBy),e))),Ll=bn(((e,t)=>((0,S.rC)(e,{name:S.LO,tables:S.LO,views:S.LO,hashCode:S.Fl}),e.tables.forEach((e=>Rl(e,t))),e.views.forEach((e=>wl(e,t))),e))),Pl=Pn((e=>((0,S.rC)(e,{name:S.LO,operation:S.LO,hashCode:S.Fl}),Sl(e.operation),e))),bl=Pn((e=>((0,S.rC)(e,{name:S.LO,target:S.LO,aliases:S.LO,operation:S.LO,hashCode:S.Fl}),e.target&&ul(e.target),Sl(e.operation),e))),Dl=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{schemas:S.LO,joins:S.LO,filters:S.LO,_elementHashCode:S.KG}),e.schemas.forEach((e=>Ll(e,t))),e.joins.forEach(bl),e.filters.forEach(Pl),e))),Ml=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,relationalOperation:S.LO.ref,bindingTransformer:S.LO,hashCode:S.Fl}),e.bindingTransformer&&nl(e.bindingTransformer),e))),Fl=(e,t)=>(vd(e,t),Ed(e,t),(0,S.rC)(e,{id:S.LO,rootInstanceSetImplementation:S.LO,primaryKey:S.LO}),e.primaryKey.forEach(Sl),e),kl=bn(Fl),Ul=bn(((e,t)=>(Fl(e,t),(0,S.rC)(e,{inlineSetImplementation:S.LO}),Pd(e.inlineSetImplementation,t),e))),jl=bn(((e,t)=>(Fl(e,t),(0,S.rC)(e,{otherwisePropertyMapping:S.LO,hashCode:S.Fl}),Cd(e.otherwisePropertyMapping,t),e))),Gl=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{primaryKey:S.LO}),e.primaryKey.forEach(Sl),e))),Vl=bn(((e,t)=>(vd(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(Al),e.filter&&Il(e.filter),e.groupBy&&Ol(e.groupBy),e.mainTableAlias&&ul(e.mainTableAlias),e))),Bl=Pn((e=>((0,S.rC)(e,{data:S.LO,inputType:S.LO,hashCode:S.Fl}),Mn(e.database),e))),$l=Pn((e=>(0,S.rC)(e,{host:S.LO,port:S.LO,databaseName:S.LO,hashCode:S.Fl}))),zl=Pn((e=>(0,S.rC)(e,{hostname:S.LO,port:S.LO,protocol:S.LO,httpPath:S.LO,hashCode:S.Fl}))),Hl=Pn((e=>(0,S.rC)(e,{databaseName:S.LO,directory:S.LO,autoServerMode:S.LO,hashCode:S.Fl}))),Yl=Pn((e=>(0,S.rC)(e,{testDataSetupCsv:S.LO,testDataSetupSqls:S.LO,hashCode:S.Fl}))),Wl=Pn((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}))),Kl=Pn((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}))),Xl=Pn((e=>(0,S.rC)(e,{projectId:S.LO,defaultDataset:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),Zl=Pn((e=>(0,S.rC)(e,{projectId:S.LO,instanceId:S.LO,databaseId:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),ql=Pn((e=>(0,S.rC)(e,{ssl:S.LO,trustStorePathVaultReference:S.LO,trustStorePasswordVaultReference:S.LO,hashCode:S.Fl}))),Jl=Pn((e=>((0,S.rC)(e,{host:S.LO,port:S.LO,catalog:S.LO,schema:S.LO,clientTags:S.LO,hashCode:S.Fl}),ql(e.sslSpecification),e))),Ql=Pn((e=>(0,S.rC)(e,{serverPrincipal:S.LO,hashCode:S.Fl}))),ec=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl}))),tc=Pn((e=>(0,S.rC)(e,{apiToken:S.LO,hashCode:S.Fl}))),sc=Pn((e=>(0,S.rC)(e,{oauthKey:S.LO,scopeName:S.LO,hashCode:S.Fl}))),ic=Pn((e=>(0,S.rC)(e,{privateKeyVaultReference:S.LO,passPhraseVaultReference:S.LO,publicUserName:S.LO,hashCode:S.Fl}))),ac=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl}))),nc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,userNameVaultReference:S.LO,passwordVaultReference:S.LO,baseVaultReference:S.LO}))),rc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,serviceAccountEmail:S.LO,additionalGcpScopes:S.LO}))),oc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,vaultReference:S.LO}))),lc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,kerberosRemoteServiceName:S.LO,kerberosUseCanonicalHostname:S.LO}))),cc=e=>{(0,S.rC)(e,{from:S.LO,to:S.LO,hashCode:S.Fl})},dc=Pn((e=>(cc(e),e))),hc=Pn((e=>(cc(e),(0,S.rC)(e,{schema:S.LO}),dc(e.schema),e))),uc=bn(((e,t)=>((e=>{$d(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 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 Zl(e);if(e instanceof _o)return Jl(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 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 Qr)return ac(e);if(e instanceof to)return nc(e);if(e instanceof eo)return rc(e);if(e instanceof so)return oc(e);if(e instanceof io)return lc(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 Co)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 Eo?dc(e):e instanceof fo&&hc(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 pc{id}class _c extends pc{__parent;assertions=[]}class mc extends pc{__parent;tests=[]}class gc extends _c{query;get hashCode(){return jn([Gn.MAPPING_TEST,this.query,this.id,jn(this.assertions)])}}class Ec extends mc{mappingStoreTestDatas=[];get hashCode(){return jn([Gn.MAPPING_TEST_SUITE,jn(this.mappingStoreTestDatas),this.id,jn(this.tests)])}}class fc extends _c{serializationFormat;parameters=[];keys=[];get hashCode(){return jn([Gn.SERVICE_TEST,this.id,jn(this.assertions),jn(this.parameters),jn(this.keys),this.serializationFormat??""])}}class Tc extends mc{testData;get hashCode(){return jn([Gn.SERVICE_TEST_SUITE,this.id,jn(this.tests),this.testData])}}class Cc{id;parentTest}class Sc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO,this.id,Bn(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class xc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class Nc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Ac{}class vc extends Ac{dataElement;get hashCode(){return jn([Gn.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Ic extends Ac{contentType;data;get hashCode(){return jn([Gn.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Oc extends Ac{instances;get hashCode(){return jn([Gn.MODEL_STORE_DATA,jn(Array.from(this.instances.keys()).map((e=>e.path))),Bn(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class yc extends Ac{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return jn([Gn.RELATIONAL_CSV_DATA_TABLE,jn(this.tables)])}}const Rc=Pn((e=>((0,S.rC)(e,{contentType:S.LO,data:S.LO,hashCode:S.Fl}),e))),wc=Pn((e=>((0,S.rC)(e,{dataElement:S.LO,hashCode:S.Fl}),e))),Lc=Pn((e=>((0,S.rC)(e,{instances:S.LO,hashCode:S.Fl}),e))),Pc=Pn((e=>((0,S.rC)(e,{values:S.LO,table:S.LO,schema:S.LO,hashCode:S.Fl}),e))),bc=Pn((e=>((0,S.rC)(e,{tables:S.LO,hashCode:S.Fl}),e.tables.forEach(Pc),e)));function Dc(e,t){if(e instanceof vc)return wc(e);if(e instanceof Ic)return Rc(e);if(e instanceof Oc)return Lc(e);if(e instanceof yc)return bc(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 Mc=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{stereotypes:S.LO,taggedValues:S.LO,data:S.LO,_elementHashCode:S.KG}),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),Dc(e.data,t),e)));class Fc{}class kc extends Fc{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return jn([Gn.SERVICE_PURE_EXECUTION,this.func])}}class Uc extends kc{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return jn([Gn.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class jc extends kc{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return jn([Gn.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,jn(this.executionParameters)])}}class Gc{_OWNER;constructor(e){this._OWNER=e}}class Vc extends Gc{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return jn([Gn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,jn(this.asserts)])}}class Bc extends Gc{tests=[];get hashCode(){return jn([Gn.SERVICE_LEGACY_MULTI_EXECUTION_TEST,jn(this.tests)])}}const $c=bn(((e,t)=>((0,S.rC)(e,{connectionId:S.LO,testData:S.LO,hashCode:S.Fl}),Dc(e.testData,t),e))),zc=Pn((e=>((0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}),e))),Hc=Pn((e=>((0,S.rC)(e,{assertion:S.LO,hashCode:S.Fl,id:S.LO}),vr(e.assertion),e))),Yc=Pn((e=>((0,S.rC)(e,{assertions:S.LO,description:S.LO,parameters:S.LO,hashCode:S.Fl}),e.assertions.forEach(Hc),e.parameters.forEach(vr),e))),Wc=bn(((e,t)=>((0,S.rC)(e,{connectionsTestData:S.LO,hashCode:S.Fl}),e.connectionsTestData.forEach((e=>$c(e,t))),e))),Kc=Pn((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(zc),e.assertions.forEach(cd),e))),Xc=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,testData:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>ld(e,t))),Wc(e.testData,t),e))),Zc=Pn((e=>((0,S.rC)(e,{parametersValues:S.LO,assert:S.LO,singleExecutionTestParent:S.LO,hashCode:S.Fl}),vr(e.assert),e))),qc=Pn((e=>((0,S.rC)(e,{data:S.LO,asserts:S.LO,hashCode:S.Fl}),e.asserts.forEach(Zc),e))),Jc=Pn((e=>(qc(e),(0,S.rC)(e,{key:S.LO}),e))),Qc=Pn((e=>((0,S.rC)(e,{tests:S.LO,hashCode:S.Fl}),e.tests.forEach(Jc),e))),ed=e=>{(0,S.rC)(e,{func:S.LO}),vr(e.func)},td=bn(((e,t)=>(ed(e),(0,S.rC)(e,{runtime:S.LO,hashCode:S.Fl}),e.mapping&&Mn(e.mapping),e.runtime&&th(e.runtime,t),e))),sd=bn(((e,t)=>((0,S.rC)(e,{key:S.LO,runtime:S.LO,hashCode:S.Fl}),Mn(e.mapping),th(e.runtime,t),e))),id=bn(((e,t)=>(ed(e),(0,S.rC)(e,{executionKey:S.LO,executionParameters:S.LO,hashCode:S.Fl}),e.executionParameters.forEach((e=>sd(e,t))),e))),ad=bn(((e,t)=>(Dn(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(oh),e.taggedValues.forEach(ch),((e,t)=>{e instanceof Uc?td(e,t):e instanceof jc&&id(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Vc?qc(e):e instanceof Bc&&Qc(e)})(e.test),e.tests.forEach((e=>Xc(e,t))),e.postValidations.forEach((e=>Yc(e))),e))),nd=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),e))),rd=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),Rc(e.expected),e))),od=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),Rc(e.expected),e)));function ld(e,t){if(e instanceof fc)return Kc(e);if(e instanceof gc)return ud(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 cd(e){return e instanceof Sc?nd(e):e instanceof xc?od(e):e instanceof Nc?rd(e):e}const dd=e=>{Dn(e),(0,S.rC)(e,{includes:S.LO}),e.includes.forEach(Mn)},hd=bn(((e,t)=>((0,S.rC)(e,{store:S.LO,data:S.LO,hashCode:S.Fl}),Dc(e.data,t),e))),ud=Pn((e=>((0,S.rC)(e,{id:S.LO,query:S.LO,assertions:S.LO,hashCode:S.Fl}),e.assertions.forEach(cd),e))),pd=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,mappingStoreTestDatas:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>ld(e,t))),e.mappingStoreTestDatas.forEach((e=>hd(e,t))),e))),_d=Pn((e=>((0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl}),Mn(e.ownerReference),e))),md=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),gd=Pn((e=>((0,S.rC)(e,{localMappingProperty:S.LO,localMappingPropertyType:S.LO,localMappingPropertyMultiplicity:S.LO,hashCode:S.Fl}),Mn(e.localMappingPropertyType),e))),Ed=(e,t)=>{(0,S.rC)(e,{sourceSetImplementation:S.LO,targetSetImplementation:S.LO}),Ah(e.property),md(e.sourceSetImplementation),e.targetSetImplementation&&md(e.targetSetImplementation),e.localMappingProperty&&gd(e.localMappingProperty)},fd=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,explodeProperty:S.LO,hashCode:S.Fl}),e.transformer&&_d(e.transformer),vr(e.transform),e)));class Td{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){fd(e,this.observerContext)}visit_FlatDataPropertyMapping(e){zr(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){$r(e,this.observerContext)}visit_RelationalPropertyMapping(e){Ml(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Dr(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){kl(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Ul(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){jl(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Cd=(e,t)=>(e.accept_PropertyMappingVisitor(new Td(t)),e),Sd=Pn((e=>(0,S.rC)(e,{isDefault:S.Fl,valueForSerialization:S.Fl}))),xd=Pn((e=>(0,S.rC)(e,{valueForSerialization:S.Fl}))),Nd=e=>{(0,S.rC)(e,{root:S.LO}),Mn(e.class),Sd(e.id),xd(e.root)},Ad=Pn((e=>((0,S.rC)(e,{setImplementation:S.LO,class:S.LO,properties:S.LO}),e))),vd=(e,t)=>{Nd(e),(0,S.rC)(e,{mappingClass:S.LO,propertyMappings:S.LO}),e.mappingClass&&Ad(e.mappingClass),e.propertyMappings.forEach((e=>Cd(e,t)))},Id=Pn((e=>((0,S.rC)(e,{}),md(e.setImplementation),e))),Od=e=>{Nd(e),(0,S.rC)(e,{parameters:S.LO,operation:S.LO,hashCode:S.Fl}),e.parameters.forEach(Id)},yd=Pn((e=>(Od(e),e))),Rd=Pn((e=>(Od(e),(0,S.rC)(e,{validationFunction:S.LO}),vr(e.validationFunction),e))),wd=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),e.srcClass&&Mn(e.srcClass),e.filter&&vr(e.filter),e)));class Ld{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){Rd(e)}visit_OperationSetImplementation(e){yd(e)}visit_PureInstanceSetImplementation(e){wd(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Br(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Gl(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Vl(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Pd=(e,t)=>(e.accept_SetImplementationVisitor(new Ld(t)),e),bd=Pn((e=>((0,S.rC)(e,{original:S.LO,substitute:S.LO}),Mn(e.original),Mn(e.substitute),e))),Dd=Pn((e=>((0,S.rC)(e,{included:S.LO,storeSubstitutions:S.LO}),Mn(e.included),e.storeSubstitutions.forEach(bd),e))),Md=Pn((e=>(0,S.rC)(e,{value:S.LO}))),Fd=Pn((e=>((0,S.rC)(e,{sourceValues:S.LO,hashCode:S.Fl}),fh(e.enum),e.sourceValues.forEach(Md),e))),kd=Pn((e=>((0,S.rC)(e,{sourceType:S.LO,enumValueMappings:S.LO,hashCode:S.Fl}),Mn(e.enumeration),Sd(e.id),e.sourceType&&Mn(e.sourceType),e.enumValueMappings.forEach(Fd),e))),Ud=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,stores:S.LO,propertyMappings:S.LO,hashCode:S.Fl}),Mn(e.association),Sd(e.id),e.stores.forEach(Mn),e.propertyMappings.forEach((e=>Cd(e,t))),e))),jd=Pn((e=>((0,S.rC)(e,{inputType:S.LO,data:S.LO,hashCode:S.Fl}),Mn(e.sourceClass),e))),Gd=Pn((e=>(0,S.rC)(e,{expectedOutput:S.LO,hashCode:S.Fl}))),Vd=bn(((e,t)=>((0,S.rC)(e,{name:S.LO,query:S.LO,inputData:S.LO,assert:S.LO,hashCode:S.Fl}),vr(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof xr)return jd(e);if(e instanceof fr)return Hr(e);if(e instanceof Nr)return Bl(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 pr&&Gd(e)})(e.assert),e))),Bd=bn(((e,t)=>(Dn(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(Dd),e.classMappings.forEach((e=>Pd(e,t))),e.enumerationMappings.forEach(kd),e.associationMappings.forEach((e=>Ud(e,t))),e.test.forEach((e=>Vd(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Tc?Xc(e,t):e instanceof Ec?pd(e,t):e}(e,t))),e))),$d=e=>{(0,S.rC)(e,{store:S.LO}),Mn(e.store)},zd=Pn((e=>($d(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),Hd=Pn((e=>($d(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Mn(e.class),e))),Yd=Pn((e=>($d(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Mn(e.class),e))),Wd=Pn((e=>($d(e),(0,S.rC)(e,{mappings:S.LO,hashCode:S.Fl}),e.mappings.forEach(Mn),e)));class Kd{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){zd(e)}visit_ModelChainConnection(e){Wd(e)}visit_JsonModelConnection(e){Hd(e)}visit_XmlModelConnection(e){Yd(e)}visit_FlatDataConnection(e){Yr(e)}visit_RelationalDatabaseConnection(e){uc(e,this.observerContext)}}const Xd=(e,t)=>(e.accept_ConnectionVisitor(new Kd(t)),e),Zd=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{connectionValue:S.LO,_elementHashCode:S.KG}),Xd(e.connectionValue,t),e))),qd=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,connection:S.LO,hashCode:S.Fl}),Xd(e.connection,t),e))),Jd=bn(((e,t)=>((0,S.rC)(e,{storeConnections:S.LO,hashCode:S.Fl}),Mn(e.store),e.storeConnections.forEach((e=>qd(e,t))),e))),Qd=bn(((e,t)=>((0,S.rC)(e,{mappings:S.LO,connections:S.LO,hashCode:S.Fl}),e.mappings.forEach(Mn),e.connections.forEach((e=>Jd(e,t))),e))),eh=Pn((e=>((0,S.rC)(e,{hashCode:S.Fl}),Mn(e.packageableRuntime),e))),th=(e,t)=>e instanceof gr?eh(e):e instanceof mr?Qd(e,t):e,sh=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{runtimeValue:S.LO,_elementHashCode:S.KG}),Qd(e.runtimeValue,t),e))),ih=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{_elementHashCode:S.KG}),e)));class ah{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){rh(e,this.observerContext)}visit_SectionIndex(e){ph(e)}visit_PrimitiveType(e){}visit_Profile(e){gh(e)}visit_Enumeration(e){Th(e)}visit_Measure(e){Sh(e)}visit_Class(e){Ih(e)}visit_Association(e){Oh(e)}visit_ConcreteFunctionDefinition(e){yh(e)}visit_FlatData(e){Gr(e)}visit_Database(e){Dl(e,this.observerContext)}visit_Mapping(e){Bd(e,this.observerContext)}visit_Service(e){ad(e,this.observerContext)}visit_ExecutionEnvironmentInstance(e){ih(e,this.observerContext)}visit_PackageableRuntime(e){sh(e,this.observerContext)}visit_PackageableConnection(e){Zd(e,this.observerContext)}visit_FileGenerationSpecification(e){cr(e)}visit_GenerationSpecification(e){hr(e)}visit_DataElement(e){Mc(e,this.observerContext)}}const nh=bn(((e,t)=>(e.accept_PackageableElementVisitor(new ah(t)),e))),rh=bn(((e,t)=>((e=>{Dn(e),(0,S.rC)(e,{children:S.LO,hashCode:S.KG})})(e),e.children.forEach((e=>{e instanceof er?rh(e,t):nh(e,t)})),e))),oh=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),lh=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),e))),ch=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),lh(e.tag),e))),dh=Pn((e=>(0,S.rC)(e,{rawType:S.LO}))),hh=Pn((e=>((0,S.rC)(e,{value:S.LO}),dh(e.value),Mn(e.ownerReference),e))),uh=Pn((e=>((0,S.rC)(e,{parserName:S.LO,elements:S.LO}),e instanceof sr?(0,S.rC)(e,{imports:S.LO,hashCode:S.Fl}):e instanceof ir&&(0,S.rC)(e,{hashCode:S.Fl}),e))),ph=Pn((e=>(Dn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(uh),e))),_h=Pn((e=>(0,S.rC)(e,{value:S.LO}))),mh=Pn((e=>(0,S.rC)(e,{value:S.LO}))),gh=Pn((e=>(Dn(e),(0,S.rC)(e,{p_stereotypes:S.LO,p_tags:S.LO,_elementHashCode:S.KG}),e.p_stereotypes.forEach(_h),e.p_tags.forEach(mh),e))),Eh=Pn((e=>((0,S.rC)(e,{name:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),fh=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Th=Pn((e=>(Dn(e),(0,S.rC)(e,{values:S.LO,stereotypes:S.LO,taggedValues:S.LO,_elementHashCode:S.KG}),e.values.forEach(Eh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Ch=Pn((e=>((0,S.rC)(e,{measure:S.LO,conversionFunction:S.LO,hashCode:S.Fl}),e.conversionFunction&&vr(e.conversionFunction),e))),Sh=Pn((e=>(Dn(e),(0,S.rC)(e,{canonicalUnit:S.LO,nonCanonicalUnits:S.LO,_elementHashCode:S.KG}),e.canonicalUnit&&Ch(e.canonicalUnit),e.nonCanonicalUnits.forEach(Ch),e))),xh=Pn((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),hh(e.genericType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Nh=Pn((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}),hh(e.genericType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Ah=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),vh=Pn((e=>((0,S.rC)(e,{name:S.LO,functionDefinition:S.LO,externalId:S.LO,enforcementLevel:S.LO,messageFunction:S.LO,hashCode:S.Fl}),vr(e.functionDefinition),e.messageFunction&&vr(e.messageFunction),e))),Ih=Pn((e=>(Dn(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(xh),e.propertiesFromAssociations.forEach(xh),e.derivedProperties.forEach(Nh),e.generalizations.forEach(hh),e.constraints.forEach(vh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Oh=Pn((e=>(Dn(e),(0,S.rC)(e,{properties:S.LO,stereotypes:S.LO,taggedValues:S.LO,derivedProperties:S.LO,_elementHashCode:S.KG}),e.properties.forEach(xh),e.derivedProperties.forEach(Nh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),yh=Pn((e=>(Dn(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),Mn(e.returnType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Rh=Pn((e=>e instanceof qn?Th(e):e instanceof Jn?Ch(e):e instanceof Xn?Ih(e):e instanceof Qn?Sh(e):e)),wh=(Pn((e=>e instanceof qn?Th(e):e instanceof Jn?Ch(e):e)),Pn((e=>(0,S.rC)(e,{_dummyObservable:S.LO})))),Lh=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Ph=Pn((e=>(wh(e),(0,S.rC)(e,{id:S.LO,hideProperties:S.LO,hideTaggedValues:S.LO,hideStereotypes:S.LO,hashCode:S.Fl}),Mn(e.class),e))),bh=Pn((e=>(Lh(e.classView),e))),Dh=Pn((e=>((0,S.rC)(e,{path:S.LO,pathForSerialization:S.Fl}),bh(e.from),bh(e.to),e))),Mh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),Fh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),Ah(e.property),Mn(e.association),e))),kh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),Ah(e.property),e))),Uh=Pn((e=>(Dn(e),(0,S.rC)(e,{classViews:S.LO,associationViews:S.LO,generalizationViews:S.LO,propertyViews:S.LO,_elementHashCode:S.KG}),e.classViews.forEach(Ph),e.associationViews.forEach(Fh),e.generalizationViews.forEach(Mh),e.propertyViews.forEach(kh),e)));var jh;!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"}(jh=jh||(jh={}));class Gh extends Wn{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return jn([jh.DIAGRAM,this.path,jn(this.classViews),jn(this.generalizationViews),jn(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Vh="Diagram";class Bh extends Ln{constructor(){super(wn.Rw.LW,wn.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Vh]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Gh)return Vh}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Gh)return Uh(e)}]}}class $h{package;name;get path(){return`${this.package}${Ce}${this.name}`}get hashCode(){return jn([Gn.PACKAGEABLE_ELEMENT,this.path])}}class zh extends $h{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return jn([jh.DIAGRAM,this.path,jn(this.classViews),jn(this.generalizationViews),jn(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Hh{rectangle;position;get hashCode(){return jn([jh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Yh extends Hh{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return jn([jh.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Wh{x;y;get hashCode(){return jn([jh.POINT,this.x.toString(),this.y.toString()])}}class Kh{width;height;get hashCode(){return jn([jh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Xh{points=[]}class Zh{sourceView;targetView;line;get hashCode(){return jn([jh.RELATIONSHIP_VIEW,this.sourceView,this.targetView,jn(this.line.points)])}}class qh extends Zh{property;get hashCode(){return jn([jh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class Jh extends qh{get hashCode(){return jn([jh.PROPERTY_VIEW,super.hashCode])}}class Qh extends Zh{get hashCode(){return jn([jh.GENERALIZATION_VIEW,super.hashCode])}}class eu{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return jn([Gn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new eu(0,0);static ZERO_ONE=new eu(0,1);static ZERO_MANY=new eu(0,void 0);static ONE=new eu(1,1);static ONE_MANY=new eu(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 jn([Gn.PACKAGEABLE_ELEMENT_POINTER,this.type??"",this.path])}},{path:(0,We.Ru)(),type:(0,We.jt)((0,We.Ru)())});const tu=(0,We.yu)(eu,{lowerBound:(0,We.Ru)(),upperBound:(0,We.jt)((0,We.Ru)())});class su{class;property;get hashCode(){return jn([Gn.PROPERTY_POINTER,this.property,this.class??""])}}class iu{}class au{queryTimeOutInSeconds=null;enableConstraints=!0}var nu,ru;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(nu||(nu={})),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"}(ru=ru||(ru={})),(0,We.yu)(class extends au{},{_type:Ze(nu.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,We.Ru)(),enableConstraints:(0,We.Ru)()});const ou=(0,We.yu)(class extends iu{body;parameters;get hashCode(){return jn([Gn.RAW_LAMBDA,$n(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(ru.LAMBDA),body:(0,We.LZ)(),parameters:(0,We.LZ)()}),lu=(0,We.yu)(class extends iu{class;name;multiplicity;get hashCode(){return jn([Gn.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(ru.VARIABLE),class:(0,We.Ru)(),multiplicity:Xe(tu),name:(0,We.Ru)()});(0,We.yu)(class extends iu{multiplicity=eu.ONE;type;value;get hashCode(){return jn([Gn.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 ru.CINTEGER;case Ae.DECIMAL:return ru.CDECIMAL;case Ae.STRING:return ru.CSTRING;case Ae.BOOLEAN:return ru.CBOOLEAN;case Ae.FLOAT:return ru.CFLOAT;case Ae.DATETIME:return ru.CDATETIME;case Ae.STRICTDATE:return ru.CSTRICTDATE;case Ae.STRICTTIME:return ru.CSTRICTTIME;case Ae.LATESTDATE:return ru.CLATESTDATE;default:throw new j(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case ru.CINTEGER:return Ae.INTEGER;case ru.CDECIMAL:return Ae.DECIMAL;case ru.CSTRING:return Ae.STRING;case ru.CBOOLEAN:return Ae.BOOLEAN;case ru.CFLOAT:return Ae.FLOAT;case ru.CDATETIME:return Ae.DATETIME;case ru.CSTRICTDATE:return Ae.STRICTDATE;case ru.CSTRICTTIME:return Ae.STRICTTIME;case ru.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 cu=(0,We.yu)(su,{class:(0,We.jt)((0,We.Ru)()),property:(0,We.Ru)()}),du=(0,We.yu)(class{profile;value;get hashCode(){return jn([Gn.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),hu=(0,We.yu)(class{profile;value;get hashCode(){return jn([Gn.TAG_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),uu=(0,We.yu)(class{tag;value;get hashCode(){return jn([Gn.TAGGED_VALUE,this.tag,this.value])}},{tag:Xe(hu),value:(0,We.Ru)()}),pu=((0,We.yu)(class extends $h{stereotypes=[];tags=[];get hashCode(){return jn([Gn.PROFILE,this.path,jn(this.stereotypes),jn(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 jn([Gn.ENUM_VALUE,this.value,jn(this.stereotypes),jn(this.taggedValues)])}},{stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),value:(0,We.Ru)()})),_u=((0,We.yu)(class extends $h{values=[];stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.ENUMERATION,this.path,jn(this.values),jn(this.stereotypes),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),values:(0,We.pb)(Xe(pu))}),(0,We.yu)(class extends $h{measure;conversionFunction;get hashCode(){return jn([Gn.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}},{_type:Ze("unit"),conversionFunction:(0,We.jt)(Xe(ou)),measure:(0,We.Ru)(),name:(0,We.Ru)(),package:(0,We.Ru)()})),mu=((0,We.yu)(class extends $h{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return jn([Gn.MEASURE,this.path,this.canonicalUnit??"",jn(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,We.jt)(Xe(_u)),name:(0,We.Ru)(),nonCanonicalUnits:(0,We.pb)(Xe(_u)),package:(0,We.Ru)()}),(0,We.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",jn(this.stereotypes),jn(this.taggedValues)])}},{aggregation:(0,We.jt)((0,We.Ru)()),multiplicity:Xe(tu),name:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),type:(0,We.Ru)()})),gu=(0,We.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return jn([Gn.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,jn(this.stereotypes),jn(this.taggedValues),$n(this.parameters,this.body)])}},{body:(0,We.LZ)(),name:(0,We.Ru)(),parameters:(0,We.LZ)(),returnMultiplicity:Xe(tu),returnType:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),Eu=(0,We.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return jn([Gn.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(ou),messageFunction:(0,We.jt)(Xe(ou)),name:(0,We.Ru)()});var fu;(0,We.yu)(class extends $h{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return jn([Gn.CLASS,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.superTypes),jn(this.constraints),jn(this.stereotypes),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:Qe(Eu,{INTERNAL__forceReturnEmptyInTest:!0}),name:(0,We.Ru)(),originalMilestonedProperties:et((()=>We.AM),(()=>We.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,We.Ru)(),properties:Qe(mu,{INTERNAL__forceReturnEmptyInTest:!0}),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(gu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),superTypes:(fu={INTERNAL__forceReturnEmptyInTest:!0},et((e=>e),(e=>e),fu)),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends $h{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.ASSOCIATION,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.stereotypes),jn(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(mu)),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(gu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends $h{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return jn([Gn.FUNCTION,this.path,jn(this.parameters),this.returnType,jn(this.taggedValues),jn(this.stereotypes),$n(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(lu)),postConstraints:(0,We.pb)((0,We.Ru)()),preConstraints:(0,We.pb)((0,We.Ru)()),returnMultiplicity:Xe(tu),returnType:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})});const Tu="diagram",Cu=(0,We.yu)(Wh,{x:(0,We.Ru)(),y:(0,We.Ru)()}),Su=(0,We.yu)(Kh,{height:(0,We.Ru)(),width:(0,We.Ru)()}),xu=(0,We.yu)(Xh,{points:(0,We.pb)(Xe(Cu))}),Nu=(0,We.yu)(Yh,{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(Cu),rectangle:Xe(Su)}),Au=(0,We.yu)(Jh,{line:Xe(xu),property:Xe(cu),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),vu=(0,We.yu)(Qh,{line:Xe(xu),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),Iu=(0,We.yu)(zh,{_type:Ze(Tu),classViews:(0,We.pb)(Xe(Nu)),generalizationViews:(0,We.pb)(Xe(vu)),name:(0,We.Ru)(),package:(0,We.Ru)(),propertyViews:(0,We.pb)(Xe(Au))});class Ou extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var yu=s(95903);const Ru=e=>H((0,yu.Z)(e.split(Ce))),wu=e=>{const t=e.lastIndexOf(Ce);return-1===t?void 0:e.substring(0,t)},Lu=(e,t)=>{const s=e.lastIndexOf(Ce);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+Ce.length,e.length)]},Pu=(e,t)=>`${e?`${e}${Ce}`:""}${t}`,bu=(e,t)=>{e.children.push(t),t.package=e},Du=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Mu=(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 er&&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 er(n),r.package=e,e.children.push(r)}return i&&i.set(Pu(e.path,n),r),-1!==a?Mu(r,t.substring(a+Ce.length),s,i):r},Fu=(e,t,s,i)=>{if(i){const a=i.get(Pu(e.path,t));if(a)return a;let n=t;for(;""!==n;){const a=Pu(e.path,n),r=i.get(a);if(r)return Mu(r,t.substring(n.length+Ce.length,t.length),s,i);const o=n.lastIndexOf(Ce);n=-1!==o?n.substring(0,o):""}}return Mu(e,t,s,i)},ku=(e,t,s)=>(X(t,"Package path is required"),Fu(e.root,t,!0,s)),Uu=(e,t)=>K(e.rawType,t),ju=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Uu(e.value,Xn);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Gu=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Vu=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Bu=(e,t)=>`${H(e,"Package path is required")}${Ce}${H(t,"Name is required")}`;class $u{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`)})(Bu(e.package,e.name),t,i);const a=this.firstPass(e,t);return bu(ku(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 zu=e=>e.classView.value.id,Hu=e=>{const t=new Jh,s=new Xh;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new su;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=zu(e.from),t.targetView=zu(e.to),t},Yu=e=>{const t=new Qh,s=new Xh;return s.points=e.pathForSerialization,t.line=s,t.sourceView=zu(e.from),t.targetView=zu(e.to),t},Wu=e=>{const t=new Yh;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 Wh;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Kh;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Ku{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return jn([jh.POINT,this.x.toString(),this.y.toString()])}}class Xu{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return jn([jh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Zu{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Ku(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 Zu(new Ku(e.position.x+e.rectangle.width,e.position.y),new Xu(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Zu(new Ku(e.position.x,e.position.y+e.rectangle.height),new Xu(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,jn([jh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class qu extends Zu{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Ku(0,0),new Xu(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return jn([jh.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Ju{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class Qu extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ep extends Qu{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ep(e)}}class tp{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new Ju(ep.create(t)),this.to=new Ju(ep.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 Ku(a,n):(t&&(e._offsetX=0,e._offsetY=0),new Ku(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)=>{q(Boolean(e.length),"Path requires at least 1 point");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];const o=e.slice(i-1,n+2);return o.length<2?[a,r]:o};get pathForSerialization(){return tp.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return jn([jh.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,jn(this.pathForSerialization)])}}class sp extends tp{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return jn([jh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class ip extends sp{get hashCode(){return jn([jh.PROPERTY_VIEW,super.hashCode])}}class ap extends tp{get hashCode(){return jn([jh.GENERALIZATION_VIEW,super.hashCode])}}class np{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new np(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new np(this.x/e,this.y/e)}normal(e){return new np(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const rp=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 Ku(t,s)},op=(e,t)=>e.classViews.find((e=>e.id===t)),lp=(e,t)=>{e.path=t},cp=e=>{const t=e.buildFullPath(),s=tp.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=H(s[0],"Diagram path expected to have at least 2 points").x-t.x,e.from._offsetY=H(s[0],"Diagram path expected to have at least 2 points").y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=np.fromPoints(s[e+1],s[e]).unit(),a=np.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])}lp(e,i)},dp=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),hp=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),up=e=>new Ku(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),pp=e=>{const t=up(e);return new Zu(new Ku(t.x-5,t.y-5),new Xu(10,10))},_p=(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)),mp=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new Ku(t,s)};class gp extends Ou{constructor(){super(wn.Rw.zE,wn.i8)}V1_getExtraElementBuilders(){return[new $u({elementClassName:"Diagram",_class:zh,firstPass:(e,t)=>{W(e,zh);const s=new Gh(e.name),i=Bu(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Gh),s},secondPass:(e,t)=>{W(e,zh);const s=(i=Bu(e.package,e.name),a=t.currentSubGraph,H(a.getOwnNullableExtensionElement(i,Gh),`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 qu(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 Xu(t,s)})(e.rectangle),i.position=mp(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(op(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),a=H(op(s,H(e.targetView)),"Property view 'targetView' field is missing"),n=t.resolveOwnProperty(e.property),r=new ip(s,n,i,a);r.path=e.line.points.map((e=>mp(e)));try{cp(r)}catch(e){G(e),t.logService.warn(h.create(e.message))}return r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t,s)=>{z(e.line,"Generalization view 'line' field is missing");const i=H(op(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),a=H(op(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),n=new ap(t,i,a);n.path=e.line.points.map((e=>mp(e)));try{cp(n)}catch(e){G(e),s.logService.warn(h.create(e.message))}return n})(e,s,t)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof zh)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof zh)return(0,We.qC)(Iu,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===Tu)return(0,We.vB)(Iu,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Gh)return(e=>{const t=new zh;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Wu),t.generalizationViews=e.generalizationViews.map(Yu),t.propertyViews=e.propertyViews.map(Hu),t})(e)}]}}class Ep extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class fp extends Ep{constructor(){super(wn.Rw.f1,wn.i8)}getExtraPureGraphExtensionClasses(){return[Gh]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Gh).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Xn?Gu(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 Tp extends c{constructor(){super(wn.Rw.NA,wn.i8,[new fp,new Bh,new gp])}}class Cp{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Sp=(0,At.createContext)(void 0),xp=({children:e})=>{const t=vn(),s=(0,Nt.fv)((()=>new Cp(t)));return(0,T.jsx)(Sp.Provider,{value:s,children:e})},Np="/welcome.pure",Ap="/",vp="::";var Ip,Op;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(Ip=Ip||(Ip={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Op=Op||(Op={}));const yp=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Rp="dummy_problem_marker_owner";var wp;!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"}(wp=wp||(wp={}));class Lp{pureId;pureType;pureName;get id(){return this.pureId}}class Pp extends Lp{deprecated}(0,We.yu)(Pp,{pureId:(0,We.Ru)(),pureType:(0,We.Ru)(),deprecated:(0,We.Ru)()});class bp extends Lp{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,We.yu)(bp,{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 Dp extends Lp{RO;notpublic;user;file;line;column}(0,We.yu)(Dp,{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 Mp{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)(Mp,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.classPath?(0,We.vB)(bp,e):e.file?(0,We.vB)(Dp,e):(0,We.vB)(Pp,e))),id:(0,We.Ru)(),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const Fp=e=>e.startsWith("/")?e.substring(1,e.length):e;class kp{content;RO;constructor(){(0,S.rC)(this,{content:S.LO,hashCode:S.Fl,setContent:S.aD})}setContent(e){this.content=e}get hashCode(){return Un(this.content)}}(0,We.yu)(kp,{content:(0,We.Ru)(),RO:(0,We.Ru)()});class Up{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class jp extends Up{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var Gp;!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_"}(Gp=Gp||(Gp={}));const Vp=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Bp{source;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(Bp,{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 $p{first;second}(0,We.yu)($p,{first:(0,We.Ru)(),second:(0,We.pb)((0,We.Ry)(Bp))});class zp{uuid=(0,n.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class Hp{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 Yp extends zp{editorStore;constructor(e){super(),this.editorStore=e}}class Wp extends Hp{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof i_&&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:Ds.CAUTION,actions:[{label:"Proceed",type:Ms.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]}):super.closeTab(e)}}var Kp;!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"}(Kp=Kp||(Kp={}));const Xp={[Kp.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Kp.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Kp.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Kp.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Kp.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Kp.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Kp.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Kp.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Kp.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Zp;!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"}(Zp=Zp||(Zp={}));const qp={[Zp.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Zp.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Zp.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Zp.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Jp;!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"}(Jp=Jp||(Jp={}));const Qp={[Jp.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Jp.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Jp.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Jp.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Jp.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Jp.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Jp.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Jp.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var e_;!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"}(e_=e_||(e_={}));class t_{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 v.PURE;case"java":return v.JAVA;case"md":return v.MARKDOWN;case"sql":return v.SQL;case"json":return v.JSON;case"xml":return v.XML;case"yml":case"yaml":return v.YAML;case"graphql":return v.GRAPHQL;default:return v.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 s_{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class i_ extends Yp{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 t_(this)}get label(){return Fp(this.filePath)}get description(){return`File: ${Fp(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return H(L(this.filePath.split("/")))}match(e){return e instanceof i_&&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 s_(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??Rp,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??Rp)}registerCommands(){this.textEditorState.language===v.PURE&&(this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.GO_BACK,action:()=>{(0,S.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column);(0,S.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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:Jp.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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:Ds.CAUTION,actions:[{label:"Compile and Proceed",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.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===wp.ENUM_VALUE?Gp.ENUM:t.pureType===wp.PROPERTY||t.pureType===wp.QUALIFIED_PROPERTY?Gp.PROPERTY:Gp.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===v.PURE&&[Jp.GO_TO_DEFINITION,Jp.GO_BACK,Jp.REVEAL_CONCEPT_IN_TREE,Jp.FIND_USAGES,Jp.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e))),[Jp.GO_TO_LINE,Jp.TOGGLE_TEXT_WRAP].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class a_{editorStore;treeData;selectedNode;loadInitialDataState=kt.create();refreshDataState=kt.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 n_{id;path;RO}class r_ extends n_{file;statusType}(0,We.yu)(r_,{id:(0,We.Ru)(),path:(0,We.Ru)(),file:(0,We.Ru)(),statusType:(0,We.Ru)(),RO:(0,We.Ru)()});class o_ extends n_{repo}(0,We.yu)(o_,{id:(0,We.Ru)(),path:(0,We.Ru)(),repo:(0,We.Ru)(),RO:(0,We.Ru)()});class l_{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof o_}get isFileNode(){return this.li_attr instanceof r_}get isRepoNode(){return this.li_attr instanceof o_&&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)(l_,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.file?(0,We.vB)(r_,e):(0,We.vB)(o_,e))),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const c_=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},d_=e=>`file_${e}`;class h_ extends a_{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)(l_,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)(l_,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(Ip.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=c_(i);for(const e of s){const s=H(this.getTreeData().nodes.get(d_(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(d_(e)),`Can't find node with path '${e}'`))}}const u_=e=>{const t=e.trim(),s=t.lastIndexOf(Ce);if(!(s<=0))return t.substring(0,s)};class p_ extends a_{loadConceptActivity=kt.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)(Mp,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)(Mp,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 bp||e.data.li_attr instanceof Dp)&&("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 Up(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(Ip.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=u_(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 Pp)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)($p,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(wu(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 wp.PROPERTY:case wp.QUALIFIED_PROPERTY:W(s,bp),a=await this.editorStore.findConceptUsages(Gp.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case wp.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)($p,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=wu(i)?.concat(Ce).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(wu(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(Gp.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 __{cached;datamarts;text}(0,We.yu)(__,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)()});class m_ extends __{error;sessionError}(0,We.yu)(m_,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)(),error:(0,We.Ru)(),sessionError:(0,We.Ru)()});class g_ extends m_{RO;line;column;source}(0,We.yu)(g_,{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 E_{text;reinit}class f_ extends E_{cache;modifiedFiles=[]}(0,We.yu)(f_,{text:(0,We.Ru)(),cache:(0,We.Ru)(),modifiedFiles:(0,We.pb)((0,We.Ru)()),reinit:(0,We.Ru)()});class T_ extends E_{RO;line;column;source;error;sessionError}(0,We.yu)(T_,{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 C_{RO;line;column;source}(0,We.yu)(C_,{RO:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),source:(0,We.Ru)()});class S_ extends E_{jumpTo}(0,We.yu)(S_,{text:(0,We.Ru)(),jumpTo:(0,We.Ry)(C_)});class x_{uuid=(0,n.Z)();sourceID;line;column;foundName}(0,We.yu)(x_,{sourceID:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),foundName:(0,We.Ru)()});class N_{uuid=(0,n.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,We.yu)(N_,{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 A_ extends T_{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,We.yu)(A_,{candidateName:(0,We.Ru)(),candidatesWithPackageImported:(0,We.pb)((0,We.Ry)(x_)),candidatesWithPackageNotImported:(0,We.pb)((0,We.Ry)(N_))});class v_ extends T_{candidateName;candidates=[]}(0,We.yu)(v_,{candidateName:(0,We.Ru)(),candidates:(0,We.pb)((0,We.Ry)(N_))});class I_{id;parentId;file;line;column}(0,We.yu)(I_,{id:(0,We.Ru)(),parentId:(0,We.Ru)(),file:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)()});class O_{children=[];li_attr;text;type}(0,We.yu)(O_,{children:(0,We.pb)((0,We.Ry)(O_)),li_attr:(0,We.Ry)(I_),text:(0,We.Ru)(),type:(0,We.Ru)()});class y_ extends E_{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,We.yu)(y_,{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)(O_))});class R_{uuid=(0,n.Z)()}class w_{before;found;after}(0,We.yu)(w_,{after:(0,We.Ru)(),before:(0,We.Ru)(),found:(0,We.Ru)()});class L_{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)(L_,{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)(w_))});class P_ extends R_{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 b_,D_,M_;(0,We.yu)(P_,{sourceId:(0,We.Ru)(),coordinates:(0,We.pb)((0,We.Ry)(L_))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(b_=b_||(b_={}));class F_{status;test}class k_ extends F_{test=[]}(0,We.yu)(k_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)())});class U_{text;RO;line;column;source;error}(0,We.yu)(U_,{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 j_ extends F_{test=[];error}(0,We.yu)(j_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)()),error:(0,We.Ry)(U_)});class G_{}class V_ extends G_{finished;tests=[]}(0,We.yu)(V_,{finished:(0,We.Ru)(),tests:(0,We.pb)((0,We.PG)((()=>We.AM),(e=>e.error?(0,We.vB)(j_,e):(0,We.vB)(k_,e))))});class B_ extends G_{error;text}(0,We.yu)(B_,{error:(0,We.Ru)(),text:(0,We.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(D_=D_||(D_={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(M_=M_||(M_={}));class $_{_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?D_.FAILED:this.passed?D_.PASSED:D_.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case b_.PASSED:this.passedTests.add(t);break;case b_.FAILED:this.failedTests.set(t,K(e,j_));break;case b_.ERROR:this.testsWithError.set(t,K(e,j_));break;default:throw new j(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class z_{editorStore;testExecutionResult;checkTestRunnerState=kt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=kt.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 $_(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)(B_,s):(0,We.vB)(V_,s);var s;return t instanceof V_?(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 H_{}class Y_ extends H_{error;errorDialog;text}(0,We.yu)(Y_,{error:(0,We.Ru)(),errorDialog:(0,We.Ru)(),text:(0,We.Ru)()});class W_{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}'`:`'${vp}'`,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:Gp.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 K_{_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 X_{_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 jn([Gn.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),$n(this.parameters,this.body)])}}class Z_ extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class q_ extends Z_{ownerReference;constructor(e){const t=or.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new q_(e)}}class J_{_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 jn([Gn.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}}class em{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return jn([Gn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new em(0,0);static ZERO_ONE=new em(0,1);static ZERO_MANY=new em(0,void 0);static ONE=new em(1,1);static ONE_MANY=new em(1,void 0)}class tm extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class sm extends tm{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new sm(e)}}class im extends Zn{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new im(Ae.STRING);static BOOLEAN=new im(Ae.BOOLEAN);static BINARY=new im(Ae.BINARY);static NUMBER=new im(Ae.NUMBER);static INTEGER=new im(Ae.INTEGER);static FLOAT=new im(Ae.FLOAT);static DECIMAL=new im(Ae.DECIMAL);static DATE=new im(Ae.DATE);static STRICTDATE=new im(Ae.STRICTDATE);static DATETIME=new im(Ae.DATETIME);static STRICTTIME=new im(Ae.STRICTTIME);static LATESTDATE=new im(Ae.LATESTDATE)}var am;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(am=am||(am={}));class nm extends sp{association;constructor(e,t,s,i,a){super(e,s,i,a),this.association=t}get hashCode(){return jn([jh.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const rm=()=>new Xn(""),om=(e,t)=>new Q_("",em.ONE,q_.create(new J_(e)),t),lm=(0,S.aD)(((e,t)=>{e.value=t})),cm=((0,S.aD)(((e,t)=>{M(e.properties,t)})),(0,S.aD)(((e,t)=>{b(e.properties,xh(t))}))),dm=((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,Nh(t))})),(0,S.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,S.aD)(((e,t)=>{b(e.constraints,vh(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,hh(t))}))),hm=((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)=>{hh(e),dh(t),e.value=t,e.ownerReference.value=t.rawType}))),um=((0,S.aD)(((e,t)=>{e.name=t})),(0,S.aD)(((e,t)=>{hm(e.genericType,dh(t))})),(0,S.aD)(((e,t)=>{e.multiplicity=t})),(0,S.aD)(((e,t)=>{e.aggregation=t})),(0,S.aD)(((e,t)=>{e.value=_h(t),lm(e.ownerReference,t._OWNER)})),(0,S.aD)(((e,t)=>{b(e.taggedValues,ch(t))})),(0,S.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,S.aD)(((e,t)=>{b(e.stereotypes,oh(t))})),(0,S.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,S.aD)(((e,t)=>{e.tag.value=mh(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=vr(t)})),(0,S.aD)(((e,t)=>{b(e.p_tags,mh(t))})),(0,S.aD)(((e,t)=>{M(e.p_tags,t)})),(0,S.aD)(((e,t)=>{b(e.p_stereotypes,_h(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)=>{lm(e.returnType,Rh(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,Eh(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=Eh(t),lm(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,Xn,`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 J_(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,S.aD)(((e,t)=>{e.canonicalUnit=Ch(t)})),(0,S.aD)(((e,t)=>{e.conversionFunction=vr(t)})),(0,S.aD)(((e,t)=>{e.classViews=t.map(Ph)}))),pm=(0,S.aD)(((e,t)=>{b(e.classViews,Ph(t))})),_m=(0,S.aD)(((e,t)=>{M(e.classViews,t)})),mm=(0,S.aD)(((e,t)=>{e.associationViews=t.map(Fh)})),gm=(0,S.aD)(((e,t)=>{M(e.associationViews,t)})),Em=(0,S.aD)(((e,t)=>{e.generalizationViews=t.map(Mh)})),fm=(0,S.aD)(((e,t)=>{b(e.generalizationViews,Mh(t))})),Tm=(0,S.aD)(((e,t)=>{M(e.generalizationViews,t)})),Cm=(0,S.aD)(((e,t)=>{e.propertyViews=t.map(kh)})),Sm=(0,S.aD)(((e,t)=>{b(e.propertyViews,kh(t))})),xm=(0,S.aD)(((e,t)=>{M(e.propertyViews,t)})),Nm=(0,S.aD)(((e,t)=>{e.hideProperties=t})),Am=(0,S.aD)(((e,t)=>{e.hideStereotypes=t})),vm=(0,S.aD)(((e,t)=>{e.hideTaggedValues=t})),Im=(0,S.aD)(((e,t)=>{e._offsetX=t})),Om=(0,S.aD)(((e,t)=>{e._offsetY=t})),ym=(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)})),Rm=(0,S.aD)(cp),wm=(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 np(a.x,a.y).normal(new np(l.x,l.y)).unit(),d=np.fromPoints(a,new Ku(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 Ku(t,s),r.push(o))}e<n.length-2&&r.push(n[e+1])}return o&&a&&lp(e,r),o})),Lm=(0,S.aD)(lp),Pm=(0,S.aD)(((e,t)=>{e.rectangle=t})),bm=(0,S.aD)(((e,t)=>{e.position=t})),Dm=(0,S.aD)((e=>{e._dummyObservable={}}));var Mm,Fm,km;!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"}(Mm=Mm||(Mm={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Fm=Fm||(Fm={})),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"}(km=km||(km={}));const Um=.05,jm=[50,75,90,100,110,125,150,200,250,300,400],Gm=e=>(e instanceof X_?"/ ":"")+e.name;class Vm{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 Xu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ku(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 Ku(0,0),this.virtualScreen=new Zu(new Ku(0,0),new Xu(0,0)),this.zoom=1,this.triangle=[new Ku(0,0),new Ku(-15,-10),new Ku(-15,10)],this.diamond=[new Ku(0,0),new Ku(-10,-5),new Ku(-20,0),new Ku(-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=Mm.LAYOUT,this.relationshipMode=Fm.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 Ku(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Ku(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setEnableLayoutAutoAdjustment(e){this.enableLayoutAutoAdjustment=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(e){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh(),e?.initial&&(this.autoRecenter(),(this.canvas.width<this.virtualScreen.rectangle.width+2*this.screenPadding+20||this.canvas.height<this.virtualScreen.rectangle.height+2*this.screenPadding+20)&&this.zoomToFit())}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new Xu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ku(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 Ku(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Mm.LAYOUT:case Mm.PAN:case Mm.ZOOM_IN:case Mm.ZOOM_OUT:case Mm.ADD_CLASS:if(t!==Fm.NONE)throw new U(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Mm.ADD_RELATIONSHIP:if(t===Fm.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===Mm.ADD_RELATIONSHIP)switch(t){case Fm.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||ju(e.class.value).includes(t.class.value)||ju(t.class.value).includes(e.class.value)||dm(e.class.value,q_.create(new J_(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new ap(this.diagram,e,t);return fm(this.diagram,s),s}};break;case Fm.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new Q_(`property_${e.class.value.properties.length+1}`,em.ONE,q_.create(new J_(t.class.value)),e.class.value);if(cm(e.class.value,s),e!==t){const i=new ip(this.diagram,sm.create(s),e,t);return Sm(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 km.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>bm(t,new Ku(e,t.position.y))));break}case km.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=>bm(t,new Ku(e-t.rectangle.width/2,t.position.y))));break}case km.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=>bm(t,new Ku(e-t.rectangle.width,t.position.y))));break}case km.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>bm(t,new Ku(t.position.x,e))));break}case km.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=>bm(t,new Ku(t.position.x,e-t.rectangle.height/2))));break}case km.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=>bm(t,new Ku(t.position.x,e-t.rectangle.height))));break}case km.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];bm(s,new Ku(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];bm(a,new Ku(i.position.x+i.rectangle.width+s,a.position.y))}}break}case km.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];bm(s,new Ku(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];bm(a,new Ku(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 Ku((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 Ku((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}resolveMouseEventCoordinate(e){if(e.target instanceof HTMLElement){const t=rp(e.target);return new Ku(t.x+e.offsetX,t.y+e.offsetY)}return new Ku(e.x,e.y)}eventCoordinateToCanvasCoordinate(e){return new Ku(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Ku(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 rp(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=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof ip){const r=this.drawLinePropertyText(H(n[n.length-2],"Diagram path expected to have at least 2 points"),H(n[n.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,up(r).x),a=Math.max(a,up(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 Zu(new Ku(t,s),new Xu(i-t,a-s))}else this.setZoomLevel(1),this.screenOffset=new Ku(0,0),this.virtualScreen=new Zu(new Ku(this.canvasDimension.width/2,this.canvasDimension.height/2),new Xu(0,0))}executeZoom(e,t){e=Math.max(e,Um);const s=this.zoom;this.setZoomLevel(e),this.screenOffset=new Ku(((t.x-this.canvasCenter.x)*(s-e)+this.screenOffset.x*s)/e,((t.y-this.canvasCenter.y)*(s-e)+this.screenOffset.y*s)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Um)),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)),Um))}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 qu(this.diagram,i,or.create(e));return bm(a,t??this.canvasCoordinateToModelCoordinate(new Ku(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),pm(this.diagram,a),Dm(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)&&fm(this.diagram,new ap(this.diagram,a,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&fm(this.diagram,new ap(this.diagram,t,a)),Gu(e).forEach((e=>{e.genericType.value.rawType===s&&Sm(this.diagram,new ip(this.diagram,sm.create(e),a,t))})),Gu(s).forEach((s=>{s.genericType.value.rawType===e&&Sm(this.diagram,new ip(this.diagram,sm.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=Gm(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 qn&&(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||(Gu(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;Pm(e,new Xu(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 Gu(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof X_?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof im?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}}Dm(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,a,n){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Gm(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 Ku(t(l),s(l)));n||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=a(c),m=this.modelCoordinateToCanvasCoordinate(new Ku(i(c),a(c)));n||this.ctx.fillText(o,m.x,m.y);const g=new Ku(Math.min(d,p),Math.min(h,_));return new Zu(g,new Xu(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 Zu(new Ku(0,0),new Xu(0,0))}drawPropertyOrAssociation(e){const t=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(H(t[t.length-2],"Diagram path expected to have at least 2 points"),H(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof 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===am.COMPOSITE||s.aggregation===am.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+dp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[0],e))*this.zoom),s.aggregation===am.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===am.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=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=H(s[s.length-2],"Diagram path expected to have at least 2 points").x,a=H(s[s.length-2],"Diagram path expected to have at least 2 points").y,n=H(s[s.length-1],"Diagram path expected to have at least 2 points").x,r=H(s[s.length-1],"Diagram path expected to have at least 2 points").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+dp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+hp(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)&&Lm(e,e.path.map((e=>new Ku(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!==Mm.ZOOM_IN?Mm.ZOOM_IN:Mm.ZOOM_OUT,Fm.NONE)}switchToViewMode(){this.changeMode(Mm.LAYOUT,Fm.NONE)}switchToPanMode(){this.changeMode(Mm.PAN,Fm.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Mm.ADD_RELATIONSHIP,Fm.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Mm.ADD_RELATIONSHIP,Fm.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Mm.ADD_CLASS,Fm.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Xn&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ku(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Xn&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}getSuperTypeLevels(e,t,s,i){if(e.length){const a=(0,rs.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new qu(t,(0,n.Z)(),or.create(Uu(e.value,Xn))))))),(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)&&(bm(t[0],new Ku(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];bm(e,new Ku(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 ap(t,s,e):[]))))))]}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{_m(this.diagram,e),mm(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Em(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Cm(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof nm?gm(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof ip&&xm(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Tm(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=>{Nm(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Am(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{vm(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=>pm(this.diagram,e))),t[1].forEach((e=>fm(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,rs.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new qu(this.diagram,(0,n.Z)(),or.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=>pm(this.diagram,e))),t[1].forEach((e=>fm(this.diagram,e)))}this.drawScreen()}}mouseup(e){const t=this.resolveMouseEventCoordinate(e);if(!this.isReadOnly)switch(this.interactionMode){case Mm.LAYOUT:this.diagram.generalizationViews.forEach((e=>Rm(e))),this.diagram.associationViews.forEach((e=>Rm(e))),this.diagram.propertyViews.forEach((e=>Rm(e)));break;case Mm.ADD_CLASS:{const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));this.onAddClassViewClick(e),this.changeMode(Mm.LAYOUT,Fm.NONE);break}case Mm.ZOOM_IN:{const e=Math.round(100*this.zoom);let s;s=e<=jm[0]-10?10*Math.floor(e/10)+10:e>=jm[jm.length-1]?100*Math.floor(e/100)+100:H(jm.find((t=>t>e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Mm.ZOOM_OUT:{const e=Math.round(100*this.zoom);let s;s=e<=jm[0]?10*Math.ceil(e/10)-10:e>=jm[jm.length-1]+100?100*Math.ceil(e/100)-100:H((0,yu.Z)(jm,(t=>t<e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Mm.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));for(let t=this.diagram.classViews.length-1;t>=0;t--){const s=this.diagram.classViews[t];if(s.contains(e.x,e.y)){const t=this.handleAddRelationship(this.startClassView,s);t&&(Im(t.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Om(t.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Im(t.to,-(s.position.x+s.rectangle.width/2-e.x)),Om(t.to,-(s.position.y+s.rectangle.height/2-e.y)))}}this.changeMode(Mm.LAYOUT,Fm.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){const t=this.resolveMouseEventCoordinate(e);if([Mm.ADD_RELATIONSHIP,Mm.ADD_CLASS,Mm.ZOOM_IN,Mm.ZOOM_OUT].includes(this.interactionMode))return;const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,s,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,s);const i=this.diagram.classViews.find((e=>e.contains(s.x,s.y)));i&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(i,s):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,s,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(s)}mousedown(e){const t=this.resolveMouseEventCoordinate(e);this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const s=this.eventCoordinateToCanvasCoordinate(t),i=this.canvasCoordinateToModelCoordinate(s);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Mm.PAN:return void(this.positionBeforeLastMove=t);case Mm.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(pp(t).contains(i.x,i.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||um(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:i},this.setSelectedClasses([]);else{let e=!1;for(let t=this.diagram.classViews.length-1;t>=0;t--){const a=this.diagram.classViews[t];if(a.contains(i.x,i.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(a)||this.setSelectedClasses([a]),this.isReadOnly||um(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=s.x/this.zoom-this.screenOffset.x,this.clickY=s.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Ku(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=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(i)}}break;case Mm.ADD_RELATIONSHIP:this.setSelectionStart(i),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(i.x,i.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Mm.LAYOUT,Fm.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=t);if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=t,void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,i),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.resolveMouseEventCoordinate(e);if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const s=this.zoom-e.deltaY/120*.05;this.executeZoom(s,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)))}mousemove(e){const t=this.resolveMouseEventCoordinate(e);if(this.cursorPosition=t,this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Mm.PAN)this.screenOffset=new Ku(this.screenOffset.x+(t.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(t.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=t,this.clearScreen(),this.drawAll();else if(this.leftClick){const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);switch(this.interactionMode){case Mm.LAYOUT:if(this.selectedClassCorner&&(Pm(this.selectedClassCorner,new Xu(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Dm(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let t=0,s=0;this.selectedClasses.forEach(((i,a)=>{const n=this._selectedClassesInitialPositions.length>a?this._selectedClassesInitialPositions[a]:void 0;if(n){const a=e.x/this.zoom-this.screenOffset.x-(this.clickX-n.oldPos.x),r=e.y/this.zoom-this.screenOffset.y-(this.clickY-n.oldPos.y);t=i.position.x-a,s=i.position.y-r,bm(i,new Ku(a,r)),Dm(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,t,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?ym(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&ym(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(t.x,t.y,e.x-t.x,e.y-t.y),this.ctx.strokeRect(t.x,t.y,e.x-t.x,e.y-t.y);const s=(e.x-t.x)/this.zoom,i=(e.y-t.y)/this.zoom;this.selection=new Zu(new Ku(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Xu(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(_p(this.selection,e)||_p(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Mm.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const t of this.diagram.classViews.slice().reverse())if(t.contains(s.x,s.y)){this.setMouseOverClassView(t),pp(t).contains(s.x,s.y)&&this.setMouseOverClassCorner(t);const i=t.class.value;let a=t.position.y+this.classViewSpaceY;a+=t.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const n=this.computeClassNameWidth(t);new Zu(this.modelCoordinateToCanvasCoordinate(new Ku(t.position.x+(t.rectangle.width-n)/2,a)),new Xu(n,this.lineHeight)).contains(e.x,e.y)&&this.setMouseOverClassName(t),a+=this.lineHeight,a+=t.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,a+=2*this.classViewSpaceY;for(const s of Gu(i))this.hasPropertyView(t,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Zu(this.modelCoordinateToCanvasCoordinate(new Ku(t.position.x+this.classViewSpaceX,a)),new Xu(this.drawClassViewProperty(t,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(e.x,e.y)&&this.setMouseOverClassProperty(s),a+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(H(t[t.length-2],"Diagram path expected to have at least 2 points"),H(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}}class Bm{_UUID=(0,n.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return jn([Gn.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class $m extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class zm extends $m{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new zm(e)}}class Hm extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class Ym extends Hm{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Ym(e)}}class Wm extends Wn{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[om(rm(),rm()),om(rm(),rm())];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 Xn&&t.genericType.value.rawType instanceof Xn){const s=K(e.genericType.value.rawType,Xn),i=K(t.genericType.value.rawType,Xn);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return jn([Gn.ASSOCIATION,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Km extends Wn{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return jn([Gn.MAPPING,this.path,jn(this.classMappings),jn(this.enumerationMappings),jn(this.associationMappings),jn(this.test),jn(this.includes),jn(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class Xm extends Wn{p_stereotypes=[];p_tags=[];get _elementHashCode(){return jn([Gn.PROFILE,this.path,jn(this.p_stereotypes.map((e=>e.value))),jn(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class Zm extends Wn{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 jn([Gn.SERVICE,jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),this.path,this.pattern,jn(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",jn(this.tests),jn(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class qm extends Wn{functionName;constructor(e){super(e),this.functionName=e}}class Jm extends qm{}class Qm extends Jm{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return jn([Gn.FUNCTION,this.path,jn(this.parameters),this.returnType.valueForSerialization??"",jn(this.taggedValues),jn(this.stereotypes.map((e=>e.pointerHashCode))),$n(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class eg extends Wn{includes=[]}class tg extends eg{sections=[];get _elementHashCode(){return jn([Gn.FLAT_DATA,this.path,jn(this.includes.map((e=>e.valueForSerialization??""))),jn(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class sg extends Wn{runtimeValue;get _elementHashCode(){return jn([Gn.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class ig extends Wn{connectionValue;get _elementHashCode(){return jn([Gn.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class ag extends Wn{}class ng extends ag{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return jn([Gn.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",jn(this.scopeElements.map((e=>e instanceof rr?e.valueForSerialization??"":e))),jn(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class rg extends Wn{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return jn([Gn.GENERATION_TREE,this.path,jn(this.generationNodes),jn(this.fileGenerations.map((e=>zn(Me.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class og extends eg{schemas=[];joins=[];filters=[];get _elementHashCode(){return jn([Gn.DATABASE,this.path,jn(this.includes.map((e=>e.valueForSerialization??""))),jn(this.schemas),jn(this.joins),jn(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class lg{_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 cg extends Wn{data;get hashCode(){return jn([Gn.DATA_ELEMENT,this.path,jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}class dg extends Wn{executionParameters=[];get _elementHashCode(){return jn([Gn.EXECUTION_ENVIRONMENT_INSTANCE,this.path,jn(this.executionParameters)])}accept_PackageableElementVisitor(e){return e.visit_ExecutionEnvironmentInstance(this)}}const hg=new Set([Wn,Kn,Zn,im,Xn,Wm,qn,Qm,Xm,Qn,Jn,cg,eg,Km,ig,sg,rg,ng,Zm,dg,class extends Wn{sections=[];get _elementHashCode(){return jn([Gn.SECTION_INDEX,this.path,jn(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}}]);class ug{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 er(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(hg.has(e))throw new U("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new lg(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(qn))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(Qn))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(Xn))}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(tg))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(og))}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 Xn?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof qn?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof Qn?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),og,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),tg,`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((()=>Fu(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){bu(t?ku(this,t,void 0):this.root,e),e instanceof Km?this.setOwnMapping(e.path,e):e instanceof eg?this.setOwnStore(e.path,e):e instanceof Kn?this.setOwnType(e.path,e):e instanceof Wm?this.setOwnAssociation(e.path,e):e instanceof Xm?this.setOwnProfile(e.path,e):e instanceof Qm?this.setOwnFunction(e.path,e):e instanceof Zm?this.setOwnService(e.path,e):e instanceof ig?this.setOwnConnection(e.path,e):e instanceof sg?this.setOwnRuntime(e.path,e):e instanceof ng?this.setOwnFileGeneration(e.path,e):e instanceof rg?this.setOwnGenerationSpecification(e.path,e):e instanceof cg?this.setOwnDataElement(e.path,e):e instanceof dg?this.setOwnExecutionEnvironment(e.path,e):e instanceof er||this.getExtensionForElementClass(y(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&Du(e.package,e),e instanceof Km?this.mappingsIndex.delete(e.path):e instanceof eg?this.storesIndex.delete(e.path):e instanceof Kn?(this.typesIndex.delete(e.path),e instanceof Qn&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof Wm?this.associationsIndex.delete(e.path):e instanceof Xm?this.profilesIndex.delete(e.path):e instanceof Qm?this.functionsIndex.delete(e.path):e instanceof Zm?this.servicesIndex.delete(e.path):e instanceof sg?this.runtimesIndex.delete(e.path):e instanceof ig?this.connectionsIndex.delete(e.path):e instanceof ng?this.fileGenerationsIndex.delete(e.path):e instanceof rg?this.generationSpecificationsIndex.delete(e.path):e instanceof cg?this.dataElementsIndex.delete(e.path):e instanceof dg?this.executionEnvironmentIndex.delete(e.path):e instanceof er?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 er&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof er)&&!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]=Lu(s);if(!(e instanceof er)){const t=this.getNullablePackage(i)??(""!==i?ku(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}_${Vu(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Vu(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(n))))),e.package!==t&&(e.package&&Du(e.package,e),bu(t,e))}var n,r;if(e instanceof Km)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof eg)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof Kn)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof Qn&&(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 Wm)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof Xm)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 Zm)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof sg)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof ig)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof ng)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof cg)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof dg)this.executionEnvironmentIndex.delete(t),this.executionEnvironmentIndex.set(s,e);else if(e instanceof rg)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof er){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)){Du(r,e);const t=""!==i?ku(this,i,void 0):this.root;bu(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 pg{}class _g extends pg{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class mg extends ug{constructor(e,t,s){super(t.name,e,s),this.root=t}}const gg=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Eg{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new er(e);this.roots.push(s),this.projectDependencyModelsIndex.set(e,new mg(this.extensionElementClasses,s,new _g(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=gg(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=gg(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=gg(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=gg(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=gg(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=gg(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=gg(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=gg(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=gg(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=gg(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=gg(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=gg(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=gg(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=gg(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=gg(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=gg(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnExecutionEnvironment=gg(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 fg extends eg{static NAME="ModelStore";static INSTANCE=new fg;constructor(){super(fg.NAME)}accept_PackageableElementVisitor(e){throw new j}}class Tg extends ug{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Ne.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(fg.NAME,fg.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[im.STRING,im.BOOLEAN,im.BINARY,im.NUMBER,im.INTEGER,im.FLOAT,im.DECIMAL,im.DATE,im.STRICTDATE,im.DATETIME,im.STRICTTIME,im.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Cg extends ug{autoImports=[];constructor(e){super(Ne.SYSTEM,e)}initializeAutoImports(){this.autoImports=ye.map((e=>K(this.getOwnNullableElement(e,!0),er,`Can't find auto-import package '${e}'`)))}}class Sg extends ug{constructor(e){super(Ne.MODEL_GENERATION,e)}}class xg extends ug{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 Sg(i),this.dependencyManager=new Eg(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),qn,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),Qn,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),Jn,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),Xn,`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),Xn),`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),tg,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),og,`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=em.ONE:0===e&&1===t?s=em.ZERO_ONE:0===e&&void 0===t?s=em.ZERO_MANY:1===e&&void 0===t?s=em.ONE_MANY:0===e&&0===t&&(s=em.ZERO),s??new em(e,t)}addElement(e,t){const s=Pu(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 Ng{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ag{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class vg{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(vg,{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 Ig=(0,We.PG)((()=>We.AM),(e=>(e.sourceId=e.source,(0,We.vB)(vg,e))));class Og{package;name;tags=[];stereotypes=[]}(0,We.yu)(Og,{name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ru)()),tags:(0,We.pb)((0,We.Ru)())});class yg{profile;value}(0,We.yu)(yg,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class Rg{profile;value}(0,We.yu)(Rg,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class wg{tag;value}(0,We.yu)(wg,{tag:(0,We.Ry)(Rg),value:(0,We.Ru)()});class Lg{rawType;typeParameter}(0,We.yu)(Lg,{rawType:(0,We.jt)((0,We.Ru)()),typeParameter:(0,We.jt)((0,We.Ru)())});class Pg{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,We.yu)(Pg,{aggregation:(0,We.Ru)(),genericType:(0,We.Ry)(Lg),multiplicity:(0,We.Ru)(),name:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg))});class bg{package;name;sourceInformation}(0,We.yu)(bg,{name:(0,We.Ru)(),package:(0,We.Ru)(),sourceInformation:Ig});class Dg{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,We.yu)(Dg,{generalizations:(0,We.pb)((0,We.Ry)(Lg)),name:(0,We.Ru)(),package:(0,We.Ru)(),properties:(0,We.pb)((0,We.Ry)(Pg)),qualifiedProperties:(0,We.pb)((0,We.Ry)(Pg)),sourceInformation:Ig,stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg))});class Mg{package;name;enumValues=[]}(0,We.yu)(Mg,{name:(0,We.Ru)(),package:(0,We.Ru)(),enumValues:(0,We.pb)((0,We.Ru)())});class Fg{x;y}(0,We.yu)(Fg,{x:(0,We.Ru)(),y:(0,We.Ru)()});class kg{height;width}(0,We.yu)(kg,{height:(0,We.Ru)(),width:(0,We.Ru)()});class Ug{points=[]}(0,We.yu)(Ug,{points:(0,We.pb)((0,We.Ry)(Fg))});class jg{id;source;target;geometry}(0,We.yu)(jg,{geometry:(0,We.Ry)(Ug),id:(0,We.Ru)(),source:(0,We.Ru)(),target:(0,We.Ru)()});class Gg{name;owningType}(0,We.yu)(Gg,{name:(0,We.Ru)(),owningType:(0,We.Ru)()});class Vg{id;source;target;property;geometry}(0,We.yu)(Vg,{geometry:(0,We.Ry)(Ug),id:(0,We.Ru)(),property:(0,We.Ry)(Gg),source:(0,We.Ru)(),target:(0,We.Ru)()});class Bg{id;type;position;rectangleGeometry}(0,We.yu)(Bg,{id:(0,We.Ru)(),position:(0,We.Ry)(Fg),rectangleGeometry:(0,We.Ry)(kg),type:(0,We.Ru)()});class $g{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,We.yu)($g,{name:(0,We.Ru)(),generalizationViews:(0,We.pb)((0,We.Ry)(jg)),package:(0,We.Ru)(),propertyViews:(0,We.pb)((0,We.Ry)(Vg)),sourceInformation:Ig,stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg)),typeViews:(0,We.pb)((0,We.Ry)(Bg))});class zg{classes=[];enumerations=[];profiles=[]}(0,We.yu)(zg,{classes:(0,We.pb)((0,We.Ry)(Dg)),enumerations:(0,We.pb)((0,We.Ry)(Mg)),profiles:(0,We.pb)((0,We.Ry)(Og))});class Hg{name;diagram;domainInfo}(0,We.yu)(Hg,{diagram:(0,We.Ry)($g),name:(0,We.Ru)(),domainInfo:(0,We.jt)((0,We.Ry)(zg))});class Yg{class;enumerations=[];profiles=[];specializations=[]}(0,We.yu)(Yg,{class:(0,We.Ry)(Dg),enumerations:(0,We.pb)((0,We.Ry)(Mg)),profiles:(0,We.pb)((0,We.Ry)(Og)),specializations:(0,We.pb)((0,We.Ry)(bg))});const Wg=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}`},Kg=(e,t,s,i)=>{const a=t.getOwnNullableClass(e);if(!a){const[a,n]=Lu(e),r=new Xn(n);return bu(Fu(t.root,a,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return a},Xg=e=>{if("*"===e)return new em(0,void 0);{const t=e.split("..");if(1===t.length)return new em(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new em(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},Zg=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,a;b(e.taggedValues,new Bm(zm.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,Ym.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=Kg(H(t.rawType),s,i,void 0);b(e.generalizations,q_.create(new J_(a))),b(a._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const a=new Q_(t.name,Xg(t.multiplicity),q_.create(new J_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Kg(H(t.genericType.rawType),s,i,void 0))),e);a.aggregation="Composite"===t.aggregation?am.COMPOSITE:"Shared"===t.aggregation?am.SHARED:void 0,b(e.properties,a)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new X_(t.name,Xg(t.multiplicity),q_.create(new J_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Kg(H(t.genericType.rawType),s,i,void 0))),e))}))},qg=e=>{const t=new xg(new Tg([]),new Cg([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Xn(e.name);bu(Fu(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 Xm(e.name);bu(Fu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Ng(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Ag(s,e))))})),i.enumerations.forEach((e=>{const s=new qn(e.name);bu(Fu(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);Zg(a,e,t,s)}))}const i=e.diagram,a=new Gh(i.name);return bu(Fu(t.root,i.package,!0,new Map),a),i.typeViews.forEach((e=>{const s=new qu(a,e.id,or.create(t.getClass(e.type)));s.position=new Ku(e.position.x,e.position.y),s.rectangle=new Xu(e.rectangleGeometry.width,e.rectangleGeometry.height),b(a.classViews,s)})),i.propertyViews.forEach((e=>{const s=new ip(a,sm.create((i=t.getClass(e.property.owningType),n=e.property.name,H(i instanceof Xn?Gu(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 Ku(e.x,e.y))),cp(s),b(a.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new ap(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 Ku(e.x,e.y))),cp(t),b(a.generalizationViews,t)})),[a,t,s]};class Jg extends Yp{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]=qg(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Fp(this.diagramPath)}get description(){return`Diagram: ${Fp(this.diagramPath)}`}get diagramName(){return Ru(this.diagramPath)}match(e){return e instanceof Jg&&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 Mm.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Mm.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Mm.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Mm.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]=qg(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 Up(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 Xm(e.name);bu(Fu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Ng(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Ag(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":Ce}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new qn(e.name);bu(Fu(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 Xn(i.name),bu(Fu(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=Kg(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,q_.create(new J_(i)))})),r&&Zg(n,i,t,s),n})((0,We.vB)(Yg,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:Zp.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Zp.RECENTER,Zp.USE_ZOOM_TOOL,Zp.USE_VIEW_TOOL,Zp.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 eE extends F{}const tE=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,sE=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,iE=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class aE{editorStore;constructor(e){this.editorStore=e}}class nE extends aE{result;constructor(e,t){super(e),this.result=t}}class rE extends aE{result;constructor(e,t){super(e),this.result=t}}class oE{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 P_,s.sourceId=e.source,a.set(e.source,s));const n=new L_(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 lE{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 cE{editorStore;loadState=kt.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)(P_,e))(e)));this.setResult(new lE(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 dE{applicationStore;initState=kt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Op.TERMINAL;auxPanelDisplayState=new K_({initial:0,default:300,snap:100});activeActivity=Ip.CONCEPT_EXPLORER;sideBarDisplayState=new K_({initial:300,default:300,snap:150});tabManagerState=new Wp(this);executionState=kt.create();navigationStack=[];fileSearchCommandLoadState=kt.create();fileSearchCommandState=new Qg;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=kt.create();referenceUsageResult;textSearchState;testRunState=kt.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 cE(this),this.directoryTreeState=new h_(this),this.conceptTreeState=new p_(this),this.client=new W_(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(iE);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 Up(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:iE},commands:[{command:e_.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:e_.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=w(e);!s||s.match(tE)?await(0,S.fl)(t.executeTests(s??vp)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:e_.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=w(e);s?.match(sE)?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:e_.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(sE))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(sE)?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:e_.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(sE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:e_.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(sE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:e_.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,S.fl)(t.loadFile(Np)).catch(t.applicationStore.alertUnhandledError)}},{command:e_.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(tE)?await(0,S.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:e_.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(sE)||s.match(tE)))try{s.match(tE)?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:e_.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(sE)||s.match(tE)||[Ap,vp].includes(s)))try{s.match(tE)||s===vp?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,We.vB)(Mp,e))).map((e=>e.li_attr instanceof Pp?`${Xt.BRIGHT_CYAN}${e.text}${Xt.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,We.vB)(l_,e))).map((e=>e.isFolderNode?`${Xt.BRIGHT_CYAN}${e.text}${Xt.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:e_.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:e_.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:e_.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:e_.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(Np)),n=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(a=yield s).error?a.source?(0,We.vB)(g_,a):(0,We.vB)(m_,a):(0,We.vB)(__,a);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open()),o instanceof m_?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof g_&&(yield(0,S.fl)(this.loadFile(o.source,new jp(o.source,o.line,o.column,new eE((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:Ds.CAUTION,actions:[{label:"Compile to debug",type:Ms.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:Kp.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Kp.SEARCH_TEXT,action:()=>{this.setActiveAuxPanelMode(Op.SEARCH),this.auxPanelDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Kp.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof i_&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Kp.TOGGLE_TERMINAL_PANEL,action:()=>{this.auxPanelDisplayState.isOpen?this.activeAuxPanelMode!==Op.TERMINAL?(this.setActiveAuxPanelMode(Op.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.auxPanelDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Kp.EXECUTE,action:()=>{(0,S.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.FULL_RECOMPILE,action:()=>{(0,S.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,S.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.RUN_ALL_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.RUN_RELAVANT_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Kp.SEARCH_FILE,Kp.SEARCH_TEXT,Kp.GO_TO_FILE,Kp.TOGGLE_TERMINAL_PANEL,Kp.EXECUTE,Kp.FULL_RECOMPILE,Kp.FULL_RECOMPILE_WITH_FULL_INIT,Kp.RUN_ALL_TESTS,Kp.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 Jg&&e.diagramPath===t));a||(yield(0,S.fl)(this.checkIfSessionWakingUp()),a=new Jg(this,(0,We.vB)(Hg,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 i_&&t.filePath===e));s||(yield(0,S.fl)(this.checkIfSessionWakingUp()),s=new i_(this,(0,We.vB)(kp,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof jp&&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 i_&&s.filePath===e)s.setFile((0,We.vB)(kp,await this.client.getFile(e)));else if(s instanceof Jg&&s.filePath===e)try{s.rebuild((0,We.vB)(Hg,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(i_)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof i_?{path:e.filePath,code:e.file.content}:e instanceof Jg?{diagram:e.diagramPath,code:Wg(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)(A_,o):o.candidateName&&o.candidates?(0,We.vB)(v_,o):(0,We.vB)(T_,o):o.jumpTo?(0,We.vB)(S_,o):o.tests?(0,We.vB)(y_,o):(0,We.vB)(f_,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof T_?(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 f_?(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))),e_.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(Y(i_)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof T_)e.source&&(yield(0,S.fl)(this.loadFile(e.source,new jp(e.source,e.line,e.column,new eE(e.text.split("\n").filter(Boolean)[0]))))),e instanceof A_?(this.setCodeFixSuggestion(new nE(this,e)),this.setActiveAuxPanelMode(Op.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()):e instanceof v_&&(this.setCodeFixSuggestion(new rE(this,e)),this.setActiveAuxPanelMode(Op.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof f_){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 T_)e.source&&await(0,S.fl)(this.loadFile(e.source,new jp(e.source,e.line,e.column,new eE(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof y_){this.setActiveAuxPanelMode(Op.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new z_(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}),`${e_.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,S.fl)(this.executeTests(vp,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 S_&&await(0,S.fl)(this.loadFile(e.jumpTo.source,new Up(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:Ds.CAUTION,actions:[{label:"Perform full re-compile",type:Ms.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(Ip.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(i_)).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!==Ip.CONCEPT_EXPLORER&&this.setActiveActivity(Ip.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)(Y_,s):new H_;return!(i instanceof Y_&&(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)(Bp,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 ${Vp(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===wp.ENUM_VALUE?Gp.ENUM:e.pureType===wp.PROPERTY||e.pureType===wp.QUALIFIED_PROPERTY?Gp.PROPERTY:Gp.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,We.qC)(L_,new L_(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,We.vB)(L_,e)));this.setReferenceUsageResult(new oE(this,e,t,s)),this.setActiveAuxPanelMode(Op.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(Op.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(Fp(e))),e_.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(Fp(e))),e_.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)),e_.MOVE)),yield(0,S.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof i_&&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(Fp(e))),e_.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof i_&&(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:Ds.CAUTION,actions:[{label:"Delete anyway",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]})}}const hE=(0,At.createContext)(void 0),uE=({children:e})=>{const t=vn(),s=(0,Nt.fv)((()=>new dE(t)));return(0,T.jsx)(hE.Provider,{value:s,children:e})},pE=()=>H((0,At.useContext)(hE),"Can't find editor store in context"),_E=(0,Nt.Pi)((()=>{const e=pE(),t=vn().terminalService.terminal,s=(0,At.useRef)(null),{ref:i,width:a,height:n}=(0,Va.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===Op.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)(Bi,{})}),(0,T.jsx)("button",{className:(0,Os.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)(zi,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Hi,{})}),(0,T.jsx)("button",{className:(0,Os.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)($i,{})})]})]}),(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)(fi,{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)(Ei,{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,Os.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)(zs,{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)(Ai,{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)(di,{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)(ei,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(Da,{className:"terminal-panel__content",content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Fa,{onClick:o,children:"Copy All"}),(0,T.jsx)(Fa,{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)(Ba,{children:"Terminal is not set up yet"})})})),mE=(0,Nt.Pi)((e=>{const{searchResult:t,result:s}=e,i=pE(),a=vn(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Up(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)(qi,{}):(0,T.jsx)(Qi,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(vi,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:Fp(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)(Ws,{})})]})]}),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)(Ws,{})})})]},e.uuid)))})]})})),gE=(0,Nt.Pi)((e=>{const{searchResult:t}=e,s=pE(),i=vn(),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)(Mi,{})}),(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)(Bi,{})}),!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)(Ki,{})}),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)(Xi,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(mE,{searchResult:t,result:e},e.uuid)))})]})})),EE=(0,Nt.Pi)((()=>{const e=pE(),t=(0,At.useRef)(null),s=e.textSearchState,i=(0,At.useMemo)((()=>(0,Ha.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===Op.SEARCH&&s.focus()}),[s,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(Gs,{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,Os.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)(zi,{})}),(0,T.jsx)("button",{className:(0,Os.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)($i,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(gE,{searchResult:e.textSearchState.result})]})})),fE=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:a,onNodeSelect:n}=e;return(0,T.jsxs)("div",{className:(0,Os.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,Os.clsx)("tree-view__node__icon",{[`${a}__tree-view__node__icon`]:a}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(qi,{}):(0,T.jsx)(Qi,{}))}),(0,T.jsx)("div",{className:(0,Os.clsx)("tree-view__node__label",{[`${a}__tree-view__node__label`]:a}),children:t.label})]})},TE=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:a,classPrefix:n,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:TE,TreeNodeContainer:fE},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,Os.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)))]})},CE=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:TE,TreeNodeContainer:fE},h=a?{...d,...a}:d;return(0,T.jsx)("div",{className:(0,Os.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 SE=s(410);const xE=SE.gs,NE="resizable-panel--collapsed",AE=(e,t)=>({collapsiblePanel:{className:(0,Os.clsx)(...t?.classes??[],{[NE]:e}),onStartResize:e=>{e.domElement.classList.remove(NE),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}}),vE=SE.jW,IE=SE.nN,OE=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var yE=s(48845);const RE=(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=pE(),u=vn(),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)?M_.PASSED:t.failedTests.has(e)?M_.FAILED:t.testsWithError.has(e)?M_.ERROR:M_.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?M_.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?M_.RUNNING:M_.PASSED})(t,p):void 0){case M_.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)(hi,{})});break;case M_.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)(xi,{})});break;case M_.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)(Ks,{})});break;case M_.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)(_i,{})});break;default:g=(0,T.jsx)(ei,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,Os.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 Up(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)(qi,{}):(0,T.jsx)(Qi,{}):(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})]})})),wE=(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)(RE,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:a,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),LE=(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)(Ba,{children:"No tests found"}),!i&&(0,T.jsx)(CE,{components:{TreeNodeContainer:RE},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()}}})]})})),PE=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,bE=e=>{const{wrapText:t,result:s}=e,i=pE(),a=vn(),[n,r]=(0,At.useState)(),o=(0,At.useRef)(void 0),l=(0,At.useRef)(null),{ref:c,width:d,height:h}=(0,Va.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:v.TEXT});r(t)}}),[a,n]),o.current?.dispose(),o.current=x.languages.registerLinkProvider(v.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(PE)).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 Up(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 k_?"Test passed!":s instanceof j_?s.error.text:"Running...";n.setValue(e),(s instanceof k_||s instanceof j_)&&n.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof k_?"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})})},DE=(0,Nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,a=pE(),n=vn(),[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,Os.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(Gi,{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 Up(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)(Vi,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(bE,{result:l,wrapText:r})})]})})),ME=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=pE(),i=vn(),a=t.testExecutionResult.count,n=t.testResultInfo,r=n?.suiteStatus??D_.NONE,o=n?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(xE,{orientation:"vertical",children:[(0,T.jsx)(vE,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(Gs,{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)(hi,{})]}),(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)(xi,{})]}),(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)(Ks,{})]})]}),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)(Fi,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(ki,{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)(mi,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(si,{})}),(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)(Ni,{})}),(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)(ai,{})}),(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)(Ws,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(yE.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)(LE,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(wE,{testRunnerState:t})]})})]})}),(0,T.jsx)(IE,{children:(0,T.jsx)(OE,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(vE,{minSize:400,children:[t.selectedTestId&&!n&&(0,T.jsx)("div",{}),t.selectedTestId&&n&&(0,T.jsx)(DE,{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)(Ba,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),FE=(0,Nt.Pi)((()=>{const e=pE().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Ba,{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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(ME,{testRunnerState:e})]})})),kE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=pE(),i=vn(),a=()=>{(0,S.fl)(s.loadFile(t.sourceID,new Up(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:`${Fp(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)(ni,{})})})]})})),UE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=pE(),i=vn();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:`${Fp(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 Up(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(ni,{})})})]})})),jE=(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)(kE,{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)(UE,{candidate:e},e.uuid)))})]})]})})),GE=(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)(UE,{candidate:e},e.uuid)))})]})]})})),VE=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof nE&&(0,T.jsx)(jE,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof rE&&(0,T.jsx)(GE,{suggestionState:e.codeFixSuggestion})]})})),BE=(0,Nt.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=pE(),a=vn(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Up(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)(qi,{}):(0,T.jsx)(Qi,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(vi,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:Fp(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)(Ws,{})})]})]}),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)(Ws,{})})})]},e.uuid)))})]})})),$E=(0,Nt.Pi)((e=>{const{referenceUsageState:t}=e,s=pE(),i=vn(),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 ${Vp(t.usageConcept)}`:`No usages found for ${Vp(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)(Mi,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(Bi,{})}),!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)(Ki,{})}),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)(Xi,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(BE,{referenceUsageResult:t,result:e},e.uuid)))})]})})),zE=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(Gs,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Ba,{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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)($E,{referenceUsageState:e.referenceUsageResult})]})})),HE=(0,Nt.Pi)((()=>{const e=pE(),t={[Op.TERMINAL]:{mode:Op.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(Ti,{className:"auxiliary-panel__header__tab__icon--terminal"}),isVisible:!0},[Op.SEARCH]:{mode:Op.SEARCH,name:"SEARCH",icon:(0,T.jsx)(oi,{className:"auxiliary-panel__header__tab__icon--search"}),isVisible:!0},[Op.TEST_RUNNER]:{mode:Op.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(sa,{className:"auxiliary-panel__header__tab__icon--test"}),isVisible:!0},[Op.REFERENCES]:{mode:Op.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(Yi,{className:"auxiliary-panel__header__tab__icon--references"}),isVisible:!0},[Op.CODE_FIX_SUGGESTION]:{mode:Op.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(Wi,{className:"auxiliary-panel__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Op).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(Op.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,Os.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)(qi,{}):(0,T.jsx)(Ji,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(ea,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Op.TERMINAL)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(_E,{})}),i(Op.SEARCH)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(EE,{})}),i(Op.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(FE,{})}),i(Op.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(VE,{})}),i(Op.REFERENCES)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(zE,{})})]})]})}));var YE=s(42689);const WE=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(ga,{})}),KE=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),XE=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),ZE=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),qE=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),JE=()=>(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)(Na,{})}),ef=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(ii,{})}),tf=()=>(0,T.jsx)("div",{children:(0,T.jsx)(Qs,{})}),sf=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Na,{})}),af=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(_a,{})}),nf=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(ri,{})}),rf=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(wi,{})}),of=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),lf=e=>{switch(e){case wp.PACKAGE:return(0,T.jsx)(WE,{});case wp.PROFILE:return(0,T.jsx)(JE,{});case wp.CLASS:return(0,T.jsx)(KE,{});case wp.ASSOCIATION:return(0,T.jsx)(of,{});case wp.PROPERTY:case wp.QUALIFIED_PROPERTY:return(0,T.jsx)(af,{});case wp.ENUMERATION:return(0,T.jsx)(XE,{});case wp.MEASURE:return(0,T.jsx)(ZE,{});case wp.UNIT:return(0,T.jsx)(qE,{});case wp.FUNCTION:return(0,T.jsx)(QE,{});case wp.NATIVE_FUNCTION:return(0,T.jsx)(sf,{});case wp.DIAGRAM:return(0,T.jsx)(nf,{});case wp.DATABASE:return(0,T.jsx)(rf,{});case wp.MAPPING:return(0,T.jsx)(ef,{});default:return(0,T.jsx)(tf,{})}},cf=/^\w[\w$]*$/,df=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,hf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),a=t.data.li_attr.pureName??t.data.li_attr.pureId,n=t.data.li_attr.pureType===wp.PACKAGE,[r,o]=(0,At.useState)(n?Ru(a):a),l=(0,At.useRef)(null),c=Boolean(r.match(n?df:cf)),d=(n?Ru(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"})]})]})})})),uf=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,pf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),a=wu(t.data.li_attr.pureId)??"",[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(uf)),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,Dp)],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"})]})]})})})),_f=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,a=s.data.li_attr,n=a.pureType,r=pE(),o=vn();return(0,T.jsxs)(Ma,{ref:t,children:[a.pureType!==wp.PROPERTY&&a.pureType!==wp.QUALIFIED_PROPERTY&&(0,T.jsx)(Fa,{onClick:()=>{o.clipboardService.copyTextToClipboard(a.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),n===wp.PACKAGE&&(0,T.jsx)(Fa,{onClick:()=>{(0,S.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),n===wp.FUNCTION&&(0,T.jsx)(Fa,{onClick:()=>{o.navigationService.navigator.visitAddress(`${r.client.baseUrl}/execute?func=${a.pureId}&mode=${r.client.mode}`)},children:"Service (JSON)"}),(a instanceof bp||a instanceof Dp)&&(0,T.jsx)(Fa,{onClick:()=>{(a instanceof Dp||a instanceof bp)&&r.findUsagesFromCoordinate(new Up(a.file,Number.parseInt(a.line,10),Number.parseInt(a.column,10)))},children:"Find Usages"}),n!==wp.PACKAGE&&(0,T.jsx)(Fa,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(ka,{}),(0,T.jsx)(Fa,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),a instanceof Dp&&(0,T.jsx)(Fa,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var mf;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(mf=mf||(mf={}));const gf=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 bp&&t.data.li_attr.classPath!==t.parent.id,p=[wp.PACKAGE,wp.CLASS].includes(t.data.li_attr.pureType),_=t.data.li_attr.pureType===wp.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:Ru(K(t.data.li_attr,bp).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,YE.c)((()=>({type:"Class"===t.data.li_attr.pureType?mf.CLASS:mf.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(Da,{content:(0,T.jsx)(_f,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Os.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)(_i,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:p?t.isOpen?(0,T.jsx)(qi,{}):(0,T.jsx)(Qi,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,Os.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:lf(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:_})]})})},Ef=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(CE,{components:{TreeNodeContainer:gf},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 Dp||i instanceof bp)&&(0,S.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Up(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(hf,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(pf,{node:s.nodeForMoveElement})]})})),ff=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),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)(Mi,{})}),(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)(si,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Gs,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(Ef,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ba,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),Tf=/^\w+(?:\.\w+)*$/,Cf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)("untitled.pure"),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 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"})]})]})})})),Sf=/^\w+$/,xf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)("untitled"),r=(0,At.useRef)(null),o=Boolean(a.match(Sf)),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"})]})]})})})),Nf=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Af=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)(t.data.li_attr.path),r=(0,At.useRef)(null),o=Boolean(a.match(Nf)),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"})]})]})})})),vf=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s}=e,i=vn(),a=pE(),n=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(Ma,{ref:t,children:[(0,T.jsx)(Fa,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(ka,{}),n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Fa,{disabled:Boolean(s.data instanceof l_&&s.data.children),onClick:()=>{(0,S.fl)(a.deleteDirectoryOrFile(s.data.li_attr.path,n,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),If=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 l_&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,_=t.data instanceof l_&&!t.data.children,m=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(gi,{className:"explorer__icon--readonly"}):p?_?(0,T.jsx)(Si,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(Ci,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Si,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(vi,{className:(0,Os.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{_||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(Da,{content:(0,T.jsx)(vf,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Os.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)(_i,{})}),!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)(qi,{}):(0,T.jsx)(Qi,{})}),(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})]})})},Of=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(CE,{components:{TreeNodeContainer:If},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)(Cf,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(xf,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(Af,{node:s.nodeForRenameFile})]})})),yf=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),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)(Mi,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof i_&&(0,S.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Hs,{})}),(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)(si,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Gs,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(Of,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ba,{children:"Failed to build directory tree"})]})]})})]})})),Rf=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,Os.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Ip.CONCEPT_EXPLORER:return(0,T.jsx)(ff,{});case Ip.FILE_EXPLORER:return(0,T.jsx)(yf,{});default:return null}})()},e.activeActivity)})})),wf=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,Os.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"})})]})})},Lf=(0,Nt.Pi)((()=>{const e=pE(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Ip.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(li,{})},{mode:Ip.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(vi,{})}].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)(wf,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,Os.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)))})]})})),Pf=(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)`:""}`})})})),bf=(0,Nt.Pi)((()=>{const e=pE(),t=vn();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 i_&&(0,T.jsx)(Pf,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,Os.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)(Js,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Ti,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Ui,{})})]})]})})),Df=e=>{(0,At.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},Mf=/[0-9]+(?::[0-9]+)?/,Ff=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,At.useState)(""),a=(0,At.useRef)(null),n=Boolean(s.match(Mf)),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"})]})]})})})),kf=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=pE(),i=vn(),a=(0,At.useRef)(null),[n,r]=(0,At.useState)(),{ref:o,width:l,height:c}=(0,Va.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]),Df(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&&(yp(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,Os.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)(Gi,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(Ff,{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})})})]})})),Uf=(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 jf{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,We.yu)(jf,{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 Gf{pureType;pureName;owner;ownerPureType}(0,We.yu)(Gf,{pureType:(0,We.Ru)(),pureName:(0,We.Ru)(),owner:(0,We.Ru)(),ownerPureType:(0,We.Ru)()});class Vf{pureId;pureName;requiredClassProperties=[]}(0,We.yu)(Vf,{pureId:(0,We.Ru)(),pureName:(0,We.Ru)(),requiredClassProperties:(0,We.jt)((0,We.pb)((0,We.Ru)()))});class Bf{name}(0,We.yu)(Bf,{name:(0,We.Ru)()});const $f="Diagram",zf="Diagram",Hf=()=>{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},Yf=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(",")})`}),Wf=(e,t)=>{const s=e.pureType,i=s===wp.FUNCTION||s===wp.NATIVE_FUNCTION?((e,t,s)=>{const i=Ru(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===wp.PACKAGE?x.languages.CompletionItemKind.Folder:s===wp.CLASS?x.languages.CompletionItemKind.Class:s===wp.FUNCTION?x.languages.CompletionItemKind.Function:s===wp.ENUMERATION?x.languages.CompletionItemKind.Enum:s===wp.PROFILE?x.languages.CompletionItemKind.Module:s===wp.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===wp.PACKAGE?`zzzz_${e.text}`:e.text}},Kf=/(?<incompletePath>(?:\w[\w$]*::)+$)/,Xf=/->\s*(?:\w[\w$]*::)+$/,Zf=/\^\s*(?:\w[\w$]*::)+$/,qf=/^\s*import\s+(?:(?<importPath>(?:(?:\w[\w$]*)::)*\w[\w$]*)::*)/,Jf=(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(qf)?.groups?.importPath)).filter($)},Qf=/->\s*(?:\w[\w$]*)?$/,eT=/\^\s*(?:\w[\w$]*)?$/,tT=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,sT=(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}),iT=/^\w[\w$]*$/,aT=(0,Nt.Pi)((e=>{const{renameConceptState:t}=e,s=vn(),i=t.fileEditorState,a=t.concept.pureName,[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(iT)),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"})]})]})})})),nT=(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=pE(),h=vn(),{ref:u,width:p,height:_}=(0,Va.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:v.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 Up(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:Jp.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Up(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Jp.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Up(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Jp.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 Up(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(v.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),a=x.editor.tokenize(i,v.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&&Uf(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(v.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let a=[];if(i.triggerKind===x.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":a=a.concat(Hf());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:$f,description:"(dsl)",insertText:zf}]));break;case":":a=a.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Kf);if(i?.groups?.incompletePath){const a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Xf)),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Zf));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-Ce.length),n?[wp.CLASS]:a?[wp.FUNCTION,wp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(jf,e)))}catch{}return r.map((e=>n?Yf(e):Wf(e,{preferArrowFunctionForm:a})))}return[]})(s,e,d));break;case">":a=a.concat(await(async(e,t,s)=>{const i=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForIdentifier(i,[wp.FUNCTION,wp.NATIVE_FUNCTION])).map((e=>(0,We.vB)(jf,e)))}catch{}return a.map((e=>Wf(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(tT),a=Jf(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(a,i.groups.owner)).map((e=>(0,We.vB)(Gf,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===wp.PROPERTY||t===wp.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===wp.PROPERTY?x.languages.CompletionItemKind.Property:t===wp.QUALIFIED_PROPERTY?x.languages.CompletionItemKind.Method:t===wp.TAG?x.languages.CompletionItemKind.Constant:t===wp.STEREOTYPE?x.languages.CompletionItemKind.Value:t===wp.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=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(Vf,e)))}catch{}return a.map((e=>Yf(e)))})(s,e,d));break;case"@":a=a.concat(await(async(e,t,s)=>{const i=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(Vf,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)(Bf,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),v.PURE)[0]);a.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&Uf(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=>sT(e,!0))).concat(Array.from(n).filter((e=>!o.includes(e))).map((e=>{const t=new Bf;return t.name=e,t})).map((e=>sT(e,!1))))})(s,e,t.filePath,d))}return{suggestions:a}}}),a.current?.dispose(),a.current=x.languages.registerCompletionItemProvider(v.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===x.languages.CompletionTriggerKind.Invoke&&(i=i.concat(Hf()),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 $f:return[{text:zf,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=Jf(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(eT));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,n?[wp.CLASS]:a?[wp.FUNCTION,wp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(jf,e)))}catch{}return r.map((e=>n?Yf(e):Wf(e,{preferArrowFunctionForm:a})))})(t,e,d))),{suggestions:i}}}),Df(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&&(yp(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,Os.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)(Gi,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(aT,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(Ff,{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 rT=s(8533);const oT=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)(ba,{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})]})},lT=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=vn(),a=s.diagram,n=t,{width:r,height:o}=(0,Va.NB)({refreshMode:"debounce",refreshRate:50,targetRef:n});(0,At.useEffect)((()=>{const e=new Vm(n.current,a);s.setRenderer(e),s.setupRenderer(),e.render({initial:!0})}),[n,s,a]),(0,At.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.render({initial:!0})}),[s,s.isDiagramRendererInitialized]),(0,At.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,At.useCallback)(((e,t)=>{if(e instanceof Mp){const a=t.getClientOffset(),n=a?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Ku(a.x,a.y))):void 0;(0,S.fl)(s.addClassView(e.li_attr.pureId,n)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,rT.L)((()=>({accept:mf.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(n),(0,T.jsx)("div",{ref:n,className:(0,Os.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),cT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=pE(),i=vn(),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(km.ALIGN_LEFT),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 center",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(km.ALIGN_CENTER),children:(0,T.jsx)(ca,{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(km.ALIGN_RIGHT),children:(0,T.jsx)(da,{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(km.ALIGN_TOP),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 middle",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(km.ALIGN_MIDDLE),children:(0,T.jsx)(ra,{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(km.ALIGN_BOTTOM),children:(0,T.jsx)(oa,{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(km.SPACE_HORIZONTALLY),children:(0,T.jsx)(ha,{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(km.SPACE_VERTICALLY),children:(0,T.jsx)(ua,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(oT,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(ka,{}),jm.map((e=>(0,T.jsxs)(Fa,{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)(qs,{})})]}),(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 Up(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Vi,{className:"diagram-editor__icon--go-to-file"})})})]})})),dT=(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,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.LAYOUT}),tabIndex:-1,onClick:i(Mm.LAYOUT,Fm.NONE),title:"View Tool (V)",children:(0,T.jsx)(Ea,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.PAN}),tabIndex:-1,onClick:i(Mm.PAN,Fm.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(fa,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Mm.ZOOM_IN,Fm.NONE),children:(0,T.jsx)(Ta,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Mm.ZOOM_OUT,Fm.NONE),children:(0,T.jsx)(Ca,{className:"diagram-editor__icon--zoom-out"})})]})})),hT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,At.useRef)(null);return Df(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(cT,{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)(dT,{diagramEditorState:t}),(0,T.jsx)(lT,{diagramEditorState:t,ref:s})]})})]})}));var uT=s(98533),pT=s(84153);(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{children:s,placeholder:i,showPlaceholder:a,className:n}=e;return(0,T.jsxs)("div",{ref:t,className:(0,Os.clsx)("dnd__entry__container",n),children:[a&&(0,T.jsx)("div",{className:"dnd__entry__placeholder",children:i?(0,T.jsx)(T.Fragment,{children:i}):(0,T.jsx)("div",{className:"dnd__entry__placeholder__content"})}),(0,T.jsx)(T.Fragment,{children:s})]})})));const _T=e=>{const{children:t,label:s,showPlaceholder:i,className:a}=e;return i?(0,T.jsx)("div",{className:(0,Os.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 mT(e){const{labelGetter:t,types:s}=e,{itemType:i,item:a,isDragging:n,currentPosition:r}=(0,uT.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)(xs.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 gT=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)},ET=(0,Nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Fa,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Fa,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),fT=(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,rT.L)((()=>({accept:[s.dndType],hover:(e,t)=>n(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[n]),l=i===r,[,c,d]=(0,YE.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,At.useEffect)((()=>{e((0,pT.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,Os.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)(_T,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(Da,{content:(0,T.jsx)(ET,{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)(Ws,{})})]})})});var h})),TT=(0,Nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(oT,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(Ma,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Fa,{className:(0,Os.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)(Ws,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(qi,{})})})),CT=(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:gT,children:[t.tabs.map((e=>(0,T.jsx)(fT,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(mT,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(TT,{managerTabState:t})]})})),ST=()=>{const[e,t]=(0,At.useState)(!1),{ref:s,width:i,height:a}=(0,Va.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,Os.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:"Run 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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},xT=(0,Nt.Pi)((()=>{const e=pE(),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)(CT,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof i_){const s=e.tabManagerState.tabs.filter((e=>e instanceof i_&&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)(vi,{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)(Ys,{className:"edit-panel__header__tab__icon--readonly"})})]})}if(t instanceof Jg){const s=e.tabManagerState.tabs.filter((e=>e instanceof Jg&&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)(nf,{})}),(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 i_?t.textEditorState.language===v.PURE?(0,T.jsx)(nT,{editorState:t}):(0,T.jsx)(kf,{editorState:t}):t instanceof Jg?(0,T.jsx)(hT,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(ST,{})}));var NT=s(50166),AT=s(35247);AT.Select.createFilter;const vT=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)(NT.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"})},IT="selector-input",OT="selector-input--dark",yT=()=>(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__loading-indicator ${OT}__loading-indicator`,children:(0,T.jsx)(_i,{})}),RT=()=>(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__dropdown-indicator`,children:(0,T.jsx)(qs,{})}),wT=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__clear-indicator`,children:(0,T.jsx)(Ws,{})})})},LT=e=>(0,T.jsx)(AT.Select.components.Input,{...e,isHidden:!1}),PT=(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?AT.CreatableSelect.default:AT.Select.default,u=l?OT:IT;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:wT,DropdownIndicator:RT,LoadingIndicator:yT,MenuList:vT,Input:LT,...r},...{...d,darkMode:l,noMatchMessage:a}})})),bT=(e,t)=>e.label.localeCompare(t.label),DT=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,a=(0,At.useRef)(null),n=(0,At.useMemo)((()=>(0,Ha.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)(PT,{ref:a,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(bT),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,Os.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)($i,{})})]})]})})}));var MT;!function(e){e.MODE="mode",e.FAST_COMPILE="fastCompile"}(MT=MT||(MT={}));const FT=(kT=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),{ref:s,width:i,height:a}=(0,Va.NB)(),n=AE(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=AE(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),o=AE(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.getCurrentLocationParameterValue(MT.MODE),t.navigationService.navigator.getCurrentLocationParameterValue(MT.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]),Df(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(Lf,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:s,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(xE,{orientation:"vertical",children:[(0,T.jsx)(vE,{...n.collapsiblePanel,direction:1,children:(0,T.jsx)(Rf,{})}),(0,T.jsx)(IE,{}),(0,T.jsx)(vE,{...n.remainingPanel,minSize:300,children:(0,T.jsxs)(xE,{orientation:"horizontal",children:[(0,T.jsx)(vE,{...o.collapsiblePanel,...0===e.auxPanelDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(xT,{})}),(0,T.jsx)(IE,{children:(0,T.jsx)(OE,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(vE,{...r.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)(HE,{})})]})})]})})})]}),(0,T.jsx)(bf,{}),(0,T.jsx)(DT,{})]})})),function(){return(0,T.jsx)(uE,{children:(0,T.jsx)(kT,{})})});var kT;const UT=()=>(0,T.jsx)(xp,{children:(0,T.jsx)(cn,{children:(0,T.jsx)(FT,{})})}),jT=JSON.parse('{"i8":"7.0.10","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class GT extends mt{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class VT extends GT{static NAME=jT.Rw.p;constructor(){super(VT.NAME,jT.i8)}getExtraKeyedCommandConfigEntries(){return[Xp,Qp,qp].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class BT extends ot{static create(){const e=new BT(Rn.create());return e.withBasePlugins([new St,new VT]),e.withBasePresets([new Tp]),e}async configureApplication(e){return new On(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:v.PURE}),x.languages.setLanguageConfiguration(v.PURE,Ye),x.languages.setMonarchTokensProvider(v.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)(Rt,{children:(0,T.jsx)(An,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(UT,{})})})}))}}class $T{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){BT.create().setup({baseUrl:e}).withPresets($T.getPresetCollection()).withPlugins($T.getPluginCollection()).start().catch((e=>{throw e}))}}$T.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:"6a7e96d2",135:"3b62eae4",246:"63a82c7f",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},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(23607)));l=o.O(l)})();
2
- //# sourceMappingURL=index.c9f4e1af.js.map
1
+ (()=>{"use strict";var e,t,s,i,a,n={23607:(e,t,s)=>{const i=JSON.parse('{"i8":"8.0.5","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,v;!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"}(v=v||(v={}));var I=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,I.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,ve,Ie,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",(Ie=Ae=Ae||(Ae={})).STRING="String",Ie.BOOLEAN="Boolean",Ie.BINARY="Binary",Ie.NUMBER="Number",Ie.INTEGER="Integer",Ie.FLOAT="Float",Ie.DECIMAL="Decimal",Ie.DATE="Date",Ie.STRICTDATE="StrictDate",Ie.DATETIME="DateTime",Ie.STRICTTIME="StrictTime",Ie.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(ve=ve||(ve={}));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",Ue.NEW="meta::pure::functions::meta::new";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,I.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.11","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 vt{navigator;constructor(e){this.navigator=e}}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")}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}updateCurrentLocation(e){this.historyAPI.push(e)}updateCurrentZone(e){this.window.location.hash="#"+e}resetZone(){this.updateCurrentLocation(this.getCurrentLocation())}getCurrentBaseAddress(e){return e?.withAppRoot?this.generateAddress(""):this.window.location.origin}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}getCurrentLocationParameters(){const e={},t=((e,t=!1)=>t?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}getCurrentLocationParameterValue(e){return this.getCurrentLocationParameters()[e]}getCurrentZone(){return this.window.location.hash.substring("#".length)}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 Ot=s(40979);const yt=(0,At.createContext)(void 0),Rt=({children:e})=>{const t=(0,Ot.k6)(),s=(0,Nt.fv)((()=>new It(t)));return(0,T.jsx)(yt.Provider,{value:s,children:e})};var wt;!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"}(wt=wt||(wt={}));class Lt{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 Pt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const a=new Lt;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 bt=s(94174).Fuse.default;var Dt,Mt,Ft;!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(Dt||(Dt={}));class kt{state;_message;_messageFormatter;constructor(){this.state=Dt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=Dt.INITIAL,this}inProgress(){return this.state=Dt.IN_PROGRESS,this}fail(){return this.state=Dt.FAILED,this}pass(){return this.state=Dt.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===Dt.INITIAL}get isInProgress(){return this.state===Dt.IN_PROGRESS}get hasFailed(){return this.state===Dt.FAILED}get hasSucceeded(){return this.state===Dt.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 kt,{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"}(Mt=Mt||(Mt={}));class Ut{currentMode=Mt.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!==Mt.STANDARD}generateSearchText(e){switch(this.currentMode){case Mt.INCLUDE:return`'"${e}"`;case Mt.EXACT:return`="${e}"`;case Mt.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(Ft=Ft||(Ft={}));class jt{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 Gt{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 Vt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Bt{applicationStore;panelRenderingKey=(0,n.Z)();isHidden=!1;isOpen=!1;selectedTab=Ft.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=kt.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 bt(this.applicationStore.documentationService.getAllDocEntries().filter(Vt),{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 Ut((()=>{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 Gt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter($).filter(Vt).map((e=>new jt(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 jt(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 jt(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 $t{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}var zt;!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"}(zt=zt||(zt={}));class Ht{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(zt.INITIALIZE_GRAPH__SUCCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(Te.APPLICATION_USAGE__INTERRUPT,{})}}class Yt{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)&&Ht.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 Wt{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 Kt{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 Xt,Zt=s(77289),qt=s(73678),Jt=s(78440),Qt=s(51919),es=s(85399),ts=s(89358);!function(e){e.RESET="",e.BOLD="",e.DIM="",e.ITALIC="",e.UNDERLINE="",e.BLINKING="",e.STRIKETHROUGH="",e.BLACK="",e.RED="",e.GREEN="",e.YELLOW="",e.BLUE="",e.MAGENTA="",e.CYAN="",e.WHITE="",e.BRIGHT_BLACK="",e.BRIGHT_RED="",e.BRIGHT_GREEN="",e.BRIGHT_YELLOW="",e.BRIGHT_BLUE="",e.BRIGHT_MAGENTA="",e.BRIGHT_CYAN="",e.BRIGHT_WHITE="",e.DIMMED_BLACK="",e.DIMMED_RED="",e.DIMMED_GREEN="",e.DIMMED_YELLOW="",e.DIMMED_BLUE="",e.DIMMED_MAGENTA="",e.DIMMED_CYAN="",e.DIMMED_WHITE="",e.BLACK_BG="",e.RED_BG="",e.GREEN_BG="",e.YELLOW_BG="",e.BLUE_BG="",e.MAGENTA_BG="",e.CYAN_BG="",e.WHITE_BG="",e.BRIGHT_BLACK_BG="",e.BRIGHT_RED_BG="",e.BRIGHT_GREEN_BG="",e.BRIGHT_YELLOW_BG="",e.BRIGHT_BLUE_BG="",e.BRIGHT_MAGENTA_BG="",e.BRIGHT_CYAN_BG="",e.BRIGHT_WHITE_BG="",e.DIMMED_BLACK_BG="",e.DIMMED_RED_BG="",e.DIMMED_GREEN_BG="",e.DIMMED_YELLOW_BG="",e.DIMMED_BLUE_BG="",e.DIMMED_MAGENTA_BG="",e.DIMMED_CYAN_BG="",e.DIMMED_WHITE_BG=""}(Xt=Xt||(Xt={}));const ss=(e,t)=>`[${e};${t}H`;class is{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 as{applicationStore;searchConfig=new is;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 ns extends as{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 rs=s(1367),os=s(67295),ls=s(72531);s(90286);const cs=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ds=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],hs=e=>(e??"").trim().replace(/\b(?:\w+)\b/gu,(e=>ds.includes(e.toLowerCase())?e.toLowerCase():cs(e))).replace(/^(?:\w+)\b/u,(e=>cs(e))).replace(/\b(?:\w+)$/u,(e=>cs(e))),us=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,os.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,ls.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var ps;function _s(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"}(ps=ps||(ps={}));const ms=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ps.SHIFT,ps.META,ps.ALT,ps.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),gs=(e,t)=>ms(e,H(_s(t)[0]));var Es=s(4707),fs=s(3493),Ts=s(53908);const Cs=(0,Es.Z)({transitions:{create:()=>"none"}}),Ss=e=>{const{children:t}=e;return(0,T.jsx)(fs.Z,{injectFirst:!0,children:(0,T.jsx)(Ts.Z,{theme:Cs,children:t})})};var xs=s(83820),Ns=s(96242),As=s(12238),vs=s(78683),Is=s(81934),Os=s(6277);const ys=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Os.clsx)(t,i),children:s})};return s.displayName=e,s},Rs=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,Os.clsx)("modal",{"modal--dark":s},i),children:t})},ws=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,Os.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:hs(t)})]})},Ls=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,Os.clsx)("modal__header",i),children:(0,T.jsx)(ws,{title:t})}):(0,T.jsx)("div",{className:(0,Os.clsx)("modal__header",i),children:s})},Ps=(ys("ModalHeaderActions","modal__header__actions"),ys("ModalBody","modal__body")),bs=ys("ModalFooter","modal__footer");var Ds,Ms;ys("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Ds=Ds||(Ds={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Ms=Ms||(Ms={}));class Fs{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 ks=e=>{switch(e){case Ms.PROCEED_WITH_CAUTION:return"btn--caution";case Ms.PROCEED:case Ms.STANDARD:default:return"btn--dark"}},Us=(0,Nt.Pi)((e=>{const{info:t}=e,s=vn(),{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??Ds.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(Ls,{title:i}),(0,T.jsxs)(Ps,{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)(bs,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${ks(e.type??Ms.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"})]})]})})})),js=(0,Nt.Pi)((()=>{const e=vn().alertService.actionAlertInfo;return e?(0,T.jsx)(Us,{info:e}):null})),Gs=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")})},Vs=(0,Nt.Pi)((()=>{const e=vn().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)(Rs,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(Gs,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(Ps,{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 Bs=s(90498);const $s=Bs.FA,zs=$s.FaHistory,Hs=$s.FaCrosshairs,Ys=($s.FaLayerGroup,$s.FaGhost,$s.FaLock),Ws=($s.FaMask,$s.FaFile,$s.FaLongArrowAltRight,$s.FaTimes),Ks=$s.FaTimesCircle,Xs=$s.FaPlus,Zs=$s.FaCog,qs=($s.FaEye,$s.FaCaretDown),Js=($s.FaFire,$s.FaSave,$s.FaSquare,$s.FaRegSquare,$s.FaCheckSquare,$s.FaHashtag,$s.FaHammer),Qs=($s.FaClock,$s.FaRegClock,$s.FaToggleOn,$s.FaQuestion),ei=$s.FaQuestionCircle,ti=$s.FaInfoCircle,si=$s.FaCompress,ii=$s.FaMap,ai=$s.FaPlay,ni=($s.FaGripVertical,$s.FaRobot,$s.FaArrowLeft,$s.FaArrowRight,$s.FaArrowAltCircleDown,$s.FaArrowAltCircleRight),ri=($s.FaArrowCircleRight,$s.FaUser,$s.FaShapes),oi=($s.FaEnvelope,$s.FaSkull,$s.FaDollarSign,$s.FaSearch),li=($s.FaStar,$s.FaKey,$s.FaExternalLinkAlt,$s.FaExternalLinkSquareAlt,$s.FaLightbulb,$s.FaRegLightbulb,$s.FaList),ci=$s.FaCircle,di=$s.FaTrash,hi=($s.FaRegCircle,$s.FaShieldAlt,$s.FaTag,$s.FaTags,$s.FaBolt,$s.FaCheckCircle),ui=$s.FaExclamationTriangle,pi=$s.FaBug,_i=$s.FaCircleNotch,mi=($s.FaRegKeyboard,$s.FaUserSecret,$s.FaBuffer,$s.FaSitemap,$s.FaExpand),gi=($s.FaExpandArrowsAlt,$s.FaSortAlphaDown,$s.FaSort,$s.FaSortAlphaDownAlt,$s.FaFolderPlus,$s.FaCaretRight,$s.FaWrench),Ei=$s.FaArrowDown,fi=$s.FaArrowUp,Ti=$s.FaTerminal,Ci=($s.FaTruckLoading,$s.FaFolderOpen),Si=$s.FaFolder,xi=($s.FaFileCode,$s.FaCodeBranch,$s.FaArrowAltCircleUp,$s.FaArrowAltCircleLeft,$s.FaRegStopCircle,$s.FaAsterisk,$s.FaFilter,$s.FaExclamationCircle),Ni=($s.FaRocket,$s.FaCheck,$s.FaBan),Ai=($s.FaFileImport,$s.FaUserFriends,$s.FaDownload,$s.FaUpload,$s.FaRegWindowRestore,$s.FaPauseCircle,$s.FaShare,$s.FaRegCopy),vi=$s.FaFileAlt,Ii=($s.FaEdit,$s.FaArrowsAltH,$s.FaRegWindowMaximize,$s.FaWindowMaximize,$s.FaLongArrowAltDown,$s.FaLongArrowAltUp,$s.FaMeteor,$s.FaPiedPiperSquare,$s.FaPuzzlePiece,$s.FaToggleOn,$s.FaToggleOff,$s.FaMapMarkerAlt),Oi=$s.FaHatWizard,yi=$s.FaRegLaughWink,Ri=$s.FaRegSadTear,wi=($s.FaBusinessTime,$s.FaDatabase),Li=($s.FaServer,$s.FaTable,$s.FaArchive,$s.FaBrain,$s.FaBookOpen,$s.FaLevelDownAlt,Bs.GI),Pi=(Li.GiWaterDrop,Li.GiBeard),bi=Li.GiSunglasses,Di=(Li.GiHouseKeys,Bs.MD),Mi=(Di.MdManageSearch,Di.MdModeEdit,Di.MdTextFields,Di.MdMoreVert,Di.MdMoreHoriz,Di.MdWrapText,Di.MdVerticalAlignBottom,Di.MdRefresh),Fi=(Di.MdFunctions,Di.MdCompareArrows,Di.MdPlaylistAddCheck,Di.MdAdd,Di.MdEdit,Di.MdSubject),ki=Di.MdViewHeadline,Ui=Di.MdAssistant,ji=(Di.MdSettingsEthernet,Di.MdLink,Di.MdWindow,Di.MdReviews,Di.MdCalculate,Di.MdRocketLaunch,Di.MdOutlineDataset,Di.MdVerified,Di.MdQueryStats,Bs.VSC),Gi=(ji.VscError,ji.VscWarning,ji.VscWordWrap),Vi=ji.VscGoToFile,Bi=ji.VscClose,$i=(ji.VscRunAll,ji.VscRunErrors,ji.VscOpenPreview,ji.VscDiff,ji.VscRegex),zi=(ji.VscVersions,ji.VscCaseSensitive),Hi=ji.VscWholeWord,Yi=ji.VscReferences,Wi=ji.VscWand,Ki=ji.VscCollapseAll,Xi=ji.VscExpandAll,Zi=(ji.VscJson,Bs.GO),qi=Zi.GoChevronDown,Ji=Zi.GoChevronUp,Qi=(Zi.GoChevronLeft,Zi.GoChevronRight),ea=(Zi.GoFileBinary,Zi.GoGitPullRequest,Zi.GoGitMerge,Zi.GoCloudDownload,Zi.GoCloudUpload,Zi.GoSync,Zi.GoGitBranch,Zi.GoX),ta=(Zi.GoPlug,Bs.SI.SiSwagger,Bs.IO5),sa=(ta.IoResize,ta.IoFileTrayFullOutline,ta.IoMenuOutline,ta.IoBeaker,ta.IoFlaskSharp),ia=(ta.IoSyncCircleSharp,Bs.BS),aa=(ia.BsDisplayFill,ia.BsChevronDown,ia.BsFillTriangleFill,ia.BsFillFileEarmarkSpreadsheetFill,ia.BsBoxSeam,ia.BsGripVertical),na=ia.BsAlignTop,ra=ia.BsAlignMiddle,oa=ia.BsAlignBottom,la=ia.BsAlignStart,ca=ia.BsAlignCenter,da=ia.BsAlignEnd,ha=ia.BsDistributeHorizontal,ua=ia.BsDistributeVertical,pa=(ia.BsDatabaseFillLock,ia.BsDatabaseFillCheck,ia.BsChevronRight,ia.BsChevronLeft,Bs.BI),_a=(pa.BiShapeTriangle,pa.BiAtom),ma=(Bs.CG.CgOptions,Bs.FI),ga=ma.FiPackage,Ea=(ma.FiMinus,ma.FiMousePointer),fa=ma.FiMove,Ta=(ma.FiPlusCircle,ma.FiSidebar,ma.FiTriangle,ma.FiZoomIn),Ca=ma.FiZoomOut,Sa=(ma.FiGitMerge,ma.FiLink,Bs.RI),xa=(Sa.RiShapeLine,Sa.RiTestTubeFill,Sa.RiRobotFill,Sa.RiGovernmentFill,Sa.RiMoneyDollarCircleFill,Bs.TB),Na=(xa.TbArrowsJoin2,xa.TbArrowsSplit2,xa.TbMathFunction),Aa=(xa.TbBook,Bs.HI);Aa.HiCode,Aa.HiHome;var va=s(73882),Ia=s(53083);const Oa=6e3;var ya;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(ya=ya||(ya={}));class Ra{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class wa{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 Ra(ya.INFO,e,t??[],null===s?void 0:s??Oa))}notifySuccess(e,t,s){this.setNotification(new Ra(ya.SUCCESS,e,t??[],null===s?void 0:s??Oa))}notifyWarning(e,t,s){this.setNotification(new Ra(ya.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Oa))}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 Ra(ya.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new Ra(ya.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Oa))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return G(e),this.notifyIllegalState(e.message),t}}}const La=(0,Nt.Pi)((()=>{const e=vn(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",a=t?.severity??ya.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)(ti,{})});switch(a){case ya.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(pi,{})});break;case ya.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Ks,{})});break;case ya.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(ui,{})});break;case ya.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(hi,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(va.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Oa,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Ia.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,Os.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)(qi,{}):(0,T.jsx)(Ji,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(Ws,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Pa=s(17954);const ba=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(Pa.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Da=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)(ba,{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}`)]})},Ma=(0,At.forwardRef)((function(e,t){const{className:s,children:i,...a}=e;return(0,T.jsx)("div",{ref:t,className:(0,Os.clsx)("menu",s),...a,children:i})})),Fa=e=>{const{className:t,onClick:s,title:i,disabled:a,children:n,...r}=e;return(0,T.jsx)("button",{className:(0,Os.clsx)("menu__item",t),disabled:Boolean(a),title:i,onClick:s,...r,children:n})},ka=ys("MenuContentDivider","menu__divider");ys("MenuContentItemIcon","menu__item__icon"),ys("MenuContentItemLabel","menu__item__label");var Ua=s(95081),ja=s(53019);const Ga=e=>(0,T.jsx)(Ua.D,{className:(0,Os.clsx)("markdown-content",e.className),remarkPlugins:[ja.Z],components:e.components??{},children:e.value.value});var Va=s(62515);const Ba=e=>{const{children:t}=e,{ref:s,width:i,height:a}=(0,Va.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[n,r]=(0,At.useState)(!1),{ref:o,width:l,height:c}=(0,Va.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,Os.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!n}),children:t})})};var $a=s(33207);const za=e=>{const{children:t,...s}=e;return(0,T.jsx)($a.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var Ha=s(13474),Ya=s(65068),Wa=s(41327),Ka=s(85688),Xa=s(28019),Za=s(8978);const qa=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,Os.clsx)("mui-radio-group",a),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ka.Z,{className:"mui-radio-group__group",...n,children:e.map((e=>(0,T.jsx)(Xa.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Za.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 Ja;!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"}(Ja=Ja||(Ja={}));const Qa=(0,Nt.Pi)((e=>{const{configState:t}=e,s=vn();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(Ja.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(ti,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(qa,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[Mt.STANDARD,Mt.INCLUDE,Mt.EXACT,Mt.INVERSE],size:1})})]})})),en=(0,Nt.Pi)((e=>{const{entry:t}=e,s=vn(),i=()=>{t.isOpen||Ht.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},a=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(Da,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(Ma,{children:(0,T.jsx)(Fa,{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,Os.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)(qi,{}):(0,T.jsx)(Qi,{})}),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:()=>{Ht.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)(Ga,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),tn=(0,Nt.Pi)((()=>{const e=vn(),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)(Da,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Fa,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Fa,{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)(Ga,{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)(en,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Ba,{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 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!"})]})})]})})),sn=(0,Nt.Pi)((()=>{const e=vn(),t=(0,At.useRef)(null),s=(0,At.useRef)(null),i=e.assistantService,a=i.searchText,n=(0,At.useMemo)((()=>(0,Ha.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,Os.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,Os.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)(Zs,{})}),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)(Ws,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(oi,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(Gs,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,Os.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)(en,{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)(en,{entry:e},e.uuid)))}),a&&!i.searchResults.length&&(0,T.jsx)(Ba,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Ri,{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)(Da,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>{fe(`documentation-registry_${(0,Ya.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)(Fa,{onClick:()=>{fe(`documentation-registry_${(0,Ya.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)(Oi,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(bi,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Pi,{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?"})]})})]})]})]})})),an=(0,Nt.Pi)((e=>{const{triggerElement:t}=e,s=vn().assistantService,i=s.currentContextualDocumentationEntry,a=s.selectedTab;return(0,T.jsx)(za,{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,Os.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Ft.SEARCH}),onClick:()=>s.setSelectedTab(Ft.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(oi,{})})}),(0,T.jsx)("div",{className:(0,Os.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":a===Ft.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(Ft.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)(Bi,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[a===Ft.SEARCH&&(0,T.jsx)(sn,{}),a===Ft.CONTEXTUAL_SUPPORT&&(0,T.jsx)(tn,{})]})]})},s.panelRenderingKey)})),nn=(0,Nt.Pi)((()=>{const[e,t]=(0,At.useState)(!1),[s,i]=(0,At.useState)((0,n.Z)()),a=vn(),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)(Wa,{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,Os.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(Ft.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)(Bi,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(ci,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(Da,{className:(0,Os.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)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>{o.setIsOpen(!1),i((0,n.Z)())},children:"Reset Position"}),(0,T.jsx)(Fa,{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)(aa,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(an,{triggerElement:r.current})]})},s)}));var rn;!function(e){e.TOP_LEVEL_CONTAINER="application.top-level-container",e.BACKDROP_CONTAINER="application.backdrop-container"}(rn||(rn={}));const on=["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"],ln=e=>(0,T.jsx)("div",{className:"backdrop__container","data-elementid":e.elementId}),cn=(0,Nt.Pi)((e=>{const{children:t}=e,s=vn(),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:on,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{on.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,rs.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=_s(e.combination);if(!a.length)return;const n=t.get(s)??a,r=H(n[0]);ms(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&&(Ht.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(Ss,{children:[(0,T.jsx)(Vs,{}),(0,T.jsx)(js,{}),(0,T.jsx)(La,{}),(0,T.jsx)(nn,{}),s.layoutService.showBackdrop&&(0,T.jsx)(xs.Z,{container:s.layoutService.getElementByID(s.layoutService.backdropContainerElementID??rn.BACKDROP_CONTAINER)??null,children:(0,T.jsx)(Ns.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(As.W,{backend:vs.PD,children:(0,T.jsxs)("div",{className:"app__container","data-elementid":rn.TOP_LEVEL_CONTAINER,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(ln,{elementId:rn.BACKDROP_CONTAINER}),t]})})]})})),dn={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"},hn={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},un=`\n${Xt.BOLD}${Xt.BRIGHT_BLUE}$purist${Xt.RESET}\n${Xt.BOLD}${Xt.MAGENTA}❯${Xt.RESET} `,pn="❯ ";class _n extends ns{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=kt.create();constructor(e){super(e),this.instance=new Zt.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${N}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:dn,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new Jt.FitAddon,this.searcher=new Qt.SearchAddon,this.renderer=new ts.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 es.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>gs(e,"Control+KeyF")||gs(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(gs(e,"Control+KeyC")&&this.instance.hasSelection()||gs(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new qt.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new qt.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(gs(t,"Control+KeyD")||gs(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(rn.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=`${pn}${this.command}`,i=`${pn}${this.command.substring(0,t-pn.length)}${this.command.length<t-pn.length?" ".repeat(t-this.command.length-pn.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)-pn.length;break}n+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:a,startX:pn.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:ss(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(ss(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(ss(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(ss(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(un),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${Xt.DIM}(system: ${e})\n${Xt.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!==pn;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(Xt.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${Xt.BRIGHT_BLACK}+-------------------------------------------------------+${Xt.RESET}\n${Xt.BRIGHT_BLACK}|${Xt.RESET} ${Xt.BRIGHT_GREEN}[@@]${Xt.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${Xt.BRIGHT_BLACK}|${Xt.RESET}\n${Xt.BRIGHT_BLACK}|${Xt.RESET} ${Xt.BRIGHT_GREEN}/|__|\\${Xt.RESET} ${Xt.BRIGHT_BLACK}|${Xt.RESET}\n${Xt.BRIGHT_BLACK}+--${Xt.RESET} ${Xt.BRIGHT_GREEN}d b${Xt.RESET} ${Xt.BRIGHT_BLACK}-----------------------------------------------+${Xt.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,rs.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${Xt.BRIGHT_GREEN}${e.command.padEnd(30)}${Xt.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${Xt.DIM}${e.usage}${Xt.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(Xt).map((([e,t])=>`${t}${(e=>e?e.trim().match(/^[A-Z_]+$/)?hs(e.trim().replace(/_+/gu," ").toLowerCase()):cs(e.trim()).split(/(?<chunk>[A-Z][a-z]+|[0-9]+)/).map((e=>e.toUpperCase()===e?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).filter(Boolean).join(" ").replace(/_+/gu," ").replace(/\s+/gu," "):"")(e).padEnd(20)}${Xt.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${Xt.RED}${e}${Xt.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:hn,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:hn,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:hn,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 mn{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new _n(e)}}const gn="(unknown)";class En{applicationStore;currentUser=gn;constructor(e){(0,S.rC)(this,{currentUser:S.LO,setCurrentUser:S.aD}),this.applicationStore=e}get isAnonymous(){return this.currentUser===gn}setCurrentUser(e){this.currentUser=e}}class fn{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 Tn{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 Cn{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)??ct.DEFAULT_DARK;this.currentColorTheme=H(this.colorThemeRegistry.get(t)),this.TEMPORARY__syncGlobalCSSClassName(this.currentColorTheme,void 0)}getElementByID(e){return document.querySelector(`[data-elementid='${e}']`)??void 0}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}get TEMPORARY__isLightColorThemeEnabled(){return this.currentColorTheme.key!==ct.DEFAULT_DARK}TEMPORARY__syncGlobalCSSClassName(e,t){t&&document.body.classList.remove(t.TEMPORARY__globalCSSClassName),document.body.classList.add(e.TEMPORARY__globalCSSClassName)}setColorTheme(e,t){const s=this.colorThemeRegistry.get(e);if(e===this.currentColorTheme.key||!s)return;const i=this.currentColorTheme;this.currentColorTheme=s,this.TEMPORARY__syncGlobalCSSClassName(s,i),t?.persist&&this.applicationStore.settingService.persistValue(pt.COLOR_THEME,e)}}class Sn{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class xn{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 Tn,this.logService=new p,this.logService.registerPlugins(s.getLoggerPlugins()),this.storageService=new Tt(this),this.settingService=new Ct(this),this.alertService=new Fs(this),this.notificationService=new wa,this.identityService=new En(this),this.layoutService=new Cn(this),this.clipboardService=new Sn(this),this.terminalService=new mn(this),this.commandService=new Wt(this),this.keyboardShortcutsService=new Kt(this),this.navigationService=new vt(t),this.navigationContextService=new Yt(this),this.documentationService=new at(this),this.assistantService=new Bt(this),this.eventService=new $t,this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins()),this.telemetryService=new fn(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.telemetryService.setup(),this.tracerService=new Pt,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 Nn=(0,At.createContext)(void 0),An=({children:e,config:t,pluginManager:s})=>{const i=H((0,At.useContext)(yt),"Can't find web application navigator in context"),a=(0,Nt.fv)((()=>new xn(t,i,s)));return(0,T.jsx)(Nn.Provider,{value:a,children:e})},vn=()=>H((0,At.useContext)(Nn),"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")}static resolveAbsoluteUrl(e){return e.trim().startsWith("/")?window.location.origin+e:e}}class On extends In{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=In.resolveAbsoluteUrl(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 yn 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 Rn extends yn{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Rn}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 wn=JSON.parse('{"i8":"7.1.51","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 Ln extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Pn=e=>t=>(0,S.bi)(t)?t:e(t),bn=e=>(t,s)=>(0,S.bi)(t)?t:e(t,s),Dn=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})},Mn=Pn((e=>(0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl})));var Fn=s(34485),kn=s(3096);const Un=e=>Fn.sha1().update(e).digest("hex"),jn=e=>Un(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Un(e):e.hashCode)).join(","));var Gn,Vn;(Vn=Gn=Gn||(Gn={})).PACKAGE="PACKAGE",Vn.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Vn.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Vn.PROFILE="PROFILE",Vn.TAG_POINTER="TAG_POINTER",Vn.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Vn.TAGGED_VALUE="TAGGED_VALUE",Vn.ENUMERATION="ENUMERATION",Vn.ENUM_VALUE="ENUM_VALUE",Vn.CLASS="CLASS",Vn.PROPERTY="PROPERTY",Vn.PROPERTY_POINTER="PROPERTY_POINTER",Vn.MULTIPLICITY="MULTIPLICITY",Vn.CONSTRAINT="CONSTRAINT",Vn.DERIVED_PROPERTY="DERIVED_PROPERTY",Vn.ASSOCIATION="ASSOCIATION",Vn.FUNCTION="FUNCTION",Vn.MEASURE="MEASURE",Vn.UNIT="UNIT",Vn.ASSERT_FAIL="ASSERT_FAIL",Vn.ASSERT_PASS="ASSERT_PASS",Vn.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Vn.EQUAL_TO="EQUAL_TO",Vn.EQUAL_TO_JSON="EQUAL_TO_JSON",Vn.EQUAL_TO_TDS="EQUAL_TO_TDS",Vn.TEST_RESULT="TEST_RESULT",Vn.TEST_ERROR="TEST_ERROR",Vn.TEST_FAILED="TEST_FAILED",Vn.TEST_PASSED="TEST_PASSED",Vn.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Vn.SECTION_INDEX="SECTION_INDEX",Vn.SECTION="SECTION",Vn.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Vn.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Vn.RAW_LAMBDA="RAW_LAMBDA",Vn.RAW_VARIABLE="RAW_VARIABLE",Vn.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Vn.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Vn.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Vn.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Vn.EXPRESSION="EXPRESSION",Vn.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Vn.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Vn.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Vn.INSTANCE_VALUE="INSTANCE_VALUE",Vn.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Vn.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Vn.KEY_EXPRESSION_INSTANCE_VALUE="KEY_EXPRESSION_INSTANCE_VALUE",Vn.KEY_EXPRESSION_VALUE="KEY_EXPRESSION_VALUE",Vn.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Vn.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Vn.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Vn.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Vn.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Vn.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Vn.FUNCTION_TYPE="FUNCTION_TYPE",Vn.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Vn.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Vn.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Vn.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Vn.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Vn.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Vn.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Vn.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE",Vn.MAPPING="MAPPING",Vn.MAPPING_INCLUDE="MAPPING_INCLUDE",Vn.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Vn.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Vn.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Vn.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Vn.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Vn.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Vn.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Vn.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Vn.PROPERTY_MAPPING="PROPERTY_MAPPING",Vn.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Vn.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Vn.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Vn.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Vn.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Vn.MAPPING_TEST="MAPPING_TEST",Vn.STORE_TEST_DATA="STORE_TEST_DATA",Vn.INPUT_DATA="INPUT_DATA",Vn.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Vn.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Vn.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Vn.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Vn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Vn.FILTER_MAPPING="FILTER_MAPPING",Vn.COLUMN_MAPPING="COLUMN_MAPPING",Vn.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Vn.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Vn.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Vn.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Vn.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Vn.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Vn.RUNTIME="RUNTIME",Vn.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Vn.ENGINE_RUNTIME="ENGINE_RUNTIME",Vn.LEGACY_RUNTIME="LEGACY_RUNTIME",Vn.RUNTIME_POINTER="RUNTIME_POINTER",Vn.STORE_CONNECTIONS="STORE_CONNECTIONS",Vn.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Vn.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Vn.CONNECTION_POINTER="CONNECTION_POINTER",Vn.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Vn.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Vn.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Vn.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Vn.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Vn.GENERATION_TREE="GENERATION_TREE",Vn.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Vn.FILE_GENERATION="FILE_GENERATION",Vn.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Vn.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Vn.MODEL_STORE_DATA="MODEL_STORE_DATA",Vn.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Vn.DATA_ELEMENT="DATA_ELEMENT",Vn.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Vn.RELATIONAL_TDS="RELATIONAL_TDS",Vn.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Vn.BINDING="BINDING",Vn.SCHEMA_SET="SCHEMA_SET",Vn.SCHEMA="SCHEMA",Vn.MODEL_UNIT="MODEL_UNIT",Vn.URL_STREAM="URL_STREAM",Vn.EXTERNAL_FORMAT_CONNECTION="EXTERNAL_FORMAT_CONNECTION",Vn.SERVICE="SERVICE",Vn.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Vn.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Vn.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Vn.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Vn.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Vn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Vn.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Vn.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Vn.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Vn.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Vn.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Vn.SERVICE_TEST="SERVICE_TEST",Vn.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Vn.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Vn.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Vn.EXECUTION_ENVIRONMENT_INSTANCE="EXECUTION_ENVIRONMENT_INSTANCE",Vn.SINGLE_EXECUTION_PARAMETER="SINGLE_EXECUTION_PARAMETER",Vn.MULTI_EXECUTION_PARAMETER="MULTI_EXECUTION_PARAMETER",Vn.DATABASE="DATABASE",Vn.DATABASE_SCHEMA="DATABASE_SCHEMA",Vn.DATABASE_JOIN="DATABASE_JOIN",Vn.DATABASE_FILTER="DATABASE_FILTER",Vn.DATBASE_VIEW="DATBASE_VIEW",Vn.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Vn.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Vn.RELATIONAL="RELATIONAL",Vn.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Vn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Vn.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Vn.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Vn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Vn.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Vn.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Vn.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Vn.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Vn.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Vn.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Vn.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Vn.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Vn.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Vn.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Vn.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Vn.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Vn.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Vn.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Vn.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Vn.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Vn.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Vn.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Vn.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Vn.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Vn.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Vn.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Vn.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Vn.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Vn.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Vn.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Vn.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Vn.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Vn.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Vn.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Vn.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Vn.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Vn.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Vn.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Vn.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Vn.TRINO_DATASOURCE_SPECIFICATION="TRINO_DATASOURCE_SPECIFICATION",Vn.TRINO_SSL_SPECIFICATION="TRINO_SSL_SPECIFICATION",Vn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Vn.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Vn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Vn.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Vn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Vn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Vn.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Vn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Vn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Vn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY="TRINO_KEREBEROS_AUTHENTICATION_STRATEGY",Vn.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Vn.SCHEMA_MAPPER="SCHEMA_MAPPER",Vn.TABLE_MAPPER="TABLE_MAPPER",Vn.FLAT_DATA="FLAT_DATA",Vn.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Vn.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Vn.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Vn.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Vn.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Vn.FLAT_DATA_STRING="FLAT_DATA_STRING",Vn.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Vn.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Vn.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Vn.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Vn.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Vn.FLAT_DATA_DATE="FLAT_DATA_DATE",Vn.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Vn.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Vn.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Vn.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Vn.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Vn.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Vn.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Vn.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER";const Bn=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(te(t=e),"Can't hash non-object value"),kn(t,s);var t,s},$n=(e,t)=>jn([e?Bn(e):"",t?Bn(t):""]),zn=(e,t)=>[Gn.PACKAGEABLE_ELEMENT_POINTER,e??"",t].map(Un).join(",");class Hn{stereotypes=[];taggedValues=[]}class Yn extends Hn{name}class Wn extends Yn{_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 jn([Gn.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new U(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class Kn extends Wn{}class Xn extends Kn{_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 jn([Gn.CLASS,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),jn(this.constraints),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class Zn extends Kn{}class qn extends Zn{values=[];get _elementHashCode(){return jn([Gn.ENUMERATION,this.path,jn(this.values),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class Jn extends Zn{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return jn([Gn.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}}class Qn extends Kn{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return jn([Gn.MEASURE,this.path,this.canonicalUnit??"",jn(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class er extends Wn{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class tr{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return jn([Gn.SECTION,this.parserName,jn(this.elements.map((e=>e.valueForSerialization??"")))])}}class sr extends tr{imports=[];get hashCode(){return jn([Gn.IMPORT_AWARE_CODE_SECTION,super.hashCode,jn(this.imports.map((e=>e.valueForSerialization??"")))])}}class ir extends tr{get hashCode(){return jn([Gn.DEFAULT_CODE_SECTION,super.hashCode])}}class ar{_UUID=(0,n.Z)()}class nr extends ar{ownerReference;constructor(e){super(),this.ownerReference=e}}class rr extends ar{value;constructor(e){super(),this.value=e}}class or extends rr{constructor(e){super(e)}static create(e){return new or(e)}get valueForSerialization(){return this.value.path}}const lr=Pn((e=>(0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}))),cr=Pn((e=>(Dn(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 rr&&Mn(e)})),e.configurationProperties.forEach(lr),e))),dr=Pn((e=>((0,S.rC)(e,{id:S.LO,hashCode:S.Fl}),Mn(e.generationElement),e))),hr=Pn((e=>(Dn(e),(0,S.rC)(e,{generationNodes:S.LO,fileGenerations:S.LO,_elementHashCode:S.KG}),e.generationNodes.forEach(dr),e.fileGenerations.forEach(Mn),e)));class ur{}class pr extends ur{expectedOutput;constructor(e){super(),this.expectedOutput=us(e)}get hashCode(){return jn([Gn.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class _r{}class mr extends _r{mappings=[];connections=[];get hashCode(){return jn([Gn.ENGINE_RUNTIME,jn(this.mappings.map((e=>zn(Me.MAPPING,e.valueForSerialization??"")))),jn(this.connections.filter((e=>e.storeConnections.length)))])}}class gr extends _r{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return jn([Gn.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Er{}class fr extends Er{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return jn([Gn.FLAT_DATA_INPUT_DATA,zn(Me.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Tr,Cr,Sr;(Sr=Tr=Tr||(Tr={})).JSON="JSON",Sr.XML="XML";class xr extends Er{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Tr.JSON?us(s):s}get hashCode(){return jn([Gn.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Cr=Cr||(Cr={}));class Nr extends Er{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return jn([Gn.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Ar=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),Mn(e.type),e))),vr=Pn((e=>(0,S.rC)(e,{body:S.LO.ref,parameters:S.LO.ref,hashCode:S.Fl}))),Ir=Pn((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,hashCode:S.Fl}),Mn(e.type),e)));class Or{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){vr(e)}visit_RawVariableExpression(e){Ir(e)}visit_RawPrimitiveInstanceValue(e){Ar(e)}}bn(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Or(t)),e)));class yr{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Rr extends yr{trueString;falseString;get hashCode(){return jn([Gn.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class wr extends yr{get hashCode(){return jn([Gn.FLAT_DATA_STRING])}}class Lr extends yr{get hashCode(){return jn([Gn.FLAT_DATA_NUMBER])}}class Pr extends yr{dateFormat;timeZone;get hashCode(){return jn([Gn.FLAT_DATA_DATE,this.dateFormat?jn(this.dateFormat):"",this.timeZone??""])}}class br extends yr{fields=[];get hashCode(){return jn([Gn.FLAT_DATA_RECORD_TYPE,jn(this.fields)])}}const Dr=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{flatData:S.LO,sectionName:S.LO,hashCode:S.Fl}),e))),Mr=Pn((e=>((0,S.rC)(e,{label:S.LO,flatDataDataType:S.LO,optional:S.LO,address:S.LO,hashCode:S.Fl}),(e=>{e instanceof Rr?(0,S.rC)(e,{trueString:S.LO,falseString:S.LO,hashCode:S.Fl}):e instanceof wr||e instanceof Lr?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof Pr?(0,S.rC)(e,{dateFormat:S.LO,timeZone:S.LO,hashCode:S.Fl}):e instanceof br&&Pn(Fr)(e)})(e.flatDataDataType),e)));function Fr(e){return(0,S.rC)(e,{fields:S.LO,hashCode:S.Fl}),e.fields.forEach(Mr),e}Pn(Fr);const kr=Pn(Fr),Ur=Pn((e=>((0,S.rC)(e,{name:S.LO,value:S.LO,hashCode:S.Fl}),e))),jr=Pn((e=>((0,S.rC)(e,{driverId:S.LO,name:S.LO,sectionProperties:S.LO,recordType:S.LO,hashCode:S.Fl}),e.sectionProperties.forEach(Ur),e.recordType&&kr(e.recordType),e))),Gr=(Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),Pn((e=>(Dn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(jr),e)))),Vr=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Br=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),Vr(e.sourceRootRecordType),e.filter&&vr(e.filter),e))),$r=bn(((e,t)=>(Ed(e,t),vd(e,t),(0,S.rC)(e,{rootInstanceSetImplementation:S.LO,hashCode:S.Fl}),e))),zr=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,hashCode:S.Fl}),vr(e.transform),e))),Hr=Pn((e=>((0,S.rC)(e,{data:S.LO,hashCode:S.Fl}),Mn(e.sourceFlatData),e))),Yr=Pn((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e)));class Wr{}class Kr extends Wr{serverPrincipal;get hashCode(){return jn([Gn.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class Xr extends Wr{get hashCode(){return jn([Gn.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class Zr extends Wr{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return jn([Gn.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class qr extends Wr{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return jn([Gn.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class Jr extends Wr{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return jn([Gn.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class Qr extends Wr{get hashCode(){return jn([Gn.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class eo extends Wr{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return jn([Gn.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,jn(this.additionalGcpScopes)])}}class to extends Wr{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return jn([Gn.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class so extends Wr{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return jn([Gn.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class io extends Wr{kerberosRemoteServiceName;kerberosUseCanonicalHostname;constructor(e,t){super(),this.kerberosRemoteServiceName=e,this.kerberosUseCanonicalHostname=t}get hashCode(){return jn([Gn.TRINO_DELEGATED_KERBEROS_AUTHENTICATION_STRATEGY,this.kerberosRemoteServiceName,this.kerberosUseCanonicalHostname.toString()])}}class ao{}class no extends ao{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return jn([Gn.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class ro extends ao{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 jn([Gn.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class oo extends ao{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return jn([Gn.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class lo extends ao{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return jn([Gn.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",jn(this.testDataSetupSqls)])}}class co extends ao{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 jn([Gn.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 ho extends ao{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 jn([Gn.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class uo extends ao{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return jn([Gn.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class po extends ao{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 jn([Gn.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class _o extends ao{host;port;sslSpecification;catalog;schema;clientTags;constructor(e,t,s){super(),this.host=e,this.port=t,this.sslSpecification=s}get hashCode(){return jn([Gn.TRINO_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.sslSpecification,this.catalog??"",this.schema??"",this.clientTags??""])}}class mo{}class go extends mo{_UUID=(0,n.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return jn([this.from,this.to])}}class Eo extends go{get hashCode(){return jn([super.hashCode,Gn.SCHEMA_MAPPER])}}class fo extends go{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return jn([super.hashCode,Gn.TABLE_MAPPER,this.schema])}}class To{_UUID=(0,n.Z)()}class Co extends To{mappers=[];get hashCode(){return jn([Gn.MAPPER_POST_PROCESSOR,jn(this.mappers)])}}const So="{target}",xo="default";class No{}class Ao extends No{}class vo extends Ao{}class Io extends vo{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return jn([Gn.RELATIONAL_OPERATION_DYNA_FUNC,this.name,jn(this.parameters)])}}var Oo;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Oo=Oo||(Oo={}));const yo=e=>[e].concat(e.children.length?yo(e.children[0]):[]);class Ro extends No{relationalOperationElement;joinTreeNode;get hashCode(){return jn([Gn.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,jn(this.joinTreeNode?yo(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class wo extends No{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new j}}class Lo extends No{alias;column;columnName;get hashCode(){return jn([Gn.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?So:this.alias.name,this.column.value.name])}}class Po extends No{value;constructor(e){super(),this.value=e}get hashCode(){return jn([Gn.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class bo extends No{values=[];get hashCode(){return jn([Gn.RELATIONAL_OPERATION_LITERAL_LIST,jn(this.values)])}}class Do extends No{owner;name;type;nullable;get hashCode(){return jn([Gn.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Mo{}class Fo extends Mo{infinityDate}class ko{}class Uo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BIGINT])}}class jo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_SMALLINT])}}class Go extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_TINYINT])}}class Vo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_INTEGER])}}class Bo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_FLOAT])}}class $o extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_DOUBLE])}}class zo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Ho extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Yo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Wo extends ko{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Ko extends ko{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Xo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_TIMESTAMP])}}class Zo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_VARCHAR])}}class qo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BIT])}}class Jo extends ko{size;constructor(e){super(),this.size=e}get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class Qo extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_REAL])}}class el extends ko{get hashCode(){return jn([Gn.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class tl extends nr{ownerReference;constructor(e){super(e),this.ownerReference=e}}class sl extends tl{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Un).join(",")}get selfJoinPointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",xo,So].map(Un).join(",")}}class il extends tl{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Un).join(",")}get selfJoinPointerHashCode(){return[Gn.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",xo,So].map(Un).join(",")}}const al=Pn((e=>((0,S.rC)(e,{packageableElementIncludes:S.LO,packageableElementExcludes:S.LO,hashCode:S.Fl}),e.packageableElementIncludes.forEach(Mn),e.packageableElementExcludes.forEach(Mn),e))),nl=(Pn((e=>(dd(e),(0,S.rC)(e,{schemaSet:S.LO,schemaId:S.LO,contentType:S.LO,modelUnit:S.LO,_elementHashCode:S.KG}),e.schemaSet&&Mn(e.schemaSet),al(e.modelUnit),e))),Pn((e=>((0,S.rC)(e,{binding:S.LO,hashCode:S.Fl}),Mn(e.binding),e)))),rl=Pn((e=>((0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),e))),ol=(Pn((e=>($d(e),(0,S.rC)(e,{externalSource:S.LO,hashCode:S.Fl}),rl(e.externalSource),e))),Pn((e=>(0,S.rC)(e,{id:S.LO,location:S.LO,content:S.LO,hashCode:S.Fl})))),ll=(Pn((e=>(Dn(e),(0,S.rC)(e,{format:S.LO,schemas:S.LO,_elementHashCode:S.KG}),e.schemas.forEach(ol),e))),Pn((e=>e instanceof Uo||e instanceof jo||e instanceof Go||e instanceof Vo||e instanceof Bo||e instanceof $o||e instanceof Xo||e instanceof Date||e instanceof Zo||e instanceof qo||e instanceof Qo||e instanceof el?(0,S.rC)(e,{hashCode:S.Fl}):e instanceof zo||e instanceof Ho||e instanceof Yo||e instanceof Jo?(0,S.rC)(e,{size:S.LO,hashCode:S.Fl}):e instanceof Wo||e instanceof Ko?(0,S.rC)(e,{precision:S.LO,scale:S.LO,hashCode:S.Fl}):e))),cl=Pn((e=>((0,S.rC)(e,{name:S.LO,type:S.LO,nullable:S.LO,hashCode:S.Fl}),ll(e.type),e))),dl=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Mn(e.ownerReference),e))),hl=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl,selfJoinPointerHashCode:S.Fl}),Mn(e.ownerReference),e))),ul=Pn((e=>((0,S.rC)(e,{relation:S.LO,name:S.LO,database:S.LO,isSelfJoinTarget:S.LO}),(e=>{e instanceof il?hl(e):e instanceof sl&&dl(e)})(e.relation),e))),pl=Pn((e=>((0,S.rC)(e,{name:S.LO,parameters:S.LO,hashCode:S.Fl}),e.parameters.forEach(Sl),e))),_l=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),ml=Pn((e=>((0,S.rC)(e,{alias:S.LO,column:S.LO,columnName:S.LO,hashCode:S.Fl}),ul(e.alias),_l(e.column),e))),gl=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),El=Pn((e=>((0,S.rC)(e,{alias:S.LO,children:S.LO,joinType:S.LO,hashCode:S.Fl}),e.alias&&ul(e.alias),e.children.forEach(El),gl(e.join),e))),fl=Pn((e=>((0,S.rC)(e,{relationalOperationElement:S.LO,joinTreeNode:S.LO,hashCode:S.Fl}),e.relationalOperationElement&&Sl(e.relationalOperationElement),e.joinTreeNode&&El(e.joinTreeNode),e))),Tl=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),e.value instanceof No&&Sl(e.value),e))),Cl=Pn((e=>((0,S.rC)(e,{values:S.LO,hashCode:S.Fl}),e.values.forEach(Tl),e)));function Sl(e){return e instanceof Io?pl(e):e instanceof wo?ul(e):e instanceof Lo?ml(e):e instanceof Do?cl(e):e instanceof Po?Tl(e):e instanceof bo?Cl(e):e instanceof Ro?fl(e):e}const xl=Pn((e=>e)),Nl=bn(((e,t)=>{if(e instanceof Fo)return xl(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})),Al=Pn((e=>((0,S.rC)(e,{columnName:S.LO,relationalOperationElement:S.LO,hashCode:S.Fl}),Sl(e.relationalOperationElement),e))),vl=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Il=Pn((e=>((0,S.rC)(e,{joinTreeNode:S.LO,database:S.LO,filterName:S.LO,hashCode:S.Fl}),e.joinTreeNode&&El(e.joinTreeNode),vl(e.filter),e))),Ol=Pn((e=>((0,S.rC)(e,{columns:S.LO}),e.columns.forEach(Sl),e))),yl=e=>{(0,S.rC)(e,{columns:S.LO,name:S.LO})},Rl=bn(((e,t)=>(yl(e),(0,S.rC)(e,{primaryKey:S.LO,hashCode:S.Fl}),e.primaryKey.forEach(cl),e.milestoning.forEach((e=>Nl(e,t))),e))),wl=bn(((e,t)=>(yl(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(cl),e.columnMappings.forEach(Al),e.filter&&Il(e.filter),e.groupBy&&Ol(e.groupBy),e))),Ll=bn(((e,t)=>((0,S.rC)(e,{name:S.LO,tables:S.LO,views:S.LO,hashCode:S.Fl}),e.tables.forEach((e=>Rl(e,t))),e.views.forEach((e=>wl(e,t))),e))),Pl=Pn((e=>((0,S.rC)(e,{name:S.LO,operation:S.LO,hashCode:S.Fl}),Sl(e.operation),e))),bl=Pn((e=>((0,S.rC)(e,{name:S.LO,target:S.LO,aliases:S.LO,operation:S.LO,hashCode:S.Fl}),e.target&&ul(e.target),Sl(e.operation),e))),Dl=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{schemas:S.LO,joins:S.LO,filters:S.LO,_elementHashCode:S.KG}),e.schemas.forEach((e=>Ll(e,t))),e.joins.forEach(bl),e.filters.forEach(Pl),e))),Ml=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,relationalOperation:S.LO.ref,bindingTransformer:S.LO,hashCode:S.Fl}),e.bindingTransformer&&nl(e.bindingTransformer),e))),Fl=(e,t)=>(vd(e,t),Ed(e,t),(0,S.rC)(e,{id:S.LO,rootInstanceSetImplementation:S.LO,primaryKey:S.LO}),e.primaryKey.forEach(Sl),e),kl=bn(Fl),Ul=bn(((e,t)=>(Fl(e,t),(0,S.rC)(e,{inlineSetImplementation:S.LO}),Pd(e.inlineSetImplementation,t),e))),jl=bn(((e,t)=>(Fl(e,t),(0,S.rC)(e,{otherwisePropertyMapping:S.LO,hashCode:S.Fl}),Cd(e.otherwisePropertyMapping,t),e))),Gl=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{primaryKey:S.LO}),e.primaryKey.forEach(Sl),e))),Vl=bn(((e,t)=>(vd(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(Al),e.filter&&Il(e.filter),e.groupBy&&Ol(e.groupBy),e.mainTableAlias&&ul(e.mainTableAlias),e))),Bl=Pn((e=>((0,S.rC)(e,{data:S.LO,inputType:S.LO,hashCode:S.Fl}),Mn(e.database),e))),$l=Pn((e=>(0,S.rC)(e,{host:S.LO,port:S.LO,databaseName:S.LO,hashCode:S.Fl}))),zl=Pn((e=>(0,S.rC)(e,{hostname:S.LO,port:S.LO,protocol:S.LO,httpPath:S.LO,hashCode:S.Fl}))),Hl=Pn((e=>(0,S.rC)(e,{databaseName:S.LO,directory:S.LO,autoServerMode:S.LO,hashCode:S.Fl}))),Yl=Pn((e=>(0,S.rC)(e,{testDataSetupCsv:S.LO,testDataSetupSqls:S.LO,hashCode:S.Fl}))),Wl=Pn((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}))),Kl=Pn((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}))),Xl=Pn((e=>(0,S.rC)(e,{projectId:S.LO,defaultDataset:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),Zl=Pn((e=>(0,S.rC)(e,{projectId:S.LO,instanceId:S.LO,databaseId:S.LO,proxyHost:S.LO,proxyPort:S.LO,hashCode:S.Fl}))),ql=Pn((e=>(0,S.rC)(e,{ssl:S.LO,trustStorePathVaultReference:S.LO,trustStorePasswordVaultReference:S.LO,hashCode:S.Fl}))),Jl=Pn((e=>((0,S.rC)(e,{host:S.LO,port:S.LO,catalog:S.LO,schema:S.LO,clientTags:S.LO,hashCode:S.Fl}),ql(e.sslSpecification),e))),Ql=Pn((e=>(0,S.rC)(e,{serverPrincipal:S.LO,hashCode:S.Fl}))),ec=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl}))),tc=Pn((e=>(0,S.rC)(e,{apiToken:S.LO,hashCode:S.Fl}))),sc=Pn((e=>(0,S.rC)(e,{oauthKey:S.LO,scopeName:S.LO,hashCode:S.Fl}))),ic=Pn((e=>(0,S.rC)(e,{privateKeyVaultReference:S.LO,passPhraseVaultReference:S.LO,publicUserName:S.LO,hashCode:S.Fl}))),ac=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl}))),nc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,userNameVaultReference:S.LO,passwordVaultReference:S.LO,baseVaultReference:S.LO}))),rc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,serviceAccountEmail:S.LO,additionalGcpScopes:S.LO}))),oc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,vaultReference:S.LO}))),lc=Pn((e=>(0,S.rC)(e,{hashCode:S.Fl,kerberosRemoteServiceName:S.LO,kerberosUseCanonicalHostname:S.LO}))),cc=e=>{(0,S.rC)(e,{from:S.LO,to:S.LO,hashCode:S.Fl})},dc=Pn((e=>(cc(e),e))),hc=Pn((e=>(cc(e),(0,S.rC)(e,{schema:S.LO}),dc(e.schema),e))),uc=bn(((e,t)=>((e=>{$d(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 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 Zl(e);if(e instanceof _o)return Jl(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 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 Qr)return ac(e);if(e instanceof to)return nc(e);if(e instanceof eo)return rc(e);if(e instanceof so)return oc(e);if(e instanceof io)return lc(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 Co)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 Eo?dc(e):e instanceof fo&&hc(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 pc{id}class _c extends pc{__parent;assertions=[]}class mc extends pc{__parent;tests=[]}class gc extends _c{query;get hashCode(){return jn([Gn.MAPPING_TEST,this.query,this.id,jn(this.assertions)])}}class Ec extends mc{mappingStoreTestDatas=[];get hashCode(){return jn([Gn.MAPPING_TEST_SUITE,jn(this.mappingStoreTestDatas),this.id,jn(this.tests)])}}class fc extends _c{serializationFormat;parameters=[];keys=[];get hashCode(){return jn([Gn.SERVICE_TEST,this.id,jn(this.assertions),jn(this.parameters),jn(this.keys),this.serializationFormat??""])}}class Tc extends mc{testData;get hashCode(){return jn([Gn.SERVICE_TEST_SUITE,this.id,jn(this.tests),this.testData])}}class Cc{id;parentTest}class Sc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO,this.id,Bn(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class xc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class Nc extends Cc{expected;get hashCode(){return jn([Gn.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Ac{}class vc extends Ac{dataElement;get hashCode(){return jn([Gn.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Ic extends Ac{contentType;data;get hashCode(){return jn([Gn.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Oc extends Ac{instances;get hashCode(){return jn([Gn.MODEL_STORE_DATA,jn(Array.from(this.instances.keys()).map((e=>e.path))),Bn(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class yc extends Ac{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return jn([Gn.RELATIONAL_CSV_DATA_TABLE,jn(this.tables)])}}const Rc=Pn((e=>((0,S.rC)(e,{contentType:S.LO,data:S.LO,hashCode:S.Fl}),e))),wc=Pn((e=>((0,S.rC)(e,{dataElement:S.LO,hashCode:S.Fl}),e))),Lc=Pn((e=>((0,S.rC)(e,{instances:S.LO,hashCode:S.Fl}),e))),Pc=Pn((e=>((0,S.rC)(e,{values:S.LO,table:S.LO,schema:S.LO,hashCode:S.Fl}),e))),bc=Pn((e=>((0,S.rC)(e,{tables:S.LO,hashCode:S.Fl}),e.tables.forEach(Pc),e)));function Dc(e,t){if(e instanceof vc)return wc(e);if(e instanceof Ic)return Rc(e);if(e instanceof Oc)return Lc(e);if(e instanceof yc)return bc(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 Mc=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{stereotypes:S.LO,taggedValues:S.LO,data:S.LO,_elementHashCode:S.KG}),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),Dc(e.data,t),e)));class Fc{}class kc extends Fc{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return jn([Gn.SERVICE_PURE_EXECUTION,this.func])}}class Uc extends kc{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return jn([Gn.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class jc extends kc{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return jn([Gn.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,jn(this.executionParameters)])}}class Gc{_OWNER;constructor(e){this._OWNER=e}}class Vc extends Gc{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return jn([Gn.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,jn(this.asserts)])}}class Bc extends Gc{tests=[];get hashCode(){return jn([Gn.SERVICE_LEGACY_MULTI_EXECUTION_TEST,jn(this.tests)])}}const $c=bn(((e,t)=>((0,S.rC)(e,{connectionId:S.LO,testData:S.LO,hashCode:S.Fl}),Dc(e.testData,t),e))),zc=Pn((e=>((0,S.rC)(e,{name:S.LO,value:S.LO.ref,hashCode:S.Fl}),e))),Hc=Pn((e=>((0,S.rC)(e,{assertion:S.LO,hashCode:S.Fl,id:S.LO}),vr(e.assertion),e))),Yc=Pn((e=>((0,S.rC)(e,{assertions:S.LO,description:S.LO,parameters:S.LO,hashCode:S.Fl}),e.assertions.forEach(Hc),e.parameters.forEach(vr),e))),Wc=bn(((e,t)=>((0,S.rC)(e,{connectionsTestData:S.LO,hashCode:S.Fl}),e.connectionsTestData.forEach((e=>$c(e,t))),e))),Kc=Pn((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(zc),e.assertions.forEach(cd),e))),Xc=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,testData:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>ld(e,t))),Wc(e.testData,t),e))),Zc=Pn((e=>((0,S.rC)(e,{parametersValues:S.LO,assert:S.LO,singleExecutionTestParent:S.LO,hashCode:S.Fl}),vr(e.assert),e))),qc=Pn((e=>((0,S.rC)(e,{data:S.LO,asserts:S.LO,hashCode:S.Fl}),e.asserts.forEach(Zc),e))),Jc=Pn((e=>(qc(e),(0,S.rC)(e,{key:S.LO}),e))),Qc=Pn((e=>((0,S.rC)(e,{tests:S.LO,hashCode:S.Fl}),e.tests.forEach(Jc),e))),ed=e=>{(0,S.rC)(e,{func:S.LO}),vr(e.func)},td=bn(((e,t)=>(ed(e),(0,S.rC)(e,{runtime:S.LO,hashCode:S.Fl}),e.mapping&&Mn(e.mapping),e.runtime&&th(e.runtime,t),e))),sd=bn(((e,t)=>((0,S.rC)(e,{key:S.LO,runtime:S.LO,hashCode:S.Fl}),Mn(e.mapping),th(e.runtime,t),e))),id=bn(((e,t)=>(ed(e),(0,S.rC)(e,{executionKey:S.LO,executionParameters:S.LO,hashCode:S.Fl}),e.executionParameters.forEach((e=>sd(e,t))),e))),ad=bn(((e,t)=>(Dn(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(oh),e.taggedValues.forEach(ch),((e,t)=>{e instanceof Uc?td(e,t):e instanceof jc&&id(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Vc?qc(e):e instanceof Bc&&Qc(e)})(e.test),e.tests.forEach((e=>Xc(e,t))),e.postValidations.forEach((e=>Yc(e))),e))),nd=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),e))),rd=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),Rc(e.expected),e))),od=Pn((e=>((0,S.rC)(e,{id:S.LO,expected:S.LO,hashCode:S.Fl}),Rc(e.expected),e)));function ld(e,t){if(e instanceof fc)return Kc(e);if(e instanceof gc)return ud(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 cd(e){return e instanceof Sc?nd(e):e instanceof xc?od(e):e instanceof Nc?rd(e):e}const dd=e=>{Dn(e),(0,S.rC)(e,{includes:S.LO}),e.includes.forEach(Mn)},hd=bn(((e,t)=>((0,S.rC)(e,{store:S.LO,data:S.LO,hashCode:S.Fl}),Dc(e.data,t),e))),ud=Pn((e=>((0,S.rC)(e,{id:S.LO,query:S.LO,assertions:S.LO,hashCode:S.Fl}),e.assertions.forEach(cd),e))),pd=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,tests:S.LO,mappingStoreTestDatas:S.LO,hashCode:S.Fl}),e.tests.forEach((e=>ld(e,t))),e.mappingStoreTestDatas.forEach((e=>hd(e,t))),e))),_d=Pn((e=>((0,S.rC)(e,{value:S.LO,valueForSerialization:S.Fl}),Mn(e.ownerReference),e))),md=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),gd=Pn((e=>((0,S.rC)(e,{localMappingProperty:S.LO,localMappingPropertyType:S.LO,localMappingPropertyMultiplicity:S.LO,hashCode:S.Fl}),Mn(e.localMappingPropertyType),e))),Ed=(e,t)=>{(0,S.rC)(e,{sourceSetImplementation:S.LO,targetSetImplementation:S.LO}),Ah(e.property),md(e.sourceSetImplementation),e.targetSetImplementation&&md(e.targetSetImplementation),e.localMappingProperty&&gd(e.localMappingProperty)},fd=bn(((e,t)=>(Ed(e,t),(0,S.rC)(e,{transformer:S.LO,transform:S.LO,explodeProperty:S.LO,hashCode:S.Fl}),e.transformer&&_d(e.transformer),vr(e.transform),e)));class Td{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){fd(e,this.observerContext)}visit_FlatDataPropertyMapping(e){zr(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){$r(e,this.observerContext)}visit_RelationalPropertyMapping(e){Ml(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Dr(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){kl(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Ul(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){jl(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Cd=(e,t)=>(e.accept_PropertyMappingVisitor(new Td(t)),e),Sd=Pn((e=>(0,S.rC)(e,{isDefault:S.Fl,valueForSerialization:S.Fl}))),xd=Pn((e=>(0,S.rC)(e,{valueForSerialization:S.Fl}))),Nd=e=>{(0,S.rC)(e,{root:S.LO}),Mn(e.class),Sd(e.id),xd(e.root)},Ad=Pn((e=>((0,S.rC)(e,{setImplementation:S.LO,class:S.LO,properties:S.LO}),e))),vd=(e,t)=>{Nd(e),(0,S.rC)(e,{mappingClass:S.LO,propertyMappings:S.LO}),e.mappingClass&&Ad(e.mappingClass),e.propertyMappings.forEach((e=>Cd(e,t)))},Id=Pn((e=>((0,S.rC)(e,{}),md(e.setImplementation),e))),Od=e=>{Nd(e),(0,S.rC)(e,{parameters:S.LO,operation:S.LO,hashCode:S.Fl}),e.parameters.forEach(Id)},yd=Pn((e=>(Od(e),e))),Rd=Pn((e=>(Od(e),(0,S.rC)(e,{validationFunction:S.LO}),vr(e.validationFunction),e))),wd=bn(((e,t)=>(vd(e,t),(0,S.rC)(e,{filter:S.LO,hashCode:S.Fl}),e.srcClass&&Mn(e.srcClass),e.filter&&vr(e.filter),e)));class Ld{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){Rd(e)}visit_OperationSetImplementation(e){yd(e)}visit_PureInstanceSetImplementation(e){wd(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Br(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Gl(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Vl(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Pd=(e,t)=>(e.accept_SetImplementationVisitor(new Ld(t)),e),bd=Pn((e=>((0,S.rC)(e,{original:S.LO,substitute:S.LO}),Mn(e.original),Mn(e.substitute),e))),Dd=Pn((e=>((0,S.rC)(e,{included:S.LO,storeSubstitutions:S.LO}),Mn(e.included),e.storeSubstitutions.forEach(bd),e))),Md=Pn((e=>(0,S.rC)(e,{value:S.LO}))),Fd=Pn((e=>((0,S.rC)(e,{sourceValues:S.LO,hashCode:S.Fl}),fh(e.enum),e.sourceValues.forEach(Md),e))),kd=Pn((e=>((0,S.rC)(e,{sourceType:S.LO,enumValueMappings:S.LO,hashCode:S.Fl}),Mn(e.enumeration),Sd(e.id),e.sourceType&&Mn(e.sourceType),e.enumValueMappings.forEach(Fd),e))),Ud=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,stores:S.LO,propertyMappings:S.LO,hashCode:S.Fl}),Mn(e.association),Sd(e.id),e.stores.forEach(Mn),e.propertyMappings.forEach((e=>Cd(e,t))),e))),jd=Pn((e=>((0,S.rC)(e,{inputType:S.LO,data:S.LO,hashCode:S.Fl}),Mn(e.sourceClass),e))),Gd=Pn((e=>(0,S.rC)(e,{expectedOutput:S.LO,hashCode:S.Fl}))),Vd=bn(((e,t)=>((0,S.rC)(e,{name:S.LO,query:S.LO,inputData:S.LO,assert:S.LO,hashCode:S.Fl}),vr(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof xr)return jd(e);if(e instanceof fr)return Hr(e);if(e instanceof Nr)return Bl(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 pr&&Gd(e)})(e.assert),e))),Bd=bn(((e,t)=>(Dn(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(Dd),e.classMappings.forEach((e=>Pd(e,t))),e.enumerationMappings.forEach(kd),e.associationMappings.forEach((e=>Ud(e,t))),e.test.forEach((e=>Vd(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Tc?Xc(e,t):e instanceof Ec?pd(e,t):e}(e,t))),e))),$d=e=>{(0,S.rC)(e,{store:S.LO}),Mn(e.store)},zd=Pn((e=>($d(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),Hd=Pn((e=>($d(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Mn(e.class),e))),Yd=Pn((e=>($d(e),(0,S.rC)(e,{url:S.LO,hashCode:S.Fl}),Mn(e.class),e))),Wd=Pn((e=>($d(e),(0,S.rC)(e,{mappings:S.LO,hashCode:S.Fl}),e.mappings.forEach(Mn),e)));class Kd{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){zd(e)}visit_ModelChainConnection(e){Wd(e)}visit_JsonModelConnection(e){Hd(e)}visit_XmlModelConnection(e){Yd(e)}visit_FlatDataConnection(e){Yr(e)}visit_RelationalDatabaseConnection(e){uc(e,this.observerContext)}}const Xd=(e,t)=>(e.accept_ConnectionVisitor(new Kd(t)),e),Zd=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{connectionValue:S.LO,_elementHashCode:S.KG}),Xd(e.connectionValue,t),e))),qd=bn(((e,t)=>((0,S.rC)(e,{id:S.LO,connection:S.LO,hashCode:S.Fl}),Xd(e.connection,t),e))),Jd=bn(((e,t)=>((0,S.rC)(e,{storeConnections:S.LO,hashCode:S.Fl}),Mn(e.store),e.storeConnections.forEach((e=>qd(e,t))),e))),Qd=bn(((e,t)=>((0,S.rC)(e,{mappings:S.LO,connections:S.LO,hashCode:S.Fl}),e.mappings.forEach(Mn),e.connections.forEach((e=>Jd(e,t))),e))),eh=Pn((e=>((0,S.rC)(e,{hashCode:S.Fl}),Mn(e.packageableRuntime),e))),th=(e,t)=>e instanceof gr?eh(e):e instanceof mr?Qd(e,t):e,sh=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{runtimeValue:S.LO,_elementHashCode:S.KG}),Qd(e.runtimeValue,t),e))),ih=bn(((e,t)=>(Dn(e),(0,S.rC)(e,{_elementHashCode:S.KG}),e)));class ah{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){rh(e,this.observerContext)}visit_SectionIndex(e){ph(e)}visit_PrimitiveType(e){}visit_Profile(e){gh(e)}visit_Enumeration(e){Th(e)}visit_Measure(e){Sh(e)}visit_Class(e){Ih(e)}visit_Association(e){Oh(e)}visit_ConcreteFunctionDefinition(e){yh(e)}visit_FlatData(e){Gr(e)}visit_Database(e){Dl(e,this.observerContext)}visit_Mapping(e){Bd(e,this.observerContext)}visit_Service(e){ad(e,this.observerContext)}visit_ExecutionEnvironmentInstance(e){ih(e,this.observerContext)}visit_PackageableRuntime(e){sh(e,this.observerContext)}visit_PackageableConnection(e){Zd(e,this.observerContext)}visit_FileGenerationSpecification(e){cr(e)}visit_GenerationSpecification(e){hr(e)}visit_DataElement(e){Mc(e,this.observerContext)}}const nh=bn(((e,t)=>(e.accept_PackageableElementVisitor(new ah(t)),e))),rh=bn(((e,t)=>((e=>{Dn(e),(0,S.rC)(e,{children:S.LO,hashCode:S.KG})})(e),e.children.forEach((e=>{e instanceof er?rh(e,t):nh(e,t)})),e))),oh=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),lh=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),e))),ch=Pn((e=>((0,S.rC)(e,{value:S.LO,hashCode:S.Fl}),lh(e.tag),e))),dh=Pn((e=>(0,S.rC)(e,{rawType:S.LO}))),hh=Pn((e=>((0,S.rC)(e,{value:S.LO}),dh(e.value),Mn(e.ownerReference),e))),uh=Pn((e=>((0,S.rC)(e,{parserName:S.LO,elements:S.LO}),e instanceof sr?(0,S.rC)(e,{imports:S.LO,hashCode:S.Fl}):e instanceof ir&&(0,S.rC)(e,{hashCode:S.Fl}),e))),ph=Pn((e=>(Dn(e),(0,S.rC)(e,{sections:S.LO,_elementHashCode:S.KG}),e.sections.forEach(uh),e))),_h=Pn((e=>(0,S.rC)(e,{value:S.LO}))),mh=Pn((e=>(0,S.rC)(e,{value:S.LO}))),gh=Pn((e=>(Dn(e),(0,S.rC)(e,{p_stereotypes:S.LO,p_tags:S.LO,_elementHashCode:S.KG}),e.p_stereotypes.forEach(_h),e.p_tags.forEach(mh),e))),Eh=Pn((e=>((0,S.rC)(e,{name:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),fh=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Th=Pn((e=>(Dn(e),(0,S.rC)(e,{values:S.LO,stereotypes:S.LO,taggedValues:S.LO,_elementHashCode:S.KG}),e.values.forEach(Eh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Ch=Pn((e=>((0,S.rC)(e,{measure:S.LO,conversionFunction:S.LO,hashCode:S.Fl}),e.conversionFunction&&vr(e.conversionFunction),e))),Sh=Pn((e=>(Dn(e),(0,S.rC)(e,{canonicalUnit:S.LO,nonCanonicalUnits:S.LO,_elementHashCode:S.KG}),e.canonicalUnit&&Ch(e.canonicalUnit),e.nonCanonicalUnits.forEach(Ch),e))),xh=Pn((e=>((0,S.rC)(e,{name:S.LO,multiplicity:S.LO,stereotypes:S.LO,taggedValues:S.LO,hashCode:S.Fl}),hh(e.genericType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Nh=Pn((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}),hh(e.genericType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Ah=Pn((e=>((0,S.rC)(e,{value:S.LO,pointerHashCode:S.Fl}),Mn(e.ownerReference),e))),vh=Pn((e=>((0,S.rC)(e,{name:S.LO,functionDefinition:S.LO,externalId:S.LO,enforcementLevel:S.LO,messageFunction:S.LO,hashCode:S.Fl}),vr(e.functionDefinition),e.messageFunction&&vr(e.messageFunction),e))),Ih=Pn((e=>(Dn(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(xh),e.propertiesFromAssociations.forEach(xh),e.derivedProperties.forEach(Nh),e.generalizations.forEach(hh),e.constraints.forEach(vh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Oh=Pn((e=>(Dn(e),(0,S.rC)(e,{properties:S.LO,stereotypes:S.LO,taggedValues:S.LO,derivedProperties:S.LO,_elementHashCode:S.KG}),e.properties.forEach(xh),e.derivedProperties.forEach(Nh),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),yh=Pn((e=>(Dn(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),Mn(e.returnType),e.stereotypes.forEach(oh),e.taggedValues.forEach(ch),e))),Rh=Pn((e=>e instanceof qn?Th(e):e instanceof Jn?Ch(e):e instanceof Xn?Ih(e):e instanceof Qn?Sh(e):e)),wh=(Pn((e=>e instanceof qn?Th(e):e instanceof Jn?Ch(e):e)),Pn((e=>(0,S.rC)(e,{_dummyObservable:S.LO})))),Lh=Pn((e=>((0,S.rC)(e,{value:S.LO}),Mn(e.ownerReference),e))),Ph=Pn((e=>(wh(e),(0,S.rC)(e,{id:S.LO,hideProperties:S.LO,hideTaggedValues:S.LO,hideStereotypes:S.LO,hashCode:S.Fl}),Mn(e.class),e))),bh=Pn((e=>(Lh(e.classView),e))),Dh=Pn((e=>((0,S.rC)(e,{path:S.LO,pathForSerialization:S.Fl}),bh(e.from),bh(e.to),e))),Mh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),e))),Fh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),Ah(e.property),Mn(e.association),e))),kh=Pn((e=>(Dh(e),(0,S.rC)(e,{hashCode:S.Fl}),Ah(e.property),e))),Uh=Pn((e=>(Dn(e),(0,S.rC)(e,{classViews:S.LO,associationViews:S.LO,generalizationViews:S.LO,propertyViews:S.LO,_elementHashCode:S.KG}),e.classViews.forEach(Ph),e.associationViews.forEach(Fh),e.generalizationViews.forEach(Mh),e.propertyViews.forEach(kh),e)));var jh;!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"}(jh=jh||(jh={}));class Gh extends Wn{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return jn([jh.DIAGRAM,this.path,jn(this.classViews),jn(this.generalizationViews),jn(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Vh="Diagram";class Bh extends Ln{constructor(){super(wn.Rw.LW,wn.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Vh]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Gh)return Vh}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Gh)return Uh(e)}]}}class $h{package;name;get path(){return`${this.package}${Ce}${this.name}`}get hashCode(){return jn([Gn.PACKAGEABLE_ELEMENT,this.path])}}class zh extends $h{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return jn([jh.DIAGRAM,this.path,jn(this.classViews),jn(this.generalizationViews),jn(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Hh{rectangle;position;get hashCode(){return jn([jh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Yh extends Hh{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return jn([jh.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Wh{x;y;get hashCode(){return jn([jh.POINT,this.x.toString(),this.y.toString()])}}class Kh{width;height;get hashCode(){return jn([jh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Xh{points=[]}class Zh{sourceView;targetView;line;get hashCode(){return jn([jh.RELATIONSHIP_VIEW,this.sourceView,this.targetView,jn(this.line.points)])}}class qh extends Zh{property;get hashCode(){return jn([jh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class Jh extends qh{get hashCode(){return jn([jh.PROPERTY_VIEW,super.hashCode])}}class Qh extends Zh{get hashCode(){return jn([jh.GENERALIZATION_VIEW,super.hashCode])}}class eu{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return jn([Gn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new eu(0,0);static ZERO_ONE=new eu(0,1);static ZERO_MANY=new eu(0,void 0);static ONE=new eu(1,1);static ONE_MANY=new eu(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 jn([Gn.PACKAGEABLE_ELEMENT_POINTER,this.type??"",this.path])}},{path:(0,We.Ru)(),type:(0,We.jt)((0,We.Ru)())});const tu=(0,We.yu)(eu,{lowerBound:(0,We.Ru)(),upperBound:(0,We.jt)((0,We.Ru)())});class su{class;property;get hashCode(){return jn([Gn.PROPERTY_POINTER,this.property,this.class??""])}}class iu{}class au{queryTimeOutInSeconds=null;enableConstraints=!0}var nu,ru;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(nu||(nu={})),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"}(ru=ru||(ru={})),(0,We.yu)(class extends au{},{_type:Ze(nu.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,We.Ru)(),enableConstraints:(0,We.Ru)()});const ou=(0,We.yu)(class extends iu{body;parameters;get hashCode(){return jn([Gn.RAW_LAMBDA,$n(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(ru.LAMBDA),body:(0,We.LZ)(),parameters:(0,We.LZ)()}),lu=(0,We.yu)(class extends iu{class;name;multiplicity;get hashCode(){return jn([Gn.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(ru.VARIABLE),class:(0,We.Ru)(),multiplicity:Xe(tu),name:(0,We.Ru)()});(0,We.yu)(class extends iu{multiplicity=eu.ONE;type;value;get hashCode(){return jn([Gn.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 ru.CINTEGER;case Ae.DECIMAL:return ru.CDECIMAL;case Ae.STRING:return ru.CSTRING;case Ae.BOOLEAN:return ru.CBOOLEAN;case Ae.FLOAT:return ru.CFLOAT;case Ae.DATETIME:return ru.CDATETIME;case Ae.STRICTDATE:return ru.CSTRICTDATE;case Ae.STRICTTIME:return ru.CSTRICTTIME;case Ae.LATESTDATE:return ru.CLATESTDATE;default:throw new j(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case ru.CINTEGER:return Ae.INTEGER;case ru.CDECIMAL:return Ae.DECIMAL;case ru.CSTRING:return Ae.STRING;case ru.CBOOLEAN:return Ae.BOOLEAN;case ru.CFLOAT:return Ae.FLOAT;case ru.CDATETIME:return Ae.DATETIME;case ru.CSTRICTDATE:return Ae.STRICTDATE;case ru.CSTRICTTIME:return Ae.STRICTTIME;case ru.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 cu=(0,We.yu)(su,{class:(0,We.jt)((0,We.Ru)()),property:(0,We.Ru)()}),du=(0,We.yu)(class{profile;value;get hashCode(){return jn([Gn.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),hu=(0,We.yu)(class{profile;value;get hashCode(){return jn([Gn.TAG_POINTER,this.value,this.profile])}},{profile:(0,We.Ru)(),value:(0,We.Ru)()}),uu=(0,We.yu)(class{tag;value;get hashCode(){return jn([Gn.TAGGED_VALUE,this.tag,this.value])}},{tag:Xe(hu),value:(0,We.Ru)()}),pu=((0,We.yu)(class extends $h{stereotypes=[];tags=[];get hashCode(){return jn([Gn.PROFILE,this.path,jn(this.stereotypes),jn(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 jn([Gn.ENUM_VALUE,this.value,jn(this.stereotypes),jn(this.taggedValues)])}},{stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),value:(0,We.Ru)()})),_u=((0,We.yu)(class extends $h{values=[];stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.ENUMERATION,this.path,jn(this.values),jn(this.stereotypes),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),values:(0,We.pb)(Xe(pu))}),(0,We.yu)(class extends $h{measure;conversionFunction;get hashCode(){return jn([Gn.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}},{_type:Ze("unit"),conversionFunction:(0,We.jt)(Xe(ou)),measure:(0,We.Ru)(),name:(0,We.Ru)(),package:(0,We.Ru)()})),mu=((0,We.yu)(class extends $h{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return jn([Gn.MEASURE,this.path,this.canonicalUnit??"",jn(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,We.jt)(Xe(_u)),name:(0,We.Ru)(),nonCanonicalUnits:(0,We.pb)(Xe(_u)),package:(0,We.Ru)()}),(0,We.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",jn(this.stereotypes),jn(this.taggedValues)])}},{aggregation:(0,We.jt)((0,We.Ru)()),multiplicity:Xe(tu),name:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0}),type:(0,We.Ru)()})),gu=(0,We.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return jn([Gn.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,jn(this.stereotypes),jn(this.taggedValues),$n(this.parameters,this.body)])}},{body:(0,We.LZ)(),name:(0,We.Ru)(),parameters:(0,We.LZ)(),returnMultiplicity:Xe(tu),returnType:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),Eu=(0,We.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return jn([Gn.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(ou),messageFunction:(0,We.jt)(Xe(ou)),name:(0,We.Ru)()});var fu;(0,We.yu)(class extends $h{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return jn([Gn.CLASS,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.superTypes),jn(this.constraints),jn(this.stereotypes),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:Qe(Eu,{INTERNAL__forceReturnEmptyInTest:!0}),name:(0,We.Ru)(),originalMilestonedProperties:et((()=>We.AM),(()=>We.AM),{INTERNAL__forceReturnEmptyInTest:!0}),package:(0,We.Ru)(),properties:Qe(mu,{INTERNAL__forceReturnEmptyInTest:!0}),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(gu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),superTypes:(fu={INTERNAL__forceReturnEmptyInTest:!0},et((e=>e),(e=>e),fu)),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends $h{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return jn([Gn.ASSOCIATION,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.stereotypes),jn(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(mu)),derivedProperties:(0,We.bm)("qualifiedProperties",Qe(gu,{INTERNAL__forceReturnEmptyInTest:!0})),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})}),(0,We.yu)(class extends $h{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return jn([Gn.FUNCTION,this.path,jn(this.parameters),this.returnType,jn(this.taggedValues),jn(this.stereotypes),$n(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(lu)),postConstraints:(0,We.pb)((0,We.Ru)()),preConstraints:(0,We.pb)((0,We.Ru)()),returnMultiplicity:Xe(tu),returnType:(0,We.Ru)(),stereotypes:Qe(du,{INTERNAL__forceReturnEmptyInTest:!0}),taggedValues:Qe(uu,{INTERNAL__forceReturnEmptyInTest:!0})});const Tu="diagram",Cu=(0,We.yu)(Wh,{x:(0,We.Ru)(),y:(0,We.Ru)()}),Su=(0,We.yu)(Kh,{height:(0,We.Ru)(),width:(0,We.Ru)()}),xu=(0,We.yu)(Xh,{points:(0,We.pb)(Xe(Cu))}),Nu=(0,We.yu)(Yh,{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(Cu),rectangle:Xe(Su)}),Au=(0,We.yu)(Jh,{line:Xe(xu),property:Xe(cu),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),vu=(0,We.yu)(Qh,{line:Xe(xu),sourceView:(0,We.Ru)(),targetView:(0,We.Ru)()}),Iu=(0,We.yu)(zh,{_type:Ze(Tu),classViews:(0,We.pb)(Xe(Nu)),generalizationViews:(0,We.pb)(Xe(vu)),name:(0,We.Ru)(),package:(0,We.Ru)(),propertyViews:(0,We.pb)(Xe(Au))});class Ou extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var yu=s(95903);const Ru=e=>H((0,yu.Z)(e.split(Ce))),wu=e=>{const t=e.lastIndexOf(Ce);return-1===t?void 0:e.substring(0,t)},Lu=(e,t)=>{const s=e.lastIndexOf(Ce);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+Ce.length,e.length)]},Pu=(e,t)=>`${e?`${e}${Ce}`:""}${t}`,bu=(e,t)=>{e.children.push(t),t.package=e},Du=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Mu=(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 er&&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 er(n),r.package=e,e.children.push(r)}return i&&i.set(Pu(e.path,n),r),-1!==a?Mu(r,t.substring(a+Ce.length),s,i):r},Fu=(e,t,s,i)=>{if(i){const a=i.get(Pu(e.path,t));if(a)return a;let n=t;for(;""!==n;){const a=Pu(e.path,n),r=i.get(a);if(r)return Mu(r,t.substring(n.length+Ce.length,t.length),s,i);const o=n.lastIndexOf(Ce);n=-1!==o?n.substring(0,o):""}}return Mu(e,t,s,i)},ku=(e,t,s)=>(X(t,"Package path is required"),Fu(e.root,t,!0,s)),Uu=(e,t)=>K(e.rawType,t),ju=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Uu(e.value,Xn);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Gu=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Vu=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Bu=(e,t)=>`${H(e,"Package path is required")}${Ce}${H(t,"Name is required")}`;class $u{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`)})(Bu(e.package,e.name),t,i);const a=this.firstPass(e,t);return bu(ku(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 zu=e=>e.classView.value.id,Hu=e=>{const t=new Jh,s=new Xh;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new su;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=zu(e.from),t.targetView=zu(e.to),t},Yu=e=>{const t=new Qh,s=new Xh;return s.points=e.pathForSerialization,t.line=s,t.sourceView=zu(e.from),t.targetView=zu(e.to),t},Wu=e=>{const t=new Yh;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 Wh;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Kh;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Ku{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return jn([jh.POINT,this.x.toString(),this.y.toString()])}}class Xu{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return jn([jh.RECTANGLE,this.width.toString(),this.height.toString()])}}class Zu{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Ku(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 Zu(new Ku(e.position.x+e.rectangle.width,e.position.y),new Xu(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Zu(new Ku(e.position.x,e.position.y+e.rectangle.height),new Xu(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,jn([jh.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class qu extends Zu{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Ku(0,0),new Xu(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return jn([jh.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Ju{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class Qu extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ep extends Qu{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ep(e)}}class tp{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new Ju(ep.create(t)),this.to=new Ju(ep.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 Ku(a,n):(t&&(e._offsetX=0,e._offsetY=0),new Ku(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)=>{q(Boolean(e.length),"Path requires at least 1 point");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];const o=e.slice(i-1,n+2);return o.length<2?[a,r]:o};get pathForSerialization(){return tp.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return jn([jh.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,jn(this.pathForSerialization)])}}class sp extends tp{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return jn([jh.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class ip extends sp{get hashCode(){return jn([jh.PROPERTY_VIEW,super.hashCode])}}class ap extends tp{get hashCode(){return jn([jh.GENERALIZATION_VIEW,super.hashCode])}}class np{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new np(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new np(this.x/e,this.y/e)}normal(e){return new np(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const rp=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 Ku(t,s)},op=(e,t)=>e.classViews.find((e=>e.id===t)),lp=(e,t)=>{e.path=t},cp=e=>{const t=e.buildFullPath(),s=tp.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=H(s[0],"Diagram path expected to have at least 2 points").x-t.x,e.from._offsetY=H(s[0],"Diagram path expected to have at least 2 points").y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=np.fromPoints(s[e+1],s[e]).unit(),a=np.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])}lp(e,i)},dp=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),hp=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),up=e=>new Ku(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),pp=e=>{const t=up(e);return new Zu(new Ku(t.x-5,t.y-5),new Xu(10,10))},_p=(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)),mp=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new Ku(t,s)};class gp extends Ou{constructor(){super(wn.Rw.zE,wn.i8)}V1_getExtraElementBuilders(){return[new $u({elementClassName:"Diagram",_class:zh,firstPass:(e,t)=>{W(e,zh);const s=new Gh(e.name),i=Bu(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Gh),s},secondPass:(e,t)=>{W(e,zh);const s=(i=Bu(e.package,e.name),a=t.currentSubGraph,H(a.getOwnNullableExtensionElement(i,Gh),`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 qu(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 Xu(t,s)})(e.rectangle),i.position=mp(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(op(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),a=H(op(s,H(e.targetView)),"Property view 'targetView' field is missing"),n=t.resolveOwnProperty(e.property),r=new ip(s,n,i,a);r.path=e.line.points.map((e=>mp(e)));try{cp(r)}catch(e){G(e),t.logService.warn(h.create(e.message))}return r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t,s)=>{z(e.line,"Generalization view 'line' field is missing");const i=H(op(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),a=H(op(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),n=new ap(t,i,a);n.path=e.line.points.map((e=>mp(e)));try{cp(n)}catch(e){G(e),s.logService.warn(h.create(e.message))}return n})(e,s,t)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof zh)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof zh)return(0,We.qC)(Iu,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===Tu)return(0,We.vB)(Iu,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Gh)return(e=>{const t=new zh;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Wu),t.generalizationViews=e.generalizationViews.map(Yu),t.propertyViews=e.propertyViews.map(Hu),t})(e)}]}}class Ep extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class fp extends Ep{constructor(){super(wn.Rw.f1,wn.i8)}getExtraPureGraphExtensionClasses(){return[Gh]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Gh).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Xn?Gu(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 Tp extends c{constructor(){super(wn.Rw.NA,wn.i8,[new fp,new Bh,new gp])}}class Cp{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Sp=(0,At.createContext)(void 0),xp=({children:e})=>{const t=vn(),s=(0,Nt.fv)((()=>new Cp(t)));return(0,T.jsx)(Sp.Provider,{value:s,children:e})},Np="/welcome.pure",Ap="/",vp="::";var Ip,Op;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(Ip=Ip||(Ip={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Op=Op||(Op={}));const yp=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Rp="dummy_problem_marker_owner";var wp;!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"}(wp=wp||(wp={}));class Lp{pureId;pureType;pureName;get id(){return this.pureId}}class Pp extends Lp{deprecated}(0,We.yu)(Pp,{pureId:(0,We.Ru)(),pureType:(0,We.Ru)(),deprecated:(0,We.Ru)()});class bp extends Lp{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,We.yu)(bp,{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 Dp extends Lp{RO;notpublic;user;file;line;column}(0,We.yu)(Dp,{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 Mp{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)(Mp,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.classPath?(0,We.vB)(bp,e):e.file?(0,We.vB)(Dp,e):(0,We.vB)(Pp,e))),id:(0,We.Ru)(),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const Fp=e=>e.startsWith("/")?e.substring(1,e.length):e;class kp{content;RO;constructor(){(0,S.rC)(this,{content:S.LO,hashCode:S.Fl,setContent:S.aD})}setContent(e){this.content=e}get hashCode(){return Un(this.content)}}(0,We.yu)(kp,{content:(0,We.Ru)(),RO:(0,We.Ru)()});class Up{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class jp extends Up{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var Gp;!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_"}(Gp=Gp||(Gp={}));const Vp=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Bp{source;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(Bp,{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 $p{first;second}(0,We.yu)($p,{first:(0,We.Ru)(),second:(0,We.pb)((0,We.Ry)(Bp))});class zp{uuid=(0,n.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class Hp{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 Yp extends zp{editorStore;constructor(e){super(),this.editorStore=e}}class Wp extends Hp{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof i_&&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:Ds.CAUTION,actions:[{label:"Proceed",type:Ms.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]}):super.closeTab(e)}}var Kp;!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"}(Kp=Kp||(Kp={}));const Xp={[Kp.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Kp.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Kp.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Kp.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Kp.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Kp.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Kp.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Kp.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Kp.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Zp;!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"}(Zp=Zp||(Zp={}));const qp={[Zp.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Zp.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Zp.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Zp.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Jp;!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"}(Jp=Jp||(Jp={}));const Qp={[Jp.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Jp.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Jp.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Jp.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Jp.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Jp.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Jp.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Jp.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var e_;!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"}(e_=e_||(e_={}));class t_{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 v.PURE;case"java":return v.JAVA;case"md":return v.MARKDOWN;case"sql":return v.SQL;case"json":return v.JSON;case"xml":return v.XML;case"yml":case"yaml":return v.YAML;case"graphql":return v.GRAPHQL;default:return v.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 s_{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class i_ extends Yp{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 t_(this)}get label(){return Fp(this.filePath)}get description(){return`File: ${Fp(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return H(L(this.filePath.split("/")))}match(e){return e instanceof i_&&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 s_(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??Rp,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??Rp)}registerCommands(){this.textEditorState.language===v.PURE&&(this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.GO_BACK,action:()=>{(0,S.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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 Up(this.filePath,e.lineNumber,e.column);(0,S.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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:Jp.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Jp.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:Ds.CAUTION,actions:[{label:"Compile and Proceed",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{(0,S.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.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===wp.ENUM_VALUE?Gp.ENUM:t.pureType===wp.PROPERTY||t.pureType===wp.QUALIFIED_PROPERTY?Gp.PROPERTY:Gp.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===v.PURE&&[Jp.GO_TO_DEFINITION,Jp.GO_BACK,Jp.REVEAL_CONCEPT_IN_TREE,Jp.FIND_USAGES,Jp.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e))),[Jp.GO_TO_LINE,Jp.TOGGLE_TEXT_WRAP].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class a_{editorStore;treeData;selectedNode;loadInitialDataState=kt.create();refreshDataState=kt.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 n_{id;path;RO}class r_ extends n_{file;statusType}(0,We.yu)(r_,{id:(0,We.Ru)(),path:(0,We.Ru)(),file:(0,We.Ru)(),statusType:(0,We.Ru)(),RO:(0,We.Ru)()});class o_ extends n_{repo}(0,We.yu)(o_,{id:(0,We.Ru)(),path:(0,We.Ru)(),repo:(0,We.Ru)(),RO:(0,We.Ru)()});class l_{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof o_}get isFileNode(){return this.li_attr instanceof r_}get isRepoNode(){return this.li_attr instanceof o_&&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)(l_,{li_attr:(0,We.PG)((()=>We.AM),(e=>e.file?(0,We.vB)(r_,e):(0,We.vB)(o_,e))),text:(0,We.Ru)(),icon:(0,We.Ru)(),children:(0,We.Ru)(),state:(0,We.Ru)()});const c_=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},d_=e=>`file_${e}`;class h_ extends a_{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)(l_,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)(l_,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(Ip.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=c_(i);for(const e of s){const s=H(this.getTreeData().nodes.get(d_(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(d_(e)),`Can't find node with path '${e}'`))}}const u_=e=>{const t=e.trim(),s=t.lastIndexOf(Ce);if(!(s<=0))return t.substring(0,s)};class p_ extends a_{loadConceptActivity=kt.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)(Mp,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)(Mp,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 bp||e.data.li_attr instanceof Dp)&&("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 Up(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(Ip.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=u_(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 Pp)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)($p,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(wu(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 wp.PROPERTY:case wp.QUALIFIED_PROPERTY:W(s,bp),a=await this.editorStore.findConceptUsages(Gp.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case wp.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)($p,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=wu(i)?.concat(Ce).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(wu(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(Gp.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 __{cached;datamarts;text}(0,We.yu)(__,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)()});class m_ extends __{error;sessionError}(0,We.yu)(m_,{cached:(0,We.Ru)(),datamarts:(0,We.pb)((0,We.Ru)()),text:(0,We.Ru)(),error:(0,We.Ru)(),sessionError:(0,We.Ru)()});class g_ extends m_{RO;line;column;source}(0,We.yu)(g_,{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 E_{text;reinit}class f_ extends E_{cache;modifiedFiles=[]}(0,We.yu)(f_,{text:(0,We.Ru)(),cache:(0,We.Ru)(),modifiedFiles:(0,We.pb)((0,We.Ru)()),reinit:(0,We.Ru)()});class T_ extends E_{RO;line;column;source;error;sessionError}(0,We.yu)(T_,{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 C_{RO;line;column;source}(0,We.yu)(C_,{RO:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),source:(0,We.Ru)()});class S_ extends E_{jumpTo}(0,We.yu)(S_,{text:(0,We.Ru)(),jumpTo:(0,We.Ry)(C_)});class x_{uuid=(0,n.Z)();sourceID;line;column;foundName}(0,We.yu)(x_,{sourceID:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)(),foundName:(0,We.Ru)()});class N_{uuid=(0,n.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,We.yu)(N_,{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 A_ extends T_{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,We.yu)(A_,{candidateName:(0,We.Ru)(),candidatesWithPackageImported:(0,We.pb)((0,We.Ry)(x_)),candidatesWithPackageNotImported:(0,We.pb)((0,We.Ry)(N_))});class v_ extends T_{candidateName;candidates=[]}(0,We.yu)(v_,{candidateName:(0,We.Ru)(),candidates:(0,We.pb)((0,We.Ry)(N_))});class I_{id;parentId;file;line;column}(0,We.yu)(I_,{id:(0,We.Ru)(),parentId:(0,We.Ru)(),file:(0,We.Ru)(),line:(0,We.Ru)(),column:(0,We.Ru)()});class O_{children=[];li_attr;text;type}(0,We.yu)(O_,{children:(0,We.pb)((0,We.Ry)(O_)),li_attr:(0,We.Ry)(I_),text:(0,We.Ru)(),type:(0,We.Ru)()});class y_ extends E_{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,We.yu)(y_,{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)(O_))});class R_{uuid=(0,n.Z)()}class w_{before;found;after}(0,We.yu)(w_,{after:(0,We.Ru)(),before:(0,We.Ru)(),found:(0,We.Ru)()});class L_{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)(L_,{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)(w_))});class P_ extends R_{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 b_,D_,M_;(0,We.yu)(P_,{sourceId:(0,We.Ru)(),coordinates:(0,We.pb)((0,We.Ry)(L_))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(b_=b_||(b_={}));class F_{status;test}class k_ extends F_{test=[]}(0,We.yu)(k_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)())});class U_{text;RO;line;column;source;error}(0,We.yu)(U_,{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 j_ extends F_{test=[];error}(0,We.yu)(j_,{status:(0,We.Ru)(),test:(0,We.pb)((0,We.Ru)()),error:(0,We.Ry)(U_)});class G_{}class V_ extends G_{finished;tests=[]}(0,We.yu)(V_,{finished:(0,We.Ru)(),tests:(0,We.pb)((0,We.PG)((()=>We.AM),(e=>e.error?(0,We.vB)(j_,e):(0,We.vB)(k_,e))))});class B_ extends G_{error;text}(0,We.yu)(B_,{error:(0,We.Ru)(),text:(0,We.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(D_=D_||(D_={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(M_=M_||(M_={}));class $_{_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?D_.FAILED:this.passed?D_.PASSED:D_.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case b_.PASSED:this.passedTests.add(t);break;case b_.FAILED:this.failedTests.set(t,K(e,j_));break;case b_.ERROR:this.testsWithError.set(t,K(e,j_));break;default:throw new j(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class z_{editorStore;testExecutionResult;checkTestRunnerState=kt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=kt.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 $_(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)(B_,s):(0,We.vB)(V_,s);var s;return t instanceof V_?(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 H_{}class Y_ extends H_{error;errorDialog;text}(0,We.yu)(Y_,{error:(0,We.Ru)(),errorDialog:(0,We.Ru)(),text:(0,We.Ru)()});class W_{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}'`:`'${vp}'`,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:Gp.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 K_{_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 X_{_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 jn([Gn.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),$n(this.parameters,this.body)])}}class Z_ extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class q_ extends Z_{ownerReference;constructor(e){const t=or.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new q_(e)}}class J_{_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 jn([Gn.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}}class em{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return jn([Gn.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new em(0,0);static ZERO_ONE=new em(0,1);static ZERO_MANY=new em(0,void 0);static ONE=new em(1,1);static ONE_MANY=new em(1,void 0)}class tm extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class sm extends tm{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new sm(e)}}class im extends Zn{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new im(Ae.STRING);static BOOLEAN=new im(Ae.BOOLEAN);static BINARY=new im(Ae.BINARY);static NUMBER=new im(Ae.NUMBER);static INTEGER=new im(Ae.INTEGER);static FLOAT=new im(Ae.FLOAT);static DECIMAL=new im(Ae.DECIMAL);static DATE=new im(Ae.DATE);static STRICTDATE=new im(Ae.STRICTDATE);static DATETIME=new im(Ae.DATETIME);static STRICTTIME=new im(Ae.STRICTTIME);static LATESTDATE=new im(Ae.LATESTDATE)}var am;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(am=am||(am={}));class nm extends sp{association;constructor(e,t,s,i,a){super(e,s,i,a),this.association=t}get hashCode(){return jn([jh.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const rm=()=>new Xn(""),om=(e,t)=>new Q_("",em.ONE,q_.create(new J_(e)),t),lm=(0,S.aD)(((e,t)=>{e.value=t})),cm=((0,S.aD)(((e,t)=>{M(e.properties,t)})),(0,S.aD)(((e,t)=>{b(e.properties,xh(t))}))),dm=((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,Nh(t))})),(0,S.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,S.aD)(((e,t)=>{b(e.constraints,vh(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,hh(t))}))),hm=((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)=>{hh(e),dh(t),e.value=t,e.ownerReference.value=t.rawType}))),um=((0,S.aD)(((e,t)=>{e.name=t})),(0,S.aD)(((e,t)=>{hm(e.genericType,dh(t))})),(0,S.aD)(((e,t)=>{e.multiplicity=t})),(0,S.aD)(((e,t)=>{e.aggregation=t})),(0,S.aD)(((e,t)=>{e.value=_h(t),lm(e.ownerReference,t._OWNER)})),(0,S.aD)(((e,t)=>{b(e.taggedValues,ch(t))})),(0,S.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,S.aD)(((e,t)=>{b(e.stereotypes,oh(t))})),(0,S.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,S.aD)(((e,t)=>{e.tag.value=mh(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=vr(t)})),(0,S.aD)(((e,t)=>{b(e.p_tags,mh(t))})),(0,S.aD)(((e,t)=>{M(e.p_tags,t)})),(0,S.aD)(((e,t)=>{b(e.p_stereotypes,_h(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)=>{lm(e.returnType,Rh(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,Eh(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=Eh(t),lm(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,Xn,`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 J_(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,S.aD)(((e,t)=>{e.canonicalUnit=Ch(t)})),(0,S.aD)(((e,t)=>{e.conversionFunction=vr(t)})),(0,S.aD)(((e,t)=>{e.classViews=t.map(Ph)}))),pm=(0,S.aD)(((e,t)=>{b(e.classViews,Ph(t))})),_m=(0,S.aD)(((e,t)=>{M(e.classViews,t)})),mm=(0,S.aD)(((e,t)=>{e.associationViews=t.map(Fh)})),gm=(0,S.aD)(((e,t)=>{M(e.associationViews,t)})),Em=(0,S.aD)(((e,t)=>{e.generalizationViews=t.map(Mh)})),fm=(0,S.aD)(((e,t)=>{b(e.generalizationViews,Mh(t))})),Tm=(0,S.aD)(((e,t)=>{M(e.generalizationViews,t)})),Cm=(0,S.aD)(((e,t)=>{e.propertyViews=t.map(kh)})),Sm=(0,S.aD)(((e,t)=>{b(e.propertyViews,kh(t))})),xm=(0,S.aD)(((e,t)=>{M(e.propertyViews,t)})),Nm=(0,S.aD)(((e,t)=>{e.hideProperties=t})),Am=(0,S.aD)(((e,t)=>{e.hideStereotypes=t})),vm=(0,S.aD)(((e,t)=>{e.hideTaggedValues=t})),Im=(0,S.aD)(((e,t)=>{e._offsetX=t})),Om=(0,S.aD)(((e,t)=>{e._offsetY=t})),ym=(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)})),Rm=(0,S.aD)(cp),wm=(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 np(a.x,a.y).normal(new np(l.x,l.y)).unit(),d=np.fromPoints(a,new Ku(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 Ku(t,s),r.push(o))}e<n.length-2&&r.push(n[e+1])}return o&&a&&lp(e,r),o})),Lm=(0,S.aD)(lp),Pm=(0,S.aD)(((e,t)=>{e.rectangle=t})),bm=(0,S.aD)(((e,t)=>{e.position=t})),Dm=(0,S.aD)((e=>{e._dummyObservable={}}));var Mm,Fm,km;!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"}(Mm=Mm||(Mm={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Fm=Fm||(Fm={})),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"}(km=km||(km={}));const Um=.05,jm=[50,75,90,100,110,125,150,200,250,300,400],Gm=e=>(e instanceof X_?"/ ":"")+e.name;class Vm{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 Xu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ku(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 Ku(0,0),this.virtualScreen=new Zu(new Ku(0,0),new Xu(0,0)),this.zoom=1,this.triangle=[new Ku(0,0),new Ku(-15,-10),new Ku(-15,10)],this.diamond=[new Ku(0,0),new Ku(-10,-5),new Ku(-20,0),new Ku(-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=Mm.LAYOUT,this.relationshipMode=Fm.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 Ku(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Ku(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setEnableLayoutAutoAdjustment(e){this.enableLayoutAutoAdjustment=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(e){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh(),e?.initial&&(this.autoRecenter(),(this.canvas.width<this.virtualScreen.rectangle.width+2*this.screenPadding+20||this.canvas.height<this.virtualScreen.rectangle.height+2*this.screenPadding+20)&&this.zoomToFit())}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new Xu(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ku(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 Ku(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Mm.LAYOUT:case Mm.PAN:case Mm.ZOOM_IN:case Mm.ZOOM_OUT:case Mm.ADD_CLASS:if(t!==Fm.NONE)throw new U(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Mm.ADD_RELATIONSHIP:if(t===Fm.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===Mm.ADD_RELATIONSHIP)switch(t){case Fm.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||ju(e.class.value).includes(t.class.value)||ju(t.class.value).includes(e.class.value)||dm(e.class.value,q_.create(new J_(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new ap(this.diagram,e,t);return fm(this.diagram,s),s}};break;case Fm.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new Q_(`property_${e.class.value.properties.length+1}`,em.ONE,q_.create(new J_(t.class.value)),e.class.value);if(cm(e.class.value,s),e!==t){const i=new ip(this.diagram,sm.create(s),e,t);return Sm(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 km.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>bm(t,new Ku(e,t.position.y))));break}case km.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=>bm(t,new Ku(e-t.rectangle.width/2,t.position.y))));break}case km.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=>bm(t,new Ku(e-t.rectangle.width,t.position.y))));break}case km.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>bm(t,new Ku(t.position.x,e))));break}case km.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=>bm(t,new Ku(t.position.x,e-t.rectangle.height/2))));break}case km.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=>bm(t,new Ku(t.position.x,e-t.rectangle.height))));break}case km.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];bm(s,new Ku(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];bm(a,new Ku(i.position.x+i.rectangle.width+s,a.position.y))}}break}case km.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];bm(s,new Ku(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];bm(a,new Ku(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 Ku((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 Ku((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}resolveMouseEventCoordinate(e){if(e.target instanceof HTMLElement){const t=rp(e.target);return new Ku(t.x+e.offsetX,t.y+e.offsetY)}return new Ku(e.x,e.y)}eventCoordinateToCanvasCoordinate(e){return new Ku(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Ku(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 rp(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=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof ip){const r=this.drawLinePropertyText(H(n[n.length-2],"Diagram path expected to have at least 2 points"),H(n[n.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,up(r).x),a=Math.max(a,up(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 Zu(new Ku(t,s),new Xu(i-t,a-s))}else this.setZoomLevel(1),this.screenOffset=new Ku(0,0),this.virtualScreen=new Zu(new Ku(this.canvasDimension.width/2,this.canvasDimension.height/2),new Xu(0,0))}executeZoom(e,t){e=Math.max(e,Um);const s=this.zoom;this.setZoomLevel(e),this.screenOffset=new Ku(((t.x-this.canvasCenter.x)*(s-e)+this.screenOffset.x*s)/e,((t.y-this.canvasCenter.y)*(s-e)+this.screenOffset.y*s)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Um)),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)),Um))}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 qu(this.diagram,i,or.create(e));return bm(a,t??this.canvasCoordinateToModelCoordinate(new Ku(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),pm(this.diagram,a),Dm(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)&&fm(this.diagram,new ap(this.diagram,a,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&fm(this.diagram,new ap(this.diagram,t,a)),Gu(e).forEach((e=>{e.genericType.value.rawType===s&&Sm(this.diagram,new ip(this.diagram,sm.create(e),a,t))})),Gu(s).forEach((s=>{s.genericType.value.rawType===e&&Sm(this.diagram,new ip(this.diagram,sm.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=Gm(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 qn&&(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||(Gu(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;Pm(e,new Xu(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 Gu(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof X_?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof im?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}}Dm(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,a,n){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Gm(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 Ku(t(l),s(l)));n||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=a(c),m=this.modelCoordinateToCanvasCoordinate(new Ku(i(c),a(c)));n||this.ctx.fillText(o,m.x,m.y);const g=new Ku(Math.min(d,p),Math.min(h,_));return new Zu(g,new Xu(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 Zu(new Ku(0,0),new Xu(0,0))}drawPropertyOrAssociation(e){const t=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(H(t[t.length-2],"Diagram path expected to have at least 2 points"),H(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof 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===am.COMPOSITE||s.aggregation===am.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+dp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+dp(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+hp(this.diamond[0],e))*this.zoom),s.aggregation===am.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===am.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=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=H(s[s.length-2],"Diagram path expected to have at least 2 points").x,a=H(s[s.length-2],"Diagram path expected to have at least 2 points").y,n=H(s[s.length-1],"Diagram path expected to have at least 2 points").x,r=H(s[s.length-1],"Diagram path expected to have at least 2 points").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+dp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+hp(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+dp(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+hp(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)&&Lm(e,e.path.map((e=>new Ku(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!==Mm.ZOOM_IN?Mm.ZOOM_IN:Mm.ZOOM_OUT,Fm.NONE)}switchToViewMode(){this.changeMode(Mm.LAYOUT,Fm.NONE)}switchToPanMode(){this.changeMode(Mm.PAN,Fm.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Mm.ADD_RELATIONSHIP,Fm.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Mm.ADD_RELATIONSHIP,Fm.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Mm.ADD_CLASS,Fm.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Xn&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ku(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Xn&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}getSuperTypeLevels(e,t,s,i){if(e.length){const a=(0,rs.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new qu(t,(0,n.Z)(),or.create(Uu(e.value,Xn))))))),(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)&&(bm(t[0],new Ku(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];bm(e,new Ku(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 ap(t,s,e):[]))))))]}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{_m(this.diagram,e),mm(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Em(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Cm(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof nm?gm(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof ip&&xm(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Tm(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=>{Nm(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Am(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{vm(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=>pm(this.diagram,e))),t[1].forEach((e=>fm(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,rs.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new qu(this.diagram,(0,n.Z)(),or.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=>pm(this.diagram,e))),t[1].forEach((e=>fm(this.diagram,e)))}this.drawScreen()}}mouseup(e){const t=this.resolveMouseEventCoordinate(e);if(!this.isReadOnly)switch(this.interactionMode){case Mm.LAYOUT:this.diagram.generalizationViews.forEach((e=>Rm(e))),this.diagram.associationViews.forEach((e=>Rm(e))),this.diagram.propertyViews.forEach((e=>Rm(e)));break;case Mm.ADD_CLASS:{const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));this.onAddClassViewClick(e),this.changeMode(Mm.LAYOUT,Fm.NONE);break}case Mm.ZOOM_IN:{const e=Math.round(100*this.zoom);let s;s=e<=jm[0]-10?10*Math.floor(e/10)+10:e>=jm[jm.length-1]?100*Math.floor(e/100)+100:H(jm.find((t=>t>e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Mm.ZOOM_OUT:{const e=Math.round(100*this.zoom);let s;s=e<=jm[0]?10*Math.ceil(e/10)-10:e>=jm[jm.length-1]+100?100*Math.ceil(e/100)-100:H((0,yu.Z)(jm,(t=>t<e))),this.zoomPoint(s/100,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)));break}case Mm.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const e=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));for(let t=this.diagram.classViews.length-1;t>=0;t--){const s=this.diagram.classViews[t];if(s.contains(e.x,e.y)){const t=this.handleAddRelationship(this.startClassView,s);t&&(Im(t.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Om(t.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Im(t.to,-(s.position.x+s.rectangle.width/2-e.x)),Om(t.to,-(s.position.y+s.rectangle.height/2-e.y)))}}this.changeMode(Mm.LAYOUT,Fm.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){const t=this.resolveMouseEventCoordinate(e);if([Mm.ADD_RELATIONSHIP,Mm.ADD_CLASS,Mm.ZOOM_IN,Mm.ZOOM_OUT].includes(this.interactionMode))return;const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,s,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,s);const i=this.diagram.classViews.find((e=>e.contains(s.x,s.y)));i&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(i,s):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,s,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(s)}mousedown(e){const t=this.resolveMouseEventCoordinate(e);this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const s=this.eventCoordinateToCanvasCoordinate(t),i=this.canvasCoordinateToModelCoordinate(s);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Mm.PAN:return void(this.positionBeforeLastMove=t);case Mm.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(pp(t).contains(i.x,i.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||um(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:i},this.setSelectedClasses([]);else{let e=!1;for(let t=this.diagram.classViews.length-1;t>=0;t--){const a=this.diagram.classViews[t];if(a.contains(i.x,i.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(a)||this.setSelectedClasses([a]),this.isReadOnly||um(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=s.x/this.zoom-this.screenOffset.x,this.clickY=s.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Ku(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=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=wm(e,i.x,i.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(i)}}break;case Mm.ADD_RELATIONSHIP:this.setSelectionStart(i),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(i.x,i.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Mm.LAYOUT,Fm.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=t);if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=t,void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,i),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.resolveMouseEventCoordinate(e);if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const s=this.zoom-e.deltaY/120*.05;this.executeZoom(s,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)))}mousemove(e){const t=this.resolveMouseEventCoordinate(e);if(this.cursorPosition=t,this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Mm.PAN)this.screenOffset=new Ku(this.screenOffset.x+(t.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(t.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=t,this.clearScreen(),this.drawAll();else if(this.leftClick){const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);switch(this.interactionMode){case Mm.LAYOUT:if(this.selectedClassCorner&&(Pm(this.selectedClassCorner,new Xu(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Dm(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let t=0,s=0;this.selectedClasses.forEach(((i,a)=>{const n=this._selectedClassesInitialPositions.length>a?this._selectedClassesInitialPositions[a]:void 0;if(n){const a=e.x/this.zoom-this.screenOffset.x-(this.clickX-n.oldPos.x),r=e.y/this.zoom-this.screenOffset.y-(this.clickY-n.oldPos.y);t=i.position.x-a,s=i.position.y-r,bm(i,new Ku(a,r)),Dm(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,t,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,t,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?ym(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&ym(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(t.x,t.y,e.x-t.x,e.y-t.y),this.ctx.strokeRect(t.x,t.y,e.x-t.x,e.y-t.y);const s=(e.x-t.x)/this.zoom,i=(e.y-t.y)/this.zoom;this.selection=new Zu(new Ku(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Xu(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(_p(this.selection,e)||_p(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Mm.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const t=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const e=this.eventCoordinateToCanvasCoordinate(t),s=this.canvasCoordinateToModelCoordinate(e);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const t of this.diagram.classViews.slice().reverse())if(t.contains(s.x,s.y)){this.setMouseOverClassView(t),pp(t).contains(s.x,s.y)&&this.setMouseOverClassCorner(t);const i=t.class.value;let a=t.position.y+this.classViewSpaceY;a+=t.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const n=this.computeClassNameWidth(t);new Zu(this.modelCoordinateToCanvasCoordinate(new Ku(t.position.x+(t.rectangle.width-n)/2,a)),new Xu(n,this.lineHeight)).contains(e.x,e.y)&&this.setMouseOverClassName(t),a+=this.lineHeight,a+=t.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,a+=2*this.classViewSpaceY;for(const s of Gu(i))this.hasPropertyView(t,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Zu(this.modelCoordinateToCanvasCoordinate(new Ku(t.position.x+this.classViewSpaceX,a)),new Xu(this.drawClassViewProperty(t,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(e.x,e.y)&&this.setMouseOverClassProperty(s),a+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=tp.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(H(t[t.length-2],"Diagram path expected to have at least 2 points"),H(t[t.length-1],"Diagram path expected to have at least 2 points"),e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}}class Bm{_UUID=(0,n.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return jn([Gn.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class $m extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class zm extends $m{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new zm(e)}}class Hm extends nr{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Gn.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Un).join(",")}}class Ym extends Hm{ownerReference;constructor(e){const t=or.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Ym(e)}}class Wm extends Wn{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[om(rm(),rm()),om(rm(),rm())];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 Xn&&t.genericType.value.rawType instanceof Xn){const s=K(e.genericType.value.rawType,Xn),i=K(t.genericType.value.rawType,Xn);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return jn([Gn.ASSOCIATION,this.path,jn(this.properties),jn(this.derivedProperties),jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Km extends Wn{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return jn([Gn.MAPPING,this.path,jn(this.classMappings),jn(this.enumerationMappings),jn(this.associationMappings),jn(this.test),jn(this.includes),jn(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class Xm extends Wn{p_stereotypes=[];p_tags=[];get _elementHashCode(){return jn([Gn.PROFILE,this.path,jn(this.p_stereotypes.map((e=>e.value))),jn(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class Zm extends Wn{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 jn([Gn.SERVICE,jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),this.path,this.pattern,jn(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",jn(this.tests),jn(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class qm extends Wn{functionName;constructor(e){super(e),this.functionName=e}}class Jm extends qm{}class Qm extends Jm{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return jn([Gn.FUNCTION,this.path,jn(this.parameters),this.returnType.valueForSerialization??"",jn(this.taggedValues),jn(this.stereotypes.map((e=>e.pointerHashCode))),$n(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class eg extends Wn{includes=[]}class tg extends eg{sections=[];get _elementHashCode(){return jn([Gn.FLAT_DATA,this.path,jn(this.includes.map((e=>e.valueForSerialization??""))),jn(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class sg extends Wn{runtimeValue;get _elementHashCode(){return jn([Gn.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class ig extends Wn{connectionValue;get _elementHashCode(){return jn([Gn.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class ag extends Wn{}class ng extends ag{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return jn([Gn.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",jn(this.scopeElements.map((e=>e instanceof rr?e.valueForSerialization??"":e))),jn(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class rg extends Wn{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return jn([Gn.GENERATION_TREE,this.path,jn(this.generationNodes),jn(this.fileGenerations.map((e=>zn(Me.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class og extends eg{schemas=[];joins=[];filters=[];get _elementHashCode(){return jn([Gn.DATABASE,this.path,jn(this.includes.map((e=>e.valueForSerialization??""))),jn(this.schemas),jn(this.joins),jn(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class lg{_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 cg extends Wn{data;get hashCode(){return jn([Gn.DATA_ELEMENT,this.path,jn(this.stereotypes.map((e=>e.pointerHashCode))),jn(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}class dg extends Wn{executionParameters=[];get _elementHashCode(){return jn([Gn.EXECUTION_ENVIRONMENT_INSTANCE,this.path,jn(this.executionParameters)])}accept_PackageableElementVisitor(e){return e.visit_ExecutionEnvironmentInstance(this)}}const hg=new Set([Wn,Kn,Zn,im,Xn,Wm,qn,Qm,Xm,Qn,Jn,cg,eg,Km,ig,sg,rg,ng,Zm,dg,class extends Wn{sections=[];get _elementHashCode(){return jn([Gn.SECTION_INDEX,this.path,jn(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}}]);class ug{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 er(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(hg.has(e))throw new U("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new lg(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(qn))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(Qn))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(Xn))}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(tg))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(og))}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 Xn?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof qn?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof Qn?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),og,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),tg,`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((()=>Fu(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){bu(t?ku(this,t,void 0):this.root,e),e instanceof Km?this.setOwnMapping(e.path,e):e instanceof eg?this.setOwnStore(e.path,e):e instanceof Kn?this.setOwnType(e.path,e):e instanceof Wm?this.setOwnAssociation(e.path,e):e instanceof Xm?this.setOwnProfile(e.path,e):e instanceof Qm?this.setOwnFunction(e.path,e):e instanceof Zm?this.setOwnService(e.path,e):e instanceof ig?this.setOwnConnection(e.path,e):e instanceof sg?this.setOwnRuntime(e.path,e):e instanceof ng?this.setOwnFileGeneration(e.path,e):e instanceof rg?this.setOwnGenerationSpecification(e.path,e):e instanceof cg?this.setOwnDataElement(e.path,e):e instanceof dg?this.setOwnExecutionEnvironment(e.path,e):e instanceof er||this.getExtensionForElementClass(y(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&Du(e.package,e),e instanceof Km?this.mappingsIndex.delete(e.path):e instanceof eg?this.storesIndex.delete(e.path):e instanceof Kn?(this.typesIndex.delete(e.path),e instanceof Qn&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof Wm?this.associationsIndex.delete(e.path):e instanceof Xm?this.profilesIndex.delete(e.path):e instanceof Qm?this.functionsIndex.delete(e.path):e instanceof Zm?this.servicesIndex.delete(e.path):e instanceof sg?this.runtimesIndex.delete(e.path):e instanceof ig?this.connectionsIndex.delete(e.path):e instanceof ng?this.fileGenerationsIndex.delete(e.path):e instanceof rg?this.generationSpecificationsIndex.delete(e.path):e instanceof cg?this.dataElementsIndex.delete(e.path):e instanceof dg?this.executionEnvironmentIndex.delete(e.path):e instanceof er?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 er&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof er)&&!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]=Lu(s);if(!(e instanceof er)){const t=this.getNullablePackage(i)??(""!==i?ku(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}_${Vu(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Vu(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(n))))),e.package!==t&&(e.package&&Du(e.package,e),bu(t,e))}var n,r;if(e instanceof Km)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof eg)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof Kn)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof Qn&&(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 Wm)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof Xm)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 Zm)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof sg)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof ig)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof ng)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof cg)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof dg)this.executionEnvironmentIndex.delete(t),this.executionEnvironmentIndex.set(s,e);else if(e instanceof rg)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof er){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)){Du(r,e);const t=""!==i?ku(this,i,void 0):this.root;bu(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 pg{}class _g extends pg{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class mg extends ug{constructor(e,t,s){super(t.name,e,s),this.root=t}}const gg=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Eg{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new er(e);this.roots.push(s),this.projectDependencyModelsIndex.set(e,new mg(this.extensionElementClasses,s,new _g(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=gg(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=gg(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=gg(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=gg(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=gg(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=gg(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=gg(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=gg(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=gg(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=gg(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=gg(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=gg(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=gg(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=gg(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=gg(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=gg(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnExecutionEnvironment=gg(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 fg extends eg{static NAME="ModelStore";static INSTANCE=new fg;constructor(){super(fg.NAME)}accept_PackageableElementVisitor(e){throw new j}}class Tg extends ug{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Ne.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(fg.NAME,fg.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[im.STRING,im.BOOLEAN,im.BINARY,im.NUMBER,im.INTEGER,im.FLOAT,im.DECIMAL,im.DATE,im.STRICTDATE,im.DATETIME,im.STRICTTIME,im.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Cg extends ug{autoImports=[];constructor(e){super(Ne.SYSTEM,e)}initializeAutoImports(){this.autoImports=ye.map((e=>K(this.getOwnNullableElement(e,!0),er,`Can't find auto-import package '${e}'`)))}}class Sg extends ug{constructor(e){super(Ne.MODEL_GENERATION,e)}}class xg extends ug{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 Sg(i),this.dependencyManager=new Eg(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),qn,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),Qn,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),Jn,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),Xn,`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),Xn),`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),tg,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),og,`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=em.ONE:0===e&&1===t?s=em.ZERO_ONE:0===e&&void 0===t?s=em.ZERO_MANY:1===e&&void 0===t?s=em.ONE_MANY:0===e&&0===t&&(s=em.ZERO),s??new em(e,t)}addElement(e,t){const s=Pu(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 Ng{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ag{_UUID=(0,n.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class vg{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,We.yu)(vg,{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 Ig=(0,We.PG)((()=>We.AM),(e=>(e.sourceId=e.source,(0,We.vB)(vg,e))));class Og{package;name;tags=[];stereotypes=[]}(0,We.yu)(Og,{name:(0,We.Ru)(),package:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ru)()),tags:(0,We.pb)((0,We.Ru)())});class yg{profile;value}(0,We.yu)(yg,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class Rg{profile;value}(0,We.yu)(Rg,{profile:(0,We.Ru)(),value:(0,We.Ru)()});class wg{tag;value}(0,We.yu)(wg,{tag:(0,We.Ry)(Rg),value:(0,We.Ru)()});class Lg{rawType;typeParameter}(0,We.yu)(Lg,{rawType:(0,We.jt)((0,We.Ru)()),typeParameter:(0,We.jt)((0,We.Ru)())});class Pg{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,We.yu)(Pg,{aggregation:(0,We.Ru)(),genericType:(0,We.Ry)(Lg),multiplicity:(0,We.Ru)(),name:(0,We.Ru)(),stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg))});class bg{package;name;sourceInformation}(0,We.yu)(bg,{name:(0,We.Ru)(),package:(0,We.Ru)(),sourceInformation:Ig});class Dg{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,We.yu)(Dg,{generalizations:(0,We.pb)((0,We.Ry)(Lg)),name:(0,We.Ru)(),package:(0,We.Ru)(),properties:(0,We.pb)((0,We.Ry)(Pg)),qualifiedProperties:(0,We.pb)((0,We.Ry)(Pg)),sourceInformation:Ig,stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg))});class Mg{package;name;enumValues=[]}(0,We.yu)(Mg,{name:(0,We.Ru)(),package:(0,We.Ru)(),enumValues:(0,We.pb)((0,We.Ru)())});class Fg{x;y}(0,We.yu)(Fg,{x:(0,We.Ru)(),y:(0,We.Ru)()});class kg{height;width}(0,We.yu)(kg,{height:(0,We.Ru)(),width:(0,We.Ru)()});class Ug{points=[]}(0,We.yu)(Ug,{points:(0,We.pb)((0,We.Ry)(Fg))});class jg{id;source;target;geometry}(0,We.yu)(jg,{geometry:(0,We.Ry)(Ug),id:(0,We.Ru)(),source:(0,We.Ru)(),target:(0,We.Ru)()});class Gg{name;owningType}(0,We.yu)(Gg,{name:(0,We.Ru)(),owningType:(0,We.Ru)()});class Vg{id;source;target;property;geometry}(0,We.yu)(Vg,{geometry:(0,We.Ry)(Ug),id:(0,We.Ru)(),property:(0,We.Ry)(Gg),source:(0,We.Ru)(),target:(0,We.Ru)()});class Bg{id;type;position;rectangleGeometry}(0,We.yu)(Bg,{id:(0,We.Ru)(),position:(0,We.Ry)(Fg),rectangleGeometry:(0,We.Ry)(kg),type:(0,We.Ru)()});class $g{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,We.yu)($g,{name:(0,We.Ru)(),generalizationViews:(0,We.pb)((0,We.Ry)(jg)),package:(0,We.Ru)(),propertyViews:(0,We.pb)((0,We.Ry)(Vg)),sourceInformation:Ig,stereotypes:(0,We.pb)((0,We.Ry)(yg)),taggedValues:(0,We.pb)((0,We.Ry)(wg)),typeViews:(0,We.pb)((0,We.Ry)(Bg))});class zg{classes=[];enumerations=[];profiles=[]}(0,We.yu)(zg,{classes:(0,We.pb)((0,We.Ry)(Dg)),enumerations:(0,We.pb)((0,We.Ry)(Mg)),profiles:(0,We.pb)((0,We.Ry)(Og))});class Hg{name;diagram;domainInfo}(0,We.yu)(Hg,{diagram:(0,We.Ry)($g),name:(0,We.Ru)(),domainInfo:(0,We.jt)((0,We.Ry)(zg))});class Yg{class;enumerations=[];profiles=[];specializations=[]}(0,We.yu)(Yg,{class:(0,We.Ry)(Dg),enumerations:(0,We.pb)((0,We.Ry)(Mg)),profiles:(0,We.pb)((0,We.Ry)(Og)),specializations:(0,We.pb)((0,We.Ry)(bg))});const Wg=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}`},Kg=(e,t,s,i)=>{const a=t.getOwnNullableClass(e);if(!a){const[a,n]=Lu(e),r=new Xn(n);return bu(Fu(t.root,a,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return a},Xg=e=>{if("*"===e)return new em(0,void 0);{const t=e.split("..");if(1===t.length)return new em(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new em(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},Zg=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,a;b(e.taggedValues,new Bm(zm.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,Ym.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=Kg(H(t.rawType),s,i,void 0);b(e.generalizations,q_.create(new J_(a))),b(a._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const a=new Q_(t.name,Xg(t.multiplicity),q_.create(new J_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Kg(H(t.genericType.rawType),s,i,void 0))),e);a.aggregation="Composite"===t.aggregation?am.COMPOSITE:"Shared"===t.aggregation?am.SHARED:void 0,b(e.properties,a)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new X_(t.name,Xg(t.multiplicity),q_.create(new J_(s.getOwnNullableEnumeration(H(t.genericType.rawType))??Kg(H(t.genericType.rawType),s,i,void 0))),e))}))},qg=e=>{const t=new xg(new Tg([]),new Cg([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Xn(e.name);bu(Fu(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 Xm(e.name);bu(Fu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Ng(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Ag(s,e))))})),i.enumerations.forEach((e=>{const s=new qn(e.name);bu(Fu(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);Zg(a,e,t,s)}))}const i=e.diagram,a=new Gh(i.name);return bu(Fu(t.root,i.package,!0,new Map),a),i.typeViews.forEach((e=>{const s=new qu(a,e.id,or.create(t.getClass(e.type)));s.position=new Ku(e.position.x,e.position.y),s.rectangle=new Xu(e.rectangleGeometry.width,e.rectangleGeometry.height),b(a.classViews,s)})),i.propertyViews.forEach((e=>{const s=new ip(a,sm.create((i=t.getClass(e.property.owningType),n=e.property.name,H(i instanceof Xn?Gu(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 Ku(e.x,e.y))),cp(s),b(a.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new ap(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 Ku(e.x,e.y))),cp(t),b(a.generalizationViews,t)})),[a,t,s]};class Jg extends Yp{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]=qg(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Fp(this.diagramPath)}get description(){return`Diagram: ${Fp(this.diagramPath)}`}get diagramName(){return Ru(this.diagramPath)}match(e){return e instanceof Jg&&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 Mm.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Mm.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Mm.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Mm.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]=qg(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 Up(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 Xm(e.name);bu(Fu(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Ng(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Ag(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":Ce}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new qn(e.name);bu(Fu(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 Xn(i.name),bu(Fu(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=Kg(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,q_.create(new J_(i)))})),r&&Zg(n,i,t,s),n})((0,We.vB)(Yg,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:Zp.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Zp.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Zp.RECENTER,Zp.USE_ZOOM_TOOL,Zp.USE_VIEW_TOOL,Zp.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 eE extends F{}const tE=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,sE=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,iE=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class aE{editorStore;constructor(e){this.editorStore=e}}class nE extends aE{result;constructor(e,t){super(e),this.result=t}}class rE extends aE{result;constructor(e,t){super(e),this.result=t}}class oE{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 P_,s.sourceId=e.source,a.set(e.source,s));const n=new L_(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 lE{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 cE{editorStore;loadState=kt.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)(P_,e))(e)));this.setResult(new lE(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 dE{applicationStore;initState=kt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Op.TERMINAL;auxPanelDisplayState=new K_({initial:0,default:300,snap:100});activeActivity=Ip.CONCEPT_EXPLORER;sideBarDisplayState=new K_({initial:300,default:300,snap:150});tabManagerState=new Wp(this);executionState=kt.create();navigationStack=[];fileSearchCommandLoadState=kt.create();fileSearchCommandState=new Qg;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=kt.create();referenceUsageResult;textSearchState;testRunState=kt.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 cE(this),this.directoryTreeState=new h_(this),this.conceptTreeState=new p_(this),this.client=new W_(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(iE);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 Up(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:iE},commands:[{command:e_.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:e_.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=w(e);!s||s.match(tE)?await(0,S.fl)(t.executeTests(s??vp)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:e_.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=w(e);s?.match(sE)?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:e_.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(sE))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(sE)?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:e_.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(sE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:e_.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(sE)?await(0,S.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:e_.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,S.fl)(t.loadFile(Np)).catch(t.applicationStore.alertUnhandledError)}},{command:e_.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(tE)?await(0,S.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:e_.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(sE)||s.match(tE)))try{s.match(tE)?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:e_.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(sE)||s.match(tE)||[Ap,vp].includes(s)))try{s.match(tE)||s===vp?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,We.vB)(Mp,e))).map((e=>e.li_attr instanceof Pp?`${Xt.BRIGHT_CYAN}${e.text}${Xt.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,We.vB)(l_,e))).map((e=>e.isFolderNode?`${Xt.BRIGHT_CYAN}${e.text}${Xt.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:e_.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:e_.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:e_.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:e_.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(Np)),n=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(a=yield s).error?a.source?(0,We.vB)(g_,a):(0,We.vB)(m_,a):(0,We.vB)(__,a);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open()),o instanceof m_?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof g_&&(yield(0,S.fl)(this.loadFile(o.source,new jp(o.source,o.line,o.column,new eE((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:Ds.CAUTION,actions:[{label:"Compile to debug",type:Ms.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:Kp.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Kp.SEARCH_TEXT,action:()=>{this.setActiveAuxPanelMode(Op.SEARCH),this.auxPanelDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Kp.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof i_&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Kp.TOGGLE_TERMINAL_PANEL,action:()=>{this.auxPanelDisplayState.isOpen?this.activeAuxPanelMode!==Op.TERMINAL?(this.setActiveAuxPanelMode(Op.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.auxPanelDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Kp.EXECUTE,action:()=>{(0,S.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.FULL_RECOMPILE,action:()=>{(0,S.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,S.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.RUN_ALL_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Kp.RUN_RELAVANT_TESTS,action:()=>{(0,S.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Kp.SEARCH_FILE,Kp.SEARCH_TEXT,Kp.GO_TO_FILE,Kp.TOGGLE_TERMINAL_PANEL,Kp.EXECUTE,Kp.FULL_RECOMPILE,Kp.FULL_RECOMPILE_WITH_FULL_INIT,Kp.RUN_ALL_TESTS,Kp.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 Jg&&e.diagramPath===t));a||(yield(0,S.fl)(this.checkIfSessionWakingUp()),a=new Jg(this,(0,We.vB)(Hg,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 i_&&t.filePath===e));s||(yield(0,S.fl)(this.checkIfSessionWakingUp()),s=new i_(this,(0,We.vB)(kp,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof jp&&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 i_&&s.filePath===e)s.setFile((0,We.vB)(kp,await this.client.getFile(e)));else if(s instanceof Jg&&s.filePath===e)try{s.rebuild((0,We.vB)(Hg,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(i_)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof i_?{path:e.filePath,code:e.file.content}:e instanceof Jg?{diagram:e.diagramPath,code:Wg(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)(A_,o):o.candidateName&&o.candidates?(0,We.vB)(v_,o):(0,We.vB)(T_,o):o.jumpTo?(0,We.vB)(S_,o):o.tests?(0,We.vB)(y_,o):(0,We.vB)(f_,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof T_?(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 f_?(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))),e_.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(Y(i_)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof T_)e.source&&(yield(0,S.fl)(this.loadFile(e.source,new jp(e.source,e.line,e.column,new eE(e.text.split("\n").filter(Boolean)[0]))))),e instanceof A_?(this.setCodeFixSuggestion(new nE(this,e)),this.setActiveAuxPanelMode(Op.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()):e instanceof v_&&(this.setCodeFixSuggestion(new rE(this,e)),this.setActiveAuxPanelMode(Op.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof f_){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 T_)e.source&&await(0,S.fl)(this.loadFile(e.source,new jp(e.source,e.line,e.column,new eE(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Op.TERMINAL),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof y_){this.setActiveAuxPanelMode(Op.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new z_(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}),`${e_.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,S.fl)(this.executeTests(vp,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 S_&&await(0,S.fl)(this.loadFile(e.jumpTo.source,new Up(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:Ds.CAUTION,actions:[{label:"Perform full re-compile",type:Ms.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(Ip.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(i_)).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!==Ip.CONCEPT_EXPLORER&&this.setActiveActivity(Ip.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)(Y_,s):new H_;return!(i instanceof Y_&&(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)(Bp,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 ${Vp(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===wp.ENUM_VALUE?Gp.ENUM:e.pureType===wp.PROPERTY||e.pureType===wp.QUALIFIED_PROPERTY?Gp.PROPERTY:Gp.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,We.qC)(L_,new L_(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,We.vB)(L_,e)));this.setReferenceUsageResult(new oE(this,e,t,s)),this.setActiveAuxPanelMode(Op.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(Op.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(Fp(e))),e_.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(Fp(e))),e_.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)),e_.MOVE)),yield(0,S.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof i_&&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(Fp(e))),e_.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof i_&&(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:Ds.CAUTION,actions:[{label:"Delete anyway",type:Ms.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Ms.PROCEED,default:!0}]})}}const hE=(0,At.createContext)(void 0),uE=({children:e})=>{const t=vn(),s=(0,Nt.fv)((()=>new dE(t)));return(0,T.jsx)(hE.Provider,{value:s,children:e})},pE=()=>H((0,At.useContext)(hE),"Can't find editor store in context"),_E=(0,Nt.Pi)((()=>{const e=pE(),t=vn().terminalService.terminal,s=(0,At.useRef)(null),{ref:i,width:a,height:n}=(0,Va.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===Op.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)(Bi,{})}),(0,T.jsx)("button",{className:(0,Os.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)(zi,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Hi,{})}),(0,T.jsx)("button",{className:(0,Os.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)($i,{})})]})]}),(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)(fi,{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)(Ei,{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,Os.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)(zs,{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)(Ai,{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)(di,{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)(ei,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(Da,{className:"terminal-panel__content",content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Fa,{onClick:o,children:"Copy All"}),(0,T.jsx)(Fa,{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)(Ba,{children:"Terminal is not set up yet"})})})),mE=(0,Nt.Pi)((e=>{const{searchResult:t,result:s}=e,i=pE(),a=vn(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Up(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)(qi,{}):(0,T.jsx)(Qi,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(vi,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:Fp(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)(Ws,{})})]})]}),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)(Ws,{})})})]},e.uuid)))})]})})),gE=(0,Nt.Pi)((e=>{const{searchResult:t}=e,s=pE(),i=vn(),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)(Mi,{})}),(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)(Bi,{})}),!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)(Ki,{})}),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)(Xi,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(mE,{searchResult:t,result:e},e.uuid)))})]})})),EE=(0,Nt.Pi)((()=>{const e=pE(),t=(0,At.useRef)(null),s=e.textSearchState,i=(0,At.useMemo)((()=>(0,Ha.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===Op.SEARCH&&s.focus()}),[s,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(Gs,{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,Os.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)(zi,{})}),(0,T.jsx)("button",{className:(0,Os.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)($i,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(gE,{searchResult:e.textSearchState.result})]})})),fE=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:a,onNodeSelect:n}=e;return(0,T.jsxs)("div",{className:(0,Os.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,Os.clsx)("tree-view__node__icon",{[`${a}__tree-view__node__icon`]:a}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(qi,{}):(0,T.jsx)(Qi,{}))}),(0,T.jsx)("div",{className:(0,Os.clsx)("tree-view__node__label",{[`${a}__tree-view__node__label`]:a}),children:t.label})]})},TE=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:a,classPrefix:n,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:TE,TreeNodeContainer:fE},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,Os.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)))]})},CE=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:TE,TreeNodeContainer:fE},h=a?{...d,...a}:d;return(0,T.jsx)("div",{className:(0,Os.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 SE=s(410);const xE=SE.gs,NE="resizable-panel--collapsed",AE=(e,t)=>({collapsiblePanel:{className:(0,Os.clsx)(...t?.classes??[],{[NE]:e}),onStartResize:e=>{e.domElement.classList.remove(NE),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}}),vE=SE.jW,IE=SE.nN,OE=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var yE=s(48845);const RE=(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=pE(),u=vn(),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)?M_.PASSED:t.failedTests.has(e)?M_.FAILED:t.testsWithError.has(e)?M_.ERROR:M_.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?M_.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?M_.RUNNING:M_.PASSED})(t,p):void 0){case M_.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)(hi,{})});break;case M_.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)(xi,{})});break;case M_.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)(Ks,{})});break;case M_.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)(_i,{})});break;default:g=(0,T.jsx)(ei,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,Os.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 Up(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)(qi,{}):(0,T.jsx)(Qi,{}):(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})]})})),wE=(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)(RE,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:a,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),LE=(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)(Ba,{children:"No tests found"}),!i&&(0,T.jsx)(CE,{components:{TreeNodeContainer:RE},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()}}})]})})),PE=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,bE=e=>{const{wrapText:t,result:s}=e,i=pE(),a=vn(),[n,r]=(0,At.useState)(),o=(0,At.useRef)(void 0),l=(0,At.useRef)(null),{ref:c,width:d,height:h}=(0,Va.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:v.TEXT});r(t)}}),[a,n]),o.current?.dispose(),o.current=x.languages.registerLinkProvider(v.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(PE)).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 Up(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 k_?"Test passed!":s instanceof j_?s.error.text:"Running...";n.setValue(e),(s instanceof k_||s instanceof j_)&&n.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof k_?"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})})},DE=(0,Nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,a=pE(),n=vn(),[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,Os.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(Gi,{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 Up(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)(Vi,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(bE,{result:l,wrapText:r})})]})})),ME=(0,Nt.Pi)((e=>{const{testRunnerState:t}=e,s=pE(),i=vn(),a=t.testExecutionResult.count,n=t.testResultInfo,r=n?.suiteStatus??D_.NONE,o=n?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(xE,{orientation:"vertical",children:[(0,T.jsx)(vE,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(Gs,{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)(hi,{})]}),(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)(xi,{})]}),(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)(Ks,{})]})]}),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)(Fi,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(ki,{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)(mi,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(si,{})}),(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)(Ni,{})}),(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)(ai,{})}),(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)(Ws,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(yE.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)(LE,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(wE,{testRunnerState:t})]})})]})}),(0,T.jsx)(IE,{children:(0,T.jsx)(OE,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(vE,{minSize:400,children:[t.selectedTestId&&!n&&(0,T.jsx)("div",{}),t.selectedTestId&&n&&(0,T.jsx)(DE,{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)(Ba,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),FE=(0,Nt.Pi)((()=>{const e=pE().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Ba,{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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(ME,{testRunnerState:e})]})})),kE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=pE(),i=vn(),a=()=>{(0,S.fl)(s.loadFile(t.sourceID,new Up(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:`${Fp(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)(ni,{})})})]})})),UE=(0,Nt.Pi)((e=>{const{candidate:t}=e,s=pE(),i=vn();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:`${Fp(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 Up(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(ni,{})})})]})})),jE=(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)(kE,{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)(UE,{candidate:e},e.uuid)))})]})]})})),GE=(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)(UE,{candidate:e},e.uuid)))})]})]})})),VE=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof nE&&(0,T.jsx)(jE,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof rE&&(0,T.jsx)(GE,{suggestionState:e.codeFixSuggestion})]})})),BE=(0,Nt.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=pE(),a=vn(),n=e=>()=>(0,S.fl)(i.loadFile(s.sourceId,new Up(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)(qi,{}):(0,T.jsx)(Qi,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(vi,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:Fp(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)(Ws,{})})]})]}),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)(Ws,{})})})]},e.uuid)))})]})})),$E=(0,Nt.Pi)((e=>{const{referenceUsageState:t}=e,s=pE(),i=vn(),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 ${Vp(t.usageConcept)}`:`No usages found for ${Vp(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)(Mi,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(Bi,{})}),!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)(Ki,{})}),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)(Xi,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(BE,{referenceUsageResult:t,result:e},e.uuid)))})]})})),zE=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(Gs,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Ba,{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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)($E,{referenceUsageState:e.referenceUsageResult})]})})),HE=(0,Nt.Pi)((()=>{const e=pE(),t={[Op.TERMINAL]:{mode:Op.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(Ti,{className:"auxiliary-panel__header__tab__icon--terminal"}),isVisible:!0},[Op.SEARCH]:{mode:Op.SEARCH,name:"SEARCH",icon:(0,T.jsx)(oi,{className:"auxiliary-panel__header__tab__icon--search"}),isVisible:!0},[Op.TEST_RUNNER]:{mode:Op.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(sa,{className:"auxiliary-panel__header__tab__icon--test"}),isVisible:!0},[Op.REFERENCES]:{mode:Op.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(Yi,{className:"auxiliary-panel__header__tab__icon--references"}),isVisible:!0},[Op.CODE_FIX_SUGGESTION]:{mode:Op.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(Wi,{className:"auxiliary-panel__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Op).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(Op.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,Os.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)(qi,{}):(0,T.jsx)(Ji,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(ea,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Op.TERMINAL)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(_E,{})}),i(Op.SEARCH)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(EE,{})}),i(Op.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(FE,{})}),i(Op.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(VE,{})}),i(Op.REFERENCES)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(zE,{})})]})]})}));var YE=s(42689);const WE=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(ga,{})}),KE=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),XE=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),ZE=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),qE=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),JE=()=>(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)(Na,{})}),ef=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(ii,{})}),tf=()=>(0,T.jsx)("div",{children:(0,T.jsx)(Qs,{})}),sf=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Na,{})}),af=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(_a,{})}),nf=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(ri,{})}),rf=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(wi,{})}),of=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),lf=e=>{switch(e){case wp.PACKAGE:return(0,T.jsx)(WE,{});case wp.PROFILE:return(0,T.jsx)(JE,{});case wp.CLASS:return(0,T.jsx)(KE,{});case wp.ASSOCIATION:return(0,T.jsx)(of,{});case wp.PROPERTY:case wp.QUALIFIED_PROPERTY:return(0,T.jsx)(af,{});case wp.ENUMERATION:return(0,T.jsx)(XE,{});case wp.MEASURE:return(0,T.jsx)(ZE,{});case wp.UNIT:return(0,T.jsx)(qE,{});case wp.FUNCTION:return(0,T.jsx)(QE,{});case wp.NATIVE_FUNCTION:return(0,T.jsx)(sf,{});case wp.DIAGRAM:return(0,T.jsx)(nf,{});case wp.DATABASE:return(0,T.jsx)(rf,{});case wp.MAPPING:return(0,T.jsx)(ef,{});default:return(0,T.jsx)(tf,{})}},cf=/^\w[\w$]*$/,df=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,hf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),a=t.data.li_attr.pureName??t.data.li_attr.pureId,n=t.data.li_attr.pureType===wp.PACKAGE,[r,o]=(0,At.useState)(n?Ru(a):a),l=(0,At.useRef)(null),c=Boolean(r.match(n?df:cf)),d=(n?Ru(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"})]})]})})})),uf=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,pf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),a=wu(t.data.li_attr.pureId)??"",[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(uf)),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,Dp)],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"})]})]})})})),_f=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,a=s.data.li_attr,n=a.pureType,r=pE(),o=vn();return(0,T.jsxs)(Ma,{ref:t,children:[a.pureType!==wp.PROPERTY&&a.pureType!==wp.QUALIFIED_PROPERTY&&(0,T.jsx)(Fa,{onClick:()=>{o.clipboardService.copyTextToClipboard(a.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),n===wp.PACKAGE&&(0,T.jsx)(Fa,{onClick:()=>{(0,S.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),n===wp.FUNCTION&&(0,T.jsx)(Fa,{onClick:()=>{o.navigationService.navigator.visitAddress(`${r.client.baseUrl}/execute?func=${a.pureId}&mode=${r.client.mode}`)},children:"Service (JSON)"}),(a instanceof bp||a instanceof Dp)&&(0,T.jsx)(Fa,{onClick:()=>{(a instanceof Dp||a instanceof bp)&&r.findUsagesFromCoordinate(new Up(a.file,Number.parseInt(a.line,10),Number.parseInt(a.column,10)))},children:"Find Usages"}),n!==wp.PACKAGE&&(0,T.jsx)(Fa,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(ka,{}),(0,T.jsx)(Fa,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),a instanceof Dp&&(0,T.jsx)(Fa,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var mf;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(mf=mf||(mf={}));const gf=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 bp&&t.data.li_attr.classPath!==t.parent.id,p=[wp.PACKAGE,wp.CLASS].includes(t.data.li_attr.pureType),_=t.data.li_attr.pureType===wp.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:Ru(K(t.data.li_attr,bp).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,YE.c)((()=>({type:"Class"===t.data.li_attr.pureType?mf.CLASS:mf.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(Da,{content:(0,T.jsx)(_f,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Os.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)(_i,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:p?t.isOpen?(0,T.jsx)(qi,{}):(0,T.jsx)(Qi,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,Os.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:lf(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:_})]})})},Ef=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(CE,{components:{TreeNodeContainer:gf},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 Dp||i instanceof bp)&&(0,S.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Up(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(hf,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(pf,{node:s.nodeForMoveElement})]})})),ff=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),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)(Mi,{})}),(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)(si,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Gs,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(Ef,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ba,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),Tf=/^\w+(?:\.\w+)*$/,Cf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)("untitled.pure"),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 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"})]})]})})})),Sf=/^\w+$/,xf=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)("untitled"),r=(0,At.useRef)(null),o=Boolean(a.match(Sf)),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"})]})]})})})),Nf=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Af=(0,Nt.Pi)((e=>{const{node:t}=e,s=pE(),i=vn(),[a,n]=(0,At.useState)(t.data.li_attr.path),r=(0,At.useRef)(null),o=Boolean(a.match(Nf)),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"})]})]})})})),vf=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{node:s}=e,i=vn(),a=pE(),n=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(Ma,{ref:t,children:[(0,T.jsx)(Fa,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(ka,{}),n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!n&&(0,T.jsx)(Fa,{onClick:()=>a.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Fa,{disabled:Boolean(s.data instanceof l_&&s.data.children),onClick:()=>{(0,S.fl)(a.deleteDirectoryOrFile(s.data.li_attr.path,n,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),If=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 l_&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,_=t.data instanceof l_&&!t.data.children,m=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(gi,{className:"explorer__icon--readonly"}):p?_?(0,T.jsx)(Si,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(Ci,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(Si,{className:(0,Os.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(vi,{className:(0,Os.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{_||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(Da,{content:(0,T.jsx)(vf,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,Os.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)(_i,{})}),!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)(qi,{}):(0,T.jsx)(Qi,{})}),(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})]})})},Of=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(CE,{components:{TreeNodeContainer:If},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)(Cf,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(xf,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(Af,{node:s.nodeForRenameFile})]})})),yf=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),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)(Mi,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof i_&&(0,S.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Hs,{})}),(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)(si,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Gs,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(Of,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Ba,{children:"Failed to build directory tree"})]})]})})]})})),Rf=(0,Nt.Pi)((()=>{const e=pE();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,Os.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Ip.CONCEPT_EXPLORER:return(0,T.jsx)(ff,{});case Ip.FILE_EXPLORER:return(0,T.jsx)(yf,{});default:return null}})()},e.activeActivity)})})),wf=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,Os.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"})})]})})},Lf=(0,Nt.Pi)((()=>{const e=pE(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Ip.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(li,{})},{mode:Ip.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(vi,{})}].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)(wf,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,Os.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)))})]})})),Pf=(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)`:""}`})})})),bf=(0,Nt.Pi)((()=>{const e=pE(),t=vn();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 i_&&(0,T.jsx)(Pf,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,Os.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)(Js,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Ti,{})}),(0,T.jsx)("button",{className:(0,Os.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)(Ui,{})})]})]})})),Df=e=>{(0,At.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},Mf=/[0-9]+(?::[0-9]+)?/,Ff=(0,Nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,At.useState)(""),a=(0,At.useRef)(null),n=Boolean(s.match(Mf)),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"})]})]})})})),kf=(0,Nt.Pi)((e=>{const{editorState:t}=e,s=pE(),i=vn(),a=(0,At.useRef)(null),[n,r]=(0,At.useState)(),{ref:o,width:l,height:c}=(0,Va.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]),Df(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&&(yp(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,Os.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)(Gi,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(Ff,{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})})})]})})),Uf=(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 jf{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,We.yu)(jf,{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 Gf{pureType;pureName;owner;ownerPureType}(0,We.yu)(Gf,{pureType:(0,We.Ru)(),pureName:(0,We.Ru)(),owner:(0,We.Ru)(),ownerPureType:(0,We.Ru)()});class Vf{pureId;pureName;requiredClassProperties=[]}(0,We.yu)(Vf,{pureId:(0,We.Ru)(),pureName:(0,We.Ru)(),requiredClassProperties:(0,We.jt)((0,We.pb)((0,We.Ru)()))});class Bf{name}(0,We.yu)(Bf,{name:(0,We.Ru)()});const $f="Diagram",zf="Diagram",Hf=()=>{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},Yf=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(",")})`}),Wf=(e,t)=>{const s=e.pureType,i=s===wp.FUNCTION||s===wp.NATIVE_FUNCTION?((e,t,s)=>{const i=Ru(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===wp.PACKAGE?x.languages.CompletionItemKind.Folder:s===wp.CLASS?x.languages.CompletionItemKind.Class:s===wp.FUNCTION?x.languages.CompletionItemKind.Function:s===wp.ENUMERATION?x.languages.CompletionItemKind.Enum:s===wp.PROFILE?x.languages.CompletionItemKind.Module:s===wp.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===wp.PACKAGE?`zzzz_${e.text}`:e.text}},Kf=/(?<incompletePath>(?:\w[\w$]*::)+$)/,Xf=/->\s*(?:\w[\w$]*::)+$/,Zf=/\^\s*(?:\w[\w$]*::)+$/,qf=/^\s*import\s+(?:(?<importPath>(?:(?:\w[\w$]*)::)*\w[\w$]*)::*)/,Jf=(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(qf)?.groups?.importPath)).filter($)},Qf=/->\s*(?:\w[\w$]*)?$/,eT=/\^\s*(?:\w[\w$]*)?$/,tT=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,sT=(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}),iT=/^\w[\w$]*$/,aT=(0,Nt.Pi)((e=>{const{renameConceptState:t}=e,s=vn(),i=t.fileEditorState,a=t.concept.pureName,[n,r]=(0,At.useState)(a),o=(0,At.useRef)(null),l=Boolean(n.match(iT)),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"})]})]})})})),nT=(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=pE(),h=vn(),{ref:u,width:p,height:_}=(0,Va.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:v.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 Up(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:Jp.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Up(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Jp.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Up(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Jp.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 Up(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(v.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),a=x.editor.tokenize(i,v.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&&Uf(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(v.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let a=[];if(i.triggerKind===x.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":a=a.concat(Hf());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:$f,description:"(dsl)",insertText:zf}]));break;case":":a=a.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Kf);if(i?.groups?.incompletePath){const a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Xf)),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Zf));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-Ce.length),n?[wp.CLASS]:a?[wp.FUNCTION,wp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(jf,e)))}catch{}return r.map((e=>n?Yf(e):Wf(e,{preferArrowFunctionForm:a})))}return[]})(s,e,d));break;case">":a=a.concat(await(async(e,t,s)=>{const i=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForIdentifier(i,[wp.FUNCTION,wp.NATIVE_FUNCTION])).map((e=>(0,We.vB)(jf,e)))}catch{}return a.map((e=>Wf(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(tT),a=Jf(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(a,i.groups.owner)).map((e=>(0,We.vB)(Gf,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===wp.PROPERTY||t===wp.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===wp.PROPERTY?x.languages.CompletionItemKind.Property:t===wp.QUALIFIED_PROPERTY?x.languages.CompletionItemKind.Method:t===wp.TAG?x.languages.CompletionItemKind.Constant:t===wp.STEREOTYPE?x.languages.CompletionItemKind.Value:t===wp.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=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(Vf,e)))}catch{}return a.map((e=>Yf(e)))})(s,e,d));break;case"@":a=a.concat(await(async(e,t,s)=>{const i=Jf(e,t);let a=[];try{a=(await s.client.getSuggestionsForClass(i)).map((e=>(0,We.vB)(Vf,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)(Bf,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),v.PURE)[0]);a.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&Uf(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=>sT(e,!0))).concat(Array.from(n).filter((e=>!o.includes(e))).map((e=>{const t=new Bf;return t.name=e,t})).map((e=>sT(e,!1))))})(s,e,t.filePath,d))}return{suggestions:a}}}),a.current?.dispose(),a.current=x.languages.registerCompletionItemProvider(v.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===x.languages.CompletionTriggerKind.Invoke&&(i=i.concat(Hf()),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 $f:return[{text:zf,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=Jf(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(eT));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,n?[wp.CLASS]:a?[wp.FUNCTION,wp.NATIVE_FUNCTION]:[])).map((e=>(0,We.vB)(jf,e)))}catch{}return r.map((e=>n?Yf(e):Wf(e,{preferArrowFunctionForm:a})))})(t,e,d))),{suggestions:i}}}),Df(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&&(yp(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,Os.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)(Gi,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(aT,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(Ff,{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 rT=s(8533);const oT=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)(ba,{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})]})},lT=(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=vn(),a=s.diagram,n=t,{width:r,height:o}=(0,Va.NB)({refreshMode:"debounce",refreshRate:50,targetRef:n});(0,At.useEffect)((()=>{const e=new Vm(n.current,a);s.setRenderer(e),s.setupRenderer(),e.render({initial:!0})}),[n,s,a]),(0,At.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.render({initial:!0})}),[s,s.isDiagramRendererInitialized]),(0,At.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,At.useCallback)(((e,t)=>{if(e instanceof Mp){const a=t.getClientOffset(),n=a?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Ku(a.x,a.y))):void 0;(0,S.fl)(s.addClassView(e.li_attr.pureId,n)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,rT.L)((()=>({accept:mf.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(n),(0,T.jsx)("div",{ref:n,className:(0,Os.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),cT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=pE(),i=vn(),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(km.ALIGN_LEFT),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 center",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(km.ALIGN_CENTER),children:(0,T.jsx)(ca,{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(km.ALIGN_RIGHT),children:(0,T.jsx)(da,{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(km.ALIGN_TOP),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 middle",disabled:n,tabIndex:-1,onClick:()=>t.renderer.align(km.ALIGN_MIDDLE),children:(0,T.jsx)(ra,{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(km.ALIGN_BOTTOM),children:(0,T.jsx)(oa,{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(km.SPACE_HORIZONTALLY),children:(0,T.jsx)(ha,{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(km.SPACE_VERTICALLY),children:(0,T.jsx)(ua,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(oT,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(ka,{}),jm.map((e=>(0,T.jsxs)(Fa,{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)(qs,{})})]}),(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 Up(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Vi,{className:"diagram-editor__icon--go-to-file"})})})]})})),dT=(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,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.LAYOUT}),tabIndex:-1,onClick:i(Mm.LAYOUT,Fm.NONE),title:"View Tool (V)",children:(0,T.jsx)(Ea,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.PAN}),tabIndex:-1,onClick:i(Mm.PAN,Fm.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(fa,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Mm.ZOOM_IN,Fm.NONE),children:(0,T.jsx)(Ta,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,Os.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Mm.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Mm.ZOOM_OUT,Fm.NONE),children:(0,T.jsx)(Ca,{className:"diagram-editor__icon--zoom-out"})})]})})),hT=(0,Nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,At.useRef)(null);return Df(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(cT,{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)(dT,{diagramEditorState:t}),(0,T.jsx)(lT,{diagramEditorState:t,ref:s})]})})]})}));var uT=s(98533),pT=s(84153);(0,Nt.Pi)((0,At.forwardRef)((function(e,t){const{children:s,placeholder:i,showPlaceholder:a,className:n}=e;return(0,T.jsxs)("div",{ref:t,className:(0,Os.clsx)("dnd__entry__container",n),children:[a&&(0,T.jsx)("div",{className:"dnd__entry__placeholder",children:i?(0,T.jsx)(T.Fragment,{children:i}):(0,T.jsx)("div",{className:"dnd__entry__placeholder__content"})}),(0,T.jsx)(T.Fragment,{children:s})]})})));const _T=e=>{const{children:t,label:s,showPlaceholder:i,className:a}=e;return i?(0,T.jsx)("div",{className:(0,Os.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 mT(e){const{labelGetter:t,types:s}=e,{itemType:i,item:a,isDragging:n,currentPosition:r}=(0,uT.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)(xs.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 gT=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)},ET=(0,Nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(Ma,{children:[(0,T.jsx)(Fa,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Fa,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Fa,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),fT=(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,rT.L)((()=>({accept:[s.dndType],hover:(e,t)=>n(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[n]),l=i===r,[,c,d]=(0,YE.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,At.useEffect)((()=>{e((0,pT.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,Os.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)(_T,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(Da,{content:(0,T.jsx)(ET,{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)(Ws,{})})]})})});var h})),TT=(0,Nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(oT,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(Ma,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Fa,{className:(0,Os.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)(Ws,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(qi,{})})})),CT=(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:gT,children:[t.tabs.map((e=>(0,T.jsx)(fT,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(mT,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(TT,{managerTabState:t})]})})),ST=()=>{const[e,t]=(0,At.useState)(!1),{ref:s,width:i,height:a}=(0,Va.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,Os.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:"Run 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)(Xs,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},xT=(0,Nt.Pi)((()=>{const e=pE(),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)(CT,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof i_){const s=e.tabManagerState.tabs.filter((e=>e instanceof i_&&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)(vi,{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)(Ys,{className:"edit-panel__header__tab__icon--readonly"})})]})}if(t instanceof Jg){const s=e.tabManagerState.tabs.filter((e=>e instanceof Jg&&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)(nf,{})}),(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 i_?t.textEditorState.language===v.PURE?(0,T.jsx)(nT,{editorState:t}):(0,T.jsx)(kf,{editorState:t}):t instanceof Jg?(0,T.jsx)(hT,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(ST,{})}));var NT=s(50166),AT=s(35247);AT.Select.createFilter;const vT=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)(NT.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"})},IT="selector-input",OT="selector-input--dark",yT=()=>(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__loading-indicator ${OT}__loading-indicator`,children:(0,T.jsx)(_i,{})}),RT=()=>(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__dropdown-indicator`,children:(0,T.jsx)(qs,{})}),wT=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${IT}__indicator ${IT}__clear-indicator`,children:(0,T.jsx)(Ws,{})})})},LT=e=>(0,T.jsx)(AT.Select.components.Input,{...e,isHidden:!1}),PT=(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?AT.CreatableSelect.default:AT.Select.default,u=l?OT:IT;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:wT,DropdownIndicator:RT,LoadingIndicator:yT,MenuList:vT,Input:LT,...r},...{...d,darkMode:l,noMatchMessage:a}})})),bT=(e,t)=>e.label.localeCompare(t.label),DT=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,a=(0,At.useRef)(null),n=(0,At.useMemo)((()=>(0,Ha.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)(PT,{ref:a,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(bT),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,Os.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)($i,{})})]})]})})}));var MT;!function(e){e.MODE="mode",e.FAST_COMPILE="fastCompile"}(MT=MT||(MT={}));const FT=(kT=(0,Nt.Pi)((()=>{const e=pE(),t=vn(),{ref:s,width:i,height:a}=(0,Va.NB)(),n=AE(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=AE(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),o=AE(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.getCurrentLocationParameterValue(MT.MODE),t.navigationService.navigator.getCurrentLocationParameterValue(MT.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]),Df(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(Lf,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:s,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(xE,{orientation:"vertical",children:[(0,T.jsx)(vE,{...n.collapsiblePanel,direction:1,children:(0,T.jsx)(Rf,{})}),(0,T.jsx)(IE,{}),(0,T.jsx)(vE,{...n.remainingPanel,minSize:300,children:(0,T.jsxs)(xE,{orientation:"horizontal",children:[(0,T.jsx)(vE,{...o.collapsiblePanel,...0===e.auxPanelDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(xT,{})}),(0,T.jsx)(IE,{children:(0,T.jsx)(OE,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(vE,{...r.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)(HE,{})})]})})]})})})]}),(0,T.jsx)(bf,{}),(0,T.jsx)(DT,{})]})})),function(){return(0,T.jsx)(uE,{children:(0,T.jsx)(kT,{})})});var kT;const UT=()=>(0,T.jsx)(xp,{children:(0,T.jsx)(cn,{children:(0,T.jsx)(FT,{})})}),jT=JSON.parse('{"i8":"7.0.11","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class GT extends mt{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class VT extends GT{static NAME=jT.Rw.p;constructor(){super(VT.NAME,jT.i8)}getExtraKeyedCommandConfigEntries(){return[Xp,Qp,qp].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class BT extends ot{static create(){const e=new BT(Rn.create());return e.withBasePlugins([new St,new VT]),e.withBasePresets([new Tp]),e}async configureApplication(e){return new On(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:v.PURE}),x.languages.setLanguageConfiguration(v.PURE,Ye),x.languages.setMonarchTokensProvider(v.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)(Rt,{children:(0,T.jsx)(An,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(UT,{})})})}))}}class $T{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){BT.create().setup({baseUrl:e}).withPresets($T.getPresetCollection()).withPlugins($T.getPluginCollection()).start().catch((e=>{throw e}))}}$T.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:"6a7e96d2",135:"3b62eae4",246:"63a82c7f",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},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(23607)));l=o.O(l)})();
2
+ //# sourceMappingURL=index.335730f4.js.map