@finos/legend-application-pure-ide-deployment 9.1.0 → 9.2.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.
@@ -0,0 +1,2 @@
1
+ (()=>{"use strict";var e,t,s,i,n,a={43002:(e,t,s)=>{const i=JSON.parse('{"i8":"8.0.0","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:m,info:_,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T=s(52322),C=s(17029),x=s(80075),S=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=()=>()=>{},P=e=>e.length?e[0]:void 0,w=e=>e.length?e[e.length-1]:void 0,L=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 n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},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,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class j 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 k extends j{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class U extends j{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 k("Expected error to be thrown")}const V=e=>{try{return e()}catch{return}};class B extends j{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=>"object"==typeof e&&null!==e,ee=(e,t="")=>(function(e,t=""){if(!(e=>"number"==typeof e&&!isNaN(e))(e))throw new B(t||"Value is expected to be a number")}(e,t),e);var te=s(39391),se=s(33654),ie=s(18247);s(72659);const ne=te.W,ae="charset=utf-8";var re,oe,le;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(re=re||(re={})),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="*/*"}(oe=oe||(oe={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(le=le||(le={}));const ce={mode:"cors",credentials:"include",redirect:"manual"},de=(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 he extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Q(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):"")||a,this.payload=t}}const ue=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 he(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===ne.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case oe.APPLICATION_JSON:return e.json();case oe.TEXT_PLAIN:return e.text();default:return Promise.reject(new he(e,`Can't process response for request with Content-Type '${i}'`))}},pe=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME",i=document.getElementById(s);i?.remove();const n=document.createElement("iframe");n.id=s,n.src=e,n.style.display="none",n.addEventListener("load",(()=>{n.remove(),t()})),document.body.appendChild(n)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>ue(e,t,s))):fetch(e,t).then((e=>ue(e,t,s))),me=(e,t)=>{const s={};return s.Accept=oe.APPLICATION_JSON,e!==le.GET&&(s[re.CONTENT_TYPE]=`${oe.APPLICATION_JSON};${ae}`),de(s,t)};class _e{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...ce,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(le.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(le.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(le.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(le.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!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,a??{});let c;if((J(s)||Q(s))&&r?.enableCompression&&(q(e!==le.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,se.Wt)(Q(e)?JSON.stringify(e):e)]))(s),n=de(n,{[re.CONTENT_TYPE]:`${oe.APPLICATION_ZLIB};${ae}`})),void 0!==s)if(J(s)||s instanceof Blob)c=s;else{if(!Q(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:me(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===ne.UNAUTHORIZED)(e)?pe(l,d,o):ue(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?pe(l,d,o):Promise.reject(e)))}}const ge=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var Ee;!function(e){e.LOAD_TEXT_EDITOR_FONT__SUCCESS="application.load.font.success",e.APPLICATION_SETUP__FAILURE="application.setup.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION__FAILURE="application.configuration.failure",e.APPLICATION_IDENTITY_AUTO_FETCH__FAILURE="application.identity.auto-fetch.failure",e.APPLICATION_DOCUMENTATION_FETCH__FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD__SKIP="application.load.documentation.skip",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK__FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE="application.load.terminal-command.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD__SKIP="application.load.contextual-documentation.skip",e.APPLICATION_COMMAND_CENTER_REGISTRATION__FAILURE="application.command-center.registration.failure",e.APPLICATION_LOAD__SUCCESS="application.load.success",e.APPLICATION_LOAD__FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT__ACCESS="application.context.access",e.APPLICATION_USAGE__INTERRUPT="application.usage.interrupt",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS="application.virtual-assistant.documentation-entry.access"}(Ee=Ee||(Ee={}));const fe="::",Te="###",Ce=["$implicit"];var xe,Se,Ne,Ae,ve;(ve=xe=xe||(xe={})).CORE="CORE",ve.MAIN="ROOT",ve.MODEL_GENERATION="MODEL_GENERATION_ROOT",ve.SYSTEM="SYSTEM_ROOT",ve.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Ae=Se=Se||(Se={})).STRING="String",Ae.BOOLEAN="Boolean",Ae.BINARY="Binary",Ae.NUMBER="Number",Ae.INTEGER="Integer",Ae.FLOAT="Float",Ae.DECIMAL="Decimal",Ae.DATE="Date",Ae.STRICTDATE="StrictDate",Ae.DATETIME="DateTime",Ae.STRICTTIME="StrictTime",Ae.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ne=Ne||(Ne={}));const Ie=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Oe,ye,Re,Pe,we,Le,be,De,Me,Fe;(ye=Oe=Oe||(Oe={})).ANY="meta::pure::metamodel::type::Any",ye.NIL="meta::pure::metamodel::type::Nil",ye.PROFILE_DOC="meta::pure::profiles::doc",ye.PROFILE_TEMPORAL="meta::pure::profiles::temporal",ye.PROFILE="meta::pure::metamodel::extension::Profile",ye.ENUMERATION="meta::pure::metamodel::type::Enumeration",ye.MEASURE="meta::pure::metamodel::type::Measure",ye.CLASS="meta::pure::metamodel::type::Class",ye.ASSOCIATION="meta::pure::metamodel::relationship::Association",ye.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",ye.FLAT_DATA="meta::flatData::metamodel::FlatData",ye.DATABASE="meta::relational::metamodel::Database",ye.MAPPING="meta::pure::mapping::Mapping",ye.SERVICE="meta::legend::service::metamodel::Service",ye.CONNECTION="meta::pure::runtime::PackageableConnection",ye.RUNTIME="meta::pure::runtime::PackageableRuntime",ye.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",ye.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",ye.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",ye.DATA_ELEMENT="meta::pure::data::DataElement",ye.TDS_ROW="meta::pure::tds::TDSRow",ye.TDS_TABULARDATASET="meta::pure::tds::TabularDataSet",ye.TDS_COLUMN="meta::pure::tds::TDSColumn",(Le=Re=Re||(Re={})).BUSINESS_TEMPORAL="businesstemporal",Le.PROCESSING_TEMPORAL="processingtemporal",Le.BITEMPORAL="bitemporal",(we=Pe=Pe||(Pe={})).ALL_VERSIONS="AllVersions",we.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(De=be=be||(be={})).STORE="STORE",De.MAPPING="MAPPING",De.RUNTIME="RUNTIME",De.FILE_GENERATION="FILE_GENERATION",De.SERVICE="SERVICE",(Fe=Me=Me||(Me={})).TODAY="meta::pure::functions::date::today",Fe.NOW="meta::pure::functions::date::now",Fe.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Fe.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Fe.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Fe.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Fe.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Fe.IS_ON_DAY="meta::pure::functions::date::isOnDay",Fe.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Fe.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Fe.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Fe.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Fe.MINUS="meta::pure::functions::math::minus",Fe.ADJUST="meta::pure::functions::date::adjust",Fe.LET="meta::pure::functions::lang::letFunction";const je="yyyy-MM-dd'T'HH:mm:ssxxxx";var ke,Ue,Ge;!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"}(ke=ke||(ke={})),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"}(Ue=Ue||(Ue={})),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"}(Ge=Ge||(Ge={}));const Ve=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Be;!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"}(Be=Be||(Be={}));const $e={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Be.IDENTIFIER,foreground:"dcdcaa"},{token:Be.NUMBER,foreground:"b5cea8"},{token:Be.DATE,foreground:"b5cea8"},{token:Be.COLOR,foreground:"b5cea8"},{token:Be.PACKAGE,foreground:"808080"},{token:Be.PARSER,foreground:"c586c0"},{token:Be.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Be.MULTIPLICITY,foreground:"2d796b"},{token:Be.GENERICS,foreground:"2d796b"},{token:Be.PROPERTY,foreground:"9cdcfe"},{token:Be.PARAMETER,foreground:"9cdcfe"},{token:Be.VARIABLE,foreground:"4fc1ff"},{token:Be.TYPE,foreground:"3dc9b0"},{token:`${Be.STRING}.escape`,foreground:"d7ba7d"}]},ze={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 He=s(79013);class Ye{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,He.qC)(this.schema,e)}fromJson(e){return(0,He.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,I.Z)(t,(e=>null!==e))):e);var t}}const We=e=>(0,He.PG)((t=>void 0===t?He.AM:(0,He.qC)(e,t)),(t=>(0,He.vB)(e,t))),Ke=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?He.AM:[],Xe=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?He.AM:[]:He.AM,Ze=e=>(0,He.PG)((()=>e),(()=>e));var qe=s(4e4);class Je{_documentationKey;markdownText;title;text;url;related;static serialization=new Ye((0,He.yu)(Je,{markdownText:(0,He.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,He.jt)((0,He.pb)((0,He.Ru)())),title:(0,He.jt)((0,He.Ru)()),text:(0,He.jt)((0,He.Ru)()),url:(0,He.jt)((0,He.Ru)())}));static create(e,t){const s=Je.serialization.fromJson(e);return s._documentationKey=t,s}}const Qe=e=>Object.entries(e).map((e=>({key:e[0],content:Je.create(e[1],e[0])})));class et{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(Ee.APPLICATION_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,qe.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(Ee.APPLICATION_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(Ee.APPLICATION_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]=Je.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class tt{}class st extends tt{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 it{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new st}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 _e;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){G(e),this.logger.error(h.create(Ee.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(Ee.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 _e(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 n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){G(e),this.logger.warn(h.create(Ee.APPLICATION_DOCUMENTATION_FETCH__FAILURE),e)}}))),e.keyedDocumentationEntries=[...Qe(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(Ee.APPLICATION_LOAD__SUCCESS),"Legend application loaded")}catch(e){throw G(e),this.logger.error(h.create(Ee.APPLICATION_LOAD__FAILURE),"Failed to load Legend application"),e}}}var nt=s(74926),at=s(34309),rt=s(2784);class ot{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,x.rC)(this,{_isNavigationBlocked:x.LO,isNavigationBlocked:x.Fl,blockNavigation:x.aD,unblockNavigation:x.aD}),this.historyAPI=e}get window(){return H(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}}var lt=s(40979);const ct=(0,rt.createContext)(void 0),dt=({children:e})=>{const t=(0,lt.k6)(),s=(0,at.fv)((()=>new ot(t)));return(0,T.jsx)(ct.Provider,{value:s,children:e})};var ht;!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"}(ht=ht||(ht={}));class ut{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 n=new ut;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}var mt,_t,gt,Et=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(mt||(mt={}));class ft{state;_message;_messageFormatter;constructor(){this.state=mt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=mt.INITIAL,this}inProgress(){return this.state=mt.IN_PROGRESS,this}fail(){return this.state=mt.FAILED,this}pass(){return this.state=mt.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===mt.INITIAL}get isInProgress(){return this.state===mt.IN_PROGRESS}get hasFailed(){return this.state===mt.FAILED}get hasSucceeded(){return this.state===mt.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,x.rC)(new ft,{state:x.LO,_message:x.LO,reset:x.aD,inProgress:x.aD,pass:x.aD,fail:x.aD,complete:x.aD,setMessage:x.aD,sync:x.aD,isInInitialState:x.Fl,isInProgress:x.Fl,hasFailed:x.Fl,hasSucceeded:x.Fl,hasCompleted:x.Fl,message:x.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(_t=_t||(_t={}));class Tt{currentMode=_t.STANDARD;onSearchModeChange;constructor(e){(0,x.rC)(this,{currentMode:x.LO,isAdvancedSearchActive:x.Fl,setCurrentMode:x.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==_t.STANDARD}generateSearchText(e){switch(this.currentMode){case _t.INCLUDE:return`'"${e}"`;case _t.EXACT:return`="${e}"`;case _t.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(gt=gt||(gt={}));class Ct{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,x.rC)(this,{isOpen:x.LO,setIsOpen:x.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 xt{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const St=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Nt{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=gt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=ft.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,x.rC)(this,{isHidden:x.LO,isOpen:x.LO,panelRenderingKey:x.LO,isOverSearchLimit:x.LO,selectedTab:x.LO,searchText:x.LO,searchResults:x.LO,currentDocumentationEntry:x.LO,showSearchConfigurationMenu:x.LO,currentContextualDocumentationEntry:x.Fl,setIsHidden:x.aD,setIsOpen:x.aD,setSelectedTab:x.aD,setSearchText:x.aD,resetSearch:x.aD,search:x.aD,openDocumentationEntry:x.aD,refreshPanelRendering:x.aD,setShowSearchConfigurationMenu:x.aD}),this.applicationStore=e,this.searchEngine=new Et.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(St),{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 Tt((()=>{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 xt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter($).filter(St).map((e=>new Ct(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 Ct(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,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new Ct(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 At{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}var vt;!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"}(vt=vt||(vt={}));class It{static logEvent_ApplicationInitializationSucceeded(e,t){e.logEvent(Ee.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(Ee.APPLICATION_CONTEXT__ACCESS,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(Ee.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS,t)}static logEvent_GraphInitializationSucceeded(e,t){e.logEvent(vt.INITIALIZE_GRAPH__SUCCESS,t)}static logEvent_ApplicationUsageInterrupted(e){e.logEvent(Ee.APPLICATION_USAGE__INTERRUPT,{})}}class Ot{applicationStore;contextStack=[];constructor(e){(0,x.rC)(this,{contextStack:x.LO,currentContext:x.Fl,push:x.aD,pop:x.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 k(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&It.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class yt{applicationStore;commandRegistry=new Map;constructor(e){(0,x.rC)(this,{commandRegistry:x.LO,registerCommand:x.aD,deregisterCommand:x.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.logService.warn(h.create(Ee.APPLICATION_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 Rt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,x.rC)(this,{keyMap:x.LO,commandKeyMap:x.LO,isHotkeysBlocked:x.LO,addHotkey:x.aD,blockGlobalHotkeys:x.aD,unblockGlobalHotkeys:x.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 Pt,wt=s(77289),Lt=s(73678),bt=s(78440),Dt=s(51919),Mt=s(85399),Ft=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=""}(Pt=Pt||(Pt={}));const jt=(e,t)=>`[${e};${t}H`;class kt{searchInput;searchText="";useRegex=!1;matchWholeWord=!1;matchCaseSensitive=!1;resultCount;currentResultIndex;constructor(){(0,x.rC)(this,{searchText:x.LO,useRegex:x.LO,matchWholeWord:x.LO,matchCaseSensitive:x.LO,resultCount:x.LO,currentResultIndex:x.LO})}setSearchInput(e){this.searchInput=e}focus(){this.searchInput?.focus()}}class Ut{applicationStore;searchConfig=new kt;constructor(e){(0,x.rC)(this,{setSearchText:x.aD,setSearchRegex:x.aD,setSearchWholeWord:x.aD,setSearchCaseSensitive:x.aD,setSearchResultCount:x.aD,setSearchCurrentResultIndex:x.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 Gt extends Ut{preserveLog=!1;commandRegistry=new Map;constructor(e){super(e),(0,x.rC)(this,{preserveLog:x.LO,setPreserveLog:x.aD})}setPreserveLog(e){this.preserveLog=e}showHelp(){}showCommonANSIEscapeSequences(){}}var Vt=s(1367),Bt=s(67295),$t=s(72531);s(90286);const zt=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Ht=e=>(e??"").trim().replace(/^(?:\w+)\b/u,(e=>zt(e))),Yt=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],Wt=["Id","ID"],Kt=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Bt.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,$t.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};var Xt;function Zt(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"}(Xt=Xt||(Xt={}));const qt=(e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![Xt.SHIFT,Xt.META,Xt.ALT,Xt.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))),Jt=(e,t)=>qt(e,H(Zt(t)[0]));var Qt=s(4707),es=s(3493),ts=s(53908);const ss=(0,Qt.Z)({transitions:{create:()=>"none"}}),is=e=>{const{children:t}=e;return(0,T.jsx)(es.Z,{injectFirst:!0,children:(0,T.jsx)(ts.Z,{theme:ss,children:t})})};var ns=s(83820),as=s(96242),rs=s(12238),os=s(78683),ls=s(81934),cs=s(6277);const ds=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,cs.clsx)(t,i),children:s})};return s.displayName=e,s},hs=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,cs.clsx)("modal",{"modal--dark":s},i),children:t})},us=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,cs.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:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Yt.includes(e.toLowerCase())?e.toLowerCase():zt(e))).replace(/^(?:\w+)\b/u,(e=>zt(e))).replace(/\b(?:\w+)$/u,(e=>zt(e))))})]});var n},ps=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,cs.clsx)("modal__header",i),children:(0,T.jsx)(us,{title:t})}):(0,T.jsx)("div",{className:(0,cs.clsx)("modal__header",i),children:s})},ms=(ds("ModalHeaderActions","modal__header__actions"),ds("ModalBody","modal__body")),_s=ds("ModalFooter","modal__footer");var gs,Es;ds("ModalFooterStatus","modal__footer__status"),function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(gs=gs||(gs={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Es=Es||(Es={}));class fs{applicationStore;blockingAlertInfo;actionAlertInfo;constructor(e){(0,x.rC)(this,{blockingAlertInfo:x.LO,actionAlertInfo:x.LO,setBlockingAlert:x.aD,setActionAlertInfo:x.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 Ts=e=>{switch(e){case Es.PROCEED_WITH_CAUTION:return"btn--caution";case Es.PROCEED:case Es.STANDARD:default:return"btn--dark"}},Cs=(0,at.Pi)((e=>{const{info:t}=e,s=Ri(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.alertService.setActionAlertInfo(void 0)};return(0,T.jsx)(ls.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??gs.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)(ps,{title:i}),(0,T.jsxs)(ms,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,T.jsxs)(_s,{children:[c.map(((e,t)=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Ts(e.type??Es.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"})]})]})})})),xs=(0,at.Pi)((()=>{const e=Ri().alertService.actionAlertInfo;return e?(0,T.jsx)(Cs,{info:e}):null})),Ss=e=>{const{isLoading:t}=e,s=(0,rt.useRef)(null);return(0,rt.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")})},Ns=(0,at.Pi)((()=>{const e=Ri().alertService.blockingAlertInfo;return e?(0,T.jsx)(ls.Z,{open:Boolean(e),onClose:R,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(hs,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(Ss,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(ms,{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 As=s(12889),vs=s(73882),Is=s(53083);const Os=6e3;var ys;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(ys=ys||(ys={}));class Rs{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Ps{notification;constructor(){(0,x.rC)(this,{notification:x.LO,setNotification:x.aD,notify:x.aD,notifySuccess:x.aD,notifyWarning:x.aD,notifyIllegalState:x.aD,notifyError:x.aD})}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new Rs(ys.INFO,e,t??[],null===s?void 0:s??Os))}notifySuccess(e,t,s){this.setNotification(new Rs(ys.SUCCESS,e,t??[],null===s?void 0:s??Os))}notifyWarning(e,t,s){this.setNotification(new Rs(ys.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Os))}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 Rs(ys.ERROR,s,t??[],void 0))}notifyIllegalState(e,t,s){this.setNotification(new Rs(ys.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Os))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return G(e),this.notifyIllegalState(e.message),t}}}const ws=(0,at.Pi)((()=>{const e=Ri(),t=e.notificationService.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??ys.INFO,[a,r]=(0,rt.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(As.uMt,{})});switch(n){case ys.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(As.nnZ,{})});break;case ys.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(As.xDH,{})});break;case ys.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(As.LPM,{})});break;case ys.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(As.rE2,{})})}const l=()=>{e.notificationService.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(i)));return(0,T.jsx)(vs.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:t?t.autoHideDuration??null:Os,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Is.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,cs.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.g8U,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(As.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Ls=s(17954);const bs=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(Ls.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Ds=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,rt.useRef)(null),[c,d]=(0,rt.useState)(!1),[h,u]=(0,rt.useState)(),[p,m]=(0,rt.useState)(0),[_,g]=(0,rt.useState)(0),E=()=>{u(void 0),d(!1),g(0),m(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),m(n)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(bs,{open:c,anchorPosition:{left:p,top:_},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${_}`)]})},Ms=(0,rt.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,T.jsx)("div",{ref:t,className:(0,cs.clsx)("menu",s),...n,children:i})})),Fs=e=>{const{className:t,onClick:s,title:i,disabled:n,children:a,...r}=e;return(0,T.jsx)("button",{className:(0,cs.clsx)("menu__item",t),disabled:Boolean(n),title:i,onClick:s,...r,children:a})},js=ds("MenuContentDivider","menu__divider");ds("MenuContentItemIcon","menu__item__icon"),ds("MenuContentItemLabel","menu__item__label");var ks=s(95081),Us=s(53019);const Gs=e=>(0,T.jsx)(ks.D,{className:(0,cs.clsx)("markdown-content",e.className),remarkPlugins:[Us.Z],children:e.value.value});var Vs=s(62515);const Bs=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,Vs.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,rt.useState)(!1),{ref:o,width:l,height:c}=(0,Vs.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,rt.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,cs.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var $s=s(33207);const zs=e=>{const{children:t,...s}=e;return(0,T.jsx)($s.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var Hs=s(13474),Ys=s(65068),Ws=s(41327),Ks=s(85688),Xs=s(28019),Zs=s(8978);const qs=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,T.jsxs)("div",{className:(0,cs.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ks.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,T.jsx)(Xs.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Zs.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 Js;!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"}(Js=Js||(Js={}));const Qs=(0,at.Pi)((e=>{const{configState:t}=e,s=Ri();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(Js.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(As.uMt,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(qs,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[_t.STANDARD,_t.INCLUDE,_t.EXACT,_t.INVERSE],size:1})})]})})),ei=(0,at.Pi)((e=>{const{entry:t}=e,s=Ri(),i=()=>{t.isOpen||It.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.clipboardService.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(Ds,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(Ms,{children:(0,T.jsx)(Fs,{onClick:n,children:"Copy Documentation Key"})}),children:(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,T.jsx)("button",{className:(0,cs.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)(As.v4q,{}):(0,T.jsx)(As.XCv,{})}),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:()=>{It.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)(Gs,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),ti=(0,at.Pi)((()=>{const e=Ri(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.clipboardService.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(Ds,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ms,{children:[(0,T.jsx)(Fs,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(Fs,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(Fs,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,T.jsx)(T.Fragment,{children:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(Gs,{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)(ei,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(Bs,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(As.jZm,{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!"})]})})]})})),si=(0,at.Pi)((()=>{const e=Ri(),t=(0,rt.useRef)(null),s=(0,rt.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,rt.useMemo)((()=>(0,Hs.Z)((()=>i.search()),100)),[i]);return(0,rt.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,cs.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":n}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),a()},value:n,placeholder:"Ask me a question"}),n&&(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,cs.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)(As.IEm,{})}),n?(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)(As.q1B,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(As.W1M,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(Ss,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,cs.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,T.jsx)(Qs,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(ei,{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)(ei,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,T.jsx)(Bs,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(As.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,T.jsx)(Ds,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(Ms,{children:[(0,T.jsx)(Fs,{onClick:()=>{ge(`documentation-registry_${(0,Ys.Z)(new Date(Date.now()),je)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),oe.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(Fs,{onClick:()=>{ge(`documentation-registry_${(0,Ys.Z)(new Date(Date.now()),je)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),oe.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)(As.Oag,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(As.ce8,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(As.dRK,{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?"})]})})]})]})]})})),ii=(0,at.Pi)((e=>{const{triggerElement:t}=e,s=Ri().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,T.jsx)(zs,{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,cs.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.SEARCH}),onClick:()=>s.setSelectedTab(gt.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(As.W1M,{})})}),(0,T.jsx)("div",{className:(0,cs.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(gt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(As.kdY,{}),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)(As.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===gt.SEARCH&&(0,T.jsx)(si,{}),n===gt.CONTEXTUAL_SUPPORT&&(0,T.jsx)(ti,{})]})]})},s.panelRenderingKey)})),ni=(0,at.Pi)((()=>{const[e,t]=(0,rt.useState)(!1),[s,i]=(0,rt.useState)((0,a.Z)()),n=Ri(),r=(0,rt.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,rt.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,T.jsx)(Ws,{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,cs.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(gt.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)(As.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(As.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(Ds,{className:(0,cs.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)(Ms,{children:[(0,T.jsx)(Fs,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,T.jsx)(Fs,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,T.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,T.jsx)(As.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(ii,{triggerElement:r.current})]})},s)})),ai="app.container",ri="app.backdrop-container",oi=["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"],li=e=>(0,T.jsx)("div",{className:"backdrop__container",id:e.elementID}),ci=(0,at.Pi)((e=>{const{children:t}=e,s=Ri(),i=s.layoutService.backdropContainerElementID?document.getElementById(s.layoutService.backdropContainerElementID)??document.getElementById(ri):document.getElementById(ri),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e.length&&(s[i]={combinations:e,handler:t})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:oi,handler:(e,t)=>{t.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,((e,t)=>{oi.includes(e)&&t.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,rt.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&((0,Vt.Z)(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)),(e=>e.combination)).forEach((e=>{const s=e.combination,n=Zt(e.combination);if(!n.length)return;const a=t.get(s)??n,r=H(a[0]);qt(i,r)?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(s,i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(n);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n]),(0,rt.useEffect)((()=>{const e=()=>{document.hidden&&(It.logEvent_ApplicationUsageInterrupted(s.telemetryService),s.timeService.recordUsageInterruption())};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[s]),(0,T.jsxs)(is,{children:[(0,T.jsx)(Ns,{}),(0,T.jsx)(xs,{}),(0,T.jsx)(ws,{}),s.layoutService.showBackdrop&&(0,T.jsx)(ns.Z,{container:i,children:(0,T.jsx)(as.Z,{className:"backdrop",open:s.layoutService.showBackdrop})}),(0,T.jsx)(rs.W,{backend:os.PD,children:(0,T.jsxs)("div",{className:"app__container",id:ai,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(li,{elementID:ri}),(0,T.jsx)(ni,{}),t]})})]})})),di={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"},hi={matchOverviewRuler:"#d186167e",activeMatchColorOverviewRuler:"#A0A0A0CC",matchBackground:"#62331c",activeMatchBackground:"#515C6A"},ui=`\n${Pt.BOLD}${Pt.BRIGHT_BLUE}$purist${Pt.RESET}\n${Pt.BOLD}${Pt.MAGENTA}❯${Pt.RESET} `,pi="❯ ";class mi extends Gt{instance;resizer;renderer;searcher;webLinkProvider;_TEMPORARY__onKeyListener;_TEMPORARY__onDataListener;command="";commandHistory=[];currentCommandSearchString="";commandHistoryNavigationIdx=void 0;isRunningCommand=!1;setupState=ft.create();constructor(e){super(e),this.instance=new wt.Terminal({allowProposedApi:!0,fontSize:12,letterSpacing:2,fontWeight:400,fontWeightBold:700,fontFamily:`"${N}", Menlo, Consolas, monospace`,tabStopWidth:2,theme:di,overviewRulerWidth:14,scrollback:1e5,convertEol:!0,scrollOnUserInput:!1}),this.resizer=new bt.FitAddon,this.searcher=new Dt.SearchAddon,this.renderer=new Ft.WebglAddon}setup(e){if(this.setupState.hasCompleted)throw new k("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 Mt.Unicode11Addon),this.instance.unicode.activeVersion="11",this.instance.attachCustomKeyEventHandler((e=>Jt(e,"Control+KeyF")||Jt(e,"Meta+KeyF")?(e.preventDefault(),e.stopPropagation(),this.searchConfig.focus(),!1):!(Jt(e,"Control+KeyC")&&this.instance.hasSelection()||Jt(e,"Control+KeyV")))),this.webLinkProvider=e?.webLinkProvider?new Lt.WebLinksAddon(e.webLinkProvider.handler,{urlRegex:e.webLinkProvider.regex}):new Lt.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(Ee.APPLICATION_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;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(Jt(t,"Control+KeyD")||Jt(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,document.getElementById(ai)?.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=`${pi}${this.command}`,i=`${pi}${this.command.substring(0,t-pi.length)}${this.command.length<t-pi.length?" ".repeat(t-this.command.length-pi.length):""}`;let n=0,a=0;for(let s=e.baseY+e.cursorY;s>-1;--s){if(H(e.getLine(s)).translateToString()===i){n=s,a+=(s===e.baseY+e.cursorY?e.cursorX:t)-pi.length;break}a+=s===e.baseY+e.cursorY?e.cursorX:t}return{startY:n,startX:pi.length,endY:n+(s.length-s.length%t)/t,endX:s.length%t,cursorIdx:a}}computeCursorJumpMovement(e){const t=this.getCommandRange();let s,i=!1;if(e){for(let e=t.cursorIdx-1;e>-1;--e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=t.cursorIdx-e-1;break}}else for(let e=t.cursorIdx+1;e<this.command.length;++e)if(this.command.charAt(e).match(/\w/))i||(i=!0);else if(i){s=e-t.cursorIdx-1;break}return void 0===s&&(s=e?t.cursorIdx:this.command.length-t.cursorIdx),e?-s:s}computeCursorMovement(e,t=!0){const s=this.instance.buffer.active,i=this.instance.cols,n=this.instance.rows,a=this.getCommandRange(),r=t?e<0?a.cursorIdx:this.command.length-a.cursorIdx:e,o=Math.min(Math.abs(e),r);let l=s.cursorX,c=s.cursorY,d=s.baseY+s.cursorY;e<0?(l=(i+(s.cursorX-o)%i)%i,c=s.cursorY-(o>s.cursorX?Math.ceil(o/i):0),d=c+s.baseY,c=Math.max(c,-1)):e>0&&(l=(s.cursorX+o)%i,c=s.cursorY+(s.cursorX+o>=i?Math.floor((s.cursorX+o)/i):0),d=c+s.baseY,c=Math.min(c,n-1));const h=d>s.viewportY+n?d-(s.viewportY+n):d<s.viewportY?d-s.viewportY:0;return{seq:jt(c+1,l+1),scroll:h}}writeToCommand(e){const t=this.getCommandRange(),s=this.command.slice(0,t.cursorIdx),i=this.command.slice(t.cursorIdx),n=this.computeCursorMovement(e.length,!1);this.instance.scrollLines(n.scroll),this.instance.write(e+i+n.seq),this.setCommand(s+e+i)}deleteFromCommand(e){const t=this.getCommandRange(),s=e<0?t.cursorIdx:this.command.length-t.cursorIdx,i=Math.min(Math.abs(e),s);let n,a,r;if(0===e)return;e<0?(n=this.command.slice(0,t.cursorIdx-i),a=this.command.slice(t.cursorIdx,this.command.length),r=-i):(n=this.command.slice(0,t.cursorIdx),a=this.command.slice(t.cursorIdx+i,this.command.length),r=0);const o=this.computeCursorMovement(r);this.instance.scrollLines(o.scroll),this.instance.write(jt(t.startY+1,t.startX+1)+n+a+" ".repeat(i)+o.seq),this.setCommand(n+a)}get isSetup(){return this.setupState.hasCompleted}isFocused(){return document.activeElement===this.instance.textarea}mount(e){if(!this.setupState.hasCompleted)throw new k("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(jt(s.startY+1,s.startX+1)+t.padEnd(this.command.length)),this.command=t,s=this.getCommandRange(),this.instance.write(jt(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(ui),this.setCommand("")}newSystemCommand(e){this.isRunningCommand||(this.command&&(this.abort(),this.newCommand()),this.instance.write(`${Pt.DIM}(system: ${e})\n${Pt.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!==pi;break}}return""===this.command&&t}clear(){this.flushScreen(),this.instance.scrollToTop(),this.newCommand()}resetANSIStyling(){this.instance.write(Pt.RESET)}showHelp(){var e;this.resetANSIStyling(),this.instance.scrollToBottom(),this.isFlushed||this.isRunningCommand||this.abort(),this.instance.write((e=this.commandRegistry,`\n${Pt.BRIGHT_BLACK}+-------------------------------------------------------+${Pt.RESET}\n${Pt.BRIGHT_BLACK}|${Pt.RESET} ${Pt.BRIGHT_GREEN}[@@]${Pt.RESET} "Hi! Welcome to the HELP menu of Pure IDE" ${Pt.BRIGHT_BLACK}|${Pt.RESET}\n${Pt.BRIGHT_BLACK}|${Pt.RESET} ${Pt.BRIGHT_GREEN}/|__|\\${Pt.RESET} ${Pt.BRIGHT_BLACK}|${Pt.RESET}\n${Pt.BRIGHT_BLACK}+--${Pt.RESET} ${Pt.BRIGHT_GREEN}d b${Pt.RESET} ${Pt.BRIGHT_BLACK}-----------------------------------------------+${Pt.RESET}\n\nFollowing is the list of supported commands:\n\n${(0,Vt.Z)(Array.from(e.values()),(e=>e.command)).map((e=>`${Pt.BRIGHT_GREEN}${e.command.padEnd(30)}${Pt.RESET}${e.description}${e.aliases?.length?`\n${"".padEnd(30)}Aliases: ${e.aliases.join(", ")}`:""}\n${"".padEnd(30)}Usage: ${Pt.DIM}${e.usage}${Pt.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(Pt).map((([e,t])=>`${t}${(e=>{if(!e)return"";const t=e.slice(-2),s=Wt.includes(t);let i=s?e.slice(0,e.length-2):e;const n=Ht(i.toLowerCase()).replace(/_(?:\w)/gu,(e=>e.toUpperCase())).replace(/_/gu," ").trim();return i=(e=>void 0!==e&&""!==e&&Boolean(e.match(/^(?:[a-z])*(?:[A-Z][a-z]+)+$/u)))(i)?(e=>Ht(e).replace(/(?:[A-Z])/gu,(e=>` ${e}`)).trim())(i):n,s?`${i} ID`.trim():n})(e).padEnd(20)}${Pt.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${Pt.RED}${e}${Pt.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:hi,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:hi,regex:this.searchConfig.useRegex,wholeWord:this.searchConfig.matchWholeWord,caseSensitive:this.searchConfig.matchCaseSensitive})}findNext(){this.searcher.findNext(this.searchConfig.searchText,{decorations:hi,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 _i{applicationStore;terminal;constructor(e){this.applicationStore=e,this.terminal=new mi(e)}}class gi{applicationStore;currentUser="(unknown)";constructor(e){(0,x.rC)(this,{currentUser:x.LO,setCurrentUser:x.aD}),this.applicationStore=e}setCurrentUser(e){this.currentUser=e}}var Ei;!function(e){e.EDITOR_THEME="editor.theme"}(Ei=Ei||(Ei={}));class fi{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 Ti{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,t){return this.data[e]??t}getNumberValue(e,t){return ee(this.getValue(e,t))}getStringValue(e,t){return((e,t="")=>(function(e,t=""){if(!J(e))throw new B(t||"Value is expected to be a string")}(e,t),e))(this.getValue(e,t))}getBooleanValue(e,t){return((e,t="")=>(function(e,t=""){if(!(e=>"boolean"==typeof e)(e))throw new B(t||"Value is expected to be a boolean")}(e,t),e))(this.getValue(e,t))}getObjectValue(e,t){return((e,t="")=>(function(e,t=""){if(!Q(e))throw new B(t||"Value is expected to be a object")}(e,t),e))(this.getValue(e,t))}persist(e,t){this.data[e]=t,this.storageService.storage.setItem(this.storeIndex,JSON.stringify(this.data))}}class Ci{applicationStore;storage;settingsStore;constructor(e){this.applicationStore=e,this.storage=new fi,this.settingsStore=new Ti(this,"application-settings-storage")}}class xi{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 Si{timestamp=Date.now();interruptions=[];recordUsageInterruption(){this.interruptions.push(Date.now())}finalizeTimingsRecord(e,t){const s=e.elapsed,i=e.startTime,n=i+s,a={...t??{},...Object.fromEntries(e.records),total:s};let r=0;for(const e of this.interruptions)if(e>=i&&e<=n)r++;else if(e>n)break;return r>0?{...a,__numberOfInteruptions:r}:a}}class Ni{applicationStore;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e){(0,x.rC)(this,{TEMPORARY__isLightThemeEnabled:x.LO,backdropContainerElementID:x.LO,showBackdrop:x.LO,setBackdropContainerElementID:x.aD,setShowBackdrop:x.aD,TEMPORARY__setIsLightThemeEnabled:x.aD}),this.applicationStore=e,this.TEMPORARY__isLightThemeEnabled=this.applicationStore.storageService.settingsStore.getBooleanValue(Ei.EDITOR_THEME,!1)}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}}class Ai{applicationStore;constructor(e){this.applicationStore=e}async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.applicationStore.notificationService.notifyError(e)}))}}class vi{navigator;constructor(e){this.navigator=e}}class Ii{uuid=(0,a.Z)();config;pluginManager;identityService;storageService;timeService=new Si;commandService;keyboardShortcutsService;layoutService;clipboardService;terminalService;logService=new p;navigationService;navigationContextService;documentationService;assistantService;alertService;notificationService;eventService;telemetryService;tracerService;constructor(e,t,s){this.config=e,this.pluginManager=s,this.timeService=new Si,this.logService=new p,this.logService.registerPlugins(s.getLoggerPlugins()),this.identityService=new gi(this),this.storageService=new Ci(this),this.layoutService=new Ni(this),this.clipboardService=new Ai(this),this.terminalService=new _i(this),this.commandService=new yt(this),this.keyboardShortcutsService=new Rt(this),this.navigationService=new vi(t),this.navigationContextService=new Ot(this),this.documentationService=new et(this),this.assistantService=new Nt(this),this.alertService=new fs(this),this.notificationService=new Ps,this.eventService=new At,this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins()),this.telemetryService=new xi(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(Ee.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notificationService.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)}}const Oi=(0,rt.createContext)(void 0),yi=({children:e,config:t,pluginManager:s})=>{const i=H((0,rt.useContext)(ct),"Can't find web application navigator in context"),n=(0,at.fv)((()=>new Ii(t,i,s)));return(0,T.jsx)(Oi.Provider,{value:n,children:e})},Ri=()=>H((0,rt.useContext)(Oi),"Can't find application store in context");class Pi{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=Qe(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=H(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=H(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=H(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class wi extends Pi{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Z(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty"),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}}class Li 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 bi extends Li{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new bi}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 Di=JSON.parse('{"i8":"7.1.39","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 Mi extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Fi=e=>t=>(0,x.bi)(t)?t:e(t),ji=e=>(t,s)=>(0,x.bi)(t)?t:e(t,s),ki=e=>{(0,x.rC)(e,{_isDeleted:x.LO,_isDisposed:x.LO,name:x.LO,package:x.LO,isDeleted:x.Fl,path:x.Fl,_elementHashCode:x.Fl,hashCode:x.Fl,setIsDeleted:x.aD,dispose:x.aD})},Ui=Fi((e=>(0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl})));var Gi=s(34485),Vi=s(3096);const Bi=e=>Gi.sha1().update(e).digest("hex"),$i=e=>Bi(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Bi(e):e.hashCode)).join(","));var zi,Hi;(Hi=zi=zi||(zi={})).PACKAGE="PACKAGE",Hi.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Hi.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Hi.PROFILE="PROFILE",Hi.TAG_POINTER="TAG_POINTER",Hi.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Hi.TAGGED_VALUE="TAGGED_VALUE",Hi.ENUMERATION="ENUMERATION",Hi.ENUM_VALUE="ENUM_VALUE",Hi.CLASS="CLASS",Hi.PROPERTY="PROPERTY",Hi.PROPERTY_POINTER="PROPERTY_POINTER",Hi.MULTIPLICITY="MULTIPLICITY",Hi.CONSTRAINT="CONSTRAINT",Hi.DERIVED_PROPERTY="DERIVED_PROPERTY",Hi.ASSOCIATION="ASSOCIATION",Hi.FUNCTION="FUNCTION",Hi.MEASURE="MEASURE",Hi.UNIT="UNIT",Hi.RUNTIME="RUNTIME",Hi.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Hi.ENGINE_RUNTIME="ENGINE_RUNTIME",Hi.LEGACY_RUNTIME="LEGACY_RUNTIME",Hi.RUNTIME_POINTER="RUNTIME_POINTER",Hi.STORE_CONNECTIONS="STORE_CONNECTIONS",Hi.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Hi.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Hi.CONNECTION_POINTER="CONNECTION_POINTER",Hi.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Hi.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Hi.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Hi.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Hi.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Hi.FLAT_DATA="FLAT_DATA",Hi.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Hi.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Hi.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Hi.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Hi.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Hi.FLAT_DATA_STRING="FLAT_DATA_STRING",Hi.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Hi.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Hi.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Hi.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Hi.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Hi.FLAT_DATA_DATE="FLAT_DATA_DATE",Hi.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Hi.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Hi.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Hi.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Hi.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Hi.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Hi.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Hi.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Hi.DATABASE="DATABASE",Hi.DATABASE_SCHEMA="DATABASE_SCHEMA",Hi.DATABASE_JOIN="DATABASE_JOIN",Hi.DATABASE_FILTER="DATABASE_FILTER",Hi.DATBASE_VIEW="DATBASE_VIEW",Hi.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Hi.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Hi.RELATIONAL="RELATIONAL",Hi.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Hi.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Hi.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Hi.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Hi.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Hi.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Hi.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Hi.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Hi.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Hi.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Hi.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Hi.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Hi.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Hi.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Hi.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Hi.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Hi.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Hi.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Hi.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Hi.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Hi.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Hi.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Hi.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Hi.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Hi.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Hi.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Hi.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Hi.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Hi.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Hi.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Hi.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Hi.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Hi.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Hi.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Hi.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Hi.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Hi.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Hi.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Hi.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Hi.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Hi.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Hi.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Hi.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Hi.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Hi.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Hi.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Hi.SPANNER_DATASOURCE_SPECIFICATION="SPANNER_DATASOURCE_SPECIFICATION",Hi.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Hi.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Hi.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Hi.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Hi.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Hi.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Hi.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Hi.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Hi.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Hi.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Hi.SCHEMA_MAPPER="SCHEMA_MAPPER",Hi.TABLE_MAPPER="TABLE_MAPPER",Hi.MAPPING="MAPPING",Hi.MAPPING_INCLUDE="MAPPING_INCLUDE",Hi.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Hi.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Hi.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Hi.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Hi.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Hi.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Hi.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Hi.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Hi.PROPERTY_MAPPING="PROPERTY_MAPPING",Hi.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Hi.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Hi.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Hi.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Hi.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Hi.MAPPING_TEST="MAPPING_TEST",Hi.STORE_TEST_DATA="STORE_TEST_DATA",Hi.INPUT_DATA="INPUT_DATA",Hi.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Hi.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Hi.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Hi.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Hi.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Hi.FILTER_MAPPING="FILTER_MAPPING",Hi.COLUMN_MAPPING="COLUMN_MAPPING",Hi.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Hi.SERVICE="SERVICE",Hi.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Hi.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Hi.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Hi.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Hi.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Hi.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Hi.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Hi.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Hi.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Hi.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Hi.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Hi.SERVICE_TEST="SERVICE_TEST",Hi.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Hi.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Hi.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Hi.GENERATION_TREE="GENERATION_TREE",Hi.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Hi.FILE_GENERATION="FILE_GENERATION",Hi.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Hi.SECTION_INDEX="SECTION_INDEX",Hi.SECTION="SECTION",Hi.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Hi.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Hi.RAW_LAMBDA="RAW_LAMBDA",Hi.RAW_VARIABLE="RAW_VARIABLE",Hi.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Hi.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Hi.ASSERT_FAIL="ASSERT_FAIL",Hi.ASSERT_PASS="ASSERT_PASS",Hi.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Hi.EQUAL_TO="EQUAL_TO",Hi.EQUAL_TO_JSON="EQUAL_TO_JSON",Hi.EQUAL_TO_TDS="EQUAL_TO_TDS",Hi.TEST_RESULT="TEST_RESULT",Hi.TEST_ERROR="TEST_ERROR",Hi.TEST_FAILED="TEST_FAILED",Hi.TEST_PASSED="TEST_PASSED",Hi.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Hi.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Hi.MODEL_STORE_DATA="MODEL_STORE_DATA",Hi.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Hi.DATA_ELEMENT="DATA_ELEMENT",Hi.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Hi.RELATIONAL_TDS="RELATIONAL_TDS",Hi.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Hi.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Hi.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Hi.EXPRESSION="EXPRESSION",Hi.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Hi.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Hi.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Hi.INSTANCE_VALUE="INSTANCE_VALUE",Hi.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Hi.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Hi.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Hi.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Hi.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Hi.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Hi.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Hi.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Hi.FUNCTION_TYPE="FUNCTION_TYPE",Hi.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Hi.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Hi.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Hi.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Hi.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Hi.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Hi.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Hi.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Yi=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(Q(t=e),"Can't hash non-object value"),Vi(t,s);var t,s},Wi=(e,t)=>$i([e?Yi(e):"",t?Yi(t):""]),Ki=(e,t)=>[zi.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Bi).join(",");class Xi{stereotypes=[];taggedValues=[]}class Zi extends Xi{name}class qi extends Zi{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}${fe}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return $i([zi.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new k(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class Ji extends qi{}class Qi extends Ji{_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 $i([zi.CLASS,this.path,$i(this.properties),$i(this.derivedProperties),$i(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),$i(this.constraints),$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class en extends Ji{}class tn extends en{values=[];get _elementHashCode(){return $i([zi.ENUMERATION,this.path,$i(this.values),$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class sn extends en{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return $i([zi.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}}class nn extends Ji{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return $i([zi.MEASURE,this.path,this.canonicalUnit??"",$i(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class an extends qi{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class rn{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return $i([zi.SECTION,this.parserName,$i(this.elements.map((e=>e.valueForSerialization??"")))])}}class on extends rn{imports=[];get hashCode(){return $i([zi.IMPORT_AWARE_CODE_SECTION,super.hashCode,$i(this.imports.map((e=>e.valueForSerialization??"")))])}}class ln extends rn{get hashCode(){return $i([zi.DEFAULT_CODE_SECTION,super.hashCode])}}class cn{_UUID=(0,a.Z)()}class dn extends cn{ownerReference;constructor(e){super(),this.ownerReference=e}}class hn extends cn{value;constructor(e){super(),this.value=e}}class un extends hn{constructor(e){super(e)}static create(e){return new un(e)}get valueForSerialization(){return this.value.path}}const pn=Fi((e=>(0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}))),mn=Fi((e=>(ki(e),(0,x.rC)(e,{type:x.LO,generationOutputPath:x.LO,scopeElements:x.LO,configurationProperties:x.LO,_elementHashCode:x.KG}),e.scopeElements.forEach((e=>{e instanceof hn&&Ui(e)})),e.configurationProperties.forEach(pn),e))),_n=Fi((e=>((0,x.rC)(e,{id:x.LO,hashCode:x.Fl}),Ui(e.generationElement),e))),gn=Fi((e=>(ki(e),(0,x.rC)(e,{generationNodes:x.LO,fileGenerations:x.LO,_elementHashCode:x.KG}),e.generationNodes.forEach(_n),e.fileGenerations.forEach(Ui),e)));class En{}class fn extends En{expectedOutput;constructor(e){super(),this.expectedOutput=Kt(e)}get hashCode(){return $i([zi.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Tn{}class Cn extends Tn{mappings=[];connections=[];get hashCode(){return $i([zi.ENGINE_RUNTIME,$i(this.mappings.map((e=>Ki(be.MAPPING,e.valueForSerialization??"")))),$i(this.connections.filter((e=>e.storeConnections.length)))])}}class xn extends Tn{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return $i([zi.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Sn{}class Nn extends Sn{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return $i([zi.FLAT_DATA_INPUT_DATA,Ki(be.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var An,vn,In;(In=An=An||(An={})).JSON="JSON",In.XML="XML";class On extends Sn{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===An.JSON?Kt(s):s}get hashCode(){return $i([zi.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(vn=vn||(vn={}));class yn extends Sn{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return $i([zi.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Rn=Fi((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),Ui(e.type),e))),Pn=Fi((e=>(0,x.rC)(e,{body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}))),wn=Fi((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,hashCode:x.Fl}),Ui(e.type),e)));class Ln{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Pn(e)}visit_RawVariableExpression(e){wn(e)}visit_RawPrimitiveInstanceValue(e){Rn(e)}}ji(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Ln(t)),e)));class bn{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Dn extends bn{trueString;falseString;get hashCode(){return $i([zi.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Mn extends bn{get hashCode(){return $i([zi.FLAT_DATA_STRING])}}class Fn extends bn{get hashCode(){return $i([zi.FLAT_DATA_NUMBER])}}class jn extends bn{dateFormat;timeZone;get hashCode(){return $i([zi.FLAT_DATA_DATE,this.dateFormat?$i(this.dateFormat):"",this.timeZone??""])}}class kn extends bn{fields=[];get hashCode(){return $i([zi.FLAT_DATA_RECORD_TYPE,$i(this.fields)])}}const Un=ji(((e,t)=>(El(e,t),(0,x.rC)(e,{flatData:x.LO,sectionName:x.LO,hashCode:x.Fl}),e))),Gn=Fi((e=>((0,x.rC)(e,{label:x.LO,flatDataDataType:x.LO,optional:x.LO,address:x.LO,hashCode:x.Fl}),(e=>{e instanceof Dn?(0,x.rC)(e,{trueString:x.LO,falseString:x.LO,hashCode:x.Fl}):e instanceof Mn||e instanceof Fn?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof jn?(0,x.rC)(e,{dateFormat:x.LO,timeZone:x.LO,hashCode:x.Fl}):e instanceof kn&&Fi(Vn)(e)})(e.flatDataDataType),e)));function Vn(e){return(0,x.rC)(e,{fields:x.LO,hashCode:x.Fl}),e.fields.forEach(Gn),e}Fi(Vn);const Bn=Fi(Vn),$n=Fi((e=>((0,x.rC)(e,{name:x.LO,value:x.LO,hashCode:x.Fl}),e))),zn=Fi((e=>((0,x.rC)(e,{driverId:x.LO,name:x.LO,sectionProperties:x.LO,recordType:x.LO,hashCode:x.Fl}),e.sectionProperties.forEach($n),e.recordType&&Bn(e.recordType),e))),Hn=(Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Ui(e.ownerReference),e))),Fi((e=>(ki(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(zn),e)))),Yn=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),Wn=ji(((e,t)=>(vl(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),Yn(e.sourceRootRecordType),e.filter&&Pn(e.filter),e))),Kn=ji(((e,t)=>(El(e,t),vl(e,t),(0,x.rC)(e,{rootInstanceSetImplementation:x.LO,hashCode:x.Fl}),e))),Xn=ji(((e,t)=>(El(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,hashCode:x.Fl}),Pn(e.transform),e))),Zn=Fi((e=>((0,x.rC)(e,{data:x.LO,hashCode:x.Fl}),Ui(e.sourceFlatData),e))),qn=Fi((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e)));class Jn{}class Qn extends Jn{serverPrincipal;get hashCode(){return $i([zi.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class ea extends Jn{get hashCode(){return $i([zi.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class ta extends Jn{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return $i([zi.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class sa extends Jn{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return $i([zi.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class ia extends Jn{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return $i([zi.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class na extends Jn{get hashCode(){return $i([zi.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class aa extends Jn{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return $i([zi.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,$i(this.additionalGcpScopes)])}}class ra extends Jn{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return $i([zi.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class oa extends Jn{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return $i([zi.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class la{}class ca extends la{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return $i([zi.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class da extends la{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 $i([zi.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class ha extends la{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return $i([zi.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class ua extends la{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return $i([zi.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",$i(this.testDataSetupSqls)])}}class pa extends la{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 $i([zi.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 ma extends la{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return $i([zi.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class _a extends la{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return $i([zi.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class ga extends la{projectId;instanceId;databaseId;proxyHost;proxyPort;constructor(e,t,s,i,n){super(),this.projectId=e,this.instanceId=t,this.databaseId=s,this.proxyHost=i,this.proxyPort=n}get hashCode(){return $i([zi.SPANNER_DATASOURCE_SPECIFICATION,this.projectId,this.instanceId,this.databaseId,this.proxyHost??"",this.proxyPort??""])}}class Ea{_UUID=(0,a.Z)()}class fa extends Ea{mappers=[];get hashCode(){return $i([zi.MAPPER_POST_PROCESSOR,$i(this.mappers)])}}const Ta="{target}",Ca="default";class xa{}class Sa extends xa{}class Na extends Sa{}class Aa extends Na{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return $i([zi.RELATIONAL_OPERATION_DYNA_FUNC,this.name,$i(this.parameters)])}}var va;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(va=va||(va={}));const Ia=e=>[e].concat(e.children.length?Ia(e.children[0]):[]);class Oa extends xa{relationalOperationElement;joinTreeNode;get hashCode(){return $i([zi.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,$i(this.joinTreeNode?Ia(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class ya extends xa{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new U}}class Ra extends xa{alias;column;columnName;get hashCode(){return $i([zi.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Ta:this.alias.name,this.column.value.name])}}class Pa extends xa{value;constructor(e){super(),this.value=e}get hashCode(){return $i([zi.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class wa extends xa{values=[];get hashCode(){return $i([zi.RELATIONAL_OPERATION_LITERAL_LIST,$i(this.values)])}}class La extends xa{owner;name;type;nullable;get hashCode(){return $i([zi.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class ba{}class Da extends ba{infinityDate}class Ma{}class Fa extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_BIGINT])}}class ja extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_SMALLINT])}}class ka extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_TINYINT])}}class Ua extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_INTEGER])}}class Ga extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_FLOAT])}}class Va extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_DOUBLE])}}class Ba extends Ma{size;constructor(e){super(),this.size=e}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class $a extends Ma{size;constructor(e){super(),this.size=e}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class za extends Ma{size;constructor(e){super(),this.size=e}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class Ha extends Ma{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Ya extends Ma{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Wa extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_TIMESTAMP])}}class Ka extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_VARCHAR])}}class Xa extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_BIT])}}class Za extends Ma{size;constructor(e){super(),this.size=e}get hashCode(){return $i([zi.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class qa extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_REAL])}}class Ja extends Ma{get hashCode(){return $i([zi.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class Qa extends dn{ownerReference;constructor(e){super(e),this.ownerReference=e}}class er extends Qa{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[zi.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Bi).join(",")}get selfJoinPointerHashCode(){return[zi.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ca,Ta].map(Bi).join(",")}}class tr extends Qa{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[zi.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Bi).join(",")}get selfJoinPointerHashCode(){return[zi.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ca,Ta].map(Bi).join(",")}}class sr{}class ir extends sr{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return $i([this.from,this.to])}}class nr extends ir{get hashCode(){return $i([super.hashCode,zi.SCHEMA_MAPPER])}}class ar extends ir{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return $i([super.hashCode,zi.TABLE_MAPPER,this.schema])}}const rr=Fi((e=>((0,x.rC)(e,{packageableElementIncludes:x.LO,packageableElementExcludes:x.LO,hashCode:x.Fl}),e.packageableElementIncludes.forEach(Ui),e.packageableElementExcludes.forEach(Ui),e))),or=(Fi((e=>(dl(e),(0,x.rC)(e,{schemaSet:x.LO,schemaId:x.LO,contentType:x.LO,modelUnit:x.LO,_elementHashCode:x.KG}),e.schemaSet&&Ui(e.schemaSet),rr(e.modelUnit),e))),Fi((e=>((0,x.rC)(e,{binding:x.LO,hashCode:x.Fl}),Ui(e.binding),e)))),lr=Fi((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e))),cr=(Fi((e=>($l(e),(0,x.rC)(e,{externalSource:x.LO,hashCode:x.Fl}),lr(e.externalSource),e))),Fi((e=>(0,x.rC)(e,{id:x.LO,location:x.LO,content:x.LO,hashCode:x.Fl})))),dr=(Fi((e=>(ki(e),(0,x.rC)(e,{format:x.LO,schemas:x.LO,_elementHashCode:x.KG}),e.schemas.forEach(cr),e))),Fi((e=>e instanceof Fa||e instanceof ja||e instanceof ka||e instanceof Ua||e instanceof Ga||e instanceof Va||e instanceof Wa||e instanceof Date||e instanceof Ka||e instanceof Xa||e instanceof qa||e instanceof Ja?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof Ba||e instanceof $a||e instanceof za||e instanceof Za?(0,x.rC)(e,{size:x.LO,hashCode:x.Fl}):e instanceof Ha||e instanceof Ya?(0,x.rC)(e,{precision:x.LO,scale:x.LO,hashCode:x.Fl}):e))),hr=Fi((e=>((0,x.rC)(e,{name:x.LO,type:x.LO,nullable:x.LO,hashCode:x.Fl}),dr(e.type),e))),ur=Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Ui(e.ownerReference),e))),pr=Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Ui(e.ownerReference),e))),mr=Fi((e=>((0,x.rC)(e,{relation:x.LO,name:x.LO,database:x.LO,isSelfJoinTarget:x.LO}),(e=>{e instanceof tr?pr(e):e instanceof er&&ur(e)})(e.relation),e))),_r=Fi((e=>((0,x.rC)(e,{name:x.LO,parameters:x.LO,hashCode:x.Fl}),e.parameters.forEach(Nr),e))),gr=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),Er=Fi((e=>((0,x.rC)(e,{alias:x.LO,column:x.LO,columnName:x.LO,hashCode:x.Fl}),mr(e.alias),gr(e.column),e))),fr=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),Tr=Fi((e=>((0,x.rC)(e,{alias:x.LO,children:x.LO,joinType:x.LO,hashCode:x.Fl}),e.alias&&mr(e.alias),e.children.forEach(Tr),fr(e.join),e))),Cr=Fi((e=>((0,x.rC)(e,{relationalOperationElement:x.LO,joinTreeNode:x.LO,hashCode:x.Fl}),e.relationalOperationElement&&Nr(e.relationalOperationElement),e.joinTreeNode&&Tr(e.joinTreeNode),e))),xr=Fi((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),e.value instanceof xa&&Nr(e.value),e))),Sr=Fi((e=>((0,x.rC)(e,{values:x.LO,hashCode:x.Fl}),e.values.forEach(xr),e)));function Nr(e){return e instanceof Aa?_r(e):e instanceof ya?mr(e):e instanceof Ra?Er(e):e instanceof La?hr(e):e instanceof Pa?xr(e):e instanceof wa?Sr(e):e instanceof Oa?Cr(e):e}const Ar=Fi((e=>e)),vr=ji(((e,t)=>{if(e instanceof Da)return Ar(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})),Ir=Fi((e=>((0,x.rC)(e,{columnName:x.LO,relationalOperationElement:x.LO,hashCode:x.Fl}),Nr(e.relationalOperationElement),e))),Or=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),yr=Fi((e=>((0,x.rC)(e,{joinTreeNode:x.LO,database:x.LO,filterName:x.LO,hashCode:x.Fl}),e.joinTreeNode&&Tr(e.joinTreeNode),Or(e.filter),e))),Rr=Fi((e=>((0,x.rC)(e,{columns:x.LO}),e.columns.forEach(Nr),e))),Pr=e=>{(0,x.rC)(e,{columns:x.LO,name:x.LO})},wr=ji(((e,t)=>(Pr(e),(0,x.rC)(e,{primaryKey:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(hr),e.milestoning.forEach((e=>vr(e,t))),e))),Lr=ji(((e,t)=>(Pr(e),(0,x.rC)(e,{primaryKey:x.LO,columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(hr),e.columnMappings.forEach(Ir),e.filter&&yr(e.filter),e.groupBy&&Rr(e.groupBy),e))),br=ji(((e,t)=>((0,x.rC)(e,{name:x.LO,tables:x.LO,views:x.LO,hashCode:x.Fl}),e.tables.forEach((e=>wr(e,t))),e.views.forEach((e=>Lr(e,t))),e))),Dr=Fi((e=>((0,x.rC)(e,{name:x.LO,operation:x.LO,hashCode:x.Fl}),Nr(e.operation),e))),Mr=Fi((e=>((0,x.rC)(e,{name:x.LO,target:x.LO,aliases:x.LO,operation:x.LO,hashCode:x.Fl}),e.target&&mr(e.target),Nr(e.operation),e))),Fr=ji(((e,t)=>(ki(e),(0,x.rC)(e,{schemas:x.LO,joins:x.LO,filters:x.LO,_elementHashCode:x.KG}),e.schemas.forEach((e=>br(e,t))),e.joins.forEach(Mr),e.filters.forEach(Dr),e))),jr=ji(((e,t)=>(El(e,t),(0,x.rC)(e,{transformer:x.LO,relationalOperation:x.LO.ref,bindingTransformer:x.LO,hashCode:x.Fl}),e.bindingTransformer&&or(e.bindingTransformer),e))),kr=(e,t)=>(vl(e,t),El(e,t),(0,x.rC)(e,{id:x.LO,rootInstanceSetImplementation:x.LO,primaryKey:x.LO}),e.primaryKey.forEach(Nr),e),Ur=ji(kr),Gr=ji(((e,t)=>(kr(e,t),(0,x.rC)(e,{inlineSetImplementation:x.LO}),Ll(e.inlineSetImplementation,t),e))),Vr=ji(((e,t)=>(kr(e,t),(0,x.rC)(e,{otherwisePropertyMapping:x.LO,hashCode:x.Fl}),Cl(e.otherwisePropertyMapping,t),e))),Br=ji(((e,t)=>(vl(e,t),(0,x.rC)(e,{primaryKey:x.LO}),e.primaryKey.forEach(Nr),e))),$r=ji(((e,t)=>(vl(e,t),(0,x.rC)(e,{columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,mainTableAlias:x.LO,superSetImplementationId:x.LO,hashCode:x.Fl}),e.columnMappings.forEach(Ir),e.filter&&yr(e.filter),e.groupBy&&Rr(e.groupBy),e.mainTableAlias&&mr(e.mainTableAlias),e))),zr=Fi((e=>((0,x.rC)(e,{data:x.LO,inputType:x.LO,hashCode:x.Fl}),Ui(e.database),e))),Hr=Fi((e=>(0,x.rC)(e,{host:x.LO,port:x.LO,databaseName:x.LO,hashCode:x.Fl}))),Yr=Fi((e=>(0,x.rC)(e,{hostname:x.LO,port:x.LO,protocol:x.LO,httpPath:x.LO,hashCode:x.Fl}))),Wr=Fi((e=>(0,x.rC)(e,{databaseName:x.LO,directory:x.LO,autoServerMode:x.LO,hashCode:x.Fl}))),Kr=Fi((e=>(0,x.rC)(e,{testDataSetupCsv:x.LO,testDataSetupSqls:x.LO,hashCode:x.Fl}))),Xr=Fi((e=>(0,x.rC)(e,{accountName:x.LO,region:x.LO,warehouseName:x.LO,databaseName:x.LO,cloudType:x.LO,quotedIdentifiersIgnoreCase:x.LO,proxyHost:x.LO,proxyPort:x.LO,nonProxyHosts:x.LO,organization:x.LO,accountType:x.LO,role:x.LO,hashCode:x.Fl}))),Zr=Fi((e=>(0,x.rC)(e,{databaseName:x.LO,endpointURL:x.LO,port:x.LO,region:x.LO,clusterID:x.LO,host:x.LO,hashCode:x.Fl}))),qr=Fi((e=>(0,x.rC)(e,{projectId:x.LO,defaultDataset:x.LO,proxyHost:x.LO,proxyPort:x.LO,hashCode:x.Fl}))),Jr=Fi((e=>(0,x.rC)(e,{projectId:x.LO,instanceId:x.LO,databaseId:x.LO,proxyHost:x.LO,proxyPort:x.LO,hashCode:x.Fl}))),Qr=Fi((e=>(0,x.rC)(e,{serverPrincipal:x.LO,hashCode:x.Fl}))),eo=Fi((e=>(0,x.rC)(e,{hashCode:x.Fl}))),to=Fi((e=>(0,x.rC)(e,{apiToken:x.LO,hashCode:x.Fl}))),so=Fi((e=>(0,x.rC)(e,{oauthKey:x.LO,scopeName:x.LO,hashCode:x.Fl}))),io=Fi((e=>(0,x.rC)(e,{privateKeyVaultReference:x.LO,passPhraseVaultReference:x.LO,publicUserName:x.LO,hashCode:x.Fl}))),no=Fi((e=>(0,x.rC)(e,{hashCode:x.Fl}))),ao=Fi((e=>(0,x.rC)(e,{hashCode:x.Fl,userNameVaultReference:x.LO,passwordVaultReference:x.LO,baseVaultReference:x.LO}))),ro=Fi((e=>(0,x.rC)(e,{hashCode:x.Fl,serviceAccountEmail:x.LO,additionalGcpScopes:x.LO}))),oo=Fi((e=>(0,x.rC)(e,{hashCode:x.Fl,vaultReference:x.LO}))),lo=e=>{(0,x.rC)(e,{from:x.LO,to:x.LO,hashCode:x.Fl})},co=Fi((e=>(lo(e),e))),ho=Fi((e=>(lo(e),(0,x.rC)(e,{schema:x.LO}),co(e.schema),e))),uo=ji(((e,t)=>((e=>{$l(e),(0,x.rC)(e,{type:x.LO,timeZone:x.LO,quoteIdentifiers:x.LO})})(e),(0,x.rC)(e,{datasourceSpecification:x.LO,authenticationStrategy:x.LO,postProcessors:x.LO,hashCode:x.Fl}),((e,t)=>{if(e instanceof ca)return Hr(e);if(e instanceof da)return Yr(e);if(e instanceof ha)return Wr(e);if(e instanceof ua)return Kr(e);if(e instanceof pa)return Xr(e);if(e instanceof ma)return Zr(e);if(e instanceof _a)return qr(e);if(e instanceof ga)return Jr(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 Qn)return Qr(e);if(e instanceof ea)return eo(e);if(e instanceof ta)return to(e);if(e instanceof sa)return so(e);if(e instanceof ia)return io(e);if(e instanceof na)return no(e);if(e instanceof ra)return ao(e);if(e instanceof aa)return ro(e);if(e instanceof oa)return oo(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 fa)return(e=>((e=>{(0,x.rC)(e,{hashCode:x.Fl})})(e),(0,x.rC)(e,{mappers:x.LO}),e.mappers.forEach((e=>{(e=>{e instanceof nr?co(e):e instanceof ar&&ho(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 po{id}class mo extends po{__parent;assertions=[]}class _o extends po{__parent;tests=[]}class go extends mo{serializationFormat;parameters=[];keys=[];get hashCode(){return $i([zi.SERVICE_TEST,this.id,$i(this.assertions),$i(this.parameters),$i(this.keys),this.serializationFormat??""])}}class Eo extends mo{query;get hashCode(){return $i([zi.MAPPING_TEST,this.query,this.id,$i(this.assertions)])}}class fo extends _o{mappingStoreTestDatas=[];get hashCode(){return $i([zi.MAPPING_TEST_SUITE,$i(this.mappingStoreTestDatas),this.id,$i(this.tests)])}}class To extends _o{testData;get hashCode(){return $i([zi.SERVICE_TEST_SUITE,this.id,$i(this.tests),this.testData])}}class Co{id;parentTest}class xo extends Co{expected;get hashCode(){return $i([zi.EQUAL_TO,this.id,Yi(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class So extends Co{expected;get hashCode(){return $i([zi.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class No extends Co{expected;get hashCode(){return $i([zi.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Ao{}class vo extends Ao{dataElement;get hashCode(){return $i([zi.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Io extends Ao{contentType;data;get hashCode(){return $i([zi.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Oo extends Ao{instances;get hashCode(){return $i([zi.MODEL_STORE_DATA,$i(Array.from(this.instances.keys()).map((e=>e.path))),Yi(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class yo extends Ao{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return $i([zi.RELATIONAL_CSV_DATA_TABLE,$i(this.tables)])}}const Ro=Fi((e=>((0,x.rC)(e,{contentType:x.LO,data:x.LO,hashCode:x.Fl}),e))),Po=Fi((e=>((0,x.rC)(e,{dataElement:x.LO,hashCode:x.Fl}),e))),wo=Fi((e=>((0,x.rC)(e,{instances:x.LO,hashCode:x.Fl}),e))),Lo=Fi((e=>((0,x.rC)(e,{values:x.LO,table:x.LO,schema:x.LO,hashCode:x.Fl}),e))),bo=Fi((e=>((0,x.rC)(e,{tables:x.LO,hashCode:x.Fl}),e.tables.forEach(Lo),e)));function Do(e,t){if(e instanceof vo)return Po(e);if(e instanceof Io)return Ro(e);if(e instanceof Oo)return wo(e);if(e instanceof yo)return bo(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 Mo=ji(((e,t)=>(ki(e),(0,x.rC)(e,{stereotypes:x.LO,taggedValues:x.LO,data:x.LO,_elementHashCode:x.KG}),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),Do(e.data,t),e)));class Fo{}class jo extends Fo{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return $i([zi.SERVICE_PURE_EXECUTION,this.func])}}class ko extends jo{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return $i([zi.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Uo extends jo{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return $i([zi.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,$i(this.executionParameters)])}}class Go{_OWNER;constructor(e){this._OWNER=e}}class Vo extends Go{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return $i([zi.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,$i(this.asserts)])}}class Bo extends Go{tests=[];get hashCode(){return $i([zi.SERVICE_LEGACY_MULTI_EXECUTION_TEST,$i(this.tests)])}}const $o=ji(((e,t)=>((0,x.rC)(e,{connectionId:x.LO,testData:x.LO,hashCode:x.Fl}),Do(e.testData,t),e))),zo=Fi((e=>((0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}),e))),Ho=Fi((e=>((0,x.rC)(e,{assertion:x.LO,hashCode:x.Fl,id:x.LO}),Pn(e.assertion),e))),Yo=Fi((e=>((0,x.rC)(e,{assertions:x.LO,description:x.LO,parameters:x.LO,hashCode:x.Fl}),e.assertions.forEach(Ho),e.parameters.forEach(Pn),e))),Wo=ji(((e,t)=>((0,x.rC)(e,{connectionsTestData:x.LO,hashCode:x.Fl}),e.connectionsTestData.forEach((e=>$o(e,t))),e))),Ko=Fi((e=>((0,x.rC)(e,{id:x.LO,serializationFormat:x.LO,assertions:x.LO,parameters:x.LO,keys:x.LO,hashCode:x.Fl}),e.parameters.forEach(zo),e.assertions.forEach(cl),e))),Xo=ji(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,testData:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>ll(e,t))),Wo(e.testData,t),e))),Zo=Fi((e=>((0,x.rC)(e,{parametersValues:x.LO,assert:x.LO,singleExecutionTestParent:x.LO,hashCode:x.Fl}),Pn(e.assert),e))),qo=Fi((e=>((0,x.rC)(e,{data:x.LO,asserts:x.LO,hashCode:x.Fl}),e.asserts.forEach(Zo),e))),Jo=Fi((e=>(qo(e),(0,x.rC)(e,{key:x.LO}),e))),Qo=Fi((e=>((0,x.rC)(e,{tests:x.LO,hashCode:x.Fl}),e.tests.forEach(Jo),e))),el=e=>{(0,x.rC)(e,{func:x.LO}),Pn(e.func)},tl=ji(((e,t)=>(el(e),(0,x.rC)(e,{runtime:x.LO,hashCode:x.Fl}),e.mapping&&Ui(e.mapping),e.runtime&&tc(e.runtime,t),e))),sl=ji(((e,t)=>((0,x.rC)(e,{key:x.LO,runtime:x.LO,hashCode:x.Fl}),Ui(e.mapping),tc(e.runtime,t),e))),il=ji(((e,t)=>(el(e),(0,x.rC)(e,{executionKey:x.LO,executionParameters:x.LO,hashCode:x.Fl}),e.executionParameters.forEach((e=>sl(e,t))),e))),nl=ji(((e,t)=>(ki(e),(0,x.rC)(e,{pattern:x.LO,owners:x.LO,documentation:x.LO,autoActivateUpdates:x.LO,execution:x.LO,test:x.LO,tests:x.LO,postValidations:x.LO,patternParameters:x.Fl,_elementHashCode:x.KG}),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),((e,t)=>{e instanceof ko?tl(e,t):e instanceof Uo&&il(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Vo?qo(e):e instanceof Bo&&Qo(e)})(e.test),e.tests.forEach((e=>Xo(e,t))),e.postValidations.forEach((e=>Yo(e))),e))),al=Fi((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),e))),rl=Fi((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ro(e.expected),e))),ol=Fi((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ro(e.expected),e)));function ll(e,t){if(e instanceof go)return Ko(e);if(e instanceof Eo)return ul(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 cl(e){return e instanceof xo?al(e):e instanceof So?ol(e):e instanceof No?rl(e):e}const dl=e=>{ki(e),(0,x.rC)(e,{includes:x.LO}),e.includes.forEach(Ui)},hl=ji(((e,t)=>((0,x.rC)(e,{store:x.LO,data:x.LO,hashCode:x.Fl}),Do(e.data,t),e))),ul=Fi((e=>((0,x.rC)(e,{id:x.LO,query:x.LO,assertions:x.LO,hashCode:x.Fl}),e.assertions.forEach(cl),e))),pl=ji(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,mappingStoreTestDatas:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>ll(e,t))),e.mappingStoreTestDatas.forEach((e=>hl(e,t))),e))),ml=Fi((e=>((0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl}),Ui(e.ownerReference),e))),_l=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),gl=Fi((e=>((0,x.rC)(e,{localMappingProperty:x.LO,localMappingPropertyType:x.LO,localMappingPropertyMultiplicity:x.LO,hashCode:x.Fl}),Ui(e.localMappingPropertyType),e))),El=(e,t)=>{(0,x.rC)(e,{sourceSetImplementation:x.LO,targetSetImplementation:x.LO}),Nc(e.property),_l(e.sourceSetImplementation),e.targetSetImplementation&&_l(e.targetSetImplementation),e.localMappingProperty&&gl(e.localMappingProperty)},fl=ji(((e,t)=>(El(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,explodeProperty:x.LO,hashCode:x.Fl}),e.transformer&&ml(e.transformer),Pn(e.transform),e)));class Tl{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){fl(e,this.observerContext)}visit_FlatDataPropertyMapping(e){Xn(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){Kn(e,this.observerContext)}visit_RelationalPropertyMapping(e){jr(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Un(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Ur(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Gr(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Vr(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Cl=(e,t)=>(e.accept_PropertyMappingVisitor(new Tl(t)),e),xl=Fi((e=>(0,x.rC)(e,{isDefault:x.Fl,valueForSerialization:x.Fl}))),Sl=Fi((e=>(0,x.rC)(e,{valueForSerialization:x.Fl}))),Nl=e=>{(0,x.rC)(e,{root:x.LO}),Ui(e.class),xl(e.id),Sl(e.root)},Al=Fi((e=>((0,x.rC)(e,{setImplementation:x.LO,class:x.LO,properties:x.LO}),e))),vl=(e,t)=>{Nl(e),(0,x.rC)(e,{mappingClass:x.LO,propertyMappings:x.LO}),e.mappingClass&&Al(e.mappingClass),e.propertyMappings.forEach((e=>Cl(e,t)))},Il=Fi((e=>((0,x.rC)(e,{}),_l(e.setImplementation),e))),Ol=e=>{Nl(e),(0,x.rC)(e,{parameters:x.LO,operation:x.LO,hashCode:x.Fl}),e.parameters.forEach(Il)},yl=Fi((e=>(Ol(e),e))),Rl=Fi((e=>(Ol(e),(0,x.rC)(e,{validationFunction:x.LO}),Pn(e.validationFunction),e))),Pl=ji(((e,t)=>(vl(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),e.srcClass&&Ui(e.srcClass),e.filter&&Pn(e.filter),e)));class wl{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){Rl(e)}visit_OperationSetImplementation(e){yl(e)}visit_PureInstanceSetImplementation(e){Pl(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){Wn(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Br(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){$r(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Ll=(e,t)=>(e.accept_SetImplementationVisitor(new wl(t)),e),bl=Fi((e=>((0,x.rC)(e,{original:x.LO,substitute:x.LO}),Ui(e.original),Ui(e.substitute),e))),Dl=Fi((e=>((0,x.rC)(e,{included:x.LO,storeSubstitutions:x.LO}),Ui(e.included),e.storeSubstitutions.forEach(bl),e))),Ml=Fi((e=>(0,x.rC)(e,{value:x.LO}))),Fl=Fi((e=>((0,x.rC)(e,{sourceValues:x.LO,hashCode:x.Fl}),Ec(e.enum),e.sourceValues.forEach(Ml),e))),jl=Fi((e=>((0,x.rC)(e,{sourceType:x.LO,enumValueMappings:x.LO,hashCode:x.Fl}),Ui(e.enumeration),xl(e.id),e.sourceType&&Ui(e.sourceType),e.enumValueMappings.forEach(Fl),e))),kl=ji(((e,t)=>((0,x.rC)(e,{id:x.LO,stores:x.LO,propertyMappings:x.LO,hashCode:x.Fl}),Ui(e.association),xl(e.id),e.stores.forEach(Ui),e.propertyMappings.forEach((e=>Cl(e,t))),e))),Ul=Fi((e=>((0,x.rC)(e,{inputType:x.LO,data:x.LO,hashCode:x.Fl}),Ui(e.sourceClass),e))),Gl=Fi((e=>(0,x.rC)(e,{expectedOutput:x.LO,hashCode:x.Fl}))),Vl=ji(((e,t)=>((0,x.rC)(e,{name:x.LO,query:x.LO,inputData:x.LO,assert:x.LO,hashCode:x.Fl}),Pn(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof On)return Ul(e);if(e instanceof Nn)return Zn(e);if(e instanceof yn)return zr(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 fn&&Gl(e)})(e.assert),e))),Bl=ji(((e,t)=>(ki(e),(0,x.rC)(e,{includes:x.LO,classMappings:x.LO,enumerationMappings:x.LO,associationMappings:x.LO,test:x.LO,tests:x.LO,_elementHashCode:x.KG}),e.includes.forEach(Dl),e.classMappings.forEach((e=>Ll(e,t))),e.enumerationMappings.forEach(jl),e.associationMappings.forEach((e=>kl(e,t))),e.test.forEach((e=>Vl(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof To?Xo(e,t):e instanceof fo?pl(e,t):e}(e,t))),e))),$l=e=>{(0,x.rC)(e,{store:x.LO}),Ui(e.store)},zl=Fi((e=>($l(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),Hl=Fi((e=>($l(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Ui(e.class),e))),Yl=Fi((e=>($l(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Ui(e.class),e))),Wl=Fi((e=>($l(e),(0,x.rC)(e,{mappings:x.LO,hashCode:x.Fl}),e.mappings.forEach(Ui),e)));class Kl{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){zl(e)}visit_ModelChainConnection(e){Wl(e)}visit_JsonModelConnection(e){Hl(e)}visit_XmlModelConnection(e){Yl(e)}visit_FlatDataConnection(e){qn(e)}visit_RelationalDatabaseConnection(e){uo(e,this.observerContext)}}const Xl=(e,t)=>(e.accept_ConnectionVisitor(new Kl(t)),e),Zl=ji(((e,t)=>(ki(e),(0,x.rC)(e,{connectionValue:x.LO,_elementHashCode:x.KG}),Xl(e.connectionValue,t),e))),ql=ji(((e,t)=>((0,x.rC)(e,{id:x.LO,connection:x.LO,hashCode:x.Fl}),Xl(e.connection,t),e))),Jl=ji(((e,t)=>((0,x.rC)(e,{storeConnections:x.LO,hashCode:x.Fl}),Ui(e.store),e.storeConnections.forEach((e=>ql(e,t))),e))),Ql=ji(((e,t)=>((0,x.rC)(e,{mappings:x.LO,connections:x.LO,hashCode:x.Fl}),e.mappings.forEach(Ui),e.connections.forEach((e=>Jl(e,t))),e))),ec=Fi((e=>((0,x.rC)(e,{hashCode:x.Fl}),Ui(e.packageableRuntime),e))),tc=(e,t)=>e instanceof xn?ec(e):e instanceof Cn?Ql(e,t):e,sc=ji(((e,t)=>(ki(e),(0,x.rC)(e,{runtimeValue:x.LO,_elementHashCode:x.KG}),Ql(e.runtimeValue,t),e)));class ic{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){ac(e,this.observerContext)}visit_SectionIndex(e){uc(e)}visit_PrimitiveType(e){}visit_Profile(e){_c(e)}visit_Enumeration(e){fc(e)}visit_Measure(e){Cc(e)}visit_Class(e){vc(e)}visit_Association(e){Ic(e)}visit_ConcreteFunctionDefinition(e){Oc(e)}visit_FlatData(e){Hn(e)}visit_Database(e){Fr(e,this.observerContext)}visit_Mapping(e){Bl(e,this.observerContext)}visit_Service(e){nl(e,this.observerContext)}visit_PackageableRuntime(e){sc(e,this.observerContext)}visit_PackageableConnection(e){Zl(e,this.observerContext)}visit_FileGenerationSpecification(e){mn(e)}visit_GenerationSpecification(e){gn(e)}visit_DataElement(e){Mo(e,this.observerContext)}}const nc=ji(((e,t)=>(e.accept_PackageableElementVisitor(new ic(t)),e))),ac=ji(((e,t)=>((e=>{ki(e),(0,x.rC)(e,{children:x.LO,hashCode:x.KG})})(e),e.children.forEach((e=>{e instanceof an?ac(e,t):nc(e,t)})),e))),rc=Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Ui(e.ownerReference),e))),oc=Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),e))),lc=Fi((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),oc(e.tag),e))),cc=Fi((e=>(0,x.rC)(e,{rawType:x.LO}))),dc=Fi((e=>((0,x.rC)(e,{value:x.LO}),cc(e.value),Ui(e.ownerReference),e))),hc=Fi((e=>((0,x.rC)(e,{parserName:x.LO,elements:x.LO}),e instanceof on?(0,x.rC)(e,{imports:x.LO,hashCode:x.Fl}):e instanceof ln&&(0,x.rC)(e,{hashCode:x.Fl}),e))),uc=Fi((e=>(ki(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(hc),e))),pc=Fi((e=>(0,x.rC)(e,{value:x.LO}))),mc=Fi((e=>(0,x.rC)(e,{value:x.LO}))),_c=Fi((e=>(ki(e),(0,x.rC)(e,{p_stereotypes:x.LO,p_tags:x.LO,_elementHashCode:x.KG}),e.p_stereotypes.forEach(pc),e.p_tags.forEach(mc),e))),gc=Fi((e=>((0,x.rC)(e,{name:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Ec=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),fc=Fi((e=>(ki(e),(0,x.rC)(e,{values:x.LO,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.values.forEach(gc),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Tc=Fi((e=>((0,x.rC)(e,{measure:x.LO,conversionFunction:x.LO,hashCode:x.Fl}),e.conversionFunction&&Pn(e.conversionFunction),e))),Cc=Fi((e=>(ki(e),(0,x.rC)(e,{canonicalUnit:x.LO,nonCanonicalUnits:x.LO,_elementHashCode:x.KG}),e.canonicalUnit&&Tc(e.canonicalUnit),e.nonCanonicalUnits.forEach(Tc),e))),xc=Fi((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),dc(e.genericType),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Sc=Fi((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}),dc(e.genericType),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Nc=Fi((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Ui(e.ownerReference),e))),Ac=Fi((e=>((0,x.rC)(e,{name:x.LO,functionDefinition:x.LO,externalId:x.LO,enforcementLevel:x.LO,messageFunction:x.LO,hashCode:x.Fl}),Pn(e.functionDefinition),e.messageFunction&&Pn(e.messageFunction),e))),vc=Fi((e=>(ki(e),(0,x.rC)(e,{_subclasses:x.LO,properties:x.LO,propertiesFromAssociations:x.LO,derivedProperties:x.LO,generalizations:x.LO,constraints:x.LO,stereotypes:x.LO,taggedValues:x.LO,dispose:x.KG,_elementHashCode:x.KG}),e.properties.forEach(xc),e.propertiesFromAssociations.forEach(xc),e.derivedProperties.forEach(Sc),e.generalizations.forEach(dc),e.constraints.forEach(Ac),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Ic=Fi((e=>(ki(e),(0,x.rC)(e,{properties:x.LO,stereotypes:x.LO,taggedValues:x.LO,derivedProperties:x.LO,_elementHashCode:x.KG}),e.properties.forEach(xc),e.derivedProperties.forEach(Sc),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),Oc=Fi((e=>(ki(e),(0,x.rC)(e,{functionName:x.LO,returnMultiplicity:x.LO,parameters:x.LO.shallow,expressionSequence:x.LO.ref,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.parameters.forEach(wn),Ui(e.returnType),e.stereotypes.forEach(rc),e.taggedValues.forEach(lc),e))),yc=Fi((e=>e instanceof tn?fc(e):e instanceof sn?Tc(e):e instanceof Qi?vc(e):e instanceof nn?Cc(e):e)),Rc=(Fi((e=>e instanceof tn?fc(e):e instanceof sn?Tc(e):e)),Fi((e=>(0,x.rC)(e,{_dummyObservable:x.LO})))),Pc=Fi((e=>((0,x.rC)(e,{value:x.LO}),Ui(e.ownerReference),e))),wc=Fi((e=>(Rc(e),(0,x.rC)(e,{id:x.LO,hideProperties:x.LO,hideTaggedValues:x.LO,hideStereotypes:x.LO,hashCode:x.Fl}),Ui(e.class),e))),Lc=Fi((e=>(Pc(e.classView),e))),bc=Fi((e=>((0,x.rC)(e,{path:x.LO,pathForSerialization:x.Fl}),Lc(e.from),Lc(e.to),e))),Dc=Fi((e=>(bc(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),Mc=Fi((e=>(bc(e),(0,x.rC)(e,{hashCode:x.Fl}),Nc(e.property),Ui(e.association),e))),Fc=Fi((e=>(bc(e),(0,x.rC)(e,{hashCode:x.Fl}),Nc(e.property),e))),jc=Fi((e=>(ki(e),(0,x.rC)(e,{classViews:x.LO,associationViews:x.LO,generalizationViews:x.LO,propertyViews:x.LO,_elementHashCode:x.KG}),e.classViews.forEach(wc),e.associationViews.forEach(Mc),e.generalizationViews.forEach(Dc),e.propertyViews.forEach(Fc),e)));var kc;!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"}(kc=kc||(kc={}));class Uc extends qi{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return $i([kc.DIAGRAM,this.path,$i(this.classViews),$i(this.generalizationViews),$i(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Gc="Diagram";class Vc extends Mi{constructor(){super(Di.Rw.LW,Di.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Gc]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Uc)return Gc}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Uc)return jc(e)}]}}class Bc{package;name;get path(){return`${this.package}${fe}${this.name}`}get hashCode(){return $i([zi.PACKAGEABLE_ELEMENT,this.path])}}class $c extends Bc{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return $i([kc.DIAGRAM,this.path,$i(this.classViews),$i(this.generalizationViews),$i(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class zc{rectangle;position;get hashCode(){return $i([kc.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Hc extends zc{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return $i([kc.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Yc{x;y;get hashCode(){return $i([kc.POINT,this.x.toString(),this.y.toString()])}}class Wc{width;height;get hashCode(){return $i([kc.RECTANGLE,this.width.toString(),this.height.toString()])}}class Kc{points=[]}class Xc{sourceView;targetView;line;get hashCode(){return $i([kc.RELATIONSHIP_VIEW,this.sourceView,this.targetView,$i(this.line.points)])}}class Zc extends Xc{property;get hashCode(){return $i([kc.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class qc extends Zc{get hashCode(){return $i([kc.PROPERTY_VIEW,super.hashCode])}}class Jc extends Xc{get hashCode(){return $i([kc.GENERALIZATION_VIEW,super.hashCode])}}class Qc{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return $i([zi.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Qc(0,0);static ZERO_ONE=new Qc(0,1);static ZERO_MANY=new Qc(0,void 0);static ONE=new Qc(1,1);static ONE_MANY=new Qc(1,void 0)}new Ye((0,He.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,He.Ru)(),startLine:(0,He.Ru)(),startColumn:(0,He.Ru)(),endLine:(0,He.Ru)(),endColumn:(0,He.Ru)()})),(0,He.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return $i([zi.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,He.Ru)(),type:(0,He.Ru)()});const ed=(0,He.yu)(Qc,{lowerBound:(0,He.Ru)(),upperBound:(0,He.jt)((0,He.Ru)())});class td{class;property;get hashCode(){return $i([zi.PROPERTY_POINTER,this.property,this.class??""])}}class sd{}class id{queryTimeOutInSeconds=null;enableConstraints=!0}var nd,ad;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(nd||(nd={})),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"}(ad=ad||(ad={})),(0,He.yu)(class extends id{},{_type:Ze(nd.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,He.Ru)(),enableConstraints:(0,He.Ru)()});const rd=(0,He.yu)(class extends sd{body;parameters;get hashCode(){return $i([zi.RAW_LAMBDA,Wi(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(ad.LAMBDA),body:(0,He.LZ)(),parameters:(0,He.LZ)()}),od=(0,He.yu)(class extends sd{class;name;multiplicity;get hashCode(){return $i([zi.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(ad.VARIABLE),class:(0,He.Ru)(),multiplicity:We(ed),name:(0,He.Ru)()});(0,He.yu)(class extends sd{multiplicity=Qc.ONE;type;value;get hashCode(){return $i([zi.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,He.bm)("_type",(0,He.PG)((e=>{switch(e){case Se.INTEGER:return ad.CINTEGER;case Se.DECIMAL:return ad.CDECIMAL;case Se.STRING:return ad.CSTRING;case Se.BOOLEAN:return ad.CBOOLEAN;case Se.FLOAT:return ad.CFLOAT;case Se.DATETIME:return ad.CDATETIME;case Se.STRICTDATE:return ad.CSTRICTDATE;case Se.STRICTTIME:return ad.CSTRICTTIME;case Se.LATESTDATE:return ad.CLATESTDATE;default:throw new U(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case ad.CINTEGER:return Se.INTEGER;case ad.CDECIMAL:return Se.DECIMAL;case ad.CSTRING:return Se.STRING;case ad.CBOOLEAN:return Se.BOOLEAN;case ad.CFLOAT:return Se.FLOAT;case ad.CDATETIME:return Se.DATETIME;case ad.CSTRICTDATE:return Se.STRICTDATE;case ad.CSTRICTTIME:return Se.STRICTTIME;case ad.CLATESTDATE:return Se.LATESTDATE;default:throw new U(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,He.jt)((0,He.Ru)())});const ld=(0,He.yu)(td,{class:(0,He.jt)((0,He.Ru)()),property:(0,He.Ru)()}),cd=(0,He.yu)(class{profile;value;get hashCode(){return $i([zi.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,He.Ru)(),value:(0,He.Ru)()}),dd=(0,He.yu)(class{profile;value;get hashCode(){return $i([zi.TAG_POINTER,this.value,this.profile])}},{profile:(0,He.Ru)(),value:(0,He.Ru)()}),hd=(0,He.yu)(class{tag;value;get hashCode(){return $i([zi.TAGGED_VALUE,this.tag,this.value])}},{tag:We(dd),value:(0,He.Ru)()}),ud=((0,He.yu)(class extends Bc{stereotypes=[];tags=[];get hashCode(){return $i([zi.PROFILE,this.path,$i(this.stereotypes),$i(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ze("profile"),name:(0,He.Ru)(),package:(0,He.Ru)(),stereotypes:(0,He.pb)((0,He.Ru)()),tags:(0,He.pb)((0,He.Ru)())}),(0,He.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return $i([zi.ENUM_VALUE,this.value,$i(this.stereotypes),$i(this.taggedValues)])}},{stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1}))),value:(0,He.Ru)()})),pd=((0,He.yu)(class extends Bc{values=[];stereotypes=[];taggedValues=[];get hashCode(){return $i([zi.ENUMERATION,this.path,$i(this.values),$i(this.stereotypes),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,He.Ru)(),package:(0,He.Ru)(),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1}))),values:(0,He.pb)(We(ud))}),(0,He.yu)(class extends Bc{measure;conversionFunction;get hashCode(){return $i([zi.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}},{_type:Ze("unit"),conversionFunction:(0,He.jt)(We(rd)),measure:(0,He.Ru)(),name:(0,He.Ru)(),package:(0,He.Ru)()})),md=((0,He.yu)(class extends Bc{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return $i([zi.MEASURE,this.path,this.canonicalUnit??"",$i(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,He.jt)(We(pd)),name:(0,He.Ru)(),nonCanonicalUnits:(0,He.pb)(We(pd)),package:(0,He.Ru)()}),(0,He.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return $i([zi.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",$i(this.stereotypes),$i(this.taggedValues)])}},{aggregation:(0,He.jt)((0,He.Ru)()),multiplicity:We(ed),name:(0,He.Ru)(),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1}))),type:(0,He.Ru)()})),_d=(0,He.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return $i([zi.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,$i(this.stereotypes),$i(this.taggedValues),Wi(this.parameters,this.body)])}},{body:(0,He.LZ)(),name:(0,He.Ru)(),parameters:(0,He.LZ)(),returnMultiplicity:We(ed),returnType:(0,He.Ru)(),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1})))}),gd=(0,He.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return $i([zi.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,He.jt)((0,He.Ru)()),externalId:(0,He.jt)((0,He.Ru)()),functionDefinition:We(rd),messageFunction:(0,He.jt)(We(rd)),name:(0,He.Ru)()}),Ed=((0,He.yu)(class extends Bc{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return $i([zi.CLASS,this.path,$i(this.properties),$i(this.derivedProperties),$i(this.superTypes),$i(this.constraints),$i(this.stereotypes),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(gd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(gd,e)),{skipIfEmpty:!1}))),name:(0,He.Ru)(),originalMilestonedProperties:(0,He.PG)((e=>Xe(e,(e=>He.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>He.AM),{skipIfEmpty:!1}))),package:(0,He.Ru)(),properties:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(md,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(md,e)),{skipIfEmpty:!1}))),derivedProperties:(0,He.bm)("qualifiedProperties",(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(_d,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(_d,e)),{skipIfEmpty:!1})))),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),superTypes:(0,He.PG)((e=>Xe(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1})))}),(0,He.yu)(class extends Bc{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return $i([zi.ASSOCIATION,this.path,$i(this.properties),$i(this.derivedProperties),$i(this.stereotypes),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ze("association"),name:(0,He.Ru)(),originalMilestonedProperties:(0,He.PG)((e=>Xe(e,(e=>He.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>He.AM),{skipIfEmpty:!1}))),package:(0,He.Ru)(),properties:(0,He.pb)(We(md)),derivedProperties:(0,He.bm)("qualifiedProperties",(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(_d,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(_d,e)),{skipIfEmpty:!1})))),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1})))}),(0,He.yu)(class extends Bc{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return $i([zi.FUNCTION,this.path,$i(this.parameters),this.returnType,$i(this.taggedValues),$i(this.stereotypes),Wi(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ze("function"),body:(0,He.pb)((0,He.LZ)()),name:(0,He.Ru)(),package:(0,He.Ru)(),parameters:(0,He.pb)(We(od)),postConstraints:(0,He.pb)((0,He.Ru)()),preConstraints:(0,He.pb)((0,He.Ru)()),returnMultiplicity:We(ed),returnType:(0,He.Ru)(),stereotypes:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(cd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(cd,e)),{skipIfEmpty:!1}))),taggedValues:(0,He.PG)((e=>Xe(e,(e=>(0,He.qC)(hd,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ke(e,(e=>(0,He.vB)(hd,e)),{skipIfEmpty:!1})))}),"diagram"),fd=(0,He.yu)(Yc,{x:(0,He.Ru)(),y:(0,He.Ru)()}),Td=(0,He.yu)(Wc,{height:(0,He.Ru)(),width:(0,He.Ru)()}),Cd=(0,He.yu)(Kc,{points:(0,He.pb)(We(fd))}),xd=(0,He.yu)(Hc,{class:(0,He.Ru)(),hideProperties:(0,He.jt)((0,He.Ru)()),hideStereotypes:(0,He.jt)((0,He.Ru)()),hideTaggedValues:(0,He.jt)((0,He.Ru)()),id:(0,He.Ru)(),position:We(fd),rectangle:We(Td)}),Sd=(0,He.yu)(qc,{line:We(Cd),property:We(ld),sourceView:(0,He.Ru)(),targetView:(0,He.Ru)()}),Nd=(0,He.yu)(Jc,{line:We(Cd),sourceView:(0,He.Ru)(),targetView:(0,He.Ru)()}),Ad=(0,He.yu)($c,{_type:Ze(Ed),classViews:(0,He.pb)(We(xd)),generalizationViews:(0,He.pb)(We(Nd)),name:(0,He.Ru)(),package:(0,He.Ru)(),propertyViews:(0,He.pb)(We(Sd))});class vd extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Id=s(95903);const Od=e=>H((0,Id.Z)(e.split(fe))),yd=e=>{const t=e.lastIndexOf(fe);return-1===t?void 0:e.substring(0,t)},Rd=(e,t)=>{const s=e.lastIndexOf(fe);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+fe.length,e.length)]},Pd=(e,t)=>`${e?`${e}${fe}`:""}${t}`,wd=(e,t)=>{e.children.push(t),t.package=e},Ld=(e,t)=>{e.children=e.children.filter((e=>e!==t))},bd=(e,t,s,i)=>{const n=t.indexOf(fe),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof an&&e.name===a)),!r){if(!s)throw new B(`Can't find child package '${a}' in package '${e.path}'`);q(!Ce.includes(a),`Can't create package with reserved name '${a}'`),r=new an(a),r.package=e,e.children.push(r)}return i&&i.set(Pd(e.path,a),r),-1!==n?bd(r,t.substring(n+fe.length),s,i):r},Dd=(e,t,s,i)=>{if(i){const n=i.get(Pd(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Pd(e.path,a),r=i.get(n);if(r)return bd(r,t.substring(a.length+fe.length,t.length),s,i);const o=a.lastIndexOf(fe);a=-1!==o?a.substring(0,o):""}}return bd(e,t,s,i)},Md=(e,t,s)=>(X(t,"Package path is required"),Dd(e.root,t,!0,s)),Fd=(e,t)=>K(e.rawType,t),jd=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Fd(e.value,Qi);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},kd=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Ud=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Gd=(e,t)=>`${H(e,"Package path is required")}${fe}${H(t,"Name is required")}`;class Vd{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`)})(Gd(e.package,e.name),t,i);const n=this.firstPass(e,t);return wd(Md(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const Bd=e=>e.classView.value.id,$d=e=>{const t=new qc,s=new Kc;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new td;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Bd(e.from),t.targetView=Bd(e.to),t},zd=e=>{const t=new Jc,s=new Kc;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Bd(e.from),t.targetView=Bd(e.to),t},Hd=e=>{const t=new Hc;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 Yc;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new Wc;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Yd{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return $i([kc.POINT,this.x.toString(),this.y.toString()])}}class Wd{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return $i([kc.RECTANGLE,this.width.toString(),this.height.toString()])}}class Kd{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Yd(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 Kd(new Yd(e.position.x+e.rectangle.width,e.position.y),new Wd(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Kd(new Yd(e.position.x,e.position.y+e.rectangle.height),new Wd(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,$i([kc.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Xd extends Kd{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Yd(0,0),new Wd(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return $i([kc.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Zd{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class qd extends dn{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Jd extends qd{ownerReference;constructor(e){const t=un.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Jd(e)}}class Qd{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new Zd(Jd.create(t)),this.to=new Zd(Jd.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new Yd(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Yd(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{if(!e.length)return[];let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];return e.slice(i-1,a+2)};get pathForSerialization(){return Qd.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return $i([kc.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,$i(this.pathForSerialization)])}}class eh extends Qd{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return $i([kc.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class th extends eh{get hashCode(){return $i([kc.PROPERTY_VIEW,super.hashCode])}}class sh extends Qd{get hashCode(){return $i([kc.GENERALIZATION_VIEW,super.hashCode])}}class ih{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new ih(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new ih(this.x/e,this.y/e)}normal(e){return new ih(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const nh=(e,t)=>e.classViews.find((e=>e.id===t)),ah=(e,t)=>{e.path=t},rh=e=>{const t=e.buildFullPath(),s=Qd.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=s[0].x-t.x,e.from._offsetY=s[0].y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=ih.fromPoints(s[e+1],s[e]).unit(),n=ih.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}ah(e,i)},oh=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),lh=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),ch=e=>new Yd(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),dh=e=>{const t=ch(e);return new Kd(new Yd(t.x-5,t.y-5),new Wd(10,10))},hh=(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)),uh=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new Yd(t,s)};class ph extends vd{constructor(){super(Di.Rw.zE,Di.i8)}V1_getExtraElementBuilders(){return[new Vd({elementClassName:"Diagram",_class:$c,firstPass:(e,t)=>{W(e,$c);const s=new Uc(e.name),i=Gd(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Uc),s},secondPass:(e,t)=>{W(e,$c);const s=(i=Gd(e.package,e.name),n=t.currentSubGraph,H(n.getOwnNullableExtensionElement(i,Uc),`Can't find diagram '${i}'`));var i,n;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 Xd(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 Wd(t,s)})(e.rectangle),i.position=uh(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(nh(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),n=H(nh(s,H(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new th(s,a,i,n);return r.path=e.line.points.map((e=>uh(e))),rh(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{z(e.line,"Generalization view 'line' field is missing");const s=H(nh(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=H(nh(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),n=new sh(t,s,i);return n.path=e.line.points.map((e=>uh(e))),rh(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof $c)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof $c)return(0,He.qC)(Ad,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===Ed)return(0,He.vB)(Ad,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Uc)return(e=>{const t=new $c;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Hd),t.generalizationViews=e.generalizationViews.map(zd),t.propertyViews=e.propertyViews.map($d),t})(e)}]}}class mh extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class _h extends mh{constructor(){super(Di.Rw.f1,Di.i8)}getExtraPureGraphExtensionClasses(){return[Uc]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Uc).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof Qi?kd(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 gh extends c{constructor(){super(Di.Rw.NA,Di.i8,[new _h,new Vc,new ph])}}class Eh{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const fh=(0,rt.createContext)(void 0),Th=({children:e})=>{const t=Ri(),s=(0,at.fv)((()=>new Eh(t)));return(0,T.jsx)(fh.Provider,{value:s,children:e})},Ch="/welcome.pure",xh="/",Sh="::";var Nh,Ah;!function(e){e.CONCEPT_EXPLORER="CONCEPT_EXPLORER",e.FILE_EXPLORER="FILE_EXPLORER"}(Nh=Nh||(Nh={})),function(e){e.TERMINAL="TERMINAL",e.SEARCH="SEARCH",e.REFERENCES="REFERNECES",e.TEST_RUNNER="TEST_RUNNER",e.CODE_FIX_SUGGESTION="CODE_FIX_SUGGESTION"}(Ah=Ah||(Ah={}));const vh=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Ih="dummy_problem_marker_owner";var Oh;!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"}(Oh=Oh||(Oh={}));class yh{pureId;pureType;pureName;get id(){return this.pureId}}class Rh extends yh{deprecated}(0,He.yu)(Rh,{pureId:(0,He.Ru)(),pureType:(0,He.Ru)(),deprecated:(0,He.Ru)()});class Ph extends yh{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,He.yu)(Ph,{pureId:(0,He.Ru)(),pureName:(0,He.Ru)(),pureType:(0,He.Ru)(),RO:(0,He.Ru)(),classPath:(0,He.Ru)(),file:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)()});class wh extends yh{RO;notpublic;user;file;line;column}(0,He.yu)(wh,{pureId:(0,He.Ru)(),pureName:(0,He.jt)((0,He.Ru)()),pureType:(0,He.Ru)(),RO:(0,He.Ru)(),notpublic:(0,He.Ru)(),user:(0,He.Ru)(),file:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)()});class Lh{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,He.yu)(Lh,{li_attr:(0,He.PG)((()=>He.AM),(e=>e.classPath?(0,He.vB)(Ph,e):e.file?(0,He.vB)(wh,e):(0,He.vB)(Rh,e))),id:(0,He.Ru)(),text:(0,He.Ru)(),icon:(0,He.Ru)(),children:(0,He.Ru)(),state:(0,He.Ru)()});const bh=e=>e.startsWith("/")?e.substring(1,e.length):e;class Dh{content;RO;constructor(){(0,x.rC)(this,{content:x.LO,hashCode:x.Fl,setContent:x.aD})}setContent(e){this.content=e}get hashCode(){return Bi(this.content)}}(0,He.yu)(Dh,{content:(0,He.Ru)(),RO:(0,He.Ru)()});class Mh{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Fh extends Mh{error;constructor(e,t,s,i){super(e,t??1,s??1),this.error=i}}var jh;!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_"}(jh=jh||(jh={}));const kh=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Uh{source;line;column;startLine;startColumn;endLine;endColumn}(0,He.yu)(Uh,{source:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),startLine:(0,He.Ru)(),startColumn:(0,He.Ru)(),endLine:(0,He.Ru)(),endColumn:(0,He.Ru)()});class Gh{first;second}(0,He.yu)(Gh,{first:(0,He.Ru)(),second:(0,He.pb)((0,He.Ry)(Uh))});class Vh{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class Bh{currentTab;tabs=[];constructor(){(0,x.rC)(this,{currentTab:x.LO,tabs:x.LO,setCurrentTab:x.aD,closeTab:x.aD,closeAllTabs:x.aD,closeAllOtherTabs:x.aD,openTab:x.aD,swapTabs:x.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 $h extends Vh{editorStore;constructor(e){super(),this.editorStore=e}}class zh extends Bh{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof eu&&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:gs.CAUTION,actions:[{label:"Proceed",type:Es.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Es.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Es.PROCEED,default:!0}]}):super.closeTab(e)}}var Hh;!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"}(Hh=Hh||(Hh={}));const Yh={[Hh.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN",additionalKeyboardShortcuts:["Control+KeyP","Meta+KeyP"]},[Hh.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF",additionalKeyboardShortcuts:["Meta+Shift+KeyF"]},[Hh.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Hh.TOGGLE_TERMINAL_PANEL]:{title:"Toggle terminal",defaultKeyboardShortcut:"Control+Backquote"},[Hh.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Hh.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Hh.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Hh.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Hh.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var Wh;!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"}(Wh=Wh||(Wh={}));const Kh={[Wh.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Wh.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Wh.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Wh.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var Xh;!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"}(Xh=Xh||(Xh={}));const Zh={[Xh.TOGGLE_TEXT_WRAP]:{title:"Toggle Text-wrap (File)",defaultKeyboardShortcut:"Alt+KeyZ"},[Xh.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal Concept in Tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[Xh.GO_TO_DEFINITION]:{title:"Go to Definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Xh.GO_BACK]:{title:"Go Back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Xh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[Xh.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[Xh.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"},[Xh.DELETE_LINE]:{title:"Delete Line (File)",defaultKeyboardShortcut:"Control+KeyD"}};var qh;!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"}(qh=qh||(qh={}));class Jh{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,x.rC)(this,{viewState:x.LO.ref,editor:x.LO.ref,_dummyCursorObservable:x.LO.ref,forcedCursorPosition:x.LO.ref,wrapText:x.LO,cursorObserver:x.Fl,notifyCursorObserver:x.aD,setViewState:x.aD,setEditor:x.aD,setForcedCursorPosition:x.aD,setWrapText:x.aD}),this.language=(e=>{switch(w(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=S.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 Qh{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class eu extends $h{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,x.rC)(this,{_currentHashCode:x.LO,file:x.LO,renameConceptState:x.LO,showGoToLinePrompt:x.LO,hasChanged:x.Fl,resetChangeDetection:x.aD,setFile:x.aD,setShowGoToLinePrompt:x.aD,setConceptToRenameState:x.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new Jh(this)}get label(){return bh(this.filePath)}get description(){return`File: ${bh(this.filePath)}${this.file.RO?" (readonly)":""}`}get fileName(){return H(w(this.filePath.split("/")))}match(e){return e instanceof eu&&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 Qh(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,S.editor.setModelMarkers(t,i??Ih,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:S.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,S.editor.removeAllMarkers(e??Ih)}registerCommands(){this.textEditorState.language===v.PURE&&(this.editorStore.applicationStore.commandService.registerCommand({key:Xh.GO_TO_DEFINITION,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,x.fl)(this.editorStore.executeNavigation(new Mh(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.GO_BACK,action:()=>{(0,x.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.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 Mh(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.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 Mh(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.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 Mh(this.filePath,e.lineNumber,e.column);(0,x.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.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:Xh.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}}),this.editorStore.applicationStore.commandService.registerCommand({key:Xh.TOGGLE_TEXT_WRAP,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.textEditorState.setWrapText(!this.textEditorState.wrapText)}})}findConceptUsages(e){const t=()=>{(0,x.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:gs.CAUTION,actions:[{label:"Compile and Proceed",type:Es.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Es.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===Oh.ENUM_VALUE?jh.ENUM:t.pureType===Oh.PROPERTY||t.pureType===Oh.QUALIFIED_PROPERTY?jh.PROPERTY:jh.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,x.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&&[Xh.GO_TO_DEFINITION,Xh.GO_BACK,Xh.REVEAL_CONCEPT_IN_TREE,Xh.FIND_USAGES,Xh.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e))),[Xh.GO_TO_LINE,Xh.TOGGLE_TEXT_WRAP].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class tu{editorStore;treeData;selectedNode;loadInitialDataState=ft.create();refreshDataState=ft.create();constructor(e){(0,x.rC)(this,{treeData:x.LO.ref,loadInitialDataState:x.LO,refreshDataState:x.LO,initialize:x.ls,expandNode:x.ls,openNode:x.ls,refreshTreeData:x.ls,setTreeData:x.aD,setSelectedNode:x.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,x.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 su{id;path;RO}class iu extends su{file;statusType}(0,He.yu)(iu,{id:(0,He.Ru)(),path:(0,He.Ru)(),file:(0,He.Ru)(),statusType:(0,He.Ru)(),RO:(0,He.Ru)()});class nu extends su{repo}(0,He.yu)(nu,{id:(0,He.Ru)(),path:(0,He.Ru)(),repo:(0,He.Ru)(),RO:(0,He.Ru)()});class au{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof nu}get isFileNode(){return this.li_attr instanceof iu}get isRepoNode(){return this.li_attr instanceof nu&&Boolean(this.li_attr.repo)}getNodeAttribute(e){return K(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,He.yu)(au,{li_attr:(0,He.PG)((()=>He.AM),(e=>e.file?(0,He.vB)(iu,e):(0,He.vB)(nu,e))),text:(0,He.Ru)(),icon:(0,He.Ru)(),children:(0,He.Ru)(),state:(0,He.Ru)()});const ru=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},ou=e=>`file_${e}`;class lu extends tu{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,x.rC)(this,{nodeForCreateNewFile:x.LO,nodeForCreateNewDirectory:x.LO,nodeForRenameFile:x.LO,setNodeForCreateNewFile:x.aD,setNodeForCreateNewDirectory:x.aD,setNodeForRenameFile:x.aD,revealPath:x.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,He.vB)(au,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,He.vB)(au,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,x.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t){t?.forceOpenExplorerPanel&&this.editorStore.setActiveActivity(Nh.FILE_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=ru(i);for(const e of s){const s=H(this.getTreeData().nodes.get(ou(e)),`Can't find node with path '${e}'`);if(s.data.isFolderNode)yield(0,x.fl)(this.expandNode(s));else{if(t?.directoryOnly)throw new Error("Can't reveal non-directory path");yield(0,x.fl)(this.editorStore.loadFile(e,t?.coordinate))}}this.setSelectedNode(H(this.getTreeData().nodes.get(ou(e)),`Can't find node with path '${e}'`))}}const cu=e=>{const t=e.trim(),s=t.lastIndexOf(fe);if(!(s<=0))return t.substring(0,s)};class du extends tu{loadConceptActivity=ft.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,x.rC)(this,{statusText:x.LO,nodeForRenameConcept:x.LO,nodeForMoveElement:x.LO,setStatusText:x.aD,setNodeForRenameConcept:x.aD,setNodeForMoveElement:x.aD,pullConceptsActivity:x.aD,pollConceptsActivity:x.ls,revealConcept:x.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,x.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,He.vB)(Lh,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,He.vB)(Lh,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof Ph||e.data.li_attr instanceof wh)&&("Diagram"===e.data.li_attr.pureType?yield(0,x.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,x.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Mh(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(Nh.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0});const s=[];let i=e;for(;i;)s.unshift(i),i=cu(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 Rh)yield(0,x.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,He.vB)(Gh,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 n=0;n<s.length;++n){const a=H(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:H(yd(a.pureId)),destinationPackage:t,usages:H(s[n]).second})}await(0,x.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.editorStore.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Oh.PROPERTY:case Oh.QUALIFIED_PROPERTY:W(s,Ph),n=await this.editorStore.findConceptUsages(jh.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Oh.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,He.vB)(Gh,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 n=[];q(e.length===s.length,"Can't find matching usages for child packageable elements");const a=yd(i)?.concat(fe).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(yd(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:H(e[t]).second})}return void await(0,x.fl)(this.editorStore.movePackageableElements(n))}default:n=await this.editorStore.findConceptUsages(jh.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,x.fl)(this.editorStore.renameConcept(i,t,s.pureType,n))}}class hu{cached;datamarts;text}(0,He.yu)(hu,{cached:(0,He.Ru)(),datamarts:(0,He.pb)((0,He.Ru)()),text:(0,He.Ru)()});class uu extends hu{error;sessionError}(0,He.yu)(uu,{cached:(0,He.Ru)(),datamarts:(0,He.pb)((0,He.Ru)()),text:(0,He.Ru)(),error:(0,He.Ru)(),sessionError:(0,He.Ru)()});class pu extends uu{RO;line;column;source}(0,He.yu)(pu,{cached:(0,He.Ru)(),datamarts:(0,He.pb)((0,He.Ru)()),text:(0,He.Ru)(),RO:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),source:(0,He.Ru)(),error:(0,He.Ru)(),sessionError:(0,He.Ru)()});class mu{text;reinit}class _u extends mu{cache;modifiedFiles=[]}(0,He.yu)(_u,{text:(0,He.Ru)(),cache:(0,He.Ru)(),modifiedFiles:(0,He.pb)((0,He.Ru)()),reinit:(0,He.Ru)()});class gu extends mu{RO;line;column;source;error;sessionError}(0,He.yu)(gu,{text:(0,He.Ru)(),RO:(0,He.Ru)(),line:(0,He.jt)((0,He.Ru)()),column:(0,He.jt)((0,He.Ru)()),source:(0,He.jt)((0,He.Ru)()),error:(0,He.Ru)(),sessionError:(0,He.Ru)()});class Eu{RO;line;column;source}(0,He.yu)(Eu,{RO:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),source:(0,He.Ru)()});class fu extends mu{jumpTo}(0,He.yu)(fu,{text:(0,He.Ru)(),jumpTo:(0,He.Ry)(Eu)});class Tu{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,He.yu)(Tu,{sourceID:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),foundName:(0,He.Ru)()});class Cu{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,He.yu)(Cu,{sourceID:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),foundName:(0,He.Ru)(),add:(0,He.Ru)(),messageToBeModified:(0,He.Ru)(),fileToBeModified:(0,He.Ru)(),lineToBeModified:(0,He.Ru)(),columnToBeModified:(0,He.Ru)()});class xu extends gu{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,He.yu)(xu,{candidateName:(0,He.Ru)(),candidatesWithPackageImported:(0,He.pb)((0,He.Ry)(Tu)),candidatesWithPackageNotImported:(0,He.pb)((0,He.Ry)(Cu))});class Su extends gu{candidateName;candidates=[]}(0,He.yu)(Su,{candidateName:(0,He.Ru)(),candidates:(0,He.pb)((0,He.Ry)(Cu))});class Nu{id;parentId;file;line;column}(0,He.yu)(Nu,{id:(0,He.Ru)(),parentId:(0,He.Ru)(),file:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)()});class Au{children=[];li_attr;text;type}(0,He.yu)(Au,{children:(0,He.pb)((0,He.Ry)(Au)),li_attr:(0,He.Ry)(Nu),text:(0,He.Ru)(),type:(0,He.Ru)()});class vu extends mu{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,He.yu)(vu,{count:(0,He.Ru)(),filterPaths:(0,He.pb)((0,He.Ru)()),path:(0,He.Ru)(),relevantTestsOnly:(0,He.Ru)(),runnerId:(0,He.Ru)(),tests:(0,He.pb)((0,He.Ry)(Au))});class Iu{uuid=(0,a.Z)()}class Ou{before;found;after}(0,He.yu)(Ou,{after:(0,He.Ru)(),before:(0,He.Ru)(),found:(0,He.Ru)()});class yu{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,He.yu)(yu,{sourceId:(0,He.Ru)(),startLine:(0,He.Ru)(),startColumn:(0,He.Ru)(),endLine:(0,He.Ru)(),endColumn:(0,He.Ru)(),preview:(0,He.jt)((0,He.Ry)(Ou))});class Ru extends Iu{sourceId;coordinates=[];isExpanded=!0;constructor(){super(),(0,x.rC)(this,{coordinates:x.LO,isExpanded:x.LO,setIsExpanded:x.aD,dismissCoordinate:x.aD})}setCoordinates(e){this.coordinates=e}setIsExpanded(e){this.isExpanded=e}dismissCoordinate(e){M(this.coordinates,e)}}var Pu,wu,Lu;(0,He.yu)(Ru,{sourceId:(0,He.Ru)(),coordinates:(0,He.pb)((0,He.Ry)(yu))}),function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Pu=Pu||(Pu={}));class bu{status;test}class Du extends bu{test=[]}(0,He.yu)(Du,{status:(0,He.Ru)(),test:(0,He.pb)((0,He.Ru)())});class Mu{text;RO;line;column;source;error}(0,He.yu)(Mu,{text:(0,He.Ru)(),RO:(0,He.Ru)(),line:(0,He.Ru)(),column:(0,He.Ru)(),source:(0,He.Ru)(),error:(0,He.Ru)()});class Fu extends bu{test=[];error}(0,He.yu)(Fu,{status:(0,He.Ru)(),test:(0,He.pb)((0,He.Ru)()),error:(0,He.Ry)(Mu)});class ju{}class ku extends ju{finished;tests=[]}(0,He.yu)(ku,{finished:(0,He.Ru)(),tests:(0,He.pb)((0,He.PG)((()=>He.AM),(e=>e.error?(0,He.vB)(Fu,e):(0,He.vB)(Du,e))))});class Uu extends ju{error;text}(0,He.yu)(Uu,{error:(0,He.Ru)(),text:(0,He.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(wu=wu||(wu={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Lu=Lu||(Lu={}));class Gu{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,x.rC)(this,{total:x.LO,time:x.LO,passedTests:x.LO,failedTests:x.LO,testsWithError:x.LO,notRunTests:x.LO,results:x.LO,passed:x.Fl,error:x.Fl,failed:x.Fl,passedTestIds:x.Fl,failedTestIds:x.Fl,testWithErrorIds:x.Fl,notRunTestIds:x.Fl,numberOfTestsRun:x.Fl,runPercentage:x.Fl,suiteStatus:x.Fl,setTime:x.aD,addResult:x.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?wu.FAILED:this.passed?wu.PASSED:wu.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Pu.PASSED:this.passedTests.add(t);break;case Pu.FAILED:this.failedTests.set(t,K(e,Fu));break;case Pu.ERROR:this.testsWithError.set(t,K(e,Fu));break;default:throw new U(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class Vu{editorStore;testExecutionResult;checkTestRunnerState=ft.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=ft.create();treeData;viewAsList=!1;constructor(e,t){(0,x.rC)(this,{testResultInfo:x.LO.ref,allTests:x.LO,selectedTestId:x.LO,treeData:x.LO.ref,viewAsList:x.LO,setViewAsList:x.aD,setSelectedTestId:x.aD,setTestResultInfo:x.aD,setTreeData:x.aD,refreshTree:x.aD,collapseTree:x.aD,expandTree:x.aD,buildTreeDataByLayer:x.aD,pullTestRunnerResult:x.aD,buildTestTreeData:x.ls,pollTestRunnerResult:x.ls,rerunTestSuite:x.ls,cancelTestRun:x.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,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=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,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{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 Gu(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,He.vB)(Uu,s):(0,He.vB)(ku,s);var s;return t instanceof ku?(await Promise.all(t.tests.map((t=>L((()=>{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,x.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 Bu{}class $u extends Bu{error;errorDialog;text}(0,He.yu)($u,{error:(0,He.Ru)(),errorDialog:(0,He.Ru)(),text:(0,He.Ru)()});class zu{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}'`:`'${Sh}'`,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:jh.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 Hu{_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,x.rC)(this,{_tempSize:x.LO,size:x.LO,defaultSize:x.LO,snapSize:x.LO,maxSize:x.LO,isOpen:x.Fl,isMaximizable:x.Fl,isMaximized:x.Fl,setSize:x.aD,open:x.aD,close:x.aD,toggle:x.aD,setMaxSize:x.aD,maximize:x.aD,minimize:x.aD,toggleMaximize:x.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 Yu{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return $i([zi.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues),Wi(this.parameters,this.body)])}}class Wu extends dn{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Ku extends Wu{ownerReference;constructor(e){const t=un.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new Ku(e)}}class Xu{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class Zu{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return $i([zi.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues)])}}class qu{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return $i([zi.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new qu(0,0);static ZERO_ONE=new qu(0,1);static ZERO_MANY=new qu(0,void 0);static ONE=new qu(1,1);static ONE_MANY=new qu(1,void 0)}class Ju extends dn{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[zi.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Bi).join(",")}}class Qu extends Ju{ownerReference;constructor(e){const t=un.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Qu(e)}}class ep extends en{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new ep(Se.STRING);static BOOLEAN=new ep(Se.BOOLEAN);static BINARY=new ep(Se.BINARY);static NUMBER=new ep(Se.NUMBER);static INTEGER=new ep(Se.INTEGER);static FLOAT=new ep(Se.FLOAT);static DECIMAL=new ep(Se.DECIMAL);static DATE=new ep(Se.DATE);static STRICTDATE=new ep(Se.STRICTDATE);static DATETIME=new ep(Se.DATETIME);static STRICTTIME=new ep(Se.STRICTTIME);static LATESTDATE=new ep(Se.LATESTDATE)}var tp;!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(tp=tp||(tp={}));class sp extends eh{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return $i([kc.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const ip=()=>new Qi(""),np=(e,t)=>new Zu("",qu.ONE,Ku.create(new Xu(e)),t),ap=(0,x.aD)(((e,t)=>{e.value=t})),rp=((0,x.aD)(((e,t)=>{M(e.properties,t)})),(0,x.aD)(((e,t)=>{b(e.properties,xc(t))}))),op=((0,x.aD)(((e,t,s)=>{D(e.properties,t,s)})),(0,x.aD)(((e,t)=>{M(e.derivedProperties,t)})),(0,x.aD)(((e,t)=>{b(e.derivedProperties,Sc(t))})),(0,x.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,x.aD)(((e,t)=>{b(e.constraints,Ac(t))})),(0,x.aD)(((e,t)=>{M(e.constraints,t)})),(0,x.aD)(((e,t,s)=>{D(e.constraints,t,s)})),(0,x.aD)(((e,t)=>{b(e.generalizations,dc(t))}))),lp=((0,x.aD)(((e,t)=>{M(e.generalizations,t)})),(0,x.aD)(((e,t,s)=>{D(e.generalizations,t,s)})),(0,x.aD)(((e,t)=>{b(e._subclasses,t)})),(0,x.aD)(((e,t)=>{M(e._subclasses,t)})),(0,x.aD)(((e,t)=>{dc(e),cc(t),e.value=t,e.ownerReference.value=t.rawType}))),cp=((0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{lp(e.genericType,cc(t))})),(0,x.aD)(((e,t)=>{e.multiplicity=t})),(0,x.aD)(((e,t)=>{e.aggregation=t})),(0,x.aD)(((e,t)=>{e.value=pc(t),ap(e.ownerReference,t._OWNER)})),(0,x.aD)(((e,t)=>{b(e.taggedValues,lc(t))})),(0,x.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,x.aD)(((e,t)=>{b(e.stereotypes,rc(t))})),(0,x.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,x.aD)(((e,t)=>{e.tag.value=mc(t),e.tag.ownerReference.value=t._OWNER})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t,s)=>{D(e.taggedValues,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.stereotypes,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{e.functionDefinition=Pn(t)})),(0,x.aD)(((e,t)=>{b(e.p_tags,mc(t))})),(0,x.aD)(((e,t)=>{M(e.p_tags,t)})),(0,x.aD)(((e,t)=>{b(e.p_stereotypes,pc(t))})),(0,x.aD)(((e,t)=>{M(e.p_stereotypes,t)})),(0,x.aD)(((e,t,s)=>{D(e.p_tags,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.p_stereotypes,t,s)})),(0,x.aD)(((e,t)=>{M(e.parameters,t)})),(0,x.aD)(((e,t)=>{b(e.parameters,wn(t))})),(0,x.aD)(((e,t)=>{ap(e.returnType,yc(t))})),(0,x.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,x.aD)(((e,t,s)=>{D(e.parameters,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{b(e.values,gc(t))})),(0,x.aD)(((e,t)=>{M(e.values,t)})),(0,x.aD)(((e,t,s)=>{D(e.values,t,s)})),(0,x.aD)(((e,t)=>{e.value=gc(t),ap(e.ownerReference,t._OWNER)})),(0,x.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),n=K(t.genericType.ownerReference.value,Qi,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&q(M(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),b(s.propertiesFromAssociations,i);const r=new Xu(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,x.aD)(((e,t)=>{e.canonicalUnit=Tc(t)})),(0,x.aD)(((e,t)=>{e.conversionFunction=Pn(t)})),(0,x.aD)(((e,t)=>{e.classViews=t.map(wc)}))),dp=(0,x.aD)(((e,t)=>{b(e.classViews,wc(t))})),hp=(0,x.aD)(((e,t)=>{M(e.classViews,t)})),up=(0,x.aD)(((e,t)=>{e.associationViews=t.map(Mc)})),pp=(0,x.aD)(((e,t)=>{M(e.associationViews,t)})),mp=(0,x.aD)(((e,t)=>{e.generalizationViews=t.map(Dc)})),_p=(0,x.aD)(((e,t)=>{b(e.generalizationViews,Dc(t))})),gp=(0,x.aD)(((e,t)=>{M(e.generalizationViews,t)})),Ep=(0,x.aD)(((e,t)=>{e.propertyViews=t.map(Fc)})),fp=(0,x.aD)(((e,t)=>{b(e.propertyViews,Fc(t))})),Tp=(0,x.aD)(((e,t)=>{M(e.propertyViews,t)})),Cp=(0,x.aD)(((e,t)=>{e.hideProperties=t})),xp=(0,x.aD)(((e,t)=>{e.hideStereotypes=t})),Sp=(0,x.aD)(((e,t)=>{e.hideTaggedValues=t})),Np=(0,x.aD)(((e,t)=>{e._offsetX=t})),Ap=(0,x.aD)(((e,t)=>{e._offsetY=t})),vp=(0,x.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Ip=(0,x.aD)(rh),Op=(0,x.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new ih(n.x,n.y).normal(new ih(l.x,l.y)).unit(),d=ih.fromPoints(n,new Yd(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new Yd(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&ah(e,r),o})),yp=(0,x.aD)(ah),Rp=(0,x.aD)(((e,t)=>{e.rectangle=t})),Pp=(0,x.aD)(((e,t)=>{e.position=t})),wp=(0,x.aD)((e=>{e._dummyObservable={}}));var Lp,bp,Dp;!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"}(Lp=Lp||(Lp={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(bp=bp||(bp={})),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"}(Dp=Dp||(Dp={}));const Mp=.05,Fp=[50,75,90,100,110,125,150,200,250,300,400],jp=e=>(e instanceof Yu?"/ ":"")+e.name;class kp{diagram;isReadOnly;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,x.rC)(this,{isReadOnly:x.LO,interactionMode:x.LO,relationshipMode:x.LO,zoom:x.LO,mouseOverClassView:x.LO,mouseOverClassName:x.LO,mouseOverClassCorner:x.LO,mouseOverClassProperty:x.LO,mouseOverPropertyHolderViewLabel:x.LO,selectionStart:x.LO,selectedClassCorner:x.LO,selectedClasses:x.LO,selectedPropertyOrAssociation:x.LO,selectedInheritance:x.LO,leftClick:x.LO,middleClick:x.LO,rightClick:x.LO,changeMode:x.aD,setIsReadOnly:x.aD,setMouseOverClassView:x.aD,setMouseOverClassName:x.aD,setMouseOverClassCorner:x.aD,setMouseOverClassProperty:x.aD,setMouseOverPropertyHolderViewLabel:x.aD,setSelectionStart:x.aD,setSelectedClassCorner:x.aD,setSelectedClasses:x.aD,setSelectedPropertyOrAssociation:x.aD,setSelectedInheritance:x.aD,setLeftClick:x.aD,setMiddleClick:x.aD,setRightClick:x.aD,setZoomLevel:x.aD,align:x.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new Wd(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Yd(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 Yd(0,0),this.virtualScreen=new Kd(new Yd(0,0),new Wd(0,0)),this.zoom=1,this.triangle=[new Yd(0,0),new Yd(-15,-10),new Yd(-15,10)],this.diamond=[new Yd(0,0),new Yd(-10,-5),new Yd(-20,0),new Yd(-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=Lp.LAYOUT,this.relationshipMode=bp.NONE,this.isReadOnly=!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 Yd(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Yd(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}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new Wd(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Yd(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 Yd(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Lp.LAYOUT:case Lp.PAN:case Lp.ZOOM_IN:case Lp.ZOOM_OUT:case Lp.ADD_CLASS:if(t!==bp.NONE)throw new k(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Lp.ADD_RELATIONSHIP:if(t===bp.NONE)throw new k("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new U(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Lp.ADD_RELATIONSHIP)switch(t){case bp.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||jd(e.class.value).includes(t.class.value)||jd(t.class.value).includes(e.class.value)||op(e.class.value,Ku.create(new Xu(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new sh(this.diagram,e,t);return _p(this.diagram,s),s}};break;case bp.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new Zu(`property_${e.class.value.properties.length+1}`,qu.ONE,Ku.create(new Xu(t.class.value)),e.class.value);if(rp(e.class.value,s),e!==t){const i=new th(this.diagram,Qu.create(s),e,t);return fp(this.diagram,i),i}};break;default:throw new U(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Dp.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Pp(t,new Yd(e,t.position.y))));break}case Dp.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=>Pp(t,new Yd(e-t.rectangle.width/2,t.position.y))));break}case Dp.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=>Pp(t,new Yd(e-t.rectangle.width,t.position.y))));break}case Dp.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Pp(t,new Yd(t.position.x,e))));break}case Dp.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=>Pp(t,new Yd(t.position.x,e-t.rectangle.height/2))));break}case Dp.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=>Pp(t,new Yd(t.position.x,e-t.rectangle.height))));break}case Dp.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];Pp(s,new Yd(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Pp(n,new Yd(i.position.x+i.rectangle.width+s,n.position.y))}}break}case Dp.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];Pp(s,new Yd(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Pp(n,new Yd(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new Yd((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 Yd((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}eventCoordinateToCanvasCoordinate(e){return new Yd(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Yd(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return(e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new Yd(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=H(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=Qd.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof th){const r=this.drawLinePropertyText(a[a.length-2],a[a.length-1],e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,ch(r).x),n=Math.max(n,ch(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new Kd(new Yd(t,s),new Wd(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Yd(0,0),this.virtualScreen=new Kd(new Yd(this.canvasDimension.width/2,this.canvasDimension.height/2),new Wd(0,0))}executeZoom(e,t){e=Math.max(e,Mp);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Yd(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Mp)),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)),Mp))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new Xd(this.diagram,i,un.create(e));return Pp(n,t??this.canvasCoordinateToModelCoordinate(new Yd(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),dp(this.diagram,n),wp(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&_p(this.diagram,new sh(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&_p(this.diagram,new sh(this.diagram,t,n)),kd(e).forEach((e=>{e.genericType.value.rawType===s&&fp(this.diagram,new th(this.diagram,Qu.create(e),n,t))})),kd(s).forEach((s=>{s.genericType.value.rawType===e&&fp(this.diagram,new th(this.diagram,Qu.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=jp(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof tn&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=Ve(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(kd(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;Rp(e,new Wd(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of kd(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof Yu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof ep?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}wp(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=jp(e),o=Ve(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 Yd(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),m=n(c),_=this.modelCoordinateToCanvasCoordinate(new Yd(i(c),n(c)));a||this.ctx.fillText(o,_.x,_.y);const g=new Yd(Math.min(d,p),Math.min(h,m));return new Kd(g,new Wd(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,m)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new Kd(new Yd(0,0),new Wd(0,0))}drawPropertyOrAssociation(e){const t=Qd.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof Zu){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===tp.COMPOSITE||s.aggregation===tp.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+oh(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+lh(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+oh(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+lh(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+oh(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+lh(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+oh(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+lh(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+oh(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+lh(this.diamond[0],e))*this.zoom),s.aggregation===tp.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===tp.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=Qd.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,n=s[s.length-2].y,a=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+oh(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+lh(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+oh(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+lh(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+oh(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+lh(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+oh(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+lh(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)&&yp(e,e.path.map((e=>new Yd(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=P(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!==Lp.ZOOM_IN?Lp.ZOOM_IN:Lp.ZOOM_OUT,bp.NONE)}switchToViewMode(){this.changeMode(Lp.LAYOUT,bp.NONE)}switchToPanMode(){this.changeMode(Lp.PAN,bp.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Lp.ADD_RELATIONSHIP,bp.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Lp.ADD_RELATIONSHIP,bp.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Lp.ADD_CLASS,bp.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof Qi&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Yd(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof Qi&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){if("Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{hp(this.diagram,e),up(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),mp(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Ep(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof sp?pp(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof th&&Tp(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&gp(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=>{Cp(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{xp(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Sp(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=>dp(this.diagram,e))),t[1].forEach((e=>_p(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,Vt.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Xd(this.diagram,(0,a.Z)(),un.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=>dp(this.diagram,e))),t[1].forEach((e=>_p(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case Lp.LAYOUT:this.diagram.generalizationViews.forEach((e=>Ip(e))),this.diagram.associationViews.forEach((e=>Ip(e))),this.diagram.propertyViews.forEach((e=>Ip(e)));break;case Lp.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(Lp.LAYOUT,bp.NONE);break}case Lp.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=Fp[0]-10?10*Math.floor(t/10)+10:t>=Fp[Fp.length-1]?100*Math.floor(t/100)+100:H(Fp.find((e=>e>t))),this.zoomPoint(s/100,new Yd(e.x,e.y));break}case Lp.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=Fp[0]?10*Math.ceil(t/10)-10:t>=Fp[Fp.length-1]+100?100*Math.ceil(t/100)-100:H((0,Id.Z)(Fp,(e=>e<t))),this.zoomPoint(s/100,new Yd(e.x,e.y));break}case Lp.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&(Np(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Ap(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Np(e.to,-(s.position.x+s.rectangle.width/2-t.x)),Ap(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(Lp.LAYOUT,bp.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([Lp.ADD_RELATIONSHIP,Lp.ADD_CLASS,Lp.ZOOM_IN,Lp.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(e){this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const t=this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Lp.PAN:return void(this.positionBeforeLastMove=new Yd(e.x,e.y));case Lp.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(dh(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||cp(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const n=this.diagram.classViews[i];if(n.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||cp(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Yd(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=Op(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Op(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Op(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case Lp.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Lp.LAYOUT,bp.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Yd(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Yd(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Yd(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Yd(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Lp.PAN)this.screenOffset=new Yd(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Yd(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case Lp.LAYOUT:if(this.selectedClassCorner&&(Rp(this.selectedClassCorner,new Wd(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),wp(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=t.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);e=i.position.x-n,s=i.position.y-r,Pp(i,new Yd(n,r)),wp(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?vp(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&vp(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new Kd(new Yd(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Wd(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(hh(this.selection,e)||hh(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Lp.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new Yd(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),dh(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let n=e.position.y+this.classViewSpaceY;n+=e.hideStereotypes?0:i.stereotypes.length*this.lineHeight;const a=this.computeClassNameWidth(e);new Kd(this.modelCoordinateToCanvasCoordinate(new Yd(e.position.x+(e.rectangle.width-a)/2,n)),new Wd(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.lineHeight,n+=2*this.classViewSpaceY;for(const s of kd(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Kd(this.modelCoordinateToCanvasCoordinate(new Yd(e.position.x+this.classViewSpaceX,n)),new Wd(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.lineHeight*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.lineHeight);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=Qd.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,Vt.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Xd(t,(0,a.Z)(),un.create(Fd(e.value,Qi))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(Pp(t[0],new Yd(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Pp(e,new Yd(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 sh(t,s,e):[]))))))]}}class Up{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return $i([zi.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class Gp extends dn{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[zi.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Bi).join(",")}}class Vp extends Gp{ownerReference;constructor(e){const t=un.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Vp(e)}}class Bp extends dn{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[zi.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Bi).join(",")}}class $p extends Bp{ownerReference;constructor(e){const t=un.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new $p(e)}}class zp extends qi{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[np(ip(),ip()),np(ip(),ip())];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 Qi&&t.genericType.value.rawType instanceof Qi){const s=K(e.genericType.value.rawType,Qi),i=K(t.genericType.value.rawType,Qi);s.propertiesFromAssociations=s.propertiesFromAssociations.filter((e=>e!==t)),i.propertiesFromAssociations=i.propertiesFromAssociations.filter((t=>t!==e))}}get _elementHashCode(){return $i([zi.ASSOCIATION,this.path,$i(this.properties),$i(this.derivedProperties),$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Hp extends qi{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return $i([zi.MAPPING,this.path,$i(this.classMappings),$i(this.enumerationMappings),$i(this.associationMappings),$i(this.test),$i(this.includes),$i(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class Yp extends qi{p_stereotypes=[];p_tags=[];get _elementHashCode(){return $i([zi.PROFILE,this.path,$i(this.p_stereotypes.map((e=>e.value))),$i(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class Wp extends qi{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,qe.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return $i([zi.SERVICE,$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues),this.path,this.pattern,$i(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",$i(this.tests),$i(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class Kp extends qi{functionName;constructor(e){super(e),this.functionName=e}}class Xp extends Kp{}class Zp extends Xp{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return $i([zi.FUNCTION,this.path,$i(this.parameters),this.returnType.valueForSerialization??"",$i(this.taggedValues),$i(this.stereotypes.map((e=>e.pointerHashCode))),Wi(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class qp extends qi{includes=[]}class Jp extends qp{sections=[];get _elementHashCode(){return $i([zi.FLAT_DATA,this.path,$i(this.includes.map((e=>e.valueForSerialization??""))),$i(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class Qp extends qi{runtimeValue;get _elementHashCode(){return $i([zi.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class em extends qi{connectionValue;get _elementHashCode(){return $i([zi.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class tm extends qi{}class sm extends tm{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return $i([zi.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",$i(this.scopeElements.map((e=>e instanceof hn?e.valueForSerialization??"":e))),$i(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class im extends qi{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return $i([zi.GENERATION_TREE,this.path,$i(this.generationNodes),$i(this.fileGenerations.map((e=>Ki(be.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class nm extends qp{schemas=[];joins=[];filters=[];get _elementHashCode(){return $i([zi.DATABASE,this.path,$i(this.includes.map((e=>e.valueForSerialization??""))),$i(this.schemas),$i(this.joins),$i(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class am{_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 rm extends qi{data;get hashCode(){return $i([zi.DATA_ELEMENT,this.path,$i(this.stereotypes.map((e=>e.pointerHashCode))),$i(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const om=new Set([qi,Ji,en,ep,Qi,zp,tn,Zp,Yp,nn,sn,class extends qi{sections=[];get _elementHashCode(){return $i([zi.SECTION_INDEX,this.path,$i(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},qp,Hp,em,Qp,Wp,im,sm,rm]);class lm{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;constructor(e,t,s){this.root=new an(e),this.extensions=this.createGraphExtensions(t),this._origin=s}createGraphExtensions(e){return e.map((e=>{if(om.has(e))throw new k("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new am(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(tn))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(nn))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(Qi))}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(Jp))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(nm))}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 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 k("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 U("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new k("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 Qi?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof tn?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof nn?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);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),nm,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),Jp,`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}'`);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)}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.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>L((()=>{e.dispose()})))))}getNullablePackage=e=>e?V((()=>Dd(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.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){wd(t?Md(this,t,void 0):this.root,e),e instanceof Hp?this.setOwnMapping(e.path,e):e instanceof qp?this.setOwnStore(e.path,e):e instanceof Ji?this.setOwnType(e.path,e):e instanceof zp?this.setOwnAssociation(e.path,e):e instanceof Yp?this.setOwnProfile(e.path,e):e instanceof Zp?this.setOwnFunction(e.path,e):e instanceof Wp?this.setOwnService(e.path,e):e instanceof em?this.setOwnConnection(e.path,e):e instanceof Qp?this.setOwnRuntime(e.path,e):e instanceof sm?this.setOwnFileGeneration(e.path,e):e instanceof im?this.setOwnGenerationSpecification(e.path,e):e instanceof rm?this.setOwnDataElement(e.path,e):e instanceof an||this.getExtensionForElementClass(y(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&Ld(e.package,e),e instanceof Hp?this.mappingsIndex.delete(e.path):e instanceof qp?this.storesIndex.delete(e.path):e instanceof Ji?(this.typesIndex.delete(e.path),e instanceof nn&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof zp?this.associationsIndex.delete(e.path):e instanceof Yp?this.profilesIndex.delete(e.path):e instanceof Zp?this.functionsIndex.delete(e.path):e instanceof Wp?this.servicesIndex.delete(e.path):e instanceof Qp?this.runtimesIndex.delete(e.path):e instanceof em?this.connectionsIndex.delete(e.path):e instanceof sm?this.fileGenerationsIndex.delete(e.path):e instanceof im?this.generationSpecificationsIndex.delete(e.path):e instanceof rm?this.dataElementsIndex.delete(e.path):e instanceof an?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 U(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof an&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof an)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new U(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new U(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=Rd(s);if(!(e instanceof an)){const t=this.getNullablePackage(i)??(""!==i?Md(this,i,void 0):this.root);e.name=n,e instanceof Zp&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Ud(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Ud(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&Ld(e.package,e),wd(t,e))}var a,r;if(e instanceof Hp)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof qp)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof Ji)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof nn&&(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 zp)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof Yp)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof Zp)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof Wp)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof Qp)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof em)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof sm)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof rm)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof im)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof an){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new k("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){Ld(r,e);const t=""!==i?Md(this,i,void 0):this.root;wd(t,e)}a.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 cm{}class dm extends cm{groupId;artifactId;versionId;constructor(e,t,s){super(),this.groupId=e,this.artifactId=t,this.versionId=s}}class hm extends lm{constructor(e,t,s){super(t.name,e,s),this.root=t}}const um=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class pm{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.entries()).forEach((([e,t])=>{const s=new an(e);this.roots.push(s),this.projectDependencyModelsIndex.set(e,new hm(this.extensionElementClasses,s,new dm(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=um(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=um(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=um(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=um(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=um(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=um(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=um(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=um(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=um(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=um(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=um(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=um(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=um(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=um(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=um(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=um(this,((e,t)=>e.getOwnNullableDataElement(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))}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 mm extends qp{static NAME="ModelStore";static INSTANCE=new mm;constructor(){super(mm.NAME)}accept_PackageableElementVisitor(e){throw new U}}class _m extends lm{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(xe.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(mm.NAME,mm.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[ep.STRING,ep.BOOLEAN,ep.BINARY,ep.NUMBER,ep.INTEGER,ep.FLOAT,ep.DECIMAL,ep.DATE,ep.STRICTDATE,ep.DATETIME,ep.STRICTTIME,ep.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class gm extends lm{autoImports=[];constructor(e){super(xe.SYSTEM,e)}initializeAutoImports(){this.autoImports=Ie.map((e=>K(this.getOwnNullableElement(e,!0),an,`Can't find auto-import package '${e}'`)))}}class Em extends lm{constructor(e){super(xe.MODEL_GENERATION,e)}}class fm extends lm{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(xe.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Em(i),this.dependencyManager=new pm(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 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),tn,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),nn,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),sn,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),Qi,`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),Qi),`Can't find property owner '${e}'`);getFunction=e=>K(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),Zp,`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),Jp,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),nm,`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=qu.ONE:0===e&&1===t?s=qu.ZERO_ONE:0===e&&void 0===t?s=qu.ZERO_MANY:1===e&&void 0===t?s=qu.ONE_MANY:0===e&&0===t&&(s=qu.ZERO),s??new qu(e,t)}addElement(e,t){const s=Pd(t??"",e.name);if(this.getNullableElement(s,!1))throw new k(`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 k(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Tm{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Cm{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class xm{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,He.yu)(xm,{column:(0,He.Ru)(),endLine:(0,He.Ru)(),endColumn:(0,He.Ru)(),line:(0,He.Ru)(),sourceId:(0,He.Ru)(),startLine:(0,He.Ru)(),startColumn:(0,He.Ru)()});const Sm=(0,He.PG)((()=>He.AM),(e=>(e.sourceId=e.source,(0,He.vB)(xm,e))));class Nm{package;name;tags=[];stereotypes=[]}(0,He.yu)(Nm,{name:(0,He.Ru)(),package:(0,He.Ru)(),stereotypes:(0,He.pb)((0,He.Ru)()),tags:(0,He.pb)((0,He.Ru)())});class Am{profile;value}(0,He.yu)(Am,{profile:(0,He.Ru)(),value:(0,He.Ru)()});class vm{profile;value}(0,He.yu)(vm,{profile:(0,He.Ru)(),value:(0,He.Ru)()});class Im{tag;value}(0,He.yu)(Im,{tag:(0,He.Ry)(vm),value:(0,He.Ru)()});class Om{rawType;typeParameter}(0,He.yu)(Om,{rawType:(0,He.jt)((0,He.Ru)()),typeParameter:(0,He.jt)((0,He.Ru)())});class ym{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,He.yu)(ym,{aggregation:(0,He.Ru)(),genericType:(0,He.Ry)(Om),multiplicity:(0,He.Ru)(),name:(0,He.Ru)(),stereotypes:(0,He.pb)((0,He.Ry)(Am)),taggedValues:(0,He.pb)((0,He.Ry)(Im))});class Rm{package;name;sourceInformation}(0,He.yu)(Rm,{name:(0,He.Ru)(),package:(0,He.Ru)(),sourceInformation:Sm});class Pm{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,He.yu)(Pm,{generalizations:(0,He.pb)((0,He.Ry)(Om)),name:(0,He.Ru)(),package:(0,He.Ru)(),properties:(0,He.pb)((0,He.Ry)(ym)),qualifiedProperties:(0,He.pb)((0,He.Ry)(ym)),sourceInformation:Sm,stereotypes:(0,He.pb)((0,He.Ry)(Am)),taggedValues:(0,He.pb)((0,He.Ry)(Im))});class wm{package;name;enumValues=[]}(0,He.yu)(wm,{name:(0,He.Ru)(),package:(0,He.Ru)(),enumValues:(0,He.pb)((0,He.Ru)())});class Lm{x;y}(0,He.yu)(Lm,{x:(0,He.Ru)(),y:(0,He.Ru)()});class bm{height;width}(0,He.yu)(bm,{height:(0,He.Ru)(),width:(0,He.Ru)()});class Dm{points=[]}(0,He.yu)(Dm,{points:(0,He.pb)((0,He.Ry)(Lm))});class Mm{id;source;target;geometry}(0,He.yu)(Mm,{geometry:(0,He.Ry)(Dm),id:(0,He.Ru)(),source:(0,He.Ru)(),target:(0,He.Ru)()});class Fm{name;owningType}(0,He.yu)(Fm,{name:(0,He.Ru)(),owningType:(0,He.Ru)()});class jm{id;source;target;property;geometry}(0,He.yu)(jm,{geometry:(0,He.Ry)(Dm),id:(0,He.Ru)(),property:(0,He.Ry)(Fm),source:(0,He.Ru)(),target:(0,He.Ru)()});class km{id;type;position;rectangleGeometry}(0,He.yu)(km,{id:(0,He.Ru)(),position:(0,He.Ry)(Lm),rectangleGeometry:(0,He.Ry)(bm),type:(0,He.Ru)()});class Um{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,He.yu)(Um,{name:(0,He.Ru)(),generalizationViews:(0,He.pb)((0,He.Ry)(Mm)),package:(0,He.Ru)(),propertyViews:(0,He.pb)((0,He.Ry)(jm)),sourceInformation:Sm,stereotypes:(0,He.pb)((0,He.Ry)(Am)),taggedValues:(0,He.pb)((0,He.Ry)(Im)),typeViews:(0,He.pb)((0,He.Ry)(km))});class Gm{classes=[];enumerations=[];profiles=[]}(0,He.yu)(Gm,{classes:(0,He.pb)((0,He.Ry)(Pm)),enumerations:(0,He.pb)((0,He.Ry)(wm)),profiles:(0,He.pb)((0,He.Ry)(Nm))});class Vm{name;diagram;domainInfo}(0,He.yu)(Vm,{diagram:(0,He.Ry)(Um),name:(0,He.Ru)(),domainInfo:(0,He.jt)((0,He.Ry)(Gm))});class Bm{class;enumerations=[];profiles=[];specializations=[]}(0,He.yu)(Bm,{class:(0,He.Ry)(Pm),enumerations:(0,He.pb)((0,He.Ry)(wm)),profiles:(0,He.pb)((0,He.Ry)(Nm)),specializations:(0,He.pb)((0,He.Ry)(Rm))});const $m=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}`},zm=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=Rd(e),r=new Qi(a);return wd(Dd(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},Hm=e=>{if("*"===e)return new qu(0,void 0);{const t=e.split("..");if(1===t.length)return new qu(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new qu(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},Ym=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;b(e.taggedValues,new Up(Vp.create((i=s.getProfile(t.tag.profile),n=t.tag.value,H(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;b(e.stereotypes,$p.create((i=s.getProfile(t.profile),n=t.value,H(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=zm(H(t.rawType),s,i,void 0);b(e.generalizations,Ku.create(new Xu(n))),b(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new Zu(t.name,Hm(t.multiplicity),Ku.create(new Xu(s.getOwnNullableEnumeration(H(t.genericType.rawType))??zm(H(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?tp.COMPOSITE:"Shared"===t.aggregation?tp.SHARED:void 0,b(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new Yu(t.name,Hm(t.multiplicity),Ku.create(new Xu(s.getOwnNullableEnumeration(H(t.genericType.rawType))??zm(H(t.genericType.rawType),s,i,void 0))),e))}))},Wm=e=>{const t=new fm(new _m([]),new gm([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new Qi(e.name);wd(Dd(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 Yp(e.name);wd(Dd(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Tm(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Cm(s,e))))})),i.enumerations.forEach((e=>{const s=new tn(e.name);wd(Dd(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":fe}${e.name}`,n=t.getClass(i);Ym(n,e,t,s)}))}const i=e.diagram,n=new Uc(i.name);return wd(Dd(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new Xd(n,e.id,un.create(t.getClass(e.type)));s.position=new Yd(e.position.x,e.position.y),s.rectangle=new Wd(e.rectangleGeometry.width,e.rectangleGeometry.height),b(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new th(n,Qu.create((i=t.getClass(e.property.owningType),a=e.property.name,H(i instanceof Qi?kd(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Yd(e.x,e.y))),rh(s),b(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new sh(n,H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Yd(e.x,e.y))),rh(t),b(n.generalizationViews,t)})),[n,t,s]};class Km extends $h{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,x.rC)(this,{_renderer:x.LO,diagram:x.LO,diagramInfo:x.LO,diagramName:x.Fl,diagramCursorClass:x.Fl,addClassView:x.ls,rebuild:x.aD,setRenderer:x.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=Wm(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return bh(this.diagramPath)}get description(){return`Diagram: ${bh(this.diagramPath)}`}get diagramName(){return Od(this.diagramPath)}match(e){return e instanceof Km&&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 Lp.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Lp.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Lp.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Lp.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]=Wm(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 Mh(t.sourceId,t.startLine,t.startColumn);(0,x.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?"":fe}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new Yp(e.name);wd(Dd(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new Tm(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Cm(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":fe}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new tn(e.name);wd(Dd(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":fe}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new Qi(i.name),wd(Dd(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=H(a),n=zm(H(`${e.package}${""===e.package?"":fe}${e.name}`),t,s,e.sourceInformation);b(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||b(n.generalizations,Ku.create(new Xu(i)))})),r&&Ym(a,i,t,s),a})((0,He.vB)(Bm,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:Wh.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandService.registerCommand({key:Wh.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Wh.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandService.registerCommand({key:Wh.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Wh.RECENTER,Wh.USE_ZOOM_TOOL,Wh.USE_VIEW_TOOL,Wh.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandService.deregisterCommand(e)))}}class Xm{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,x.rC)(this,{text:x.LO,isCaseSensitive:x.LO,isRegExp:x.LO,reset:x.aD,setText:x.aD,setCaseSensitive:x.aD,setRegExp:x.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 Zm extends F{}const qm=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,Jm=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Qm=/(?:(?<url>https?:[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>])|(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+))))/;class e_{editorStore;constructor(e){this.editorStore=e}}class t_ extends e_{result;constructor(e,t){super(e),this.result=t}}class s_ extends e_{result;constructor(e,t){super(e),this.result=t}}class i_{editorStore;usageConcept;searchEntries=[];constructor(e,t,s,i){(0,x.rC)(this,{searchEntries:x.LO,numberOfFiles:x.Fl,numberOfResults:x.Fl}),this.editorStore=e,this.usageConcept=t;const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=H(n.get(e.source)):(s=new Ru,s.sourceId=e.source,n.set(e.source,s));const a=new yu(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),this.searchEntries=Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=H(n.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))}dismissSearchEntry(e){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 n_{searchState;searchEntries=[];constructor(e,t){(0,x.rC)(this,{searchEntries:x.LO,numberOfFiles:x.Fl,numberOfResults:x.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 a_{editorStore;loadState=ft.create();searchInput;text="";isCaseSensitive=!1;isRegExp=!1;result;constructor(e){(0,x.rC)(this,{text:x.LO,isCaseSensitive:x.LO,isRegExp:x.LO,result:x.LO,setText:x.aD,setCaseSensitive:x.aD,setRegExp:x.aD,setResult:x.aD,search:x.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,He.vB)(Ru,e))(e)));this.setResult(new n_(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 r_{applicationStore;initState=ft.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Ah.TERMINAL;auxPanelDisplayState=new Hu({initial:0,default:300,snap:100});activeActivity=Nh.CONCEPT_EXPLORER;sideBarDisplayState=new Hu({initial:300,default:300,snap:150});tabManagerState=new zh(this);executionState=ft.create();navigationStack=[];fileSearchCommandLoadState=ft.create();fileSearchCommandState=new Xm;openFileSearchCommand=!1;fileSearchCommandResults=[];codeFixSuggestion;referenceUsageLoadState=ft.create();referenceUsageResult;textSearchState;testRunState=ft.create();testRunnerState;constructor(e){var t;(0,x.rC)(this,{isMaxAuxPanelSizeSet:x.LO,activeAuxPanelMode:x.LO,activeActivity:x.LO,navigationStack:x.LO,openFileSearchCommand:x.LO,fileSearchCommandResults:x.LO,fileSearchCommandState:x.LO,codeFixSuggestion:x.LO,referenceUsageResult:x.LO,testRunnerState:x.LO,setCodeFixSuggestion:x.aD,setReferenceUsageResult:x.aD,setOpenFileSearchCommand:x.aD,setActiveAuxPanelMode:x.aD,setActiveActivity:x.aD,setTestRunnerState:x.aD,pullInitializationActivity:x.aD,pullExecutionStatus:x.aD,initialize:x.ls,checkIfSessionWakingUp:x.ls,loadDiagram:x.ls,loadFile:x.ls,execute:x.ls,executeGo:x.ls,manageExecuteGoResult:x.ls,executeTests:x.ls,executeFullTestSuite:x.ls,executeNavigation:x.ls,navigateBack:x.ls,fullReCompile:x.ls,command:x.ls,findUsagesFromCoordinate:x.ls,findUsages:x.ls,renameConcept:x.ls,movePackageableElements:x.ls,updateFileUsingSuggestionCandidate:x.ls,updateFile:x.ls,searchFile:x.ls,createNewDirectory:x.ls,createNewFile:x.ls,renameFile:x.ls,deleteDirectoryOrFile:x.ls}),this.applicationStore=e,this.textSearchState=new a_(this),this.directoryTreeState=new lu(this),this.conceptTreeState=new du(this),this.client=new zu(new _e({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(Qm);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,x.fl)(t.loadFile(i.groups.path_sourceId,new Mh(i.groups.path_sourceId,Number.parseInt(i.groups.path_line,10),Number.parseInt(i.groups.path_column,10)))).catch(t.applicationStore.alertUnhandledError)},regex:Qm},commands:[{command:qh.GO,description:"Run the go() function in welcome file",usage:"go",aliases:["compile","executeGo"],handler:async e=>(0,x.fl)(t.executeGo()).catch(t.applicationStore.alertUnhandledError)},{command:qh.TEST,description:"Run the test suite (by path if specified)",usage:"test [/some/path]",handler:async e=>{const s=P(e);!s||s.match(qm)?await(0,x.fl)(t.executeTests(s??Sh)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid package/concept path")}},{command:qh.REMOVE,description:"Remove a file or directory",usage:"rm /some/path",handler:async e=>{const s=P(e);s?.match(Jm)?await(0,x.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:qh.MOVE,description:"Move a file",usage:"mv /old/path /new/path",handler:async e=>{const s=e[0];if(!s?.match(Jm))return void t.applicationStore.terminalService.terminal.fail("command requires a valid old file path");const i=e[1];i?.match(Jm)?await(0,x.fl)(t.renameFile(s,i)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid new file path")}},{command:qh.NEW_DIRECTORY,description:"Create a new directory",usage:"mkdir /some/path",handler:async e=>{const s=e[0];s?.match(Jm)?await(0,x.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid directory path")}},{command:qh.NEW_FILE,description:"Create a new file",usage:"touch /some/path",handler:async e=>{const s=e[0];s?.match(Jm)?await(0,x.fl)(t.createNewDirectory(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid path")}},{command:qh.WELCOME,description:"Open the welcome file",usage:"welcome",aliases:["start"],handler:async()=>{await(0,x.fl)(t.loadFile(Ch)).catch(t.applicationStore.alertUnhandledError)}},{command:qh.OPEN_FILE,description:"Open a file",usage:"open /some/file/path",aliases:["edit","code","vi"],handler:async e=>{const s=e[0];s?.match(qm)?await(0,x.fl)(t.loadFile(s)).catch(t.applicationStore.alertUnhandledError):t.applicationStore.terminalService.terminal.fail("command requires a valid file path")}},{command:qh.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(Jm)||s.match(qm)))try{s.match(qm)?await(0,x.fl)(t.conceptTreeState.revealConcept(s,{forceOpenExplorerPanel:!0,packageOnly:!0})):await(0,x.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:qh.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(Jm)||s.match(qm)||[xh,Sh].includes(s)))try{s.match(qm)||s===Sh?t.applicationStore.terminalService.terminal.output((await t.client.getConceptChildren(s)).map((e=>(0,He.vB)(Lh,e))).map((e=>e.li_attr instanceof Rh?`${Pt.BRIGHT_CYAN}${e.text}${Pt.RESET}`:e.text)).join("\n")):t.applicationStore.terminalService.terminal.output((await t.client.getDirectoryChildren(s)).map((e=>(0,He.vB)(au,e))).map((e=>e.isFolderNode?`${Pt.BRIGHT_CYAN}${e.text}${Pt.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:qh.CLEAR,description:"Clear the terminal",usage:"clear",handler:async e=>{t.applicationStore.terminalService.terminal.clear()}},{command:qh.ECHO,description:"Print text",usage:"echo 'some string'",handler:async(e,s,i)=>{const n=i.substring(i.indexOf(s)+s.length).trim();t.applicationStore.terminalService.terminal.output(n.replaceAll(/\\u001b/g,""))}},{command:qh.ANSI,description:"Show common ANSI escape sequences used for styling",usage:"ansi",handler:async e=>(t.applicationStore.terminalService.terminal.showCommonANSIEscapeSequences(),Promise.resolve())},{command:qh.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,x.fl)(this.loadFile(Ch)),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,He.vB)(pu,n):(0,He.vB)(uu,n):(0,He.vB)(hu,n);o.text&&(this.applicationStore.terminalService.terminal.output(o.text,{systemCommand:"initialize application"}),this.setActiveAuxPanelMode(Ah.TERMINAL),this.auxPanelDisplayState.open()),o instanceof uu?o.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof pu&&(yield(0,x.fl)(this.loadFile(o.source,new Fh(o.source,o.line,o.column,new Zm((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,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:gs.CAUTION,actions:[{label:"Compile to debug",type:Es.PROCEED_WITH_CAUTION,default:!0,handler:()=>{(0,x.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}]})}finally{this.applicationStore.terminalService.terminal.clear()}var n}else this.applicationStore.notificationService.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.alertService.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.alertService.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandService.registerCommand({key:Hh.SEARCH_FILE,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandService.registerCommand({key:Hh.SEARCH_TEXT,action:()=>{this.setActiveAuxPanelMode(Ah.SEARCH),this.auxPanelDisplayState.open(),this.textSearchState.focus(),this.textSearchState.select()}}),this.applicationStore.commandService.registerCommand({key:Hh.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof eu&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,{forceOpenExplorerPanel:!0})}}),this.applicationStore.commandService.registerCommand({key:Hh.TOGGLE_TERMINAL_PANEL,action:()=>{this.auxPanelDisplayState.isOpen?this.activeAuxPanelMode!==Ah.TERMINAL?(this.setActiveAuxPanelMode(Ah.TERMINAL),this.applicationStore.terminalService.terminal.focus()):this.applicationStore.terminalService.terminal.isFocused()?this.auxPanelDisplayState.close():this.applicationStore.terminalService.terminal.focus():(this.setActiveAuxPanelMode(Ah.TERMINAL),this.auxPanelDisplayState.open())}}),this.applicationStore.commandService.registerCommand({key:Hh.EXECUTE,action:()=>{(0,x.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Hh.FULL_RECOMPILE,action:()=>{(0,x.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Hh.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,x.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Hh.RUN_ALL_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandService.registerCommand({key:Hh.RUN_RELAVANT_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Hh.SEARCH_FILE,Hh.SEARCH_TEXT,Hh.GO_TO_FILE,Hh.TOGGLE_TERMINAL_PANEL,Hh.EXECUTE,Hh.FULL_RECOMPILE,Hh.FULL_RECOMPILE_WITH_FULL_INIT,Hh.RUN_ALL_TESTS,Hh.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandService.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof Km&&e.diagramPath===t));n||(yield(0,x.fl)(this.checkIfSessionWakingUp()),n=new Km(this,(0,He.vB)(Vm,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){try{let s=this.tabManagerState.tabs.find((t=>t instanceof eu&&t.filePath===e));s||(yield(0,x.fl)(this.checkIfSessionWakingUp()),s=new eu(this,(0,He.vB)(Dh,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Fh&&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 eu&&s.filePath===e)s.setFile((0,He.vB)(Dh,await this.client.getFile(e)));else if(s instanceof Km&&s.filePath===e)try{s.rebuild((0,He.vB)(Vm,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n,a){if(!this.initState.hasCompleted)return void this.applicationStore.notificationService.notifyWarning("Can't execute while initializing application");if(this.executionState.isInProgress)return void this.applicationStore.notificationService.notifyWarning("Another execution is already in progress!");this.setCodeFixSuggestion(void 0),this.executionState.inProgress();const r=this.tabManagerState.tabs.filter(Y(eu)).map((e=>e.filePath));try{const l=this.tabManagerState.tabs.map((e=>e instanceof eu?{path:e.filePath,code:e.file.content}:e instanceof Km?{diagram:e.diagramPath,code:$m(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,He.vB)(xu,o):o.candidateName&&o.candidates?(0,He.vB)(Su,o):(0,He.vB)(gu,o):o.jumpTo?(0,He.vB)(fu,o):o.tests?(0,He.vB)(vu,o):(0,He.vB)(_u,o);this.applicationStore.alertService.setBlockingAlert(void 0),p instanceof gu?(this.applicationStore.notificationService.notifyError("Execution failed"+(p.text?`: ${p.text}`:"")),this.applicationStore.terminalService.terminal.fail(p.text,{systemCommand:n??"execute"}),p.sessionError?this.applicationStore.alertService.setBlockingAlert({message:"Session corrupted",prompt:p.sessionError}):yield(0,x.fl)(i(p,r))):(a?.silentTerminalOnSuccess||this.applicationStore.terminalService.terminal.output(p.text??"",{clear:a?.clearTerminal,systemCommand:n??"execute"}),p instanceof _u?(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,x.fl)(this.initialize(!1,(()=>(0,x.fl)(this.execute(e,t,s,i,n))),this.client.mode,this.client.compilerMode))):yield(0,x.fl)(i(p,r))):yield(0,x.fl)(i(p,r)))}catch(e){G(e),this.applicationStore.notificationService.notifyError(e),this.applicationStore.terminalService.terminal.fail(e.message,{systemCommand:n??"execute"})}finally{this.applicationStore.alertService.setBlockingAlert(void 0),this.executionState.reset()}var o}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.alertService.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,x.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,x.fl)(this.manageExecuteGoResult(e,t))),qh.GO,{clearTerminal:!0}))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(this.tabManagerState.tabs.filter(Y(eu)).filter((e=>t.includes(e.filePath))).forEach((e=>e.clearError())),e instanceof gu)e.source&&(yield(0,x.fl)(this.loadFile(e.source,new Fh(e.source,e.line,e.column,new Zm(e.text.split("\n").filter(Boolean)[0]))))),e instanceof xu?(this.setCodeFixSuggestion(new t_(this,e)),this.setActiveAuxPanelMode(Ah.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()):e instanceof Su&&(this.setCodeFixSuggestion(new s_(this,e)),this.setActiveAuxPanelMode(Ah.CODE_FIX_SUGGESTION),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof _u){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,x.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,x.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof gu)e.source&&await(0,x.fl)(this.loadFile(e.source,new Fh(e.source,e.line,e.column,new Zm(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Ah.TERMINAL),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof vu){this.setActiveAuxPanelMode(Ah.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new Vu(this,e);this.setTestRunnerState(t),await(0,x.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,x.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}),`${qh.TEST} ${e}`)))}*executeFullTestSuite(e){yield(0,x.fl)(this.executeTests(Sh,e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,x.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof fu&&await(0,x.fl)(this.loadFile(e.jumpTo.source,new Mh(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,x.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:gs.CAUTION,actions:[{label:"Perform full re-compile",type:Es.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,x.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(Nh.CONCEPT_EXPLORER,{keepShowingIfMatchedCurrent:!0})}),"recompile")).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Es.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(eu)).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!==Nh.CONCEPT_EXPLORER&&this.setActiveActivity(Nh.CONCEPT_EXPLORER);const e=t.path.split(fe);let s=H(e[0]),i=H(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${fe}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,x.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,He.vB)($u,s):new Bu;return!(i instanceof $u&&(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,He.vB)(Uh,e)))}*findUsagesFromCoordinate(e){const t=yield this.getConceptInfo(e);t&&(yield(0,x.fl)(this.findUsages(t)))}*findUsages(e){try{this.referenceUsageLoadState.inProgress(),this.applicationStore.alertService.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${kh(e)}`,showLoading:!0});const t=yield this.findConceptUsages(e.pureType===Oh.ENUM_VALUE?jh.ENUM:e.pureType===Oh.PROPERTY||e.pureType===Oh.QUALIFIED_PROPERTY?jh.PROPERTY:jh.ELEMENT,(e.owner?[`'${e.owner}'`]:[]).concat(`'${e.path}'`)),s=(yield this.client.getTextSearchPreview(t.map((e=>(0,He.qC)(yu,new yu(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,He.vB)(yu,e)));this.setReferenceUsageResult(new i_(this,e,t,s)),this.setActiveAuxPanelMode(Ah.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 n=i.map((e=>e.source));for(const e of n)yield this.reloadFile(e);yield this.refreshTrees(),this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){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,qe.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,x.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Ah.TERMINAL),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield this.reloadFile(e);this.applicationStore.notificationService.notifyWarning("Please re-compile the code after refacting")}catch(t){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,x.fl)(this.command((()=>this.client.createFolder(bh(e))),qh.NEW_DIRECTORY)),yield(0,x.fl)(this.directoryTreeState.refreshTreeData())}catch(e){G(e),this.applicationStore.notificationService.notifyError(e)}}*createNewFile(e){try{const t=yield(0,x.fl)(this.command((()=>this.client.createFile(bh(e))),qh.NEW_FILE));yield(0,x.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,x.fl)(this.loadFile(e)))}catch(e){G(e),this.applicationStore.notificationService.notifyError(e)}}*renameFile(e,t){try{yield(0,x.fl)(this.command((()=>this.client.renameFile(e,t)),qh.MOVE)),yield(0,x.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof eu&&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,x.fl)(this.command((()=>this.client.deleteDirectoryOrFile(bh(e))),qh.REMOVE)),this.tabManagerState.tabs.filter((s=>s instanceof eu&&(void 0===t||t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,x.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:gs.CAUTION,actions:[{label:"Delete anyway",type:Es.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Es.PROCEED,default:!0}]})}}const o_=(0,rt.createContext)(void 0),l_=({children:e})=>{const t=Ri(),s=(0,at.fv)((()=>new r_(t)));return(0,T.jsx)(o_.Provider,{value:s,children:e})},c_=()=>H((0,rt.useContext)(o_),"Can't find editor store in context"),d_=(0,at.Pi)((()=>{const e=c_(),t=Ri().terminalService.terminal,s=(0,rt.useRef)(null),{ref:i,width:n,height:a}=(0,Vs.NB)();(0,rt.useEffect)((()=>(s.current&&t.searchConfig.setSearchInput(s.current),()=>t.searchConfig.setSearchInput(void 0))),[t]),(0,rt.useEffect)((()=>{i.current&&t.mount(i.current)}),[t,i]),(0,rt.useEffect)((()=>{e.auxPanelDisplayState.isOpen&&e.activeAuxPanelMode===Ah.TERMINAL&&t.focus()}),[t,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,rt.useEffect)((()=>{t.autoResize()}),[t,n,a]);const r=()=>{t.clear(),t.focus()},o=()=>t.copyAll();return t.isSetup?(0,T.jsxs)("div",{className:"terminal-panel",children:[(0,T.jsxs)("div",{className:"terminal-panel__header",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__group",children:[(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__container",children:[(0,T.jsx)("input",{ref:s,className:"terminal-panel__header__searcher__input input--dark",spellCheck:!1,value:t.searchConfig.searchText,onChange:e=>{const s=e.target.value;t.setSearchText(s),t.search(s)},onKeyDown:e=>{"Enter"===e.code?e.shiftKey?t.findPrevious():t.findNext():"Escape"===e.code&&(t.clearSearch(),t.focus())},placeholder:"Find"}),(0,T.jsxs)("div",{className:"terminal-panel__header__searcher__input__actions",children:[(0,T.jsx)("button",{className:"terminal-panel__header__searcher__input__action",tabIndex:-1,title:"Clear Search",onClick:()=>t.clearSearch(),children:(0,T.jsx)(As.Two,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.a2g,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.Xj8,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.x47,{})})]})]}),(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)(As.Hf3,{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)(As.veu,{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,cs.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)(As.F_y,{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)(As.TIy,{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)(As.XHJ,{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)(As.pTE,{className:"terminal-panel__header__action__icon"})})]})]}),(0,T.jsx)(Ds,{className:"terminal-panel__content",content:(0,T.jsxs)(Ms,{children:[(0,T.jsx)(Fs,{onClick:()=>t.copy(),children:"Copy"}),(0,T.jsx)(Fs,{onClick:o,children:"Copy All"}),(0,T.jsx)(Fs,{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)(Bs,{children:"Terminal is not set up yet"})})})),h_=(0,at.Pi)((e=>{const{searchResult:t,result:s}=e,i=c_(),n=Ri(),a=e=>()=>(0,x.fl)(i.loadFile(s.sourceId,new Mh(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"text-search-panel__entry",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__label",children:(0,T.jsx)(As.QqN,{})}),(0,T.jsx)("div",{className:"text-search-panel__entry__header__title__content",children:bh(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)(As.q1B,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"text-search-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label text-search-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"text-search-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text text-search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"text-search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"text-search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"text-search-panel__entry__content__item__action text-search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(As.q1B,{})})})]},e.uuid)))})]})})),u_=(0,at.Pi)((e=>{const{searchResult:t}=e,s=c_(),i=Ri(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"text-search-panel__content",children:[(0,T.jsxs)("div",{className:"text-search-panel__content__header",children:[(0,T.jsx)("div",{className:"text-search-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} result(s) in ${t.numberOfFiles} files`:"No result"}),(0,T.jsxs)("div",{className:"text-search-panel__content__header__actions",children:[(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Refresh",onClick:()=>{(0,x.fl)(s.textSearchState.search()).catch(i.alertUnhandledError)},children:(0,T.jsx)(As.DuK,{})}),(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)(As.Two,{})}),!n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(As.S9M,{})}),n&&(0,T.jsx)("button",{className:"text-search-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(As.U9q,{})})]})]}),(0,T.jsx)("div",{className:"text-search-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(h_,{searchResult:t,result:e},e.uuid)))})]})})),p_=(0,at.Pi)((()=>{const e=c_(),t=(0,rt.useRef)(null),s=e.textSearchState,i=(0,rt.useMemo)((()=>(0,Hs.Z)((()=>s.search()),300)),[s]);return(0,rt.useEffect)((()=>(t.current&&s.setSearchInput(t.current),()=>s.setSearchInput(void 0))),[s]),(0,rt.useEffect)((()=>{e.auxPanelDisplayState.isOpen&&e.activeAuxPanelMode===Ah.SEARCH&&s.focus()}),[s,e.auxPanelDisplayState.isOpen,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"text-search-panel",children:[(0,T.jsx)(Ss,{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,cs.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)(As.a2g,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.x47,{})})]})]})}),e.textSearchState.result&&(0,T.jsx)(u_,{searchResult:e.textSearchState.result})]})})),m_=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,T.jsxs)("div",{className:(0,cs.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,cs.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{}))}),(0,T.jsx)("div",{className:(0,cs.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},__=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:__,TreeNodeContainer:m_},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,cs.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},g_=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter($),d={TreeNodeView:__,TreeNodeContainer:m_},h=n?{...d,...n}:d;return(0,T.jsx)("div",{className:(0,cs.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,T.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var E_=s(410);const f_=E_.gs,T_="resizable-panel--collapsed",C_=(e,t)=>({collapsiblePanel:{className:(0,cs.clsx)(...t?.classes??[],{[T_]:e}),onStartResize:e=>{e.domElement.classList.remove(T_),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}}),x_=E_.jW,S_=E_.nN,N_=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var A_=s(48845);const v_=(0,at.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=c_(),u=Ri(),p=r.testResultInfo,m=!t.data.type,_=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?Lu.PASSED:t.failedTests.has(e)?Lu.FAILED:t.testsWithError.has(e)?Lu.ERROR:Lu.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?Lu.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?Lu.RUNNING:Lu.PASSED})(t,p):void 0){case Lu.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)(As.rE2,{})});break;case Lu.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)(As.$Ow,{})});break;case Lu.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)(As.xDH,{})});break;case Lu.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)(As.VRP,{})});break;default:g=(0,T.jsx)(As.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,cs.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":_}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),m?E():o(t)},onDoubleClick:()=>{m?E():(0,x.fl)(h.loadFile(t.data.li_attr.file,new Mh(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:e=>{e.stopPropagation(),E()},children:m?t.isOpen?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{}):(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})]})})),I_=(0,at.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(fe),(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)(v_,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),O_=(0,at.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)(Bs,{children:"No tests found"}),!i&&(0,T.jsx)(g_,{components:{TreeNodeContainer:v_},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()}}})]})})),y_=/(?<path>resource:(?<path_sourceId>\/?(?:\w+\/)*\w+(?:\.\w+)*) (?:line:(?<path_line>\d+)) (?:column:(?<path_column>\d+)))/g,R_=e=>{const{wrapText:t,result:s}=e,i=c_(),n=Ri(),[a,r]=(0,rt.useState)(),o=(0,rt.useRef)(void 0),l=(0,rt.useRef)(null),{ref:c,width:d,height:h}=(0,Vs.NB)();return(0,rt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,rt.useEffect)((()=>{if(!a&&l.current){const e=l.current,t=S.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)}}),[n,a]),o.current?.dispose(),o.current=S.languages.registerLinkProvider(v.TEXT,{provideLinks:e=>{const t=[];for(let s=1;s<=e.getLineCount();++s)Array.from(e.getLineContent(s).matchAll(y_)).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,x.fl)(i.loadFile(t.sourceId,new Mh(t.sourceId,Number.parseInt(t.line,10),Number.parseInt(t.column,10)))).catch(i.applicationStore.alertUnhandledError)}}),(0,rt.useEffect)((()=>{void 0!==d&&void 0!==h&&a?.layout({width:d,height:h})}),[a,d,h]),(0,rt.useEffect)((()=>{if(a){const e=s instanceof Du?"Test passed!":s instanceof Fu?s.error.text:"Running...";a.setValue(e),(s instanceof Du||s instanceof Fu)&&a.createDecorationsCollection([{range:{startLineNumber:1,startColumn:1,endLineNumber:Number.MAX_SAFE_INTEGER,endColumn:Number.MAX_SAFE_INTEGER},options:{inlineClassName:s instanceof Du?"test-runner-panel__result__content--success":"test-runner-panel__result__content--failure"}}])}}),[a,s]),(0,rt.useEffect)((()=>{a&&a.updateOptions({wordWrap:t?"on":"off"})}),[a,t]),(0,rt.useEffect)((()=>()=>{a&&(e=>{e.dispose(),e.getModel()?.dispose()})(a),o.current?.dispose()}),[a]),(0,T.jsx)("div",{ref:c,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:l})})},P_=(0,at.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=c_(),a=Ri(),[r,o]=(0,rt.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,cs.clsx)("panel__header__action",{"panel__header__action--active":r}),tabIndex:-1,onClick:()=>o(!r),title:"Toggle Text Wrap",children:(0,T.jsx)(As.NK0,{className:"test-runner-panel__result__header__icon--text-wrap"})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,x.fl)(n.loadFile(c.li_attr.file,new Mh(c.li_attr.file,Number.parseInt(c.li_attr.line,10),Number.parseInt(c.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,T.jsx)(As.qdB,{})})]})]}),(0,T.jsx)("div",{className:"panel__content test-runner-panel__result",children:(0,T.jsx)(R_,{result:l,wrapText:r})})]})})),w_=(0,at.Pi)((e=>{const{testRunnerState:t}=e,s=c_(),i=Ri(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??wu.NONE,o=a?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(f_,{orientation:"vertical",children:[(0,T.jsx)(x_,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(Ss,{isLoading:t.treeBuildingState.isInProgress}),(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,T.jsx)(As.rE2,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,T.jsx)(As.$Ow,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,T.jsx)(As.xDH,{})]})]}),a&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,T.jsx)(As.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(As.VjU,{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)(As.Qq,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(As.jG4,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,x.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(As.SCS,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(As.o1U,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(t.cancelTestRun()).catch(i.alertUnhandledError).finally((()=>{s.setTestRunnerState(void 0)}))},title:"Reset",children:(0,T.jsx)(As.q1B,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(A_.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)(O_,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(I_,{testRunnerState:t})]})})]})}),(0,T.jsx)(S_,{children:(0,T.jsx)(N_,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(x_,{minSize:400,children:[t.selectedTestId&&!a&&(0,T.jsx)("div",{}),t.selectedTestId&&a&&(0,T.jsx)(P_,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsx)("div",{className:"panel__header"}),(0,T.jsx)("div",{className:"panel__content",children:(0,T.jsx)(Bs,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),L_=(0,at.Pi)((()=>{const e=c_().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(Bs,{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)(As.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)(w_,{testRunnerState:e})]})})),b_=(0,at.Pi)((e=>{const{candidate:t}=e,s=c_(),i=Ri(),n=()=>{(0,x.fl)(s.loadFile(t.sourceID,new Mh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"suggestions-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__label__candidate-location",children:`${bh(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"suggestions-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"suggestions-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,T.jsx)(As.bK4,{})})})]})})),D_=(0,at.Pi)((e=>{const{candidate:t}=e,s=c_(),i=Ri();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,x.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:`${bh(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,x.fl)(s.loadFile(t.sourceID,new Mh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(As.bK4,{})})})]})})),M_=(0,at.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)(b_,{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)(D_,{candidate:e},e.uuid)))})]})]})})),F_=(0,at.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)(D_,{candidate:e},e.uuid)))})]})]})})),j_=(0,at.Pi)((()=>{const e=c_();return(0,T.jsxs)("div",{className:"suggestions-panel",children:[e.codeFixSuggestion instanceof t_&&(0,T.jsx)(M_,{suggestionState:e.codeFixSuggestion}),e.codeFixSuggestion instanceof s_&&(0,T.jsx)(F_,{suggestionState:e.codeFixSuggestion})]})})),k_=(0,at.Pi)((e=>{const{referenceUsageResult:t,result:s}=e,i=c_(),n=Ri(),a=e=>()=>(0,x.fl)(i.loadFile(s.sourceId,new Mh(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"references-panel__entry",children:[(0,T.jsxs)("div",{className:"references-panel__entry__header",onClick:()=>s.setIsExpanded(!s.isExpanded),children:[(0,T.jsxs)("div",{className:"references-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"references-panel__entry__header__title__expander",children:s.isExpanded?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__label",children:(0,T.jsx)(As.QqN,{})}),(0,T.jsx)("div",{className:"references-panel__entry__header__title__content",children:bh(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)(As.q1B,{})})]})]}),s.isExpanded&&(0,T.jsx)("div",{className:"references-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"references-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label references-panel__entry__content__item__label--full",title:e.preview?`${e.preview.before}${e.preview.found.replaceAll(/\n/g,"↵")}${e.preview.after}`:"Go To Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"references-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"references-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text references-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"references-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"references-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"references-panel__entry__content__item__action references-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(As.q1B,{})})})]},e.uuid)))})]})})),U_=(0,at.Pi)((e=>{const{referenceUsageState:t}=e,s=c_(),i=Ri(),n=t.searchEntries.some((e=>!e.isExpanded));return(0,T.jsxs)("div",{className:"references-panel__content",children:[(0,T.jsxs)("div",{className:"references-panel__content__header",children:[(0,T.jsx)("div",{className:"references-panel__content__header__title",children:t.searchEntries.length?`${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${kh(t.usageConcept)}`:`No usages found for ${kh(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,x.fl)(s.findUsages(t.usageConcept)).catch(i.alertUnhandledError)},children:(0,T.jsx)(As.DuK,{})}),(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Clear",onClick:()=>s.setReferenceUsageResult(void 0),children:(0,T.jsx)(As.Two,{})}),!n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Collapse All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!1)))},children:(0,T.jsx)(As.S9M,{})}),n&&(0,T.jsx)("button",{className:"references-panel__content__header__action",tabIndex:-1,title:"Expand All",onClick:()=>{t.searchEntries.forEach((e=>e.setIsExpanded(!0)))},children:(0,T.jsx)(As.U9q,{})})]})]}),(0,T.jsx)("div",{className:"references-panel__content__results",children:t.searchEntries.map((e=>(0,T.jsx)(k_,{referenceUsageResult:t,result:e},e.uuid)))})]})})),G_=(0,at.Pi)((()=>{const e=c_();return(0,T.jsxs)("div",{className:"references-panel",children:[(0,T.jsx)(Ss,{isLoading:e.referenceUsageLoadState.isInProgress}),!e.referenceUsageResult&&(0,T.jsx)(Bs,{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)(As.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F7"})]})]})})})}),e.referenceUsageResult&&(0,T.jsx)(U_,{referenceUsageState:e.referenceUsageResult})]})})),V_=(0,at.Pi)((()=>{const e=c_(),t={[Ah.TERMINAL]:{mode:Ah.TERMINAL,name:"TERMINAL",icon:(0,T.jsx)(As.FxN,{className:"auxiliary-panel__header__tab__icon--terminal"}),isVisible:!0},[Ah.SEARCH]:{mode:Ah.SEARCH,name:"SEARCH",icon:(0,T.jsx)(As.W1M,{className:"auxiliary-panel__header__tab__icon--search"}),isVisible:!0},[Ah.TEST_RUNNER]:{mode:Ah.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)(As.Vzd,{className:"auxiliary-panel__header__tab__icon--test"}),isVisible:!0},[Ah.REFERENCES]:{mode:Ah.REFERENCES,name:"REFERENCES",icon:(0,T.jsx)(As.IMP,{className:"auxiliary-panel__header__tab__icon--references"}),isVisible:!0},[Ah.CODE_FIX_SUGGESTION]:{mode:Ah.CODE_FIX_SUGGESTION,name:"SUGGESTIONS",icon:(0,T.jsx)(As.uuU,{className:"auxiliary-panel__header__tab__icon--suggestion"}),isVisible:Boolean(e.codeFixSuggestion)}},s=Object.values(Ah).filter((e=>$(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,rt.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Ah.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,cs.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)(As.v4q,{}):(0,T.jsx)(As.g8U,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(As.b0D,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Ah.TERMINAL)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(d_,{})}),i(Ah.SEARCH)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(p_,{})}),i(Ah.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(L_,{})}),i(Ah.CODE_FIX_SUGGESTION)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(j_,{})}),i(Ah.REFERENCES)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(G_,{})})]})]})}));var B_=s(42689);const $_=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(As.jtq,{})}),z_=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),H_=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),Y_=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),W_=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),K_=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),X_=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(As.eid,{})}),Z_=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(As.Zlt,{})}),q_=()=>(0,T.jsx)("div",{children:(0,T.jsx)(As.UOT,{})}),J_=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(As.eid,{})}),Q_=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(As.HXR,{})}),eg=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(As.oF7,{})}),tg=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(As.VHe,{})}),sg=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),ig=e=>{switch(e){case Oh.PACKAGE:return(0,T.jsx)($_,{});case Oh.PROFILE:return(0,T.jsx)(K_,{});case Oh.CLASS:return(0,T.jsx)(z_,{});case Oh.ASSOCIATION:return(0,T.jsx)(sg,{});case Oh.PROPERTY:case Oh.QUALIFIED_PROPERTY:return(0,T.jsx)(Q_,{});case Oh.ENUMERATION:return(0,T.jsx)(H_,{});case Oh.MEASURE:return(0,T.jsx)(Y_,{});case Oh.UNIT:return(0,T.jsx)(W_,{});case Oh.FUNCTION:return(0,T.jsx)(X_,{});case Oh.NATIVE_FUNCTION:return(0,T.jsx)(J_,{});case Oh.DIAGRAM:return(0,T.jsx)(eg,{});case Oh.DATABASE:return(0,T.jsx)(tg,{});case Oh.MAPPING:return(0,T.jsx)(Z_,{});default:return(0,T.jsx)(q_,{})}},ng=/^\w[\w$]*$/,ag=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,rg=(0,at.Pi)((e=>{const{node:t}=e,s=c_(),i=Ri(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Oh.PACKAGE,[r,o]=(0,rt.useState)(a?Od(n):n),l=(0,rt.useRef)(null),c=Boolean(r.match(a?ag:ng)),d=(a?Od(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,T.jsx)(ls.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"})]})]})})})),og=/^(?:(?:\w[\w$]*)::)*\w[\w$]*$/,lg=(0,at.Pi)((e=>{const{node:t}=e,s=c_(),i=Ri(),n=yd(t.data.li_attr.pureId)??"",[a,r]=(0,rt.useState)(n),o=(0,rt.useRef)(null),l=Boolean(a.match(og)),c=n===a,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,wh)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(ls.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Move element"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Move"})]})]})})})),cg=(0,at.Pi)((0,rt.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr,a=n.pureType,r=c_(),o=Ri();return(0,T.jsxs)(Ms,{ref:t,children:[n.pureType!==Oh.PROPERTY&&n.pureType!==Oh.QUALIFIED_PROPERTY&&(0,T.jsx)(Fs,{onClick:()=>{o.clipboardService.copyTextToClipboard(n.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),a===Oh.PACKAGE&&(0,T.jsx)(Fs,{onClick:()=>{(0,x.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),a===Oh.FUNCTION&&(0,T.jsx)(Fs,{onClick:()=>{window.open(`${r.client.baseUrl}/execute?func=${n.pureId}&mode=${r.client.mode}`,"_blank")},children:"Service (JSON)"}),(n instanceof Ph||n instanceof wh)&&(0,T.jsx)(Fs,{onClick:()=>{(n instanceof wh||n instanceof Ph)&&r.findUsagesFromCoordinate(new Mh(n.file,Number.parseInt(n.line,10),Number.parseInt(n.column,10)))},children:"Find Usages"}),a!==Oh.PACKAGE&&(0,T.jsx)(Fs,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(js,{}),(0,T.jsx)(Fs,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),n instanceof wh&&(0,T.jsx)(Fs,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var dg;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(dg=dg||(dg={}));const hg=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,rt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof Ph&&t.data.li_attr.classPath!==t.parent.id,p=[Oh.PACKAGE,Oh.CLASS].includes(t.data.li_attr.pureType),m=t.data.li_attr.pureType===Oh.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:Od(K(t.data.li_attr,Ph).classPath)})]}):t.label.includes("(")?(0,T.jsxs)(T.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,_=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,B_.c)((()=>({type:"Class"===t.data.li_attr.pureType?dg.CLASS:dg.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(Ds,{content:(0,T.jsx)(cg,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,cs.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&_(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(As.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:_,children:p?t.isOpen?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,cs.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:ig(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:m})]})})},ug=(0,at.Pi)((()=>{const e=c_(),t=Ri(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(g_,{components:{TreeNodeContainer:hg},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,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:s=>{const i=s.data.li_attr;(i instanceof wh||i instanceof Ph)&&(0,x.fl)(e.directoryTreeState.revealPath(i.file,{forceOpenExplorerPanel:!0,coordinate:new Mh(i.file,Number.parseInt(i.line,10),Number.parseInt(i.column,10))})).catch(t.alertUnhandledError)}}}),s.nodeForRenameConcept&&(0,T.jsx)(rg,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(lg,{node:s.nodeForMoveElement})]})})),pg=(0,at.Pi)((()=>{const e=c_(),t=Ri(),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,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(As.DuK,{})}),(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)(As.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Ss,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(ug,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Bs,{children:"Failed to build concept tree. Make sure graph compiles"})]})]})})]})})),mg=/^\w+(?:\.\w+)*$/,_g=(0,at.Pi)((e=>{const{node:t}=e,s=c_(),i=Ri(),[n,a]=(0,rt.useState)("untitled.pure"),r=(0,rt.useRef)(null),o=Boolean(n.match(mg)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(ls.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),gg=/^\w+$/,Eg=(0,at.Pi)((e=>{const{node:t}=e,s=c_(),i=Ri(),[n,a]=(0,rt.useState)("untitled"),r=(0,rt.useRef)(null),o=Boolean(n.match(gg)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(ls.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),fg=/^\/?(?:\w+\/)*\w+(?:\.\w+)*$/,Tg=(0,at.Pi)((e=>{const{node:t}=e,s=c_(),i=Ri(),[n,a]=(0,rt.useState)(t.data.li_attr.path),r=(0,rt.useRef)(null),o=Boolean(n.match(fg)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,x.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,T.jsx)(ls.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Rename"})]})]})})})),Cg=(0,at.Pi)((0,rt.forwardRef)((function(e,t){const{node:s}=e,i=Ri(),n=c_(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(Ms,{ref:t,children:[(0,T.jsx)(Fs,{onClick:()=>{i.clipboardService.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(js,{}),a&&(0,T.jsx)(Fs,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,T.jsx)(Fs,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,T.jsx)(Fs,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(Fs,{disabled:Boolean(s.data instanceof au&&s.data.children),onClick:()=>{(0,x.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),xg=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,rt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof au&&t.data.isRepoNode&&"/platform"===t.data.li_attr.path,u=t.data.li_attr.RO,p=t.data.isFolderNode,m=t.data instanceof au&&!t.data.children,_=h||t.data.isRepoNode&&t.data.li_attr.path.startsWith("/platform_")?(0,T.jsx)(As.R0,{className:"explorer__icon--readonly"}):p?m?(0,T.jsx)(As.ROc,{className:(0,cs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):t.isOpen?(0,T.jsx)(As.ry,{className:(0,cs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(As.ROc,{className:(0,cs.clsx)("explorer__icon--folder",{"explorer__icon--readonly":u})}):(0,T.jsx)(As.QqN,{className:(0,cs.clsx)("explorer__icon--file",{"explorer__icon--readonly":u})}),g=()=>{m||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(Ds,{content:(0,T.jsx)(Cg,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,cs.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(p?g():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(As.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||m?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(As.v4q,{}):(0,T.jsx)(As.XCv,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},Sg=(0,at.Pi)((()=>{const e=c_(),t=Ri(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(g_,{components:{TreeNodeContainer:xg},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,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(_g,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(Eg,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(Tg,{node:s.nodeForRenameFile})]})})),Ng=(0,at.Pi)((()=>{const e=c_(),t=Ri(),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,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(As.DuK,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof eu&&(0,x.fl)(s.revealPath(i.filePath)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(As.cOE,{})}),(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)(As.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Ss,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(Sg,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(Bs,{children:"Failed to build directory tree"})]})]})})]})})),Ag=(0,at.Pi)((()=>{const e=c_();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,cs.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Nh.CONCEPT_EXPLORER:return(0,T.jsx)(pg,{});case Nh.FILE_EXPLORER:return(0,T.jsx)(Ng,{});default:return null}})()},e.activeActivity)})})),vg=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,cs.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"})})]})})},Ig=(0,at.Pi)((()=>{const e=c_(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Nh.CONCEPT_EXPLORER,title:"Concept Explorer",icon:(0,T.jsx)(As.DE2,{})},{mode:Nh.FILE_EXPLORER,title:"File Explorer",icon:(0,T.jsx)(As.QqN,{})}].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)(vg,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,cs.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)))})]})})),Og=(0,at.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)`:""}`})})})),yg=(0,at.Pi)((()=>{const e=c_(),t=Ri();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 eu&&(0,T.jsx)(Og,{fileEditorState:e.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,cs.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,x.fl)(e.executeGo()).catch(t.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(As.pgN,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.FxN,{})}),(0,T.jsx)("button",{className:(0,cs.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)(As.UHp,{})})]})]})})),Rg=e=>{(0,rt.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},Pg=/[0-9]+(?::[0-9]+)?/,wg=(0,at.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,rt.useState)(""),n=(0,rt.useRef)(null),a=Boolean(s.match(Pg)),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(P(t)))))??1,V((()=>parseInt(H(w(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=a?c?void 0:"Invalid line number":"Invalid value (format [line:column] - e.g. 123:45)",h=()=>t.setShowGoToLinePrompt(!1),u=e=>{e.preventDefault(),h(),t.textEditorState.setForcedCursorPosition({lineNumber:o,column:l??1})};return(0,T.jsx)(ls.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>n.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Go to..."}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:n,className:"input input--dark",onChange:e=>i(e.target.value),placeholder:r?`Current Line: ${r.lineNumber}, Col: ${r.column}. Type a line between 1 and ${t.textEditorState.model.getLineCount()} to navigate to`:void 0,value:s,spellCheck:!1}),""!==s&&d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:""===s||Boolean(d),onClick:u,children:"Go"})]})]})})})),Lg=(0,at.Pi)((e=>{const{editorState:t}=e,s=c_(),i=Ri(),n=(0,rt.useRef)(null),[a,r]=(0,rt.useState)(),{ref:o,width:l,height:c}=(0,Vs.NB)();return(0,rt.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=S.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,a]),Rg(t),(0,rt.useEffect)((()=>{void 0!==l&&void 0!==c&&a?.layout({width:l,height:c})}),[a,l,c]),(0,rt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(vh(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,rt.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose())}),[t,a]),(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,cs.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)(As.NK0,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(wg,{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:n})})})]})})),bg=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=H(P(e.split(".")));return t.includes(i)};class Dg{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,He.yu)(Dg,{pureType:(0,He.Ru)(),pureId:(0,He.Ru)(),pureName:(0,He.Ru)(),text:(0,He.Ru)(),requiredClassProperties:(0,He.jt)((0,He.pb)((0,He.Ru)()))});class Mg{pureType;pureName;owner;ownerPureType}(0,He.yu)(Mg,{pureType:(0,He.Ru)(),pureName:(0,He.Ru)(),owner:(0,He.Ru)(),ownerPureType:(0,He.Ru)()});class Fg{pureId;pureName;requiredClassProperties=[]}(0,He.yu)(Fg,{pureId:(0,He.Ru)(),pureName:(0,He.Ru)(),requiredClassProperties:(0,He.jt)((0,He.pb)((0,He.Ru)()))});class jg{name}(0,He.yu)(jg,{name:(0,He.Ru)()});const kg="Diagram",Ug="Diagram",Gg=()=>{const e=[];return e.push({label:{label:"/copyright",description:"(copyright header)"},kind:S.languages.CompletionItemKind.Snippet,insertTextRules:S.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},Vg=e=>({label:{label:e.pureName,description:e.pureId},kind:S.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),Bg=(e,t)=>{const s=e.pureType,i=s===Oh.FUNCTION||s===Oh.NATIVE_FUNCTION?((e,t,s)=>{const i=Od(t),n=V((()=>i.substring(i.indexOf("_"),i.length-1))),a=n?.split("__")??[];return a.pop(),s&&a.shift(),`${e}(${a.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,n=s===Oh.PACKAGE?S.languages.CompletionItemKind.Folder:s===Oh.CLASS?S.languages.CompletionItemKind.Class:s===Oh.FUNCTION?S.languages.CompletionItemKind.Function:s===Oh.ENUMERATION?S.languages.CompletionItemKind.Enum:s===Oh.PROFILE?S.languages.CompletionItemKind.Module:s===Oh.ASSOCIATION?S.languages.CompletionItemKind.Interface:S.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:n,filterText:e.pureName,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===Oh.PACKAGE?`zzzz_${e.text}`:e.text}},$g=/(?<incompletePath>(?:\w[\w$]*::)+$)/,zg=/->\s*(?:\w[\w$]*::)+$/,Hg=/\^\s*(?:\w[\w$]*::)+$/,Yg=/^\s*import\s+(?:(?<importPath>(?:(?:\w[\w$]*)::)*\w[\w$]*)::*)/,Wg=(e,t)=>{const s=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=`${Te}${Ge.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(Te))).lastIndexOf(!0)).map((e=>e.match(Yg)?.groups?.importPath)).filter($)},Kg=/->\s*(?:\w[\w$]*)?$/,Xg=/\^\s*(?:\w[\w$]*)?$/,Zg=/^(?<owner>(?:(?:\w[\w$]*)::)*\w[\w$]*)\s*.$/,qg=(e,t)=>({label:e.name,kind:S.languages.CompletionItemKind.Variable,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:t?e.name:`zzzz_${e.name}`,insertText:e.name}),Jg=/^\w[\w$]*$/,Qg=(0,at.Pi)((e=>{const{renameConceptState:t}=e,s=Ri(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,rt.useState)(n),o=(0,rt.useRef)(null),l=Boolean(a.match(Jg)),c=n===a,d=l?void 0:"Invalid concept name",h=()=>{(0,x.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(ls.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Rename"})]})]})})})),eE=(0,at.Pi)((e=>{const{editorState:t}=e,s=(0,rt.useRef)(void 0),i=(0,rt.useRef)(void 0),n=(0,rt.useRef)(void 0),a=(0,rt.useRef)(null),[r,o]=(0,rt.useState)(),[l,c]=(0,rt.useState)(!1),d=c_(),h=Ri(),{ref:u,width:p,height:m}=(0,Vs.NB)();return(0,rt.useEffect)((()=>{if(!r&&a.current){const e=a.current,s=S.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,x.fl)(d.executeNavigation(new Mh(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:Xh.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Mh(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:Xh.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Mh(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:Xh.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 Mh(t.filePath,s.lineNumber,s.column);(0,x.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=S.languages.registerDefinitionProvider(v.PURE,{provideDefinition:(e,s)=>{const i=e.getLineContent(s.lineNumber),n=S.editor.tokenize(i,v.PURE)[0];if(!n)return[];let a,r;for(let e=1;e<=n.length;++e){const t=e===n.length?i.length:H(n[e]).offset;if(t+1>s.column){a=H(n[e-1]),r={startLineNumber:s.lineNumber,startColumn:a.offset+1,endLineNumber:s.lineNumber,endColumn:t+1};break}}return a&&r&&bg(a.type,[Be.TYPE,Be.VARIABLE,Be.PROPERTY,Be.PARAMETER,Be.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:r}]:[]}}),i.current?.dispose(),i.current=S.languages.registerCompletionItemProvider(v.PURE,{triggerCharacters:["/","#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let n=[];if(i.triggerKind===S.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"/":n=n.concat(Gg());break;case"#":n=n.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${Te}${e.text}`,description:e.description},kind:S.languages.CompletionItemKind.Keyword,insertText:`${Te}${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:Ge.PURE,description:"(core Pure)",insertText:Ge.PURE},{text:Ge.MAPPING,description:"(dsl)",insertText:Ge.MAPPING},{text:Ge.CONNECTION,description:"(dsl)",insertText:Ge.CONNECTION},{text:Ge.RUNTIME,description:"(dsl)",insertText:Ge.RUNTIME},{text:Ge.RELATIONAL,description:"(external store)",insertText:Ge.RELATIONAL},{text:kg,description:"(dsl)",insertText:Ug}]));break;case":":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match($g);if(i?.groups?.incompletePath){const n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(zg)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Hg));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-fe.length),a?[Oh.CLASS]:n?[Oh.FUNCTION,Oh.NATIVE_FUNCTION]:[])).map((e=>(0,He.vB)(Dg,e)))}catch{}return r.map((e=>a?Vg(e):Bg(e,{preferArrowFunctionForm:n})))}return[]})(s,e,d));break;case">":n=n.concat(await(async(e,t,s)=>{const i=Wg(e,t);let n=[];try{n=(await s.client.getSuggestionsForIdentifier(i,[Oh.FUNCTION,Oh.NATIVE_FUNCTION])).map((e=>(0,He.vB)(Dg,e)))}catch{}return n.map((e=>Bg(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Zg),n=Wg(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(n,i.groups.owner)).map((e=>(0,He.vB)(Mg,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===Oh.PROPERTY||t===Oh.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===Oh.PROPERTY?S.languages.CompletionItemKind.Property:t===Oh.QUALIFIED_PROPERTY?S.languages.CompletionItemKind.Method:t===Oh.TAG?S.languages.CompletionItemKind.Constant:t===Oh.STEREOTYPE?S.languages.CompletionItemKind.Value:t===Oh.ENUM_VALUE?S.languages.CompletionItemKind.Enum:S.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":n=n.concat(await(async(e,t,s)=>{const i=Wg(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,He.vB)(Fg,e)))}catch{}return n.map((e=>Vg(e)))})(s,e,d));break;case"@":n=n.concat(await(async(e,t,s)=>{const i=Wg(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,He.vB)(Fg,e)))}catch{}return n.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:S.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":n=n.concat(await(async(e,t,s,i)=>{let n=[];try{n=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,He.vB)(jg,e)))}catch{}const a=new Set;let r=!1;for(let s=e.lineNumber-1;s>Math.max(0,e.lineNumber-1-10)&&!r;--s){const i=t.getLineContent(s+1);(i.match(/^\s*function\s+/)||i.match(/^\s*###\w+/))&&(r=!0);const n=H(S.editor.tokenize(t.getLineContent(s+1),v.PURE)[0]);n.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&bg(i.type,[Be.VARIABLE,Be.PARAMETER],!0)&&a.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===n.length-1?Number.MAX_SAFE_INTEGER:H(n[r+1]).offset+1}))}))}const o=n.map((e=>e.name));return n.map((e=>qg(e,!0))).concat(Array.from(a).filter((e=>!o.includes(e))).map((e=>{const t=new jg;return t.name=e,t})).map((e=>qg(e,!1))))})(s,e,t.filePath,d))}return{suggestions:n}}}),n.current?.dispose(),n.current=S.languages.registerCompletionItemProvider(v.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===S.languages.CompletionTriggerKind.Invoke&&(i=i.concat(Gg()),i=i.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${Te}${Ge.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(Te))),o=(e=>{if(e.startsWith(Te))return e.substring(Te.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:S.languages.CompletionItemKind.Snippet,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case Ge.PURE:return[{text:ke.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:ke.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:ke.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:ke.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:ke.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:ke.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:ke.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:ke.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:ke.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Ge.MAPPING:return[{text:ke.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:ke.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:ke.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:ke.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 Ge.RELATIONAL:return[{text:ke.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 kg:return[{text:Ug,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:S.languages.CompletionItemKind.Snippet,insertTextRules:S.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=Wg(e,t),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Kg)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Xg));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,a?[Oh.CLASS]:n?[Oh.FUNCTION,Oh.NATIVE_FUNCTION]:[])).map((e=>(0,He.vB)(Dg,e)))}catch{}return r.map((e=>a?Vg(e):Bg(e,{preferArrowFunctionForm:n})))})(t,e,d))),{suggestions:i}}}),Rg(t),(0,rt.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,rt.useEffect)((()=>{void 0!==p&&void 0!==m&&r?.layout({width:p,height:m})}),[r,p,m]),(0,rt.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(vh(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,rt.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),n.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel 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,cs.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)(As.NK0,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(Qg,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(wg,{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:a})})})]})}));var tE=s(8533);const sE=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,rt.useRef)(null),[h,u]=(0,rt.useState)(null);return(0,rt.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)(bs,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},iE=(0,at.Pi)((0,rt.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Ri(),n=s.diagram,a=t,{width:r,height:o}=(0,Vs.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,rt.useEffect)((()=>{const e=new kp(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}),[a,s,n]),(0,rt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,rt.useCallback)(((e,t)=>{if(e instanceof Lh){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Yd(n.x,n.y))):void 0;(0,x.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,tE.L)((()=>({accept:dg.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,T.jsx)("div",{ref:a,className:(0,cs.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),nE=(0,at.Pi)((e=>{const{diagramEditorState:t}=e,s=c_(),i=Ri(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_LEFT),children:(0,T.jsx)(As.eRw,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_CENTER),children:(0,T.jsx)(As.UPo,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_RIGHT),children:(0,T.jsx)(As.B_D,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_TOP),children:(0,T.jsx)(As.Cti,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_MIDDLE),children:(0,T.jsx)(As.w0Y,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.ALIGN_BOTTOM),children:(0,T.jsx)(As.HLb,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.SPACE_HORIZONTALLY),children:(0,T.jsx)(As.ppk,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Dp.SPACE_VERTICALLY),children:(0,T.jsx)(As.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(sE,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(Ms,{children:[(0,T.jsx)(Fs,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(js,{}),Fp.map((e=>(0,T.jsxs)(Fs,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,T.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,T.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,T.jsx)(As.VAA,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(s.loadFile(t.filePath,new Mh(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(As.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),aE=(0,at.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,cs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Lp.LAYOUT}),tabIndex:-1,onClick:i(Lp.LAYOUT,bp.NONE),title:"View Tool (V)",children:(0,T.jsx)(As.Hrt,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,cs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Lp.PAN}),tabIndex:-1,onClick:i(Lp.PAN,bp.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(As.tPC,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,cs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Lp.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Lp.ZOOM_IN,bp.NONE),children:(0,T.jsx)(As.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,cs.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Lp.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Lp.ZOOM_OUT,bp.NONE),children:(0,T.jsx)(As.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),rE=(0,at.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,rt.useRef)(null);return Rg(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(nE,{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)(aE,{diagramEditorState:t}),(0,T.jsx)(iE,{diagramEditorState:t,ref:s})]})})]})}));var oE=s(98533),lE=s(84153);const cE=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,T.jsx)("div",{className:(0,cs.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,T.jsx)(T.Fragment,{children:t})};function dE(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,oE.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,T.jsx)(ns.Z,{children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const hE=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)},uE=(0,at.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(Ms,{children:[(0,T.jsx)(Fs,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(Fs,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(Fs,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),pE=(0,at.Pi)((e=>{const t=(0,rt.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,rt.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,tE.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,B_.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,rt.useEffect)((()=>{e((0,lE.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,cs.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)(cE,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(Ds,{content:(0,T.jsx)(uE,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,T.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,T.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,T.jsx)(As.q1B,{})})]})})});var h})),mE=(0,at.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(sE,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(Ms,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(Fs,{className:(0,cs.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)(As.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(As.v4q,{})})})),_E=(0,at.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:hE,children:[t.tabs.map((e=>(0,T.jsx)(pE,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(dE,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(mE,{managerTabState:t})]})})),gE=()=>{const[e,t]=(0,rt.useState)(!1),{ref:s,width:i,height:n}=(0,Vs.NB)();return(0,rt.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,T.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,T.jsxs)("div",{className:(0,cs.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(As.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},EE=(0,at.Pi)((()=>{const e=c_(),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)(_E,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof eu){const s=e.tabManagerState.tabs.filter((e=>e instanceof eu&&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)(As.QqN,{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)(As.mBM,{className:"edit-panel__header__tab__icon--readonly"})})]})}if(t instanceof Km){const s=e.tabManagerState.tabs.filter((e=>e instanceof Km&&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)(eg,{})}),(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 eu?t.textEditorState.language===v.PURE?(0,T.jsx)(eE,{editorState:t}):(0,T.jsx)(Lg,{editorState:t}):t instanceof Km?(0,T.jsx)(rE,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(gE,{})}));var fE=s(50166),TE=s(35247);const CE=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,rt.useRef)(null);return(0,rt.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(fE.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,T.jsx)("div",{style:t,children:i[e]})}):(0,T.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},xE="selector-input",SE="selector-input--dark",NE=()=>(0,T.jsx)("div",{className:`${xE}__indicator ${xE}__loading-indicator ${SE}__loading-indicator`,children:(0,T.jsx)(As.VRP,{})}),AE=()=>(0,T.jsx)("div",{className:`${xE}__indicator ${xE}__dropdown-indicator`,children:(0,T.jsx)(As.VAA,{})}),vE=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${xE}__indicator ${xE}__clear-indicator`,children:(0,T.jsx)(As.q1B,{})})})},IE=e=>(0,T.jsx)(TE.baseComponents.Input,{...e,isHidden:!1}),OE=(0,rt.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?TE.CreatableSelect:TE.Select,u=l?SE:xE;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:vE,DropdownIndicator:AE,LoadingIndicator:NE,MenuList:CE,Input:IE,...r},...{...d,darkMode:l,noMatchMessage:n}})})),yE=(e,t)=>e.label.localeCompare(t.label),RE=(0,at.Pi)((()=>{const e=c_(),t=Ri(),s=e.fileSearchCommandLoadState,i=e.fileSearchCommandState,n=(0,rt.useRef)(null),a=(0,rt.useMemo)((()=>(0,Hs.Z)((()=>{(0,x.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(ls.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Open file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)(OE,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(yE),onChange:s=>{s?.value&&(r(),i.reset(),(0,x.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,cs.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)(As.x47,{})})]})]})})})),PE=(wE=(0,at.Pi)((()=>{const e=c_(),t=Ri(),{ref:s,width:i,height:n}=(0,Vs.NB)(),a=C_(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),r=C_(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),o=C_(e.auxPanelDisplayState.isMaximized);return(0,rt.useEffect)((()=>{s.current&&e.auxPanelDisplayState.setMaxSize(s.current.offsetHeight)}),[e,s,n,i]),(0,rt.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,rt.useEffect)((()=>{const s=((e,t=!1)=>t?ie.Z.parseUrl(e).query:ie.Z.parse(e))(window.location.search);(0,x.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,rt.useEffect)((()=>(t.navigationService.navigator.blockNavigation([()=>!0],void 0,(()=>t.notificationService.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigationService.navigator.unblockNavigation()})),[e,t]),Rg(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(Ig,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:s,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(f_,{orientation:"vertical",children:[(0,T.jsx)(x_,{...a.collapsiblePanel,direction:1,children:(0,T.jsx)(Ag,{})}),(0,T.jsx)(S_,{}),(0,T.jsx)(x_,{...a.remainingPanel,minSize:300,children:(0,T.jsxs)(f_,{orientation:"horizontal",children:[(0,T.jsx)(x_,{...o.collapsiblePanel,...0===e.auxPanelDisplayState.size?r.remainingPanel:{},children:(0,T.jsx)(EE,{})}),(0,T.jsx)(S_,{children:(0,T.jsx)(N_,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(x_,{...r.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?o.remainingPanel:{},direction:-1,children:(0,T.jsx)(V_,{})})]})})]})})})]}),(0,T.jsx)(yg,{}),(0,T.jsx)(RE,{})]})})),function(){return(0,T.jsx)(l_,{children:(0,T.jsx)(wE,{})})});var wE;const LE=()=>(0,T.jsx)(Th,{children:(0,T.jsx)(ci,{children:(0,T.jsx)(PE,{})})}),bE=JSON.parse('{"i8":"6.2.45","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class DE extends o{}class ME extends DE{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class FE extends ME{static NAME=bE.Rw.p;constructor(){super(FE.NAME,bE.i8)}getExtraKeyedCommandConfigEntries(){return[Yh,Zh,Kh].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class jE extends it{static create(){const e=new jE(bi.create());return e.withBasePlugins([new FE]),e.withBasePresets([new gh]),e}async configureApplication(e){return new wi(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;S.editor.defineTheme(A.LEGEND,$e),S.editor.addKeybindingRules([{keybinding:S.KeyMod.WinCtrl|S.KeyCode.KeyG,command:null},{keybinding:S.KeyMod.WinCtrl|S.KeyCode.KeyB,command:null},{keybinding:S.KeyMod.WinCtrl|S.KeyCode.KeyO,command:null},{keybinding:S.KeyMod.WinCtrl|S.KeyCode.KeyD,command:null},{keybinding:S.KeyMod.WinCtrl|S.KeyCode.KeyP,command:null},{keybinding:S.KeyCode.F1,command:null},{keybinding:S.KeyCode.F8,command:null},{keybinding:S.KeyCode.F9,command:null},{keybinding:S.KeyMod.CtrlCmd|S.KeyCode.F2,command:null},{keybinding:S.KeyMod.Shift|S.KeyCode.F10,command:null},{keybinding:S.KeyMod.CtrlCmd|S.KeyCode.F12,command:null}]),S.languages.register({id:v.PURE}),S.languages.setLanguageConfiguration(v.PURE,ze),S.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",ke.CLASS,ke.ASSOCIATION,ke.ENUMERATION,ke.MEASURE,ke.PROFILE,ke.FUNCTION,ke.MAPPING,ke.RUNTIME,ke.CONNECTION,ke.FILE_GENERATION,ke.GENERATION_SPECIFICATION,ke.DATA_ELEMENT,Ue.JSON_MODEL_CONNECTION,Ue.MODEL_CHAIN_CONNECTION,Ue.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",ke.SERVICE,ke.FLAT_DATA,ke.DATABASE,Ue.FLAT_DATA_CONNECTION,Ue.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Ge.PURE,Ge.CONNECTION,Ge.RUNTIME,Ge.MAPPING,Ge.SERVICE,Ge.FLATDATA,Ge.RELATIONAL,Ge.GENERATION_SPECIFICATION,Ge.FILE_GENERATION_SPECIFICATION,Ge.DATA].concat(s).map((e=>`${Te}${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":Be.PARSER,"@default":Be.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Be.LANGUAGE_STRUCT,"@keywords":`${Be.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]+\\$)))_":Be.TYPE,"@default":Be.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Be.OPERATOR,"@default":Be.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Be.DELIMITER],[/'([^'\\]|\\.)*$/,`${Be.STRING}.invalid`],[/'/,Be.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Be.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Be.PACKAGE,Be.TYPE,Be.GENERICS,Be.WHITESPACE,Be.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Be.PACKAGE,Be.TYPE,Be.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Be.TYPE}.operator`,Be.WHITESPACE,Be.PACKAGE,Be.TYPE,Be.GENERICS,Be.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Be.DELIMITER,Be.PROPERTY]],[/(@identifier)(\s*=)/,[Be.PROPERTY,Be.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Be.TYPE,Be.OPERATOR,Be.PROPERTY]],[/(@identifier)(\s*:)/,[Be.PARAMETER,Be.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[Be.KEYWORD,Be.WHITESPACE,Be.VARIABLE,Be.OPERATOR]],[/(\$@identifier)/,[`${Be.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${Be.DATE}.latest`]],[/(@date)/,[Be.DATE]],[/(@time)/,[`${Be.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Be.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Be.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Be.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Be.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Be.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Be.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Be.NUMBER}.float`],[/(@digits)[lL]?/,Be.NUMBER]],whitespace:[[/[ \t\r\n]+/,Be.WHITESPACE],[/\/\*\*(?!\/)/,`${Be.COMMENT}.doc`,"@doc"],[/\/\*/,Be.COMMENT,"@comment"],[/\/\/.*$/,Be.COMMENT]],comment:[[/[^/*]+/,Be.COMMENT],[/\*\//,Be.COMMENT,"@pop"],[/[/*]/,Be.COMMENT]],doc:[[/[^/*]+/,`${Be.COMMENT}.doc`],[/\/\*/,`${Be.COMMENT}.doc.invalid`],[/\*\//,`${Be.COMMENT}.doc`,"@pop"],[/[/*]/,`${Be.COMMENT}.doc`]],string:[[/[^\\']+/,Be.STRING],[/@escapes/,`${Be.STRING}.escape`],[/\\./,`${Be.STRING}.escape.invalid`],[/'/,Be.STRING,"@pop"]],characters:[[/'[^\\']'/,Be.STRING],[/(')(@escapes)(')/,[Be.STRING,`${Be.STRING}.escape`,Be.STRING]],[/'/,`${Be.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}`)?(S.editor.remeasureFonts(),t.info(h.create(Ee.LOAD_TEXT_EDITOR_FONT__SUCCESS),`Monospaced font '${N}' has been loaded`)):t.error(h.create(Ee.APPLICATION_SETUP__FAILURE),s)})).catch((()=>t.error(h.create(Ee.APPLICATION_SETUP__FAILURE),s))),(0,x.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)(nt.VK,{basename:this.baseUrl,children:(0,T.jsx)(dt,{children:(0,T.jsx)(yi,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(LE,{})})})}))}}class kE{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){jE.create().setup({baseUrl:e}).withPresets(kE.getPresetCollection()).withPlugins(kE.getPluginCollection()).start().catch((e=>{throw e}))}}kE.run("/ide/")},94174:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fuse=void 0;var n=s(71659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},12889:(e,t,s)=>{t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.Zlt=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.mBM=t.cOE=t.F_y=void 0,t.QqN=t.TIy=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.Hf3=t.veu=t.R0=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=t.XHJ=t.J$M=void 0,t.Two=t.qdB=t.NK0=t.UHp=t.VjU=t.NEI=t.DuK=t.ce8=t.dRK=t.VHe=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.tPC=t.Hrt=t.jtq=t.HXR=t.LyQ=t.ppk=t.B_D=t.UPo=t.eRw=t.HLb=t.w0Y=t.Cti=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.U9q=t.S9M=t.uuU=t.IMP=t.Xj8=t.a2g=t.x47=void 0,t.eid=t.xLV=t.Sd5=void 0;var i=s(18978);Object.defineProperty(t,"F_y",{enumerable:!0,get:function(){return i.FaHistory}}),Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),Object.defineProperty(t,"mBM",{enumerable:!0,get:function(){return i.FaLock}}),Object.defineProperty(t,"q1B",{enumerable:!0,get:function(){return i.FaTimes}}),Object.defineProperty(t,"xDH",{enumerable:!0,get:function(){return i.FaTimesCircle}}),Object.defineProperty(t,"pOD",{enumerable:!0,get:function(){return i.FaPlus}}),Object.defineProperty(t,"IEm",{enumerable:!0,get:function(){return i.FaCog}}),Object.defineProperty(t,"VAA",{enumerable:!0,get:function(){return i.FaCaretDown}}),Object.defineProperty(t,"pgN",{enumerable:!0,get:function(){return i.FaHammer}}),Object.defineProperty(t,"UOT",{enumerable:!0,get:function(){return i.FaQuestion}}),Object.defineProperty(t,"pTE",{enumerable:!0,get:function(){return i.FaQuestionCircle}}),Object.defineProperty(t,"uMt",{enumerable:!0,get:function(){return i.FaInfoCircle}}),Object.defineProperty(t,"jG4",{enumerable:!0,get:function(){return i.FaCompress}}),Object.defineProperty(t,"Zlt",{enumerable:!0,get:function(){return i.FaMap}}),Object.defineProperty(t,"o1U",{enumerable:!0,get:function(){return i.FaPlay}}),Object.defineProperty(t,"bK4",{enumerable:!0,get:function(){return i.FaArrowAltCircleRight}}),Object.defineProperty(t,"oF7",{enumerable:!0,get:function(){return i.FaShapes}}),Object.defineProperty(t,"W1M",{enumerable:!0,get:function(){return i.FaSearch}}),Object.defineProperty(t,"DE2",{enumerable:!0,get:function(){return i.FaList}}),Object.defineProperty(t,"J$M",{enumerable:!0,get:function(){return i.FaCircle}}),Object.defineProperty(t,"XHJ",{enumerable:!0,get:function(){return i.FaTrash}}),Object.defineProperty(t,"rE2",{enumerable:!0,get:function(){return i.FaCheckCircle}}),Object.defineProperty(t,"LPM",{enumerable:!0,get:function(){return i.FaExclamationTriangle}}),Object.defineProperty(t,"nnZ",{enumerable:!0,get:function(){return i.FaBug}}),Object.defineProperty(t,"VRP",{enumerable:!0,get:function(){return i.FaCircleNotch}}),Object.defineProperty(t,"Qq",{enumerable:!0,get:function(){return i.FaExpand}}),Object.defineProperty(t,"R0",{enumerable:!0,get:function(){return i.FaWrench}}),Object.defineProperty(t,"veu",{enumerable:!0,get:function(){return i.FaArrowDown}}),Object.defineProperty(t,"Hf3",{enumerable:!0,get:function(){return i.FaArrowUp}}),Object.defineProperty(t,"FxN",{enumerable:!0,get:function(){return i.FaTerminal}}),Object.defineProperty(t,"ry",{enumerable:!0,get:function(){return i.FaFolderOpen}}),Object.defineProperty(t,"ROc",{enumerable:!0,get:function(){return i.FaFolder}}),Object.defineProperty(t,"$Ow",{enumerable:!0,get:function(){return i.FaExclamationCircle}}),Object.defineProperty(t,"SCS",{enumerable:!0,get:function(){return i.FaBan}}),Object.defineProperty(t,"TIy",{enumerable:!0,get:function(){return i.FaRegCopy}}),Object.defineProperty(t,"QqN",{enumerable:!0,get:function(){return i.FaFileAlt}}),Object.defineProperty(t,"kdY",{enumerable:!0,get:function(){return i.FaMapMarkerAlt}}),Object.defineProperty(t,"Oag",{enumerable:!0,get:function(){return i.FaHatWizard}}),Object.defineProperty(t,"jZm",{enumerable:!0,get:function(){return i.FaRegLaughWink}}),Object.defineProperty(t,"DXi",{enumerable:!0,get:function(){return i.FaRegSadTear}}),Object.defineProperty(t,"VHe",{enumerable:!0,get:function(){return i.FaDatabase}});var n=s(1553);Object.defineProperty(t,"dRK",{enumerable:!0,get:function(){return n.GiBeard}}),Object.defineProperty(t,"ce8",{enumerable:!0,get:function(){return n.GiSunglasses}});var a=s(65186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"NEI",{enumerable:!0,get:function(){return a.MdSubject}}),Object.defineProperty(t,"VjU",{enumerable:!0,get:function(){return a.MdViewHeadline}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(49385);Object.defineProperty(t,"NK0",{enumerable:!0,get:function(){return r.VscWordWrap}}),Object.defineProperty(t,"qdB",{enumerable:!0,get:function(){return r.VscGoToFile}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return r.VscClose}}),Object.defineProperty(t,"x47",{enumerable:!0,get:function(){return r.VscRegex}}),Object.defineProperty(t,"a2g",{enumerable:!0,get:function(){return r.VscCaseSensitive}}),Object.defineProperty(t,"Xj8",{enumerable:!0,get:function(){return r.VscWholeWord}}),Object.defineProperty(t,"IMP",{enumerable:!0,get:function(){return r.VscReferences}}),Object.defineProperty(t,"uuU",{enumerable:!0,get:function(){return r.VscWand}}),Object.defineProperty(t,"S9M",{enumerable:!0,get:function(){return r.VscCollapseAll}}),Object.defineProperty(t,"U9q",{enumerable:!0,get:function(){return r.VscExpandAll}});var o=s(70563);Object.defineProperty(t,"v4q",{enumerable:!0,get:function(){return o.GoChevronDown}}),Object.defineProperty(t,"g8U",{enumerable:!0,get:function(){return o.GoChevronUp}}),Object.defineProperty(t,"XCv",{enumerable:!0,get:function(){return o.GoChevronRight}}),Object.defineProperty(t,"b0D",{enumerable:!0,get:function(){return o.GoX}});s(16636);var l=s(91914);Object.defineProperty(t,"Vzd",{enumerable:!0,get:function(){return l.IoFlaskSharp}});var c=s(8799);Object.defineProperty(t,"POq",{enumerable:!0,get:function(){return c.BsGripVertical}}),Object.defineProperty(t,"Cti",{enumerable:!0,get:function(){return c.BsAlignTop}}),Object.defineProperty(t,"w0Y",{enumerable:!0,get:function(){return c.BsAlignMiddle}}),Object.defineProperty(t,"HLb",{enumerable:!0,get:function(){return c.BsAlignBottom}}),Object.defineProperty(t,"eRw",{enumerable:!0,get:function(){return c.BsAlignStart}}),Object.defineProperty(t,"UPo",{enumerable:!0,get:function(){return c.BsAlignCenter}}),Object.defineProperty(t,"B_D",{enumerable:!0,get:function(){return c.BsAlignEnd}}),Object.defineProperty(t,"ppk",{enumerable:!0,get:function(){return c.BsDistributeHorizontal}}),Object.defineProperty(t,"LyQ",{enumerable:!0,get:function(){return c.BsDistributeVertical}});var d=s(77245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return d.BiAtom}});s(30924);var h=s(34543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return h.FiPackage}}),Object.defineProperty(t,"Hrt",{enumerable:!0,get:function(){return h.FiMousePointer}}),Object.defineProperty(t,"tPC",{enumerable:!0,get:function(){return h.FiMove}}),Object.defineProperty(t,"Sd5",{enumerable:!0,get:function(){return h.FiZoomIn}}),Object.defineProperty(t,"xLV",{enumerable:!0,get:function(){return h.FiZoomOut}});s(75100);var u=s(58920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}});s(52742)},35247:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseComponents=t.createFilter=t.Select=t.CreatableSelect=void 0;var n=s(54319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(31776);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return i(a).default}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return a.createFilter}}),Object.defineProperty(t,"baseComponents",{enumerable:!0,get:function(){return a.components}})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{14:"b63f5ea7",135:"3b62eae4",246:"ff0363bc",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(43002)));l=o.O(l)})();
2
+ //# sourceMappingURL=index.17480da4.js.map