@finos/legend-application-pure-ide-deployment 8.17.0 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e,t,s,i,n,a={7757:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.7","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(1004);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 h{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 d{channel;name;timestamp=Date.now();static create(e){const t=new d;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:_,info:m,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T,C,x=s(2322),O=s(7029),N=s(75),A=s(361);!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(T=T||(T={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql"}(C=C||(C={}));var y=s(5928),S=s(1112);const v=e=>e.constructor,I=()=>()=>{},R=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),w=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),P=(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)},L=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class b 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 D 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 M extends D{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class k extends D{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,y.Z)(i,(e=>void 0!==e)));var i;return(0,S.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function F(e){if(!(e instanceof Error))throw new M("Expected error to be thrown")}const j=e=>{try{return e()}catch{return}};class U extends D{constructor(e,t){super("Assertion Error",e,t)}}const V=e=>null!=e;function G(e,t=""){if(null==e)throw new U(t||"Value is nullable")}const z=(e,t="")=>(G(e,t),e),B=e=>t=>((e,t)=>e instanceof t)(t,e);function $(e,t,s=""){if(!(e instanceof t))throw new U(s||`Value is expected to be of type '${t.name}'`)}const H=(e,t,s="")=>($(e,t,s),e);function Y(e,t=""){if(""===z(e,t))throw new U(t||"Expected string value to be non-empty")}function W(e,t=""){return Y(e,t),e}function K(e,t=""){if(!e)throw new U(t||"Expected predicate to be truthy")}const X=e=>"string"==typeof e,Z=e=>"object"==typeof e&&null!==e;var q=s(9391),J=s(3654),Q=s(4126);s(2659);const ee=q.W,te="charset=utf-8";var se,ie,ne;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(se=se||(se={})),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="*/*"}(ie=ie||(ie={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ne=ne||(ne={}));const ae={mode:"cors",credentials:"include",redirect:"manual"},re=(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 oe extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Z(e))return X(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&X(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const le=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 oe(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===ee.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ie.APPLICATION_JSON:return e.json();case ie.TEXT_PLAIN:return e.text();default:return Promise.reject(new oe(e,`Can't process response for request with Content-Type '${i}'`))}},ce=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>le(e,t,s))):fetch(e,t).then((e=>le(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ie.APPLICATION_JSON,e!==ne.GET&&(s[se.CONTENT_TYPE]=`${ie.APPLICATION_JSON};${te}`),re(s,t)};class de{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...ae,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ne.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ne.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ne.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ne.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&&!j((()=>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(V).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((X(s)||Z(s))&&r?.enableCompression&&(K(e!==ne.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,J.Wt)(Z(e)?JSON.stringify(e):e)]))(s),n=re(n,{[se.CONTENT_TYPE]:`${ie.APPLICATION_ZLIB};${te}`})),void 0!==s)if(X(s)||s instanceof Blob)c=s;else{if(!Z(s))throw new U("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const h={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,h).then((e=>(e=>0===e.status||e.status===ee.UNAUTHORIZED)(e)?ce(l,h,o):le(e,h,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?ce(l,h,o):Promise.reject(e)))}}const ue=(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 pe;!function(e){e.TEXT_EDITOR_FONT_LOADED="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_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(pe=pe||(pe={}));const _e="::",me=["$implicit"];var ge,Ee,fe,Te,Ce;(Ce=ge=ge||(ge={})).CORE="CORE",Ce.MAIN="ROOT",Ce.MODEL_GENERATION="MODEL_GENERATION_ROOT",Ce.SYSTEM="SYSTEM_ROOT",Ce.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Te=Ee=Ee||(Ee={})).STRING="String",Te.BOOLEAN="Boolean",Te.BINARY="Binary",Te.NUMBER="Number",Te.INTEGER="Integer",Te.FLOAT="Float",Te.DECIMAL="Decimal",Te.DATE="Date",Te.STRICTDATE="StrictDate",Te.DATETIME="DateTime",Te.STRICTTIME="StrictTime",Te.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(fe=fe||(fe={}));const xe=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Oe,Ne,Ae,ye,Se,ve,Ie,Re,we,Pe;(Ne=Oe=Oe||(Oe={})).ANY="meta::pure::metamodel::type::Any",Ne.NIL="meta::pure::metamodel::type::Nil",Ne.PROFILE_DOC="meta::pure::profiles::doc",Ne.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ne.PROFILE="meta::pure::metamodel::extension::Profile",Ne.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ne.MEASURE="meta::pure::metamodel::type::Measure",Ne.CLASS="meta::pure::metamodel::type::Class",Ne.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ne.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ne.FLAT_DATA="meta::flatData::metamodel::FlatData",Ne.DATABASE="meta::relational::metamodel::Database",Ne.MAPPING="meta::pure::mapping::Mapping",Ne.SERVICE="meta::legend::service::metamodel::Service",Ne.CONNECTION="meta::pure::runtime::PackageableConnection",Ne.RUNTIME="meta::pure::runtime::PackageableRuntime",Ne.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ne.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ne.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ne.DATA_ELEMENT="meta::pure::data::DataElement",Ne.TDS_ROW="meta::pure::tds::TDSRow",(ve=Ae=Ae||(Ae={})).BUSINESS_TEMPORAL="businesstemporal",ve.PROCESSING_TEMPORAL="processingtemporal",ve.BITEMPORAL="bitemporal",(Se=ye=ye||(ye={})).ALL_VERSIONS="AllVersions",Se.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(Re=Ie=Ie||(Ie={})).STORE="STORE",Re.MAPPING="MAPPING",Re.RUNTIME="RUNTIME",Re.FILE_GENERATION="FILE_GENERATION",Re.SERVICE="SERVICE",(Pe=we=we||(we={})).TODAY="meta::pure::functions::date::today",Pe.NOW="meta::pure::functions::date::now",Pe.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Pe.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Pe.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Pe.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Pe.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Pe.IS_ON_DAY="meta::pure::functions::date::isOnDay",Pe.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Pe.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Pe.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Pe.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Pe.MINUS="meta::pure::functions::math::minus",Pe.ADJUST="meta::pure::functions::date::adjust",Pe.LET="meta::pure::functions::lang::letFunction";const Le="yyyy-MM-dd'T'HH:mm:ssxxxx";var be,De,Me;!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"}(be=be||(be={})),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"}(De=De||(De={})),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"}(Me=Me||(Me={}));const ke=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`,Fe={base:"vs-dark",inherit:!0,colors:{},rules:[{token:"package",foreground:"808080"},{token:"parser-marker",foreground:"c586c0"},{token:"property",foreground:"dcdcaa"},{token:"function",foreground:"dcdcaa"},{token:"language-struct",foreground:"c586c0"},{token:"multiplicity",foreground:"2d796b"},{token:"attribute",foreground:"9cdcfe"},{token:"cast",foreground:"569cd6"}]},je={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:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var Ue=s(9013);class Ve{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Ue.qC)(this.schema,e)}fromJson(e){return(0,Ue.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,y.Z)(t,(e=>null!==e))):e);var t}}const Ge=e=>(0,Ue.PG)((t=>void 0===t?Ue.AM:(0,Ue.qC)(e,t)),(t=>(0,Ue.vB)(e,t))),ze=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Ue.AM:[],Be=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Ue.AM:[]:Ue.AM,$e=e=>(0,Ue.PG)((()=>e),(()=>e));var He=s(0);class Ye{_documentationKey;markdownText;title;text;url;related;static serialization=new Ve((0,Ue.yu)(Ye,{markdownText:(0,Ue.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Ue.jt)((0,Ue.pb)((0,Ue.Ru)())),title:(0,Ue.jt)((0,Ue.Ru)()),text:(0,Ue.jt)((0,Ue.Ru)()),url:(0,Ue.jt)((0,Ue.Ru)())}));static create(e,t){const s=Ye.serialization.fromJson(e);return s._documentationKey=t,s}}const We=e=>Object.entries(e).map((e=>({key:e[0],content:Ye.create(e[1],e[0])})));class Ke{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.log.warn(d.create(pe.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),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,He.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.log.warn(d.create(pe.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.log.warn(d.create(pe.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),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]=Ye.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Xe{}class Ze extends Xe{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 qe{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Ze}setup(e){return this.baseUrl=W(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 de;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){F(e),this.logger.error(d.create(pe.APPLICATION_CONFIGURATION_FAILURE),e)}G(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){F(e),this.logger.error(d.create(pe.APPLICATION_CONFIGURATION_FAILURE),e)}return G(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 de(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(W(e.url,"Can't load documentation registry: 'url' field is missing or empty"));G(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){F(e),this.logger.warn(d.create(pe.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...We(t),...e.keyedDocumentationEntries]}async start(){G(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(d.create(pe.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw F(e),this.logger.error(d.create(pe.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var Je=s(4926),Qe=s(9038),et=s(2784);class tt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,N.rC)(this,{_isNavigationBlocked:N.LO,isNavigationBlocked:N.Fl,blockNavigation:N.aD,unblockNavigation:N.aD}),this.historyAPI=e}get window(){return z(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 st=s(979);const it=(0,et.createContext)(void 0),nt=({children:e})=>{const t=(0,st.k6)(),s=(0,Qe.fv)((()=>new tt(t)));return(0,x.jsx)(it.Provider,{value:s,children:e})};class at{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var rt;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(rt=rt||(rt={}));class ot{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class lt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ot;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 ct,ht,dt,ut=s(4174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(ct||(ct={}));class pt{state;_message;_messageFormatter;constructor(){this.state=ct.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=ct.INITIAL,this}inProgress(){return this.state=ct.IN_PROGRESS,this}fail(){return this.state=ct.FAILED,this}pass(){return this.state=ct.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===ct.INITIAL}get isInProgress(){return this.state===ct.IN_PROGRESS}get hasFailed(){return this.state===ct.FAILED}get hasSucceeded(){return this.state===ct.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,N.rC)(new pt,{state:N.LO,_message:N.LO,reset:N.aD,inProgress:N.aD,pass:N.aD,fail:N.aD,complete:N.aD,setMessage:N.aD,isInInitialState:N.Fl,isInProgress:N.Fl,hasFailed:N.Fl,hasSucceeded:N.Fl,hasCompleted:N.Fl,message:N.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(ht=ht||(ht={}));class _t{currentMode=ht.STANDARD;onSearchModeChange;constructor(e){(0,N.rC)(this,{currentMode:N.LO,isAdvancedSearchActive:N.Fl,setCurrentMode:N.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==ht.STANDARD}generateSearchText(e){switch(this.currentMode){case ht.INCLUDE:return`'"${e}"`;case ht.EXACT:return`="${e}"`;case ht.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(dt=dt||(dt={}));class mt{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,N.rC)(this,{isOpen:N.LO,setIsOpen:N.aD}),this.documentationKey=e._documentationKey,this.title=W(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class gt{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 Et=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class ft{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=dt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=pt.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,N.rC)(this,{isHidden:N.LO,isOpen:N.LO,panelRenderingKey:N.LO,isOverSearchLimit:N.LO,selectedTab:N.LO,searchText:N.LO,searchResults:N.LO,currentDocumentationEntry:N.LO,showSearchConfigurationMenu:N.LO,currentContextualDocumentationEntry:N.Fl,setIsHidden:N.aD,setIsOpen:N.aD,setSelectedTab:N.aD,setSearchText:N.aD,resetSearch:N.aD,search:N.aD,openDocumentationEntry:N.aD,refreshPanelRendering:N.aD,setShowSearchConfigurationMenu:N.aD}),this.applicationStore=e,this.searchEngine=new ut.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Et),{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 _t((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new gt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(V).filter(Et).map((e=>new mt(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 mt(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 mt(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 Tt{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class Ct{static logEvent_ApplicationInitialized(e,t){e.logEvent(pe.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(pe.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(pe.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class xt{applicationStore;contextStack=[];constructor(e){(0,N.rC)(this,{contextStack:N.LO,currentContext:N.Fl,push:N.aD,pop:N.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 M(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&Ct.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 Ot{applicationStore;commandRegistry=new Map;constructor(e){(0,N.rC)(this,{commandRegistry:N.LO,registerCommand:N.aD,deregisterCommand:N.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(d.create(pe.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 Nt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,N.rC)(this,{keyMap:N.LO,commandKeyMap:N.LO,isHotkeysBlocked:N.LO,updateHotkey:N.aD,blockGlobalHotkeys:N.aD,unblockGlobalHotkeys:N.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&w(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(d.create(pe.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===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.commandCenter.runCommand(e))return}}var At,yt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(At=At||(At={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(yt=yt||(yt={}));const St=6e3;var vt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(vt=vt||(vt={}));class It{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Rt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Tt;telemetryService=new at;tracerService=new lt;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,N.rC)(this,{notification:N.LO,blockingAlertInfo:N.LO,actionAlertInfo:N.LO,TEMPORARY__isLightThemeEnabled:N.LO,backdropContainerElementID:N.LO,showBackdrop:N.LO,setBackdropContainerElementID:N.aD,setShowBackdrop:N.aD,setBlockingAlert:N.aD,setActionAlertInfo:N.aD,setNotification:N.aD,notify:N.aD,notifySuccess:N.aD,notifyWarning:N.aD,notifyIllegalState:N.aD,notifyError:N.aD,TEMPORARY__setIsLightThemeEnabled:N.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new xt(this),this.documentationService=new Ke(this),this.assistantService=new ft(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new Ot(this),this.keyboardShortcutsService=new Nt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new It(vt.INFO,e,t??[],null===s?void 0:s??St))}notifySuccess(e,t,s){this.setNotification(new It(vt.SUCCESS,e,t??[],null===s?void 0:s??St))}notifyWarning(e,t,s){this.setNotification(new It(vt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??St))}notifyIllegalState(e,t,s){this.setNotification(new It(vt.ILEGAL_STATE,X(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??St))}notifyError(e,t){let s;e instanceof b?s=e.detail:e instanceof Error?s=e.message:(K(X(e),"Can't display error"),s=e),s&&this.setNotification(new It(vt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return F(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(d.create(pe.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const wt=(0,et.createContext)(void 0),Pt=({children:e,config:t,pluginManager:s})=>{const i=z((0,et.useContext)(it),"Can't find web application navigator in context"),n=(0,Qe.fv)((()=>new Rt(t,i,s)));return(0,x.jsx)(wt.Provider,{value:n,children:e})},Lt=()=>z((0,et.useContext)(wt),"Can't find application store in context");class bt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=W(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=W(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=We(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=z(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=z(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=z(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Dt extends bt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),G(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=W(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 Mt extends h{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 kt extends Mt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new kt}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 Ft=JSON.parse('{"i8":"7.1.8","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 jt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Ut=e=>t=>(0,N.bi)(t)?t:e(t),Vt=e=>(t,s)=>(0,N.bi)(t)?t:e(t,s),Gt=e=>{(0,N.rC)(e,{_isDeleted:N.LO,_isDisposed:N.LO,name:N.LO,package:N.LO,isDeleted:N.Fl,path:N.Fl,_elementHashCode:N.Fl,hashCode:N.Fl,setIsDeleted:N.aD,dispose:N.aD})},zt=Ut((e=>(0,N.rC)(e,{value:N.LO,valueForSerialization:N.Fl})));var Bt=s(4485),$t=s(3096);const Ht=e=>Bt.sha1().update(e).digest("hex"),Yt=e=>Ht(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Ht(e):e.hashCode)).join(","));var Wt,Kt;(Kt=Wt=Wt||(Wt={})).PACKAGE="PACKAGE",Kt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Kt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Kt.PROFILE="PROFILE",Kt.TAG_POINTER="TAG_POINTER",Kt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Kt.TAGGED_VALUE="TAGGED_VALUE",Kt.ENUMERATION="ENUMERATION",Kt.ENUM_VALUE="ENUM_VALUE",Kt.CLASS="CLASS",Kt.PROPERTY="PROPERTY",Kt.PROPERTY_POINTER="PROPERTY_POINTER",Kt.MULTIPLICITY="MULTIPLICITY",Kt.CONSTRAINT="CONSTRAINT",Kt.DERIVED_PROPERTY="DERIVED_PROPERTY",Kt.ASSOCIATION="ASSOCIATION",Kt.FUNCTION="FUNCTION",Kt.MEASURE="MEASURE",Kt.UNIT="UNIT",Kt.RUNTIME="RUNTIME",Kt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Kt.ENGINE_RUNTIME="ENGINE_RUNTIME",Kt.LEGACY_RUNTIME="LEGACY_RUNTIME",Kt.RUNTIME_POINTER="RUNTIME_POINTER",Kt.STORE_CONNECTIONS="STORE_CONNECTIONS",Kt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Kt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Kt.CONNECTION_POINTER="CONNECTION_POINTER",Kt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Kt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Kt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Kt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Kt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Kt.FLAT_DATA="FLAT_DATA",Kt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Kt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Kt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Kt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Kt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Kt.FLAT_DATA_STRING="FLAT_DATA_STRING",Kt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Kt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Kt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Kt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Kt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Kt.FLAT_DATA_DATE="FLAT_DATA_DATE",Kt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Kt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Kt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Kt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Kt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Kt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Kt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Kt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Kt.DATABASE="DATABASE",Kt.DATABASE_SCHEMA="DATABASE_SCHEMA",Kt.DATABASE_JOIN="DATABASE_JOIN",Kt.DATABASE_FILTER="DATABASE_FILTER",Kt.DATBASE_VIEW="DATBASE_VIEW",Kt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Kt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Kt.RELATIONAL="RELATIONAL",Kt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Kt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Kt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Kt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Kt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Kt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Kt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Kt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Kt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Kt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Kt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Kt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Kt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Kt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Kt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Kt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Kt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Kt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Kt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Kt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Kt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Kt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Kt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Kt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Kt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Kt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Kt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Kt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Kt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Kt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Kt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Kt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Kt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Kt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Kt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Kt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Kt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Kt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Kt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Kt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Kt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Kt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Kt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Kt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Kt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Kt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Kt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Kt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Kt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Kt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Kt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Kt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Kt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Kt.SCHEMA_MAPPER="SCHEMA_MAPPER",Kt.TABLE_MAPPER="TABLE_MAPPER",Kt.MAPPING="MAPPING",Kt.MAPPING_INCLUDE="MAPPING_INCLUDE",Kt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Kt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Kt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Kt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Kt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Kt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Kt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Kt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Kt.PROPERTY_MAPPING="PROPERTY_MAPPING",Kt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Kt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Kt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Kt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Kt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Kt.MAPPING_TEST="MAPPING_TEST",Kt.STORE_TEST_DATA="STORE_TEST_DATA",Kt.INPUT_DATA="INPUT_DATA",Kt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Kt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Kt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Kt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Kt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Kt.FILTER_MAPPING="FILTER_MAPPING",Kt.COLUMN_MAPPING="COLUMN_MAPPING",Kt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Kt.SERVICE="SERVICE",Kt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Kt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Kt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Kt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Kt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Kt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Kt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Kt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Kt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Kt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Kt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Kt.SERVICE_TEST="SERVICE_TEST",Kt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Kt.GENERATION_TREE="GENERATION_TREE",Kt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Kt.FILE_GENERATION="FILE_GENERATION",Kt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Kt.SECTION_INDEX="SECTION_INDEX",Kt.SECTION="SECTION",Kt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Kt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Kt.RAW_LAMBDA="RAW_LAMBDA",Kt.RAW_VARIABLE="RAW_VARIABLE",Kt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Kt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Kt.ASSERT_FAIL="ASSERT_FAIL",Kt.ASSERT_PASS="ASSERT_PASS",Kt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Kt.EQUAL_TO="EQUAL_TO",Kt.EQUAL_TO_JSON="EQUAL_TO_JSON",Kt.EQUAL_TO_TDS="EQUAL_TO_TDS",Kt.TEST_RESULT="TEST_RESULT",Kt.TEST_ERROR="TEST_ERROR",Kt.TEST_FAILED="TEST_FAILED",Kt.TEST_PASSED="TEST_PASSED",Kt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Kt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Kt.MODEL_STORE_DATA="MODEL_STORE_DATA",Kt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Kt.DATA_ELEMENT="DATA_ELEMENT",Kt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Kt.RELATIONAL_TDS="RELATIONAL_TDS",Kt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Kt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Kt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Kt.EXPRESSION="EXPRESSION",Kt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Kt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Kt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Kt.INSTANCE_VALUE="INSTANCE_VALUE",Kt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Kt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Kt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Kt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Kt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Kt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Kt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Kt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Kt.FUNCTION_TYPE="FUNCTION_TYPE",Kt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Kt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Kt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Kt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Kt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Kt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Kt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Kt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Xt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},K(Z(t=e),"Can't hash non-object value"),$t(t,s);var t,s},Zt=(e,t)=>Yt([e?Xt(e):"",t?Xt(t):""]),qt=(e,t)=>[Wt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Ht).join(",");class Jt{stereotypes=[];taggedValues=[]}class Qt extends Jt{name}class es extends Qt{_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}::${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new M(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ts extends es{}class ss extends ts{_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 Yt([Wt.CLASS,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Yt(this.constraints),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class is extends ts{}class ns extends is{values=[];get _elementHashCode(){return Yt([Wt.ENUMERATION,this.path,Yt(this.values),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class as extends is{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Yt([Wt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new k}}class rs extends ts{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Yt([Wt.MEASURE,this.path,this.canonicalUnit??"",Yt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class os extends es{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class ls{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Yt([Wt.SECTION,this.parserName,Yt(this.elements.map((e=>e.valueForSerialization??"")))])}}class cs extends ls{imports=[];get hashCode(){return Yt([Wt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Yt(this.imports.map((e=>e.valueForSerialization??"")))])}}class hs extends ls{get hashCode(){return Yt([Wt.DEFAULT_CODE_SECTION,super.hashCode])}}class ds{_UUID=(0,a.Z)()}class us extends ds{ownerReference;constructor(e){super(),this.ownerReference=e}}class ps extends ds{value;constructor(e){super(),this.value=e}}class _s extends ps{constructor(e){super(e)}static create(e){return new _s(e)}get valueForSerialization(){return this.value.path}}const ms=Ut((e=>(0,N.rC)(e,{name:N.LO,value:N.LO.ref,hashCode:N.Fl}))),gs=Ut((e=>(Gt(e),(0,N.rC)(e,{type:N.LO,generationOutputPath:N.LO,scopeElements:N.LO,configurationProperties:N.LO,_elementHashCode:N.KG}),e.scopeElements.forEach((e=>{e instanceof ps&&zt(e)})),e.configurationProperties.forEach(ms),e))),Es=Ut((e=>((0,N.rC)(e,{id:N.LO,hashCode:N.Fl}),zt(e.generationElement),e))),fs=Ut((e=>(Gt(e),(0,N.rC)(e,{generationNodes:N.LO,fileGenerations:N.LO,_elementHashCode:N.KG}),e.generationNodes.forEach(Es),e.fileGenerations.forEach(zt),e)));var Ts=s(7295),Cs=s(2531);const xs=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Os=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],Ns=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Ts.P)(e,void 0,s);return G(i,"Can't stringify lossless JSON value"),i})((0,Cs.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class As{}class ys extends As{expectedOutput;constructor(e){super(),this.expectedOutput=Ns(e)}get hashCode(){return Yt([Wt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Ss{}class vs extends Ss{mappings=[];connections=[];get hashCode(){return Yt([Wt.ENGINE_RUNTIME,Yt(this.mappings.map((e=>qt(Ie.MAPPING,e.valueForSerialization??"")))),Yt(this.connections.filter((e=>e.storeConnections.length)))])}}class Is extends Ss{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Yt([Wt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Rs{}class ws extends Rs{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Yt([Wt.FLAT_DATA_INPUT_DATA,qt(Ie.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ps,Ls,bs;(bs=Ps=Ps||(Ps={})).JSON="JSON",bs.XML="XML";class Ds extends Rs{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ps.JSON?Ns(s):s}get hashCode(){return Yt([Wt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Ls=Ls||(Ls={}));class Ms extends Rs{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Yt([Wt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const ks=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),zt(e.type),e))),Fs=Ut((e=>(0,N.rC)(e,{body:N.LO.ref,parameters:N.LO.ref,hashCode:N.Fl}))),js=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,hashCode:N.Fl}),zt(e.type),e)));class Us{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Fs(e)}visit_RawVariableExpression(e){js(e)}visit_RawPrimitiveInstanceValue(e){ks(e)}}Vt(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Us(t)),e)));class Vs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Gs extends Vs{trueString;falseString;get hashCode(){return Yt([Wt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class zs extends Vs{get hashCode(){return Yt([Wt.FLAT_DATA_STRING])}}class Bs extends Vs{get hashCode(){return Yt([Wt.FLAT_DATA_NUMBER])}}class $s extends Vs{dateFormat;timeZone;get hashCode(){return Yt([Wt.FLAT_DATA_DATE,this.dateFormat?Yt(this.dateFormat):"",this.timeZone??""])}}class Hs extends Vs{fields=[];get hashCode(){return Yt([Wt.FLAT_DATA_RECORD_TYPE,Yt(this.fields)])}}const Ys=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{flatData:N.LO,sectionName:N.LO,hashCode:N.Fl}),e))),Ws=Ut((e=>((0,N.rC)(e,{label:N.LO,flatDataDataType:N.LO,optional:N.LO,address:N.LO,hashCode:N.Fl}),(e=>{e instanceof Gs?(0,N.rC)(e,{trueString:N.LO,falseString:N.LO,hashCode:N.Fl}):e instanceof zs||e instanceof Bs?(0,N.rC)(e,{hashCode:N.Fl}):e instanceof $s?(0,N.rC)(e,{dateFormat:N.LO,timeZone:N.LO,hashCode:N.Fl}):e instanceof Hs&&Ut(Ks)(e)})(e.flatDataDataType),e)));function Ks(e){return(0,N.rC)(e,{fields:N.LO,hashCode:N.Fl}),e.fields.forEach(Ws),e}Ut(Ks);const Xs=Ut(Ks),Zs=Ut((e=>((0,N.rC)(e,{name:N.LO,value:N.LO,hashCode:N.Fl}),e))),qs=Ut((e=>((0,N.rC)(e,{driverId:N.LO,name:N.LO,sectionProperties:N.LO,recordType:N.LO,hashCode:N.Fl}),e.sectionProperties.forEach(Zs),e.recordType&&Xs(e.recordType),e))),Js=(Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),Ut((e=>(Gt(e),(0,N.rC)(e,{sections:N.LO,_elementHashCode:N.KG}),e.sections.forEach(qs),e)))),Qs=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),ei=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{filter:N.LO,hashCode:N.Fl}),Qs(e.sourceRootRecordType),e.filter&&Fs(e.filter),e))),ti=Vt(((e,t)=>(Cr(e,t),Ir(e,t),(0,N.rC)(e,{rootInstanceSetImplementation:N.LO,hashCode:N.Fl}),e))),si=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,transform:N.LO,hashCode:N.Fl}),Fs(e.transform),e))),ii=Ut((e=>((0,N.rC)(e,{data:N.LO,hashCode:N.Fl}),zt(e.sourceFlatData),e))),ni=Ut((e=>((0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),e)));class ai{}class ri extends ai{serverPrincipal;get hashCode(){return Yt([Wt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class oi extends ai{get hashCode(){return Yt([Wt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class li extends ai{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Yt([Wt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class ci extends ai{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Yt([Wt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class hi extends ai{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Yt([Wt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class di extends ai{get hashCode(){return Yt([Wt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class ui extends ai{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Yt([Wt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Yt(this.additionalGcpScopes)])}}class pi extends ai{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Yt([Wt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class _i extends ai{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Yt([Wt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class mi{}class gi extends mi{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Yt([Wt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ei extends mi{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 Yt([Wt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class fi extends mi{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Yt([Wt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Ti extends mi{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Yt([Wt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Yt(this.testDataSetupSqls)])}}class Ci extends mi{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 Yt([Wt.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 xi extends mi{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 Yt([Wt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Oi extends mi{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Yt([Wt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class Ni{_UUID=(0,a.Z)()}class Ai extends Ni{mappers=[];get hashCode(){return Yt([Wt.MAPPER_POST_PROCESSOR,Yt(this.mappers)])}}const yi="{target}",Si="default";class vi{}class Ii extends vi{}class Ri extends Ii{}class wi extends Ri{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Yt(this.parameters)])}}var Pi;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Pi=Pi||(Pi={}));const Li=e=>[e].concat(e.children.length?Li(e.children[0]):[]);class bi extends vi{relationalOperationElement;joinTreeNode;get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Yt(this.joinTreeNode?Li(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Di extends vi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new k}}class Mi extends vi{alias;column;columnName;get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?yi:this.alias.name,this.column.value.name])}}class ki extends vi{value;constructor(e){super(),this.value=e}get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Fi extends vi{values=[];get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_LITERAL_LIST,Yt(this.values)])}}class ji extends vi{owner;name;type;nullable;get hashCode(){return Yt([Wt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Ui{}class Vi extends Ui{infinityDate}class Gi{}class zi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BIGINT])}}class Bi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_SMALLINT])}}class $i extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_TINYINT])}}class Hi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_INTEGER])}}class Yi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_FLOAT])}}class Wi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_DOUBLE])}}class Ki extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Xi extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Zi extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class qi extends Gi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Ji extends Gi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Qi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_TIMESTAMP])}}class en extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARCHAR])}}class tn extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BIT])}}class sn extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class nn extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_REAL])}}class an extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class rn extends us{ownerReference;constructor(e){super(e),this.ownerReference=e}}class on extends rn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Ht).join(",")}get selfJoinPointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Si,yi].map(Ht).join(",")}}class ln extends rn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Ht).join(",")}get selfJoinPointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Si,yi].map(Ht).join(",")}}class cn{}class hn extends cn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Yt([this.from,this.to])}}class dn extends hn{get hashCode(){return Yt([super.hashCode,Wt.SCHEMA_MAPPER])}}class un extends hn{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Yt([super.hashCode,Wt.TABLE_MAPPER,this.schema])}}const pn=Ut((e=>((0,N.rC)(e,{packageableElementIncludes:N.LO,packageableElementExcludes:N.LO,hashCode:N.Fl}),e.packageableElementIncludes.forEach(zt),e.packageableElementExcludes.forEach(zt),e))),_n=(Ut((e=>(pr(e),(0,N.rC)(e,{schemaSet:N.LO,schemaId:N.LO,contentType:N.LO,modelUnit:N.LO,_elementHashCode:N.KG}),e.schemaSet&&zt(e.schemaSet),pn(e.modelUnit),e))),Ut((e=>((0,N.rC)(e,{binding:N.LO,hashCode:N.Fl}),zt(e.binding),e)))),mn=Ut((e=>((0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),e))),gn=(Ut((e=>(Yr(e),(0,N.rC)(e,{externalSource:N.LO,hashCode:N.Fl}),mn(e.externalSource),e))),Ut((e=>(0,N.rC)(e,{id:N.LO,location:N.LO,content:N.LO,hashCode:N.Fl})))),En=(Ut((e=>(Gt(e),(0,N.rC)(e,{format:N.LO,schemas:N.LO,_elementHashCode:N.KG}),e.schemas.forEach(gn),e))),Ut((e=>e instanceof zi||e instanceof Bi||e instanceof $i||e instanceof Hi||e instanceof Yi||e instanceof Wi||e instanceof Qi||e instanceof Date||e instanceof en||e instanceof tn||e instanceof nn||e instanceof an?(0,N.rC)(e,{hashCode:N.Fl}):e instanceof Ki||e instanceof Xi||e instanceof Zi||e instanceof sn?(0,N.rC)(e,{size:N.LO,hashCode:N.Fl}):e instanceof qi||e instanceof Ji?(0,N.rC)(e,{precision:N.LO,scale:N.LO,hashCode:N.Fl}):e))),fn=Ut((e=>((0,N.rC)(e,{name:N.LO,type:N.LO,nullable:N.LO,hashCode:N.Fl}),En(e.type),e))),Tn=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl,selfJoinPointerHashCode:N.Fl}),zt(e.ownerReference),e))),Cn=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl,selfJoinPointerHashCode:N.Fl}),zt(e.ownerReference),e))),xn=Ut((e=>((0,N.rC)(e,{relation:N.LO,name:N.LO,database:N.LO,isSelfJoinTarget:N.LO}),(e=>{e instanceof ln?Cn(e):e instanceof on&&Tn(e)})(e.relation),e))),On=Ut((e=>((0,N.rC)(e,{name:N.LO,parameters:N.LO,hashCode:N.Fl}),e.parameters.forEach(wn),e))),Nn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),An=Ut((e=>((0,N.rC)(e,{alias:N.LO,column:N.LO,columnName:N.LO,hashCode:N.Fl}),xn(e.alias),Nn(e.column),e))),yn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Sn=Ut((e=>((0,N.rC)(e,{alias:N.LO,children:N.LO,joinType:N.LO,hashCode:N.Fl}),e.alias&&xn(e.alias),e.children.forEach(Sn),yn(e.join),e))),vn=Ut((e=>((0,N.rC)(e,{relationalOperationElement:N.LO,joinTreeNode:N.LO,hashCode:N.Fl}),e.relationalOperationElement&&wn(e.relationalOperationElement),e.joinTreeNode&&Sn(e.joinTreeNode),e))),In=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),e.value instanceof vi&&wn(e.value),e))),Rn=Ut((e=>((0,N.rC)(e,{values:N.LO,hashCode:N.Fl}),e.values.forEach(In),e)));function wn(e){return e instanceof wi?On(e):e instanceof Di?xn(e):e instanceof Mi?An(e):e instanceof ji?fn(e):e instanceof ki?In(e):e instanceof Fi?Rn(e):e instanceof bi?vn(e):e}const Pn=Ut((e=>e)),Ln=Vt(((e,t)=>{if(e instanceof Vi)return Pn(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})),bn=Ut((e=>((0,N.rC)(e,{columnName:N.LO,relationalOperationElement:N.LO,hashCode:N.Fl}),wn(e.relationalOperationElement),e))),Dn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Mn=Ut((e=>((0,N.rC)(e,{joinTreeNode:N.LO,database:N.LO,filterName:N.LO,hashCode:N.Fl}),e.joinTreeNode&&Sn(e.joinTreeNode),Dn(e.filter),e))),kn=Ut((e=>((0,N.rC)(e,{columns:N.LO}),e.columns.forEach(wn),e))),Fn=e=>{(0,N.rC)(e,{columns:N.LO,name:N.LO})},jn=Vt(((e,t)=>(Fn(e),(0,N.rC)(e,{primaryKey:N.LO,hashCode:N.Fl}),e.primaryKey.forEach(fn),e.milestoning.forEach((e=>Ln(e,t))),e))),Un=Vt(((e,t)=>(Fn(e),(0,N.rC)(e,{primaryKey:N.LO,columnMappings:N.LO,filter:N.LO,distinct:N.LO,groupBy:N.LO,hashCode:N.Fl}),e.primaryKey.forEach(fn),e.columnMappings.forEach(bn),e.filter&&Mn(e.filter),e.groupBy&&kn(e.groupBy),e))),Vn=Vt(((e,t)=>((0,N.rC)(e,{name:N.LO,tables:N.LO,views:N.LO,hashCode:N.Fl}),e.tables.forEach((e=>jn(e,t))),e.views.forEach((e=>Un(e,t))),e))),Gn=Ut((e=>((0,N.rC)(e,{name:N.LO,operation:N.LO,hashCode:N.Fl}),wn(e.operation),e))),zn=Ut((e=>((0,N.rC)(e,{name:N.LO,target:N.LO,aliases:N.LO,operation:N.LO,hashCode:N.Fl}),e.target&&xn(e.target),wn(e.operation),e))),Bn=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{schemas:N.LO,joins:N.LO,filters:N.LO,_elementHashCode:N.KG}),e.schemas.forEach((e=>Vn(e,t))),e.joins.forEach(zn),e.filters.forEach(Gn),e))),$n=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,relationalOperation:N.LO.ref,bindingTransformer:N.LO,hashCode:N.Fl}),e.bindingTransformer&&_n(e.bindingTransformer),e))),Hn=(e,t)=>(Ir(e,t),Cr(e,t),(0,N.rC)(e,{id:N.LO,rootInstanceSetImplementation:N.LO,primaryKey:N.LO}),e.primaryKey.forEach(wn),e),Yn=Vt(Hn),Wn=Vt(((e,t)=>(Hn(e,t),(0,N.rC)(e,{inlineSetImplementation:N.LO}),Mr(e.inlineSetImplementation,t),e))),Kn=Vt(((e,t)=>(Hn(e,t),(0,N.rC)(e,{otherwisePropertyMapping:N.LO,hashCode:N.Fl}),Nr(e.otherwisePropertyMapping,t),e))),Xn=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{primaryKey:N.LO}),e.primaryKey.forEach(wn),e))),Zn=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{columnMappings:N.LO,filter:N.LO,distinct:N.LO,groupBy:N.LO,mainTableAlias:N.LO,superSetImplementationId:N.LO,hashCode:N.Fl}),e.columnMappings.forEach(bn),e.filter&&Mn(e.filter),e.groupBy&&kn(e.groupBy),e.mainTableAlias&&xn(e.mainTableAlias),e))),qn=Ut((e=>((0,N.rC)(e,{data:N.LO,inputType:N.LO,hashCode:N.Fl}),zt(e.database),e))),Jn=Ut((e=>(0,N.rC)(e,{host:N.LO,port:N.LO,databaseName:N.LO,hashCode:N.Fl}))),Qn=Ut((e=>(0,N.rC)(e,{hostname:N.LO,port:N.LO,protocol:N.LO,httpPath:N.LO,hashCode:N.Fl}))),ea=Ut((e=>(0,N.rC)(e,{databaseName:N.LO,directory:N.LO,autoServerMode:N.LO,hashCode:N.Fl}))),ta=Ut((e=>(0,N.rC)(e,{testDataSetupCsv:N.LO,testDataSetupSqls:N.LO,hashCode:N.Fl}))),sa=Ut((e=>(0,N.rC)(e,{accountName:N.LO,region:N.LO,warehouseName:N.LO,databaseName:N.LO,cloudType:N.LO,quotedIdentifiersIgnoreCase:N.LO,proxyHost:N.LO,proxyPort:N.LO,nonProxyHosts:N.LO,organization:N.LO,accountType:N.LO,role:N.LO,hashCode:N.Fl}))),ia=Ut((e=>(0,N.rC)(e,{databaseName:N.LO,endpointURL:N.LO,port:N.LO,region:N.LO,clusterID:N.LO,host:N.LO,hashCode:N.Fl}))),na=Ut((e=>(0,N.rC)(e,{projectId:N.LO,defaultDataset:N.LO,proxyHost:N.LO,proxyPort:N.LO,hashCode:N.Fl}))),aa=Ut((e=>(0,N.rC)(e,{serverPrincipal:N.LO,hashCode:N.Fl}))),ra=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl}))),oa=Ut((e=>(0,N.rC)(e,{apiToken:N.LO,hashCode:N.Fl}))),la=Ut((e=>(0,N.rC)(e,{oauthKey:N.LO,scopeName:N.LO,hashCode:N.Fl}))),ca=Ut((e=>(0,N.rC)(e,{privateKeyVaultReference:N.LO,passPhraseVaultReference:N.LO,publicUserName:N.LO,hashCode:N.Fl}))),ha=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl}))),da=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,userNameVaultReference:N.LO,passwordVaultReference:N.LO,baseVaultReference:N.LO}))),ua=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,serviceAccountEmail:N.LO,additionalGcpScopes:N.LO}))),pa=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,vaultReference:N.LO}))),_a=e=>{(0,N.rC)(e,{from:N.LO,to:N.LO,hashCode:N.Fl})},ma=Ut((e=>(_a(e),e))),ga=Ut((e=>(_a(e),(0,N.rC)(e,{schema:N.LO}),ma(e.schema),e))),Ea=Vt(((e,t)=>((e=>{Yr(e),(0,N.rC)(e,{type:N.LO,timeZone:N.LO,quoteIdentifiers:N.LO})})(e),(0,N.rC)(e,{datasourceSpecification:N.LO,authenticationStrategy:N.LO,postProcessors:N.LO,hashCode:N.Fl}),((e,t)=>{if(e instanceof gi)return Jn(e);if(e instanceof Ei)return Qn(e);if(e instanceof fi)return ea(e);if(e instanceof Ti)return ta(e);if(e instanceof Ci)return sa(e);if(e instanceof xi)return ia(e);if(e instanceof Oi)return na(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 ri)return aa(e);if(e instanceof oi)return ra(e);if(e instanceof li)return oa(e);if(e instanceof ci)return la(e);if(e instanceof hi)return ca(e);if(e instanceof di)return ha(e);if(e instanceof pi)return da(e);if(e instanceof ui)return ua(e);if(e instanceof _i)return pa(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 Ai)return(e=>((e=>{(0,N.rC)(e,{hashCode:N.Fl})})(e),(0,N.rC)(e,{mappers:N.LO}),e.mappers.forEach((e=>{(e=>{e instanceof dn?ma(e):e instanceof un&&ga(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 fa{id}class Ta extends fa{__parent;assertions=[]}class Ca extends fa{__parent;tests=[]}class xa extends Ta{serializationFormat;parameters=[];keys=[];get hashCode(){return Yt([Wt.SERVICE_TEST,this.id,Yt(this.assertions),Yt(this.parameters),Yt(this.keys),this.serializationFormat??""])}}class Oa extends Ta{query;get hashCode(){return Yt([Wt.MAPPING_TEST,this.query,this.id,Yt(this.assertions)])}}class Na extends Ca{storeTestDatas=[];get hashCode(){return Yt([Wt.MAPPING_TEST_SUITE,Yt(this.storeTestDatas),this.id,Yt(this.tests)])}}class Aa extends Ca{testData;get hashCode(){return Yt([Wt.SERVICE_TEST_SUITE,this.id,Yt(this.tests),this.testData])}}class ya{id;parentTest}class Sa extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO,this.id,Xt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class va extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class Ia extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Ra{}class wa extends Ra{dataElement;get hashCode(){return Yt([Wt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Pa extends Ra{contentType;data;get hashCode(){return Yt([Wt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class La extends Ra{instances;get hashCode(){return Yt([Wt.MODEL_STORE_DATA,Yt(Array.from(this.instances.keys()).map((e=>e.path))),Xt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ba extends Ra{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Yt([Wt.RELATIONAL_CSV_DATA_TABLE,Yt(this.tables)])}}const Da=Ut((e=>((0,N.rC)(e,{contentType:N.LO,data:N.LO,hashCode:N.Fl}),e))),Ma=Ut((e=>((0,N.rC)(e,{dataElement:N.LO,hashCode:N.Fl}),e))),ka=Ut((e=>((0,N.rC)(e,{instances:N.LO,hashCode:N.Fl}),e))),Fa=Ut((e=>((0,N.rC)(e,{values:N.LO,table:N.LO,schema:N.LO,hashCode:N.Fl}),e))),ja=Ut((e=>((0,N.rC)(e,{tables:N.LO,hashCode:N.Fl}),e.tables.forEach(Fa),e)));function Ua(e,t){if(e instanceof wa)return Ma(e);if(e instanceof Pa)return Da(e);if(e instanceof La)return ka(e);if(e instanceof ba)return ja(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 Va=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{stereotypes:N.LO,taggedValues:N.LO,data:N.LO,_elementHashCode:N.KG}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),Ua(e.data,t),e)));class Ga{}class za extends Ga{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Yt([Wt.SERVICE_PURE_EXECUTION,this.func])}}class Ba extends za{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Yt([Wt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping.valueForSerialization??"",this.runtime])}}class $a extends za{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Yt([Wt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Yt(this.executionParameters)])}}class Ha{_OWNER;constructor(e){this._OWNER=e}}class Ya extends Ha{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Yt([Wt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Yt(this.asserts)])}}class Wa extends Ha{tests=[];get hashCode(){return Yt([Wt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Yt(this.tests)])}}const Ka=Vt(((e,t)=>((0,N.rC)(e,{connectionId:N.LO,testData:N.LO,hashCode:N.Fl}),Ua(e.testData,t),e))),Xa=Ut((e=>((0,N.rC)(e,{name:N.LO,value:N.LO.ref,hashCode:N.Fl}),e))),Za=Vt(((e,t)=>((0,N.rC)(e,{connectionsTestData:N.LO,hashCode:N.Fl}),e.connectionsTestData.forEach((e=>Ka(e,t))),e))),qa=Ut((e=>((0,N.rC)(e,{id:N.LO,serializationFormat:N.LO,assertions:N.LO,parameters:N.LO,keys:N.LO,hashCode:N.Fl}),e.parameters.forEach(Xa),e.assertions.forEach(ur),e))),Ja=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,tests:N.LO,testData:N.LO,hashCode:N.Fl}),e.tests.forEach((e=>dr(e,t))),Za(e.testData,t),e))),Qa=Ut((e=>((0,N.rC)(e,{parametersValues:N.LO,assert:N.LO,singleExecutionTestParent:N.LO,hashCode:N.Fl}),Fs(e.assert),e))),er=Ut((e=>((0,N.rC)(e,{data:N.LO,asserts:N.LO,hashCode:N.Fl}),e.asserts.forEach(Qa),e))),tr=Ut((e=>(er(e),(0,N.rC)(e,{key:N.LO}),e))),sr=Ut((e=>((0,N.rC)(e,{tests:N.LO,hashCode:N.Fl}),e.tests.forEach(tr),e))),ir=e=>{(0,N.rC)(e,{func:N.LO}),Fs(e.func)},nr=Vt(((e,t)=>(ir(e),(0,N.rC)(e,{runtime:N.LO,hashCode:N.Fl}),zt(e.mapping),no(e.runtime,t),e))),ar=Vt(((e,t)=>((0,N.rC)(e,{key:N.LO,runtime:N.LO,hashCode:N.Fl}),zt(e.mapping),no(e.runtime,t),e))),rr=Vt(((e,t)=>(ir(e),(0,N.rC)(e,{executionKey:N.LO,executionParameters:N.LO,hashCode:N.Fl}),e.executionParameters.forEach((e=>ar(e,t))),e))),or=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{pattern:N.LO,owners:N.LO,documentation:N.LO,autoActivateUpdates:N.LO,execution:N.LO,test:N.LO,tests:N.LO,patternParameters:N.Fl,_elementHashCode:N.KG}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),((e,t)=>{e instanceof Ba?nr(e,t):e instanceof $a&&rr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Ya?er(e):e instanceof Wa&&sr(e)})(e.test),e.tests.forEach((e=>Ja(e,t))),e))),lr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),e))),cr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),Da(e.expected),e))),hr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),Da(e.expected),e)));function dr(e,t){if(e instanceof xa)return qa(e);if(e instanceof Oa)return mr(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 ur(e){return e instanceof Sa?lr(e):e instanceof va?hr(e):e instanceof Ia?cr(e):e}const pr=e=>{Gt(e),(0,N.rC)(e,{includes:N.LO}),e.includes.forEach(zt)},_r=Vt(((e,t)=>((0,N.rC)(e,{store:N.LO,data:N.LO,hashCode:N.Fl}),Ua(e.data,t),e))),mr=Ut((e=>((0,N.rC)(e,{id:N.LO,query:N.LO,assertions:N.LO,hashCode:N.Fl}),e.assertions.forEach(ur),e))),gr=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,tests:N.LO,storeTestDatas:N.LO,hashCode:N.Fl}),e.tests.forEach((e=>dr(e,t))),e.storeTestDatas.forEach((e=>_r(e,t))),e))),Er=Ut((e=>((0,N.rC)(e,{value:N.LO,valueForSerialization:N.Fl}),zt(e.ownerReference),e))),fr=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Tr=Ut((e=>((0,N.rC)(e,{localMappingProperty:N.LO,localMappingPropertyType:N.LO,localMappingPropertyMultiplicity:N.LO,hashCode:N.Fl}),zt(e.localMappingPropertyType),e))),Cr=(e,t)=>{(0,N.rC)(e,{sourceSetImplementation:N.LO,targetSetImplementation:N.LO}),vo(e.property),fr(e.sourceSetImplementation),e.targetSetImplementation&&fr(e.targetSetImplementation),e.localMappingProperty&&Tr(e.localMappingProperty)},xr=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,transform:N.LO,explodeProperty:N.LO,hashCode:N.Fl}),e.transformer&&Er(e.transformer),Fs(e.transform),e)));class Or{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){xr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){si(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ti(e,this.observerContext)}visit_RelationalPropertyMapping(e){$n(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Ys(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Yn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Wn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Kn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Nr=(e,t)=>(e.accept_PropertyMappingVisitor(new Or(t)),e),Ar=Ut((e=>(0,N.rC)(e,{isDefault:N.Fl,valueForSerialization:N.Fl}))),yr=Ut((e=>(0,N.rC)(e,{valueForSerialization:N.Fl}))),Sr=e=>{(0,N.rC)(e,{root:N.LO}),zt(e.class),Ar(e.id),yr(e.root)},vr=Ut((e=>((0,N.rC)(e,{setImplementation:N.LO,class:N.LO,properties:N.LO}),e))),Ir=(e,t)=>{Sr(e),(0,N.rC)(e,{mappingClass:N.LO,propertyMappings:N.LO}),e.mappingClass&&vr(e.mappingClass),e.propertyMappings.forEach((e=>Nr(e,t)))},Rr=Ut((e=>((0,N.rC)(e,{}),fr(e.setImplementation),e))),wr=e=>{Sr(e),(0,N.rC)(e,{parameters:N.LO,operation:N.LO,hashCode:N.Fl}),e.parameters.forEach(Rr)},Pr=Ut((e=>(wr(e),e))),Lr=Ut((e=>(wr(e),(0,N.rC)(e,{validationFunction:N.LO}),Fs(e.validationFunction),e))),br=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{filter:N.LO,hashCode:N.Fl}),e.srcClass&&zt(e.srcClass),e.filter&&Fs(e.filter),e)));class Dr{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){Lr(e)}visit_OperationSetImplementation(e){Pr(e)}visit_PureInstanceSetImplementation(e){br(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ei(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Xn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Zn(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Mr=(e,t)=>(e.accept_SetImplementationVisitor(new Dr(t)),e),kr=Ut((e=>((0,N.rC)(e,{original:N.LO,substitute:N.LO}),zt(e.original),zt(e.substitute),e))),Fr=Ut((e=>((0,N.rC)(e,{included:N.LO,storeSubstitutions:N.LO}),zt(e.included),e.storeSubstitutions.forEach(kr),e))),jr=Ut((e=>(0,N.rC)(e,{value:N.LO}))),Ur=Ut((e=>((0,N.rC)(e,{sourceValues:N.LO,hashCode:N.Fl}),xo(e.enum),e.sourceValues.forEach(jr),e))),Vr=Ut((e=>((0,N.rC)(e,{sourceType:N.LO,enumValueMappings:N.LO,hashCode:N.Fl}),zt(e.enumeration),Ar(e.id),e.sourceType&&zt(e.sourceType),e.enumValueMappings.forEach(Ur),e))),Gr=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,stores:N.LO,propertyMappings:N.LO,hashCode:N.Fl}),zt(e.association),Ar(e.id),e.stores.forEach(zt),e.propertyMappings.forEach((e=>Nr(e,t))),e))),zr=Ut((e=>((0,N.rC)(e,{inputType:N.LO,data:N.LO,hashCode:N.Fl}),zt(e.sourceClass),e))),Br=Ut((e=>(0,N.rC)(e,{expectedOutput:N.LO,hashCode:N.Fl}))),$r=Vt(((e,t)=>((0,N.rC)(e,{name:N.LO,query:N.LO,inputData:N.LO,assert:N.LO,hashCode:N.Fl}),Fs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Ds)return zr(e);if(e instanceof ws)return ii(e);if(e instanceof Ms)return qn(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 ys&&Br(e)})(e.assert),e))),Hr=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{includes:N.LO,classMappings:N.LO,enumerationMappings:N.LO,associationMappings:N.LO,test:N.LO,tests:N.LO,_elementHashCode:N.KG}),e.includes.forEach(Fr),e.classMappings.forEach((e=>Mr(e,t))),e.enumerationMappings.forEach(Vr),e.associationMappings.forEach((e=>Gr(e,t))),e.test.forEach((e=>$r(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Aa?Ja(e,t):e instanceof Na?gr(e,t):e}(e,t))),e))),Yr=e=>{(0,N.rC)(e,{store:N.LO}),zt(e.store)},Wr=Ut((e=>(Yr(e),(0,N.rC)(e,{hashCode:N.Fl}),e))),Kr=Ut((e=>(Yr(e),(0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),zt(e.class),e))),Xr=Ut((e=>(Yr(e),(0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),zt(e.class),e))),Zr=Ut((e=>(Yr(e),(0,N.rC)(e,{mappings:N.LO,hashCode:N.Fl}),e.mappings.forEach(zt),e)));class qr{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){Wr(e)}visit_ModelChainConnection(e){Zr(e)}visit_JsonModelConnection(e){Kr(e)}visit_XmlModelConnection(e){Xr(e)}visit_FlatDataConnection(e){ni(e)}visit_RelationalDatabaseConnection(e){Ea(e,this.observerContext)}}const Jr=(e,t)=>(e.accept_ConnectionVisitor(new qr(t)),e),Qr=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{connectionValue:N.LO,_elementHashCode:N.KG}),Jr(e.connectionValue,t),e))),eo=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,connection:N.LO,hashCode:N.Fl}),Jr(e.connection,t),e))),to=Vt(((e,t)=>((0,N.rC)(e,{storeConnections:N.LO,hashCode:N.Fl}),zt(e.store),e.storeConnections.forEach((e=>eo(e,t))),e))),so=Vt(((e,t)=>((0,N.rC)(e,{mappings:N.LO,connections:N.LO,hashCode:N.Fl}),e.mappings.forEach(zt),e.connections.forEach((e=>to(e,t))),e))),io=Ut((e=>((0,N.rC)(e,{hashCode:N.Fl}),zt(e.packageableRuntime),e))),no=(e,t)=>e instanceof Is?io(e):e instanceof vs?so(e,t):e,ao=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{runtimeValue:N.LO,_elementHashCode:N.KG}),so(e.runtimeValue,t),e)));class ro{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){lo(e,this.observerContext)}visit_SectionIndex(e){go(e)}visit_PrimitiveType(e){}visit_Profile(e){To(e)}visit_Enumeration(e){Oo(e)}visit_Measure(e){Ao(e)}visit_Class(e){Ro(e)}visit_Association(e){wo(e)}visit_ConcreteFunctionDefinition(e){Po(e)}visit_FlatData(e){Js(e)}visit_Database(e){Bn(e,this.observerContext)}visit_Mapping(e){Hr(e,this.observerContext)}visit_Service(e){or(e,this.observerContext)}visit_PackageableRuntime(e){ao(e,this.observerContext)}visit_PackageableConnection(e){Qr(e,this.observerContext)}visit_FileGenerationSpecification(e){gs(e)}visit_GenerationSpecification(e){fs(e)}visit_DataElement(e){Va(e,this.observerContext)}}const oo=Vt(((e,t)=>(e.accept_PackageableElementVisitor(new ro(t)),e))),lo=Vt(((e,t)=>((e=>{Gt(e),(0,N.rC)(e,{children:N.LO,hashCode:N.KG})})(e),e.children.forEach((e=>{e instanceof os?lo(e,t):oo(e,t)})),e))),co=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),ho=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),e))),uo=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),ho(e.tag),e))),po=Ut((e=>(0,N.rC)(e,{rawType:N.LO}))),_o=Ut((e=>((0,N.rC)(e,{value:N.LO}),po(e.value),zt(e.ownerReference),e))),mo=Ut((e=>((0,N.rC)(e,{parserName:N.LO,elements:N.LO}),e instanceof cs?(0,N.rC)(e,{imports:N.LO,hashCode:N.Fl}):e instanceof hs&&(0,N.rC)(e,{hashCode:N.Fl}),e))),go=Ut((e=>(Gt(e),(0,N.rC)(e,{sections:N.LO,_elementHashCode:N.KG}),e.sections.forEach(mo),e))),Eo=Ut((e=>(0,N.rC)(e,{value:N.LO}))),fo=Ut((e=>(0,N.rC)(e,{value:N.LO}))),To=Ut((e=>(Gt(e),(0,N.rC)(e,{p_stereotypes:N.LO,p_tags:N.LO,_elementHashCode:N.KG}),e.p_stereotypes.forEach(Eo),e.p_tags.forEach(fo),e))),Co=Ut((e=>((0,N.rC)(e,{name:N.LO,stereotypes:N.LO,taggedValues:N.LO,hashCode:N.Fl}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),xo=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Oo=Ut((e=>(Gt(e),(0,N.rC)(e,{values:N.LO,stereotypes:N.LO,taggedValues:N.LO,_elementHashCode:N.KG}),e.values.forEach(Co),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),No=Ut((e=>((0,N.rC)(e,{measure:N.LO,conversionFunction:N.LO,hashCode:N.Fl}),e.conversionFunction&&Fs(e.conversionFunction),e))),Ao=Ut((e=>(Gt(e),(0,N.rC)(e,{canonicalUnit:N.LO,nonCanonicalUnits:N.LO,_elementHashCode:N.KG}),e.canonicalUnit&&No(e.canonicalUnit),e.nonCanonicalUnits.forEach(No),e))),yo=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,stereotypes:N.LO,taggedValues:N.LO,hashCode:N.Fl}),_o(e.genericType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),So=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,stereotypes:N.LO,taggedValues:N.LO,body:N.LO.ref,parameters:N.LO.ref,hashCode:N.Fl}),_o(e.genericType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),vo=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),Io=Ut((e=>((0,N.rC)(e,{name:N.LO,functionDefinition:N.LO,externalId:N.LO,enforcementLevel:N.LO,messageFunction:N.LO,hashCode:N.Fl}),Fs(e.functionDefinition),e.messageFunction&&Fs(e.messageFunction),e))),Ro=Ut((e=>(Gt(e),(0,N.rC)(e,{_subclasses:N.LO,properties:N.LO,propertiesFromAssociations:N.LO,derivedProperties:N.LO,generalizations:N.LO,constraints:N.LO,stereotypes:N.LO,taggedValues:N.LO,dispose:N.KG,_elementHashCode:N.KG}),e.properties.forEach(yo),e.propertiesFromAssociations.forEach(yo),e.derivedProperties.forEach(So),e.generalizations.forEach(_o),e.constraints.forEach(Io),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),wo=Ut((e=>(Gt(e),(0,N.rC)(e,{properties:N.LO,stereotypes:N.LO,taggedValues:N.LO,derivedProperties:N.LO,_elementHashCode:N.KG}),e.properties.forEach(yo),e.derivedProperties.forEach(So),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),Po=Ut((e=>(Gt(e),(0,N.rC)(e,{functionName:N.LO,returnMultiplicity:N.LO,parameters:N.LO.shallow,expressionSequence:N.LO.ref,stereotypes:N.LO,taggedValues:N.LO,_elementHashCode:N.KG}),e.parameters.forEach(js),zt(e.returnType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),Lo=Ut((e=>e instanceof ns?Oo(e):e instanceof as?No(e):e instanceof ss?Ro(e):e instanceof rs?Ao(e):e)),bo=(Ut((e=>e instanceof ns?Oo(e):e instanceof as?No(e):e)),Ut((e=>(0,N.rC)(e,{_dummyObservable:N.LO})))),Do=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Mo=Ut((e=>(bo(e),(0,N.rC)(e,{id:N.LO,hideProperties:N.LO,hideTaggedValues:N.LO,hideStereotypes:N.LO,hashCode:N.Fl}),zt(e.class),e))),ko=Ut((e=>(Do(e.classView),e))),Fo=Ut((e=>((0,N.rC)(e,{path:N.LO,pathForSerialization:N.Fl}),ko(e.from),ko(e.to),e))),jo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),e))),Uo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),vo(e.property),zt(e.association),e))),Vo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),vo(e.property),e))),Go=Ut((e=>(Gt(e),(0,N.rC)(e,{classViews:N.LO,associationViews:N.LO,generalizationViews:N.LO,propertyViews:N.LO,_elementHashCode:N.KG}),e.classViews.forEach(Mo),e.associationViews.forEach(Uo),e.generalizationViews.forEach(jo),e.propertyViews.forEach(Vo),e)));var zo;!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"}(zo=zo||(zo={}));class Bo extends es{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Yt([zo.DIAGRAM,this.path,Yt(this.classViews),Yt(this.generalizationViews),Yt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const $o="Diagram";class Ho extends jt{constructor(){super(Ft.Rw.LW,Ft.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[$o]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Bo)return $o}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Bo)return Go(e)}]}}class Yo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT,this.path])}}class Wo extends Yo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Yt([zo.DIAGRAM,this.path,Yt(this.classViews),Yt(this.generalizationViews),Yt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Ko{rectangle;position;get hashCode(){return Yt([zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Xo extends Ko{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Yt([zo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Zo{x;y;get hashCode(){return Yt([zo.POINT,this.x.toString(),this.y.toString()])}}class qo{width;height;get hashCode(){return Yt([zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class Jo{points=[]}class Qo{sourceView;targetView;line;get hashCode(){return Yt([zo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Yt(this.line.points)])}}class el extends Qo{property;get hashCode(){return Yt([zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class tl extends el{get hashCode(){return Yt([zo.PROPERTY_VIEW,super.hashCode])}}class sl extends Qo{get hashCode(){return Yt([zo.GENERALIZATION_VIEW,super.hashCode])}}class il{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Yt([Wt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new il(0,0);static ZERO_ONE=new il(0,1);static ZERO_MANY=new il(0,void 0);static ONE=new il(1,1);static ONE_MANY=new il(1,void 0)}new Ve((0,Ue.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()})),(0,Ue.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Ue.Ru)(),type:(0,Ue.Ru)()});const nl=(0,Ue.yu)(il,{lowerBound:(0,Ue.Ru)(),upperBound:(0,Ue.jt)((0,Ue.Ru)())});class al{class;property;get hashCode(){return Yt([Wt.PROPERTY_POINTER,this.property,this.class??""])}}class rl{}class ol{queryTimeOutInSeconds=null;enableConstraints=!0}var ll,cl;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(ll||(ll={})),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"}(cl=cl||(cl={})),(0,Ue.yu)(class extends ol{},{_type:$e(ll.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Ue.Ru)(),enableConstraints:(0,Ue.Ru)()});const hl=(0,Ue.yu)(class extends rl{body;parameters;get hashCode(){return Yt([Wt.RAW_LAMBDA,Zt(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:$e(cl.LAMBDA),body:(0,Ue.LZ)(),parameters:(0,Ue.LZ)()}),dl=(0,Ue.yu)(class extends rl{class;name;multiplicity;get hashCode(){return Yt([Wt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:$e(cl.VARIABLE),class:(0,Ue.Ru)(),multiplicity:Ge(nl),name:(0,Ue.Ru)()});(0,Ue.yu)(class extends rl{multiplicity=il.ONE;type;value;get hashCode(){return Yt([Wt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Ue.bm)("_type",(0,Ue.PG)((e=>{switch(e){case Ee.INTEGER:return cl.CINTEGER;case Ee.DECIMAL:return cl.CDECIMAL;case Ee.STRING:return cl.CSTRING;case Ee.BOOLEAN:return cl.CBOOLEAN;case Ee.FLOAT:return cl.CFLOAT;case Ee.DATETIME:return cl.CDATETIME;case Ee.STRICTDATE:return cl.CSTRICTDATE;case Ee.STRICTTIME:return cl.CSTRICTTIME;case Ee.LATESTDATE:return cl.CLATESTDATE;default:throw new k(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case cl.CINTEGER:return Ee.INTEGER;case cl.CDECIMAL:return Ee.DECIMAL;case cl.CSTRING:return Ee.STRING;case cl.CBOOLEAN:return Ee.BOOLEAN;case cl.CFLOAT:return Ee.FLOAT;case cl.CDATETIME:return Ee.DATETIME;case cl.CSTRICTDATE:return Ee.STRICTDATE;case cl.CSTRICTTIME:return Ee.STRICTTIME;case cl.CLATESTDATE:return Ee.LATESTDATE;default:throw new k(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Ue.jt)((0,Ue.Ru)())});const ul=(0,Ue.yu)(al,{class:(0,Ue.jt)((0,Ue.Ru)()),property:(0,Ue.Ru)()}),pl=(0,Ue.yu)(class{profile;value;get hashCode(){return Yt([Wt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()}),_l=(0,Ue.yu)(class{profile;value;get hashCode(){return Yt([Wt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()}),ml=(0,Ue.yu)(class{tag;value;get hashCode(){return Yt([Wt.TAGGED_VALUE,this.tag,this.value])}},{tag:Ge(_l),value:(0,Ue.Ru)()}),gl=((0,Ue.yu)(class extends Yo{stereotypes=[];tags=[];get hashCode(){return Yt([Wt.PROFILE,this.path,Yt(this.stereotypes),Yt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:$e("profile"),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ru)()),tags:(0,Ue.pb)((0,Ue.Ru)())}),(0,Ue.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ENUM_VALUE,this.value,Yt(this.stereotypes),Yt(this.taggedValues)])}},{stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),value:(0,Ue.Ru)()})),El=((0,Ue.yu)(class extends Yo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ENUMERATION,this.path,Yt(this.values),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:$e("Enumeration"),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),values:(0,Ue.pb)(Ge(gl))}),(0,Ue.yu)(class extends Yo{measure;conversionFunction;get hashCode(){return Yt([Wt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new k}},{_type:$e("unit"),conversionFunction:(0,Ue.jt)(Ge(hl)),measure:(0,Ue.Ru)(),name:(0,Ue.Ru)(),package:(0,Ue.Ru)()})),fl=((0,Ue.yu)(class extends Yo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Yt([Wt.MEASURE,this.path,this.canonicalUnit??"",Yt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:$e("measure"),canonicalUnit:(0,Ue.jt)(Ge(El)),name:(0,Ue.Ru)(),nonCanonicalUnits:(0,Ue.pb)(Ge(El)),package:(0,Ue.Ru)()}),(0,Ue.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Yt(this.stereotypes),Yt(this.taggedValues)])}},{aggregation:(0,Ue.jt)((0,Ue.Ru)()),multiplicity:Ge(nl),name:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),type:(0,Ue.Ru)()})),Tl=(0,Ue.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Yt([Wt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Yt(this.stereotypes),Yt(this.taggedValues),Zt(this.parameters,this.body)])}},{body:(0,Ue.LZ)(),name:(0,Ue.Ru)(),parameters:(0,Ue.LZ)(),returnMultiplicity:Ge(nl),returnType:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),Cl=(0,Ue.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Yt([Wt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Ue.jt)((0,Ue.Ru)()),externalId:(0,Ue.jt)((0,Ue.Ru)()),functionDefinition:Ge(hl),messageFunction:(0,Ue.jt)(Ge(hl)),name:(0,Ue.Ru)()}),xl=((0,Ue.yu)(class extends Yo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Yt([Wt.CLASS,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.superTypes),Yt(this.constraints),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:$e("class"),constraints:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Cl,e)),{skipIfEmpty:!1}))),name:(0,Ue.Ru)(),originalMilestonedProperties:(0,Ue.PG)((e=>Be(e,(e=>Ue.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>Ue.AM),{skipIfEmpty:!1}))),package:(0,Ue.Ru)(),properties:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(fl,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Ue.bm)("qualifiedProperties",(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Tl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),superTypes:(0,Ue.PG)((e=>Be(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),(0,Ue.yu)(class extends Yo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ASSOCIATION,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:$e("association"),name:(0,Ue.Ru)(),originalMilestonedProperties:(0,Ue.PG)((e=>Be(e,(e=>Ue.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>Ue.AM),{skipIfEmpty:!1}))),package:(0,Ue.Ru)(),properties:(0,Ue.pb)(Ge(fl)),derivedProperties:(0,Ue.bm)("qualifiedProperties",(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Tl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),(0,Ue.yu)(class extends Yo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Yt([Wt.FUNCTION,this.path,Yt(this.parameters),this.returnType,Yt(this.taggedValues),Yt(this.stereotypes),Zt(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:$e("function"),body:(0,Ue.pb)((0,Ue.LZ)()),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),parameters:(0,Ue.pb)(Ge(dl)),postConstraints:(0,Ue.pb)((0,Ue.Ru)()),preConstraints:(0,Ue.pb)((0,Ue.Ru)()),returnMultiplicity:Ge(nl),returnType:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),"diagram"),Ol=(0,Ue.yu)(Zo,{x:(0,Ue.Ru)(),y:(0,Ue.Ru)()}),Nl=(0,Ue.yu)(qo,{height:(0,Ue.Ru)(),width:(0,Ue.Ru)()}),Al=(0,Ue.yu)(Jo,{points:(0,Ue.pb)(Ge(Ol))}),yl=(0,Ue.yu)(Xo,{class:(0,Ue.Ru)(),hideProperties:(0,Ue.jt)((0,Ue.Ru)()),hideStereotypes:(0,Ue.jt)((0,Ue.Ru)()),hideTaggedValues:(0,Ue.jt)((0,Ue.Ru)()),id:(0,Ue.Ru)(),position:Ge(Ol),rectangle:Ge(Nl)}),Sl=(0,Ue.yu)(tl,{line:Ge(Al),property:Ge(ul),sourceView:(0,Ue.Ru)(),targetView:(0,Ue.Ru)()}),vl=(0,Ue.yu)(sl,{line:Ge(Al),sourceView:(0,Ue.Ru)(),targetView:(0,Ue.Ru)()}),Il=(0,Ue.yu)(Wo,{_type:$e(xl),classViews:(0,Ue.pb)(Ge(yl)),generalizationViews:(0,Ue.pb)(Ge(vl)),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),propertyViews:(0,Ue.pb)(Ge(Sl))});class Rl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}const wl=(e,t)=>{const s=e.lastIndexOf(_e);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+_e.length,e.length)]},Pl=(e,t)=>`${e?`${e}::`:""}${t}`,Ll=(e,t)=>{e.children.push(t),t.package=e},bl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Dl=(e,t,s,i)=>{const n=t.indexOf(_e),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof os&&e.name===a)),!r){if(!s)throw new U(`Can't find child package '${a}' in package '${e.path}'`);K(!me.includes(a),`Can't create package with reserved name '${a}'`),r=new os(a),r.package=e,e.children.push(r)}return i&&i.set(Pl(e.path,a),r),-1!==n?Dl(r,t.substring(n+_e.length),s,i):r},Ml=(e,t,s,i)=>{if(i){const n=i.get(Pl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Pl(e.path,a),r=i.get(n);if(r)return Dl(r,t.substring(a.length+_e.length,t.length),s,i);const o=a.lastIndexOf(_e);a=-1!==o?a.substring(0,o):""}}return Dl(e,t,s,i)},kl=(e,t,s)=>(Y(t,"Package path is required"),Ml(e.root,t,!0,s)),Fl=(e,t)=>H(e.rawType,t),jl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Fl(e.value,ss);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Ul=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Vl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Gl=(e,t)=>`${z(e,"Package path is required")}::${z(t,"Name is required")}`;class zl{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){Y(e.package,"Element 'package' field is missing or empty"),Y(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new U(`Element '${e}' already exists`);s.add(e)}else K(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Gl(e.package,e.name),t,i);const n=this.firstPass(e,t);return Ll(kl(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 Bl=e=>e.classView.value.id,$l=e=>{const t=new tl,s=new Jo;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new al;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Bl(e.from),t.targetView=Bl(e.to),t},Hl=e=>{const t=new sl,s=new Jo;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Bl(e.from),t.targetView=Bl(e.to),t},Yl=e=>{const t=new Xo;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 Zo;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new qo;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Wl{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Yt([zo.POINT,this.x.toString(),this.y.toString()])}}class Kl{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Yt([zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class Xl{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Wl(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 Xl(new Wl(e.position.x+e.rectangle.width,e.position.y),new Kl(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Xl(new Wl(e.position.x,e.position.y+e.rectangle.height),new Kl(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Yt([zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Zl extends Xl{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Wl(0,0),new Kl(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Yt([zo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class ql{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class Jl extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Ql extends Jl{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Ql(e)}}class ec{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new ql(Ql.create(t)),this.to=new ql(Ql.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 Wl(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Wl(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 ec.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Yt([zo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Yt(this.pathForSerialization)])}}class tc extends ec{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Yt([zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class sc extends tc{get hashCode(){return Yt([zo.PROPERTY_VIEW,super.hashCode])}}class ic extends ec{get hashCode(){return Yt([zo.GENERALIZATION_VIEW,super.hashCode])}}class nc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new nc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new nc(this.x/e,this.y/e)}normal(e){return new nc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const ac=(e,t)=>e.classViews.find((e=>e.id===t)),rc=(e,t)=>{e.path=t},oc=e=>{const t=e.buildFullPath(),s=ec.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=nc.fromPoints(s[e+1],s[e]).unit(),n=nc.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])}rc(e,i)},lc=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),cc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),hc=e=>new Wl(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),dc=e=>{const t=hc(e);return new Xl(new Wl(t.x-5,t.y-5),new Kl(10,10))},uc=(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)),pc=e=>{const t=z(e.x,"Point 'x' coordinate is missing"),s=z(e.y,"Point 'y' coordinate is missing");return new Wl(t,s)};class _c extends Rl{constructor(){super(Ft.Rw.zE,Ft.i8)}V1_getExtraElementBuilders(){return[new zl({elementClassName:"Diagram",_class:Wo,firstPass:(e,t)=>{$(e,Wo);const s=new Bo(e.name),i=Gl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Bo),s},secondPass:(e,t)=>{$(e,Wo);const s=(i=Gl(e.package,e.name),n=t.currentSubGraph,z(n.getOwnNullableExtensionElement(i,Bo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{Y(e.class,"Class view 'class' field is missing or empty"),Y(e.id,"Class view 'id' field is missing or empty"),G(e.rectangle,"Class view 'rectangle' field is missing"),G(e.position,"Class view 'position' field is missing");const i=new Zl(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=z(e.width,"Rectangle 'width' is missing"),s=z(e.height,"Rectangle 'height' is missing");return new Kl(t,s)})(e.rectangle),i.position=pc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{G(e.property,"Property view 'property' field is missing"),G(e.line,"Property view 'line' field is missing");const i=z(ac(s,z(e.sourceView)),"Property view 'sourceView' field is missing"),n=z(ac(s,z(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new sc(s,a,i,n);return r.path=e.line.points.map((e=>pc(e))),oc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{G(e.line,"Generalization view 'line' field is missing");const s=z(ac(t,z(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=z(ac(t,z(e.targetView)),"Generalization view 'targetView' field is missing"),n=new ic(t,s,i);return n.path=e.line.points.map((e=>pc(e))),oc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Wo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Wo)return(0,Ue.qC)(Il,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===xl)return(0,Ue.vB)(Il,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Bo)return(e=>{const t=new Wo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Yl),t.generalizationViews=e.generalizationViews.map(Hl),t.propertyViews=e.propertyViews.map($l),t})(e)}]}}class mc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class gc extends mc{constructor(){super(Ft.Rw.f1,Ft.i8)}getExtraPureGraphExtensionClasses(){return[Bo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Bo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof ss?Ul(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>L(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>L(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=>L(e.generalizationViews,t)))})(t,e)))}]}}class Ec extends c{constructor(){super(Ft.Rw.NA,Ft.i8,[new gc,new Ho,new _c])}}var fc=s(5453),Tc=s(3493),Cc=s(3908);const xc=(0,fc.Z)({transitions:{create:()=>"none"}}),Oc=e=>{const{children:t}=e;return(0,x.jsx)(Tc.Z,{injectFirst:!0,children:(0,x.jsx)(Cc.Z,{theme:xc,children:t})})};var Nc=s(3820),Ac=s(9631),yc=s(2238),Sc=s(8683),vc=s(889),Ic=s(6277);const Rc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)(t,i),children:s})};return s.displayName=e,s},wc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)("modal",{"modal--dark":s},i),children:t})},Pc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Ic.clsx)("modal__title",i),children:[s&&(0,x.jsx)("div",{className:"modal__title__icon",children:s}),(0,x.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Os.includes(e.toLowerCase())?e.toLowerCase():xs(e))).replace(/^(?:\w+)\b/u,(e=>xs(e))).replace(/\b(?:\w+)$/u,(e=>xs(e))))})]});var n},Lc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Ic.clsx)("modal__header",i),children:(0,x.jsx)(Pc,{title:t})}):(0,x.jsx)("div",{className:(0,Ic.clsx)("modal__header",i),children:s})},bc=(Rc("ModalHeaderActions","modal__header__actions"),Rc("ModalBody","modal__body")),Dc=Rc("ModalFooter","modal__footer"),Mc=e=>{switch(e){case yt.PROCEED_WITH_CAUTION:return"btn--caution";case yt.PROCEED:case yt.STANDARD:default:return"btn--dark"}},kc=(0,Qe.Pi)((e=>{const{info:t}=e,s=Lt(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,h=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,x.jsx)(vc.Z,{open:Boolean(s.actionAlertInfo),onClose:I,TransitionProps:{onEnter:()=>l?.()},children:(0,x.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),h()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??At.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(Lc,{title:i}),(0,x.jsxs)(bc,{children:[(0,x.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,x.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,x.jsxs)(Dc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Mc(e.type??yt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),h()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,x.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:h,children:"Cancel"})]})]})})})),Fc=(0,Qe.Pi)((()=>{const e=Lt().actionAlertInfo;return e?(0,x.jsx)(kc,{info:e}):null})),jc=e=>{const{isLoading:t}=e,s=(0,et.useRef)(null);return(0,et.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,x.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Uc=(0,Qe.Pi)((()=>{const e=Lt().blockingAlertInfo;return e?(0,x.jsx)(vc.Z,{open:Boolean(e),onClose:I,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(wc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)(jc,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(bc,{children:[(0,x.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,x.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Vc=s(2889),Gc=s(8619),zc=s(3029);const Bc=(0,Qe.Pi)((()=>{const e=Lt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??vt.INFO,[a,r]=(0,et.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Vc.uMt,{})});switch(n){case vt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Vc.nnZ,{})});break;case vt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Vc.xDH,{})});break;case vt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Vc.LPM,{})});break;case vt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Vc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Gc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:St,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(zc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,x.jsxs)("div",{className:"notification__message__content",children:[o,(0,x.jsx)("div",{className:(0,Ic.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,x.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Vc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var $c;!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"}($c=$c||($c={}));var Hc=s(1826);const Yc=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(Hc.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Wc=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,et.useRef)(null),[c,h]=(0,et.useState)(!1),[d,u]=(0,et.useState)(),[p,_]=(0,et.useState)(0),[m,g]=(0,et.useState)(0),E=()=>{u(void 0),h(!1),g(0),_(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},T=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(d!==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),h(!0),g(a),_(n)}};return(0,x.jsxs)("div",{ref:l,className:t,onContextMenu:T,children:[s,(0,x.jsx)(Yc,{open:c,anchorPosition:{left:p,top:m},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:T},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${m}`)]})},Kc=(0,et.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Ic.clsx)("menu",s),...n,children:i})})),Xc=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Ic.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})};Rc("MenuContentDivider","menu__divider"),Rc("MenuContentItemIcon","menu__item__icon"),Rc("MenuContentItemLabel","menu__item__label");var Zc=s(2794),qc=s(1215);const Jc=e=>(0,x.jsx)(Zc.D,{className:(0,Ic.clsx)("markdown-content",e.className),remarkPlugins:[qc.Z],children:e.value.value});var Qc=s(2515);const eh=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,Qc.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,et.useState)(!1),{ref:o,width:l,height:c}=(0,Qc.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,et.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,x.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,x.jsx)("div",{ref:s,className:(0,Ic.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var th=s(1222);const sh=e=>{const{children:t,...s}=e;return(0,x.jsx)(th.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var ih=s(3474),nh=s(5068),ah=s(1327),rh=s(7793),oh=s(6569),lh=s(6678);const ch=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,x.jsxs)("div",{className:(0,Ic.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(rh.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(oh.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(lh.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,x.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var hh;!function(e){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_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"}(hh=hh||(hh={}));const dh=(0,Qe.Pi)((e=>{const{configState:t}=e,s=Lt();return(0,x.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,x.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,x.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(hh.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Vc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(ch,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[ht.STANDARD,ht.INCLUDE,ht.EXACT,ht.INVERSE],size:1})})]})})),uh=(0,Qe.Pi)((e=>{const{entry:t}=e,s=Lt(),i=()=>{t.isOpen||Ct.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(Wc,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(Kc,{children:(0,x.jsx)(Xc,{onClick:n,children:"Copy Documentation Key"})}),children:(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,x.jsx)("button",{className:(0,Ic.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,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{})}),t.url?(0,x.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{Ct.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(Jc,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),ph=(0,Qe.Pi)((()=>{const e=Lt(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,x.jsxs)(Wc,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(Xc,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(Xc,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,x.jsx)(x.Fragment,{children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(Jc,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,x.jsx)(uh,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(eh,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Vc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),_h=(0,Qe.Pi)((()=>{const e=Lt(),t=(0,et.useRef)(null),s=(0,et.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,et.useMemo)((()=>(0,ih.Z)((()=>i.search()),100)),[i]);return(0,et.useEffect)((()=>{t.current?.focus()}),[]),(0,x.jsxs)("div",{className:"virtual-assistant__search",children:[(0,x.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,x.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,Ic.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,x.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,x.jsx)("button",{ref:s,className:(0,Ic.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,x.jsx)(Vc.IEm,{})}),n?(0,x.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,x.jsx)(Vc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Vc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)(jc,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(dh,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(uh,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,x.jsxs)(x.Fragment,{children:[Boolean(i.searchResults.length)&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,x.jsx)(uh,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(eh,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Vc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,x.jsx)(Wc,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>{ue(`documentation-registry_${(0,nh.Z)(new Date(Date.now()),Le)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ie.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(Xc,{onClick:()=>{ue(`documentation-registry_${(0,nh.Z)(new Date(Date.now()),Le)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ie.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,x.jsxs)("div",{className:"virtual-assistant__character",children:[(0,x.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,x.jsx)(Vc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Vc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Vc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,x.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,x.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),mh=(0,Qe.Pi)((e=>{const{triggerElement:t}=e,s=Lt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(sh,{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,x.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===dt.SEARCH}),onClick:()=>s.setSelectedTab(dt.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Vc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===dt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(dt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Vc.kdY,{}),i&&(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,x.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,x.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,x.jsx)(Vc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===dt.SEARCH&&(0,x.jsx)(_h,{}),n===dt.CONTEXTUAL_SUPPORT&&(0,x.jsx)(ph,{})]})]})},s.panelRenderingKey)})),gh=(0,Qe.Pi)((()=>{const[e,t]=(0,et.useState)(!1),[s,i]=(0,et.useState)((0,a.Z)()),n=Lt(),r=(0,et.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,et.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(ah,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,x.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,x.jsxs)("div",{className:(0,Ic.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,x.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(dt.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,x.jsx)(Vc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Vc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(Wc,{className:(0,Ic.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(Xc,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,x.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,x.jsx)(Vc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(mh,{triggerElement:r.current})]})},s)})),Eh="app.container",fh="app.backdrop-container",Th=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7"],Ch=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),xh=(0,Qe.Pi)((e=>{const{children:t}=e,s=Lt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(fh):document.getElementById(fh),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:Th,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Th.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,et.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=z(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=z(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![$c.SHIFT,$c.META,$c.ALT,$c.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(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,x.jsxs)(Oc,{children:[(0,x.jsx)(Uc,{}),(0,x.jsx)(Fc,{}),(0,x.jsx)(Bc,{}),s.showBackdrop&&(0,x.jsx)(Nc.Z,{container:i,children:(0,x.jsx)(Ac.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(yc.W,{backend:Sc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Eh,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Ch,{elementID:fh}),(0,x.jsx)(gh,{}),t]})})]})}));class Oh{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Nh=(0,et.createContext)(void 0),Ah=({children:e})=>{const t=Lt(),s=(0,Qe.fv)((()=>new Oh(t)));return(0,x.jsx)(Nh.Provider,{value:s,children:e})};var yh,Sh;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(yh=yh||(yh={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(Sh=Sh||(Sh={}));const vh=e=>e.startsWith("/")?e.substring(1,e.length):e;class Ih{content;constructor(){(0,N.rC)(this,{content:N.LO,setContent:N.aD})}setContent(e){this.content=e}}(0,Ue.yu)(Ih,{content:(0,Ue.Ru)()});class Rh{file;line;column;errorMessage;constructor(e,t,s,i){(0,N.rC)(this,{file:N.LO,line:N.LO,column:N.LO,errorMessage:N.LO,setErrorMessage:N.aD}),this.file=e,this.line=t,this.column=s,this.errorMessage=i}setErrorMessage(e){this.errorMessage=e}}class wh{uuid=(0,a.Z)();get description(){}}class Ph{currentTab;tabs=[];constructor(){(0,N.rC)(this,{currentTab:N.LO,tabs:N.LO,setCurrentTab:N.aD,closeTab:N.aD,closeAllTabs:N.aD,closeAllOtherTabs:N.aD,openTab:N.aD,swapTabs:N.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){G(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){P(this.tabs,e,t)}}class Lh extends wh{editorStore;constructor(e){super(),this.editorStore=e}}class bh extends Ph{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){const t=this.tabs.findIndex((t=>t===e));if(K(-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)}openTab(e){if(!this.tabs.find((t=>t===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)}}var Dh;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_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",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"}(Dh=Dh||(Dh={}));const Mh={[Dh.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[Dh.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[Dh.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Dh.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+`"},[Dh.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Dh.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Dh.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Dh.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Dh.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"},[Dh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Dh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Dh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"}};class kh extends Lh{_textEditor;file;filePath;coordinate;constructor(e,t,s,i){super(e),(0,N.rC)(this,{_textEditor:N.LO,file:N.LO,coordinate:N.LO,setTextEditor:N.aD,setFile:N.aD,setCoordinate:N.aD}),this.file=t,this.filePath=s,this.coordinate=i}get label(){return vh(this.filePath)}get description(){return vh(this.filePath)}get textEditor(){return z(this._textEditor,"Text editor must be initialized (this is likely caused by calling this method at the wrong place)")}setTextEditor(e){this._textEditor=e}setFile(e){this.file=e}setCoordinate(e){this.coordinate=e}clearError(){this.coordinate?.setErrorMessage(void 0)}registerCommands(){this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.GO_TO_DEFINITION,trigger:()=>void 0!==this._textEditor&&this.textEditor.hasTextFocus(),action:()=>{const e=this.textEditor.getPosition();if(e){const t=new Rh(this.filePath,e.lineNumber,e.column);(0,N.fl)(this.editorStore.executeNavigation(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.GO_BACK,action:()=>{(0,N.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.FIND_USAGES,trigger:()=>void 0!==this._textEditor&&this.textEditor.hasTextFocus(),action:()=>{const e=this.textEditor.getPosition();if(e){const t=new Rh(this.filePath,e.lineNumber,e.column);(0,N.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}deregisterCommands(){[Dh.GO_TO_DEFINITION,Dh.GO_BACK,Dh.FIND_USAGES].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class Fh{editorStore;treeData;selectedNode;loadInitialDataState=pt.create();refreshDataState=pt.create();constructor(e){(0,N.rC)(this,{treeData:N.LO.ref,loadInitialDataState:N.LO,refreshDataState:N.LO,initialize:N.ls,expandNode:N.ls,openNode:N.ls,refreshTreeData:N.ls,setTreeData:N.aD,setSelectedNode:N.aD}),this.editorStore=e}getTreeData(){return z(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){F(e),this.editorStore.applicationStore.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({...z(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){F(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){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 F(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>z(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(z(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,N.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>z(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class jh{id;path}class Uh extends jh{file;statusType}(0,Ue.yu)(Uh,{id:(0,Ue.Ru)(),path:(0,Ue.Ru)(),file:(0,Ue.Ru)(),statusType:(0,Ue.Ru)()});class Vh extends jh{repo}(0,Ue.yu)(Vh,{id:(0,Ue.Ru)(),path:(0,Ue.Ru)(),repo:(0,Ue.Ru)()});class Gh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof Vh}get isFileNode(){return this.li_attr instanceof Uh}getNodeAttribute(e){return H(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Ue.yu)(Gh,{li_attr:(0,Ue.PG)((()=>Ue.AM),(e=>e.file&&"true"===e.file?(0,Ue.vB)(Uh,e):(0,Ue.vB)(Vh,e))),text:(0,Ue.Ru)(),icon:(0,Ue.Ru)(),children:(0,Ue.Ru)(),state:(0,Ue.Ru)()});const zh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},Bh=e=>e.endsWith(".pure"),$h=e=>`file_${e}`;class Hh extends Fh{nodeForCreateNewFile;nodeForCreateNewDirectory;constructor(e){super(e),(0,N.rC)(this,{nodeForCreateNewFile:N.LO,nodeForCreateNewDirectory:N.LO,setNodeForCreateNewFile:N.aD,setNodeForCreateNewDirectory:N.aD,revealPath:N.ls})}setNodeForCreateNewFile=e=>{K(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{K(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Ue.vB)(Gh,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,Ue.vB)(Gh,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,N.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(yh.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=zh(n);for(const e of i)if(Bh(e))yield(0,N.fl)(this.editorStore.loadFile(e,s));else{const t=z(this.getTreeData().nodes.get($h(e)),`Can't find directory node with path '${e}'`);yield(0,N.fl)(this.expandNode(t))}const a=z(this.getTreeData().nodes.get($h(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}var Yh,Wh,Kh,Xh;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram"}(Yh=Yh||(Yh={}));class Zh{pureId;pureType;get id(){return this.pureId}}class qh extends Zh{deprecated}(0,Ue.yu)(qh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),deprecated:(0,Ue.Ru)()});class Jh extends Zh{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Ue.yu)(Jh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),classPath:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class Qh extends Zh{RO;notpublic;user;file;line;column}(0,Ue.yu)(Qh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),notpublic:(0,Ue.Ru)(),user:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class ed{li_attr;id;text;icon;children;state;getNodeAttribute(e){return H(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Ue.yu)(ed,{li_attr:(0,Ue.PG)((()=>Ue.AM),(e=>e.classPath?(0,Ue.vB)(Jh,e):e.file?(0,Ue.vB)(Qh,e):(0,Ue.vB)(qh,e))),id:(0,Ue.Ru)(),text:(0,Ue.Ru)(),icon:(0,Ue.Ru)(),children:(0,Ue.Ru)(),state:(0,Ue.Ru)()});class td extends Fh{loadConceptActivity=pt.create();statusText;constructor(e){super(e),(0,N.rC)(this,{statusText:N.LO,setStatusText:N.aD,pullConceptsActivity:N.aD,pollConceptsActivity:N.ls})}setStatusText(e){this.statusText=e}async getRootNodes(){return await(0,N.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Ue.vB)(ed,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,Ue.vB)(ed,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.li_attr instanceof Jh||e.data.li_attr instanceof Qh)&&("Diagram"===e.data.li_attr.pureType?yield(0,N.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId)):yield(0,N.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Rh(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()}}class sd{cached;datamarts;text}(0,Ue.yu)(sd,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)()});class id extends sd{error;sessionError}(0,Ue.yu)(id,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class nd extends id{RO;line;column;source}(0,Ue.yu)(nd,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class ad{text;reinit}class rd extends ad{cache;modifiedFiles=[]}(0,Ue.yu)(rd,{text:(0,Ue.Ru)(),cache:(0,Ue.Ru)(),modifiedFiles:(0,Ue.pb)((0,Ue.Ru)()),reinit:(0,Ue.Ru)()});class od extends ad{RO;line;column;source;error;sessionError}(0,Ue.yu)(od,{text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class ld{RO;line;column;source}(0,Ue.yu)(ld,{RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)()});class cd extends ad{jumpTo}(0,Ue.yu)(cd,{text:(0,Ue.Ru)(),jumpTo:(0,Ue.Ry)(ld)});class hd{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Ue.yu)(hd,{sourceID:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),foundName:(0,Ue.Ru)()});class dd{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Ue.yu)(dd,{sourceID:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),foundName:(0,Ue.Ru)(),add:(0,Ue.Ru)(),messageToBeModified:(0,Ue.Ru)(),fileToBeModified:(0,Ue.Ru)(),lineToBeModified:(0,Ue.Ru)(),columnToBeModified:(0,Ue.Ru)()});class ud extends od{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Ue.yu)(ud,{candidateName:(0,Ue.Ru)(),candidatesWithPackageImported:(0,Ue.pb)((0,Ue.Ry)(hd)),candidatesWithPackageNotImported:(0,Ue.pb)((0,Ue.Ry)(dd))});class pd extends od{candidateName;candidates=[]}(0,Ue.yu)(pd,{candidateName:(0,Ue.Ru)(),candidates:(0,Ue.pb)((0,Ue.Ry)(dd))});class _d{id;parentId;file;line;column}(0,Ue.yu)(_d,{id:(0,Ue.Ru)(),parentId:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class md{children=[];li_attr;text;type}(0,Ue.yu)(md,{children:(0,Ue.pb)((0,Ue.Ry)(md)),li_attr:(0,Ue.Ry)(_d),text:(0,Ue.Ru)(),type:(0,Ue.Ru)()});class gd extends ad{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Ue.yu)(gd,{count:(0,Ue.Ru)(),filterPaths:(0,Ue.pb)((0,Ue.Ru)()),path:(0,Ue.Ru)(),relevantTestsOnly:(0,Ue.Ru)(),runnerId:(0,Ue.Ru)(),tests:(0,Ue.pb)((0,Ue.Ry)(md))});class Ed{uuid=(0,a.Z)()}class fd{uuid=(0,a.Z)();startLine;startColumn;endLine;endColumn;constructor(e,t,s,i){this.startLine=e,this.startColumn=t,this.endLine=s,this.endColumn=i}}(0,Ue.yu)(fd,{startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()});class Td extends Ed{sourceId;coordinates=[];constructor(){super(),(0,N.rC)(this,{coordinates:N.LO,dismissCoordinate:N.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){L(this.coordinates,e)}}(0,Ue.yu)(Td,{sourceId:(0,Ue.Ru)(),coordinates:(0,Ue.pb)((0,Ue.Ry)(fd))});class Cd{editorStore;constructor(e){this.editorStore=e}}class xd extends Cd{searchEntries=[];constructor(e,t){super(e),(0,N.rC)(this,{searchEntries:N.LO,numberOfFiles:N.Fl,numberOfResults:N.Fl}),this.searchEntries=t}dismissSearchEntry(e){L(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Od extends xd{usageConcept;constructor(e,t,s){const i=new Map;s.forEach((e=>{let t;i.has(e.source)?t=z(i.get(e.source)):(t=new Td,t.sourceId=e.source,i.set(e.source,t)),t.coordinates.push(new fd(e.startLine,e.startColumn,e.endLine,e.endColumn))})),super(e,Array.from(i.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=z(i.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class Nd extends Cd{result;constructor(e,t){super(e),this.result=t}}class Ad extends Cd{result;constructor(e,t){super(e),this.result=t}}!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Wh=Wh||(Wh={}));class yd{status;test}class Sd extends yd{test=[]}(0,Ue.yu)(Sd,{status:(0,Ue.Ru)(),test:(0,Ue.pb)((0,Ue.Ru)())});class vd{text;RO;line;column;source;error}(0,Ue.yu)(vd,{text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)()});class Id extends yd{test=[];error}(0,Ue.yu)(Id,{status:(0,Ue.Ru)(),test:(0,Ue.pb)((0,Ue.Ru)()),error:(0,Ue.Ry)(vd)});class Rd{}class wd extends Rd{finished;tests=[]}(0,Ue.yu)(wd,{finished:(0,Ue.Ru)(),tests:(0,Ue.pb)((0,Ue.PG)((()=>Ue.AM),(e=>e.error?(0,Ue.vB)(Id,e):(0,Ue.vB)(Sd,e))))});class Pd extends Rd{error;text}(0,Ue.yu)(Pd,{error:(0,Ue.Ru)(),text:(0,Ue.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Kh=Kh||(Kh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Xh=Xh||(Xh={}));class Ld{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,N.rC)(this,{total:N.LO,time:N.LO,passedTests:N.LO,failedTests:N.LO,testsWithError:N.LO,notRunTests:N.LO,results:N.LO,passed:N.Fl,error:N.Fl,failed:N.Fl,passedTestIds:N.Fl,failedTestIds:N.Fl,testWithErrorIds:N.Fl,notRunTestIds:N.Fl,numberOfTestsRun:N.Fl,runPercentage:N.Fl,suiteStatus:N.Fl,setTime:N.aD,addResult:N.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?Kh.FAILED:this.passed?Kh.PASSED:Kh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Wh.PASSED:this.passedTests.add(t);break;case Wh.FAILED:this.failedTests.set(t,H(e,Id));break;case Wh.ERROR:this.testsWithError.set(t,H(e,Id));break;default:throw new k(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class bd{editorStore;testExecutionResult;checkTestRunnerState=pt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=pt.create();selectedNode;treeData;constructor(e,t){(0,N.rC)(this,{testResultInfo:N.LO.ref,allTests:N.LO,selectedTestId:N.LO,selectedNode:N.LO,treeData:N.LO.ref,setSelectedTestId:N.aD,setTestResultInfo:N.aD,setTreeData:N.aD,refreshTree:N.aD,setSelectedNode:N.aD,collapseTree:N.aD,expandTree:N.aD,buildTreeDataByLayer:N.aD,pullTestRunnerResult:N.aD,buildTestTreeData:N.ls,pollTestRunnerResult:N.ls,rerunTestSuite:N.ls,cancelTestRun:N.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return z(this.treeData,"Test tree data has not been initialized")}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...z(this.treeData)})}setSelectedNode(e){e?.id!==this.selectedNode?.id&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}*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.setSelectedNode(void 0),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.setSelectedNode(void 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=z(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?w(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{K(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 Ld(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,Ue.vB)(Pd,s):(0,Ue.vB)(wd,s);var s;return t instanceof wd?(await Promise.all(t.tests.map((t=>R((()=>{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){F(e),this.editorStore.applicationStore.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,N.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.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}const Dd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Md{source;line;column;startLine;startColumn;endLine;endColumn}(0,Ue.yu)(Md,{source:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()});class kd{}class Fd extends kd{error;errorDialog;text}(0,Ue.yu)(Fd,{error:(0,Ue.Ru)(),errorDialog:(0,Ue.Ru)(),text:(0,Ue.Ru)()});class jd{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return z(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});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});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}'`:"'::'",format:"raw",mode:this.mode,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});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});getConceptPath=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptPath`,void 0,void 0,{file:e,line:t,column:s});getUsages=(e,t)=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});createFile=e=>this.networkClient.get(`${this.baseUrl}/newFile/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.get(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});deleteDirectoryOrFile=e=>this.networkClient.get(`${this.baseUrl}/deleteFile/${e}`,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}'`]}))}class Ud{_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,N.rC)(this,{_tempSize:N.LO,size:N.LO,defaultSize:N.LO,snapSize:N.LO,maxSize:N.LO,isOpen:N.Fl,isMaximizable:N.Fl,isMaximized:N.Fl,setSize:N.aD,open:N.aD,close:N.aD,toggle:N.aD,setMaxSize:N.aD,maximize:N.aD,minimize:N.aD,toggleMaximize:N.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 Vd{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Yt([Wt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Vd(0,0);static ZERO_ONE=new Vd(0,1);static ZERO_MANY=new Vd(0,void 0);static ONE=new Vd(1,1);static ONE_MANY=new Vd(1,void 0)}class Gd{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Yt([Wt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class zd extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class Bd extends zd{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Bd(e)}}class $d extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class Hd extends $d{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Hd(e)}}class Yd extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Wd extends Yd{ownerReference;constructor(e){const t=_s.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new Wd(e)}}class Kd{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class Xd{_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 Yt([Wt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}}class Zd{_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 Yt([Wt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),Zt(this.parameters,this.body)])}}class qd extends is{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new qd(Ee.STRING);static BOOLEAN=new qd(Ee.BOOLEAN);static BINARY=new qd(Ee.BINARY);static NUMBER=new qd(Ee.NUMBER);static INTEGER=new qd(Ee.INTEGER);static FLOAT=new qd(Ee.FLOAT);static DECIMAL=new qd(Ee.DECIMAL);static DATE=new qd(Ee.DATE);static STRICTDATE=new qd(Ee.STRICTDATE);static DATETIME=new qd(Ee.DATETIME);static STRICTTIME=new qd(Ee.STRICTTIME);static LATESTDATE=new qd(Ee.LATESTDATE)}const Jd=()=>new ss(""),Qd=(e,t)=>new Xd("",Vd.ONE,Wd.create(new Kd(e)),t);class eu extends es{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Qd(Jd(),Jd()),Qd(Jd(),Jd())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Yt([Wt.ASSOCIATION,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class tu extends es{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Yt([Wt.MAPPING,this.path,Yt(this.classMappings),Yt(this.enumerationMappings),Yt(this.associationMappings),Yt(this.test),Yt(this.includes),Yt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class su extends es{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Yt([Wt.PROFILE,this.path,Yt(this.p_stereotypes.map((e=>e.value))),Yt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class iu extends es{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];get patternParameters(){return(0,He.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Yt([Wt.SERVICE,Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),this.path,this.pattern,Yt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Yt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class nu extends es{functionName;constructor(e){super(e),this.functionName=e}}class au extends nu{}class ru extends au{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Yt([Wt.FUNCTION,this.path,Yt(this.parameters),this.returnType.valueForSerialization??"",Yt(this.taggedValues),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class ou extends es{includes=[]}class lu extends ou{sections=[];get _elementHashCode(){return Yt([Wt.FLAT_DATA,this.path,Yt(this.includes.map((e=>e.valueForSerialization??""))),Yt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class cu extends es{runtimeValue;get _elementHashCode(){return Yt([Wt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class hu extends es{connectionValue;get _elementHashCode(){return Yt([Wt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class du extends es{}class uu extends du{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Yt([Wt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Yt(this.scopeElements.map((e=>e instanceof ps?e.valueForSerialization??"":e))),Yt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class pu extends es{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Yt([Wt.GENERATION_TREE,this.path,Yt(this.generationNodes),Yt(this.fileGenerations.map((e=>qt(Ie.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class _u extends ou{schemas=[];joins=[];filters=[];get _elementHashCode(){return Yt([Wt.DATABASE,this.path,Yt(this.includes.map((e=>e.valueForSerialization??""))),Yt(this.schemas),Yt(this.joins),Yt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class mu{_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 gu extends es{data;get hashCode(){return Yt([Wt.DATA_ELEMENT,this.path,Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const Eu=new Set([es,ts,is,qd,ss,eu,ns,ru,su,rs,as,class extends es{sections=[];get _elementHashCode(){return Yt([Wt.SECTION_INDEX,this.path,Yt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},ou,tu,hu,cu,iu,pu,uu,gu]);class fu{root;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){this.root=new os(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(Eu.has(e))throw new M("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new mu(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(B(ns))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(B(rs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(B(ss))}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(B(lu))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(B(_u))}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]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new k("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new M("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 ss?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof ns?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof rs?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=>z(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>z(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>z(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>z(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>z(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>z(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>z(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>z(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>z(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>H(this.getOwnNullableStore(e),_u,`Can't find database '${e}'`);getOwnFlatDataStore=e=>H(this.getOwnNullableStore(e),lu,`Can't find flat-data store '${e}'`);getOwnMapping=e=>z(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>z(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>z(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>z(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>z(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>z(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>z(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=>R((()=>{e.dispose()})))))}getNullablePackage=e=>e?j((()=>Ml(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){Ll(t?kl(this,t,void 0):this.root,e),e instanceof tu?this.setOwnMapping(e.path,e):e instanceof ou?this.setOwnStore(e.path,e):e instanceof ts?this.setOwnType(e.path,e):e instanceof eu?this.setOwnAssociation(e.path,e):e instanceof su?this.setOwnProfile(e.path,e):e instanceof ru?this.setOwnFunction(e.path,e):e instanceof iu?this.setOwnService(e.path,e):e instanceof hu?this.setOwnConnection(e.path,e):e instanceof cu?this.setOwnRuntime(e.path,e):e instanceof uu?this.setOwnFileGeneration(e.path,e):e instanceof pu?this.setOwnGenerationSpecification(e.path,e):e instanceof gu?this.setOwnDataElement(e.path,e):e instanceof os||this.getExtensionForElementClass(v(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&bl(e.package,e),e instanceof tu?this.mappingsIndex.delete(e.path):e instanceof ou?this.storesIndex.delete(e.path):e instanceof ts?(this.typesIndex.delete(e.path),e instanceof rs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof eu?this.associationsIndex.delete(e.path):e instanceof su?this.profilesIndex.delete(e.path):e instanceof ru?this.functionsIndex.delete(e.path):e instanceof iu?this.servicesIndex.delete(e.path):e instanceof cu?this.runtimesIndex.delete(e.path):e instanceof hu?this.connectionsIndex.delete(e.path):e instanceof uu?this.fileGenerationsIndex.delete(e.path):e instanceof pu?this.generationSpecificationsIndex.delete(e.path):e instanceof gu?this.dataElementsIndex.delete(e.path):e instanceof os?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(v(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new k(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof os&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof os)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new k(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new k(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=wl(s);if(!(e instanceof os)){const t=this.getNullablePackage(i)??(""!==i?kl(this,i,void 0):this.root);e.name=n,e instanceof ru&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Vl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Vl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&bl(e.package,e),Ll(t,e))}var a,r;if(e instanceof tu)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof ou)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ts)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof rs&&(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 eu)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof su)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof ru)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof iu)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof cu)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof hu)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof uu)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof gu)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof pu)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof os){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new M("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){bl(r,e);const t=""!==i?kl(this,i,void 0):this.root;Ll(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(v(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 Tu extends fu{constructor(e,t){super(ge.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const Cu=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class xu{root=new os(ge.PROJECT_DEPENDENCY_ROOT);projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{this.projectDependencyModelsIndex.set(e,new Tu(this.extensionElementClasses,this.root))}))}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=Cu(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=Cu(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=Cu(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=Cu(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=Cu(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=Cu(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=Cu(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=Cu(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=Cu(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=Cu(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=Cu(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=Cu(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=Cu(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=Cu(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=Cu(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=Cu(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 z(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class Ou extends ou{static NAME="ModelStore";static INSTANCE=new Ou;constructor(){super(Ou.NAME)}accept_PackageableElementVisitor(e){throw new k}}class Nu extends fu{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(ge.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Ou.NAME,Ou.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[qd.STRING,qd.BOOLEAN,qd.BINARY,qd.NUMBER,qd.INTEGER,qd.FLOAT,qd.DECIMAL,qd.DATE,qd.STRICTDATE,qd.DATETIME,qd.STRICTTIME,qd.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Au extends fu{autoImports=[];constructor(e){super(ge.SYSTEM,e)}initializeAutoImports(){this.autoImports=xe.map((e=>H(this.getOwnNullableElement(e,!0),os,`Can't find auto-import package '${e}'`)))}}class yu extends fu{constructor(e){super(ge.MODEL_GENERATION,e)}}class Su extends fu{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(ge.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new yu(i),this.dependencyManager=new xu(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=>z(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>z(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=>z(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>H(this.getType(e),ns,`Can't find enumeration '${e}'`);getMeasure=e=>H(this.getType(e),rs,`Can't find measure '${e}'`);getUnit=e=>H(this.getType(e),as,`Can't find unit '${e}'`);getClass=e=>H(this.getType(e),ss,`Can't find class '${e}'`);getAssociation=e=>z(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>z(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??H(this.getType(e),ss),`Can't find property owner '${e}'`);getFunction=e=>H(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),ru,`Can't find function '${e}'`);getStore=e=>z(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=>H(this.getStore(e),lu,`Can't find flat-data store '${e}'`);getDatabase=e=>H(this.getStore(e),_u,`Can't find database store '${e}'`);getMapping=e=>z(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>z(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>z(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>z(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>z(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>z(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>z(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 z(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)=>z(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>j((()=>this.getClass(e)));getNullableMapping=e=>j((()=>this.getMapping(e)));getNullableService=e=>j((()=>this.getService(e)));getNullableRuntime=e=>j((()=>this.getRuntime(e)));getNullableFileGeneration=e=>j((()=>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=Vd.ONE:0===e&&1===t?s=Vd.ZERO_ONE:0===e&&void 0===t?s=Vd.ZERO_MANY:1===e&&void 0===t?s=Vd.ONE_MANY:0===e&&0===t&&(s=Vd.ZERO),s??new Vd(e,t)}addElement(e,t){const s=Pl(t??"",e.name);if(this.getNullableElement(s,!1))throw new M(`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 M(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class vu{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Iu{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ru extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class wu extends Ru{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new wu(e)}}class Pu{source;line;column;startLine;startColumn;endLine;endColumn}(0,Ue.yu)(Pu,{column:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)(),line:(0,Ue.Ru)(),source:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)()});class Lu{package;name;tags=[];stereotypes=[]}(0,Ue.yu)(Lu,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ru)()),tags:(0,Ue.pb)((0,Ue.Ru)())});class bu{profile;value}(0,Ue.yu)(bu,{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()});class Du{profile;value}(0,Ue.yu)(Du,{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()});class Mu{tag;value}(0,Ue.yu)(Mu,{tag:(0,Ue.Ry)(Du),value:(0,Ue.Ru)()});class ku{rawType;typeParameter}(0,Ue.yu)(ku,{rawType:(0,Ue.jt)((0,Ue.Ru)()),typeParameter:(0,Ue.jt)((0,Ue.Ru)())});class Fu{name;stereotypes=[];taggedValues=[];multiplicity;genericType}(0,Ue.yu)(Fu,{genericType:(0,Ue.Ry)(ku),multiplicity:(0,Ue.Ru)(),name:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu))});class ju{package;name;sourceInformation}(0,Ue.yu)(ju,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),sourceInformation:(0,Ue.Ry)(Pu)});class Uu{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Ue.yu)(Uu,{generalizations:(0,Ue.pb)((0,Ue.Ry)(ku)),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),properties:(0,Ue.pb)((0,Ue.Ry)(Fu)),qualifiedProperties:(0,Ue.pb)((0,Ue.Ry)(Fu)),sourceInformation:(0,Ue.Ry)(Pu),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu))});class Vu{package;name;enumValues=[]}(0,Ue.yu)(Vu,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),enumValues:(0,Ue.pb)((0,Ue.Ru)())});class Gu{x;y}(0,Ue.yu)(Gu,{x:(0,Ue.Ru)(),y:(0,Ue.Ru)()});class zu{height;width}(0,Ue.yu)(zu,{height:(0,Ue.Ru)(),width:(0,Ue.Ru)()});class Bu{points=[]}(0,Ue.yu)(Bu,{points:(0,Ue.pb)((0,Ue.Ry)(Gu))});class $u{id;source;target;geometry}(0,Ue.yu)($u,{geometry:(0,Ue.Ry)(Bu),id:(0,Ue.Ru)(),source:(0,Ue.Ru)(),target:(0,Ue.Ru)()});class Hu{name;owningType}(0,Ue.yu)(Hu,{name:(0,Ue.Ru)(),owningType:(0,Ue.Ru)()});class Yu{id;source;target;property;geometry}(0,Ue.yu)(Yu,{geometry:(0,Ue.Ry)(Bu),id:(0,Ue.Ru)(),property:(0,Ue.Ry)(Hu),source:(0,Ue.Ru)(),target:(0,Ue.Ru)()});class Wu{id;type;position;rectangleGeometry}(0,Ue.yu)(Wu,{id:(0,Ue.Ru)(),position:(0,Ue.Ry)(Gu),rectangleGeometry:(0,Ue.Ry)(zu),type:(0,Ue.Ru)()});class Ku{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[]}(0,Ue.yu)(Ku,{name:(0,Ue.Ru)(),generalizationViews:(0,Ue.pb)((0,Ue.Ry)($u)),package:(0,Ue.Ru)(),propertyViews:(0,Ue.pb)((0,Ue.Ry)(Yu)),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu)),typeViews:(0,Ue.pb)((0,Ue.Ry)(Wu))});class Xu{classes=[];enumerations=[];profiles=[]}(0,Ue.yu)(Xu,{classes:(0,Ue.pb)((0,Ue.Ry)(Uu)),enumerations:(0,Ue.pb)((0,Ue.Ry)(Vu)),profiles:(0,Ue.pb)((0,Ue.Ry)(Lu))});class Zu{name;diagram;domainInfo}(0,Ue.yu)(Zu,{diagram:(0,Ue.Ry)(Ku),name:(0,Ue.Ru)(),domainInfo:(0,Ue.jt)((0,Ue.Ry)(Xu))});class qu{class;enumerations=[];profiles=[];specializations=[]}(0,Ue.yu)(qu,{class:(0,Ue.Ry)(Uu),enumerations:(0,Ue.pb)((0,Ue.Ry)(Vu)),profiles:(0,Ue.pb)((0,Ue.Ry)(Lu)),specializations:(0,Ue.pb)((0,Ue.Ry)(ju))});const Ju=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}`},Qu=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=wl(e),r=new ss(a);return Ll(Ml(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},ep=e=>{if("*"===e)return new Vd(0,void 0);{const t=e.split("..");if(1===t.length)return new Vd(parseInt(z(t[0]),10),parseInt(z(t[0]),10));if(2===t.length)return new Vd(parseInt(z(t[0]),10),"*"===t[1]?void 0:parseInt(z(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},tp=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;w(e.taggedValues,new Gd(Bd.create((i=s.getProfile(t.tag.profile),n=t.tag.value,z(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;w(e.stereotypes,Hd.create((i=s.getProfile(t.profile),n=t.value,z(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=Qu(z(t.rawType),s,i,void 0);w(e.generalizations,Wd.create(new Kd(n))),w(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{w(e.properties,new Xd(t.name,ep(t.multiplicity),Wd.create(new Kd(s.getOwnNullableEnumeration(z(t.genericType.rawType))??Qu(z(t.genericType.rawType),s,i,void 0))),e))})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{w(e.derivedProperties,new Zd(t.name,ep(t.multiplicity),Wd.create(new Kd(s.getOwnNullableEnumeration(z(t.genericType.rawType))??Qu(z(t.genericType.rawType),s,i,void 0))),e))}))},sp=e=>{const t=new Su(new Nu([]),new Au([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new ss(e.name);Ll(Ml(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 su(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new vu(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new Iu(s,e))))})),i.enumerations.forEach((e=>{const s=new ns(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":_e}${e.name}`,n=t.getClass(i);tp(n,e,t,s)}))}const i=e.diagram,n=new Bo(i.name);return Ll(Ml(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new Zl(n,e.id,_s.create(t.getClass(e.type)));s.position=new Wl(e.position.x,e.position.y),s.rectangle=new Kl(e.rectangleGeometry.width,e.rectangleGeometry.height),w(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new sc(n,wu.create((i=t.getClass(e.property.owningType),a=e.property.name,z(i instanceof ss?Ul(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),z(n.classViews.find((t=>t.id===e.source))),z(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Wl(e.x,e.y))),oc(s),w(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new ic(n,z(n.classViews.find((t=>t.id===e.source))),z(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Wl(e.x,e.y))),oc(t),w(n.generalizationViews,t)})),[n,t,s]};class ip extends Lh{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;constructor(e,t,s,i){super(e),(0,N.rC)(this,{_renderer:N.LO,diagram:N.LO,diagramInfo:N.LO,addClassView:N.ls,rebuild:N.aD,setRenderer:N.aD}),this.diagramPath=s,this.filePath=i,this.diagramInfo=t;const[n,a,r]=sp(t);this.diagram=n,this.graph=a,this.diagramClasses=r}get label(){return vh(this.diagramPath)}get description(){return vh(this.diagramPath)}get renderer(){return z(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)}rebuild(e){this.diagramInfo=e;const[t,s,i]=sp(e);this.diagram=t,this.graph=s,this.diagramClasses=i}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Rh(t.source,t.startLine,t.startColumn);(0,N.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?"":_e}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new su(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new vu(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new Iu(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":_e}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new ns(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":_e}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new ss(i.name),Ll(Ml(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=z(a),n=Qu(z(`${e.package}${""===e.package?"":_e}${e.name}`),t,s,e.sourceInformation);w(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||w(n.generalizations,Wd.create(new Kd(i)))})),r&&tp(a,i,t,s),a})((0,Ue.vB)(qu,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 -");return`cview_${e.map((e=>{const t=e.match(new RegExp("^cview_(?<count>\\d+)$"));return t?.groups?.count?parseInt(t.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0)+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}}class np{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,N.rC)(this,{text:N.LO,isCaseSensitive:N.LO,isRegExp:N.LO,reset:N.aD,setText:N.aD,setCaseSensitive:N.aD,setRegExp:N.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class ap{applicationStore;initState=pt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Sh.CONSOLE;auxPanelDisplayState=new Ud({initial:0,default:300,snap:100});activeActivity=yh.CONCEPT;sideBarDisplayState=new Ud({initial:300,default:300,snap:150});tabManagerState=new bh(this);executionState=pt.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=pt.create();fileSearchCommandState=new np;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=pt.create();textSearchCommandState=new np;openTextSearchCommand=!1;searchState;testRunState=pt.create();testRunnerState;constructor(e){(0,N.rC)(this,{isMaxAuxPanelSizeSet:N.LO,activeAuxPanelMode:N.LO,activeActivity:N.LO,consoleText:N.LO,navigationStack:N.LO,openFileSearchCommand:N.LO,fileSearchCommandResults:N.LO,fileSearchCommandState:N.LO,openTextSearchCommand:N.LO,textSearchCommandState:N.LO,searchState:N.LO,testRunnerState:N.LO,setOpenFileSearchCommand:N.aD,setOpenTextSearchCommand:N.aD,setActiveAuxPanelMode:N.aD,setActiveActivity:N.aD,setConsoleText:N.aD,setSearchState:N.aD,setTestRunnerState:N.aD,pullInitializationActivity:N.aD,pullExecutionStatus:N.aD,initialize:N.ls,checkIfSessionWakingUp:N.ls,loadDiagram:N.ls,loadFile:N.ls,reloadFile:N.ls,execute:N.ls,executeGo:N.ls,manageExecuteGoResult:N.ls,executeTests:N.ls,executeFullTestSuite:N.ls,executeNavigation:N.ls,navigateBack:N.ls,executeSaveAndReset:N.ls,fullReCompile:N.ls,refreshTrees:N.ls,updateFileUsingSuggestionCandidate:N.ls,updateFile:N.ls,searchFile:N.ls,searchText:N.ls,findUsages:N.ls,command:N.ls,createNewDirectory:N.ls,createNewFile:N.ls,deleteDirectoryOrFile:N.ls}),this.applicationStore=e,this.directoryTreeState=new Hh(this),this.conceptTreeState=new td(this),this.client=new jd(new de({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,N.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,Ue.vB)(nd,n):(0,Ue.vB)(id,n):(0,Ue.vB)(sd,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open()),o instanceof id?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof nd&&(yield(0,N.fl)(this.loadFile(o.source,new Rh(o.source,o.line,o.column,(o.text??"").split("\n").filter(Boolean)[0])))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return F(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.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.commandCenter.registerCommand({key:Dh.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Dh.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Dh.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof kh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:Dh.EXECUTE,action:()=>{(0,N.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.FULL_RECOMPILE,action:()=>{(0,N.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,N.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.RUN_ALL_TESTS,action:()=>{(0,N.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.RUN_RELAVANT_TESTS,action:()=>{(0,N.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Dh.SEARCH_FILE,Dh.SEARCH_TEXT,Dh.GO_TO_FILE,Dh.TOGGLE_AUX_PANEL,Dh.EXECUTE,Dh.FULL_RECOMPILE,Dh.FULL_RECOMPILE_WITH_FULL_INIT,Dh.RUN_ALL_TESTS,Dh.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.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){const s=this.tabManagerState.tabs.find((t=>t instanceof ip&&t.filePath===e));if(s)this.tabManagerState.openTab(s);else{yield(0,N.fl)(this.checkIfSessionWakingUp());const s=new ip(this,(0,Ue.vB)(Zu,yield this.client.getDiagramInfo(t)),t,e);this.tabManagerState.openTab(s)}}*loadFile(e,t){const s=this.tabManagerState.tabs.find((t=>t instanceof kh&&t.filePath===e));if(s)t&&s.setCoordinate(t),this.tabManagerState.openTab(s);else{yield(0,N.fl)(this.checkIfSessionWakingUp());const s=new kh(this,(0,Ue.vB)(Ih,yield this.client.getFile(e)),e,t);this.tabManagerState.openTab(s)}}*reloadFile(e){yield Promise.all(this.tabManagerState.tabs.map((async t=>{t instanceof kh&&t.filePath===e?(t.setFile((0,Ue.vB)(Ih,await this.client.getFile(e))),t.setCoordinate(void 0)):t instanceof ip&&t.filePath===e&&t.rebuild((0,Ue.vB)(Zu,await this.client.getDiagramInfo(t.diagramPath)))})))}*execute(e,t,s,i){if(this.initState.hasSucceeded)if(this.executionState.isInProgress)this.applicationStore.notifyWarning("Another execution is already in progress!");else{this.searchState instanceof xd||this.setSearchState(void 0),this.executionState.inProgress();try{const a=this.tabManagerState.tabs.map((e=>e instanceof kh?{path:e.filePath,code:e.file.content}:e instanceof ip?{diagram:e.diagramPath,code:Ju(e.diagram)}:void 0)).filter(V),r=this.client.execute(a,e,t),o=1e3;let l,c=!1;yield Promise.all([r.then((e=>{c=!0,l=e})),new Promise((e=>setTimeout((()=>{!c&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),o,!0)))]);const h=(n=z(l)).error?n.candidateName&&n.PureUnmatchedFunctionException?(0,Ue.vB)(ud,n):n.candidateName&&n.candidates?(0,Ue.vB)(pd,n):(0,Ue.vB)(od,n):n.jumpTo?(0,Ue.vB)(cd,n):n.tests?(0,Ue.vB)(gd,n):(0,Ue.vB)(rd,n);this.applicationStore.setBlockingAlert(void 0),this.setConsoleText(h.text),h instanceof od?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,N.fl)(i(h))):h instanceof rd?(this.applicationStore.notifySuccess("Execution succeeded!"),h.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,N.fl)(this.initialize(!1,(()=>(0,N.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,N.fl)(i(h))):yield(0,N.fl)(i(h))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var n}else this.applicationStore.notifyWarning("Can't execute while initializing application")}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.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.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,N.fl)(this.execute("executeGo",{},!0,(e=>(0,N.fl)(this.manageExecuteGoResult(e)))))}*manageExecuteGoResult(e){const t=(0,N.fl)(this.refreshTrees());if(e instanceof od)yield(0,N.fl)(this.loadFile(e.source,new Rh(e.source,e.line,e.column,e.text.split("\n").filter(Boolean)[0]))),e instanceof ud?(this.setSearchState(new Nd(this,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof pd&&(this.setSearchState(new Ad(this,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof rd&&e.modifiedFiles.length)for(const t of e.modifiedFiles)yield(0,N.fl)(this.reloadFile(t));yield t}*executeTests(e,t){this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,N.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async e=>{const t=(0,N.fl)(this.refreshTrees());if(e instanceof od)await(0,N.fl)(this.loadFile(e.source,new Rh(e.source,e.line,e.column,e.text.split("\n").filter(Boolean)[0]))),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof gd){this.setActiveAuxPanelMode(Sh.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new bd(this,e);this.setTestRunnerState(t),await(0,N.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,N.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}await t}))))}*executeFullTestSuite(e){yield(0,N.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,N.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async e=>{e instanceof cd&&await(0,N.fl)(this.loadFile(e.jumpTo.source,new Rh(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column)))})))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,N.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*executeSaveAndReset(e){yield(0,N.fl)(this.execute("executeSaveAndReset",{},!0,(async t=>{this.initState.reset(),await(0,N.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.setActiveActivity(yh.CONCEPT,{keepShowingIfMatchedCurrent:!0})})))}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:At.CAUTION,actions:[{label:"Perform full re-compile",type:yt.PROCEED_WITH_CAUTION,handler:()=>{(0,N.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:yt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,N.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){yield(0,N.fl)(this.execute("updateSource",{updatePath:e,updateSources:[{path:e,line:t,column:s,add:i,message:n}]},!1,(e=>(0,N.fl)(this.manageExecuteGoResult(e)))))}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,Ue.vB)(Td,e))(e)));this.setSearchState(new xd(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){F(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*findUsages(e){const t="Error finding references. Please make sure that the code compiles and that you are looking for references of non primitive types!";let s;try{s=yield this.client.getConceptPath(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Dd(s)}`,showLoading:!0});const e=(yield this.client.getUsages(s.owner?s.type?"meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",(s.owner?[`'${s.owner}'`]:[]).concat(`'${s.path}'`))).map((e=>(0,Ue.vB)(Md,e)));this.setSearchState(new Od(this,s,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}*command(e){try{const s=(t=yield e()).error?(0,Ue.vB)(Fd,t):new kd;return!(s instanceof Fd&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return F(e),this.applicationStore.notifyError(e),!1}var t}*createNewDirectory(e){yield(0,N.fl)(this.command((()=>this.client.createFolder(vh(e))))),yield(0,N.fl)(this.directoryTreeState.refreshTreeData())}*createNewFile(e){const t=yield(0,N.fl)(this.command((()=>this.client.createFile(vh(e)))));yield(0,N.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,N.fl)(this.loadFile(e)))}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,N.fl)(this.command((()=>this.client.deleteDirectoryOrFile(vh(e))))),this.tabManagerState.tabs.filter((t=>t instanceof kh&&t.filePath.startsWith(e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,N.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.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:At.CAUTION,actions:[{label:"Delete anyway",type:yt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:yt.PROCEED,default:!0}]})}}const rp=(0,et.createContext)(void 0),op=({children:e})=>{const t=Lt(),s=(0,Qe.fv)((()=>new ap(t)));return(0,x.jsx)(rp.Provider,{value:s,children:e})},lp=()=>z((0,et.useContext)(rp),"Can't find editor store in context"),cp=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,x.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),hp=(0,Qe.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=lp(),n=Lt(),a=e=>()=>(0,N.fl)(i.loadFile(s.sourceId,new Rh(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,x.jsxs)("div",{className:"search-panel__entry",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,x.jsx)(Vc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:vh(s.sourceId)})]}),(0,x.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,x.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,x.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,x.jsx)(Vc.q1B,{})})]})]}),(0,x.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:`line: ${e.startLine} - column: ${e.startColumn}`}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,x.jsx)(Vc.q1B,{})})})]},e.uuid)))})]})})),dp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=lp();return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,x.jsx)(hp,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(eh,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),up=(0,Qe.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Dd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(hp,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(eh,{children:`No usages found for ${Dd(t.usageConcept)}`})})),pp=(0,Qe.Pi)((e=>{const{candidate:t}=e,s=lp(),i=Lt(),n=()=>{(0,N.fl)(s.loadFile(t.sourceID,new Rh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${vh(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,x.jsx)(Vc.bK4,{})})})]})})),_p=(0,Qe.Pi)((e=>{const{candidate:t}=e,s=lp(),i=Lt();return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,N.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${vh(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,N.fl)(s.loadFile(t.sourceID,new Rh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Vc.bK4,{})})})]})})),mp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,x.jsx)(pp,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,x.jsx)(_p,{candidate:e},e.uuid)))})]})]})})),gp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,x.jsx)(_p,{candidate:e},e.uuid)))})]})]})})),Ep=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)(jc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Od&&(0,x.jsx)(up,{usageState:e.searchState}),e.searchState instanceof xd&&(0,x.jsx)(dp,{searchState:e.searchState}),e.searchState instanceof Nd&&(0,x.jsx)(mp,{searchState:e.searchState}),e.searchState instanceof Ad&&(0,x.jsx)(gp,{searchState:e.searchState})]})})),fp=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Ic.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,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},Tp=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:Tp,TreeNodeContainer:fp},h=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Ic.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,x.jsx)(h.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,x.jsx)(h.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},Cp=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(V),h={TreeNodeView:Tp,TreeNodeContainer:fp},d=n?{...h,...n}:h;return(0,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,x.jsx)(d.TreeNodeView,{level:0,node:e,getChildNodes:r,components:d,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var xp=s(410);const Op=xp.gs,Np="resizable-panel--collapsed",Ap=(e,t)=>({collapsiblePanel:{className:(0,Ic.clsx)(...t?.classes??[],{[Np]:e}),onStartResize:e=>{e.domElement.classList.remove(Np),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}}),yp=xp.jW,Sp=xp.nN,vp=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var Ip=s(177);const Rp=(0,Qe.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c}=a,h=r.testResultInfo,d=!t.data.type,u=t.id===r.selectedNode?.id,p=h?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?Xh.PASSED:t.failedTests.has(e)?Xh.FAILED:t.testsWithError.has(e)?Xh.ERROR:Xh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(s)))||t.testWithErrorIds.some((e=>e.startsWith(s)))?Xh.FAILED:t.notRunTestIds.some((e=>e.startsWith(s)))?Xh.RUNNING:Xh.PASSED})(t,h):void 0;let _=(0,x.jsx)(Vc.pTE,{});switch(p){case Xh.PASSED:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,x.jsx)(Vc.rE2,{})});break;case Xh.FAILED:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,x.jsx)(Vc.$Ow,{})});break;case Xh.ERROR:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,x.jsx)(Vc.xDH,{})});break;case Xh.RUNNING:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,x.jsx)(Vc.VRP,{})});break;default:_=(0,x.jsx)(Vc.pTE,{})}const m=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Ic.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":u}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{d?m():o(t)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:d?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,dangerouslySetInnerHTML:{__html:t.label}})]})})),wp=(0,Qe.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,children:(0,x.jsxs)("div",{className:"explorer__content__inner",onClick:()=>t.setSelectedNode(void 0),children:[i&&(0,x.jsx)(eh,{children:"No tests found"}),!i&&(0,x.jsx)(Cp,{components:{TreeNodeContainer:Rp},treeData:s,onNodeSelect:e=>t.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(V),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})})),Pp=(0,Qe.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=i.results.get(s),a=z(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__label",children:a.text})})}),(0,x.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!n&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),n instanceof Sd&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),n instanceof Id&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:n.error.text})]})]})})),Lp=(0,Qe.Pi)((e=>{const{testRunnerState:t}=e,s=lp(),i=Lt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Kh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(Op,{orientation:"vertical",children:[(0,x.jsx)(yp,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)(jc,{isLoading:t.treeBuildingState.isInProgress}),(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,x.jsx)(Vc.rE2,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,x.jsx)(Vc.$Ow,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,x.jsx)(Vc.xDH,{})]})]}),a&&(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,x.jsx)(Vc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Vc.jG4,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,N.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,x.jsx)(Vc.SCS,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,N.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,x.jsx)(Vc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(Ip.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,x.jsx)("div",{className:"panel__content",children:t.treeData&&(0,x.jsx)(wp,{testRunnerState:t})})]})}),(0,x.jsx)(Sp,{children:(0,x.jsx)(vp,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(yp,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(Pp,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header"}),(0,x.jsx)("div",{className:"panel__content",children:(0,x.jsx)(eh,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),bp=(0,Qe.Pi)((()=>{const e=lp().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(Lp,{testRunnerState:e})]})})),Dp=(0,Qe.Pi)((()=>{const e=lp(),t={[Sh.CONSOLE]:{mode:Sh.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[Sh.SEARCH_RESULT]:{mode:Sh.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Vc.W1M,{})}),isVisible:!0},[Sh.TEST_RUNNER]:{mode:Sh.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Vc.Vzd,{})}),isVisible:!0}},s=Object.values(Sh).filter((e=>V(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,et.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Sh.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,x.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(V).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Ic.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,x.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(Sh.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(cp,{})}),i(Sh.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(Ep,{})}),i(Sh.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(bp,{})})]})]})}));var Mp=s(2689);const kp=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Vc.jtq,{})}),Fp=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),jp=()=>(0,x.jsx)("div",{className:"icon color--association",children:"A"}),Up=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),Vp=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),Gp=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),zp=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),Bp=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Vc.eid,{})}),$p=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Vc.UOT,{})}),Hp=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Vc.eid,{})}),Yp=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Vc.HXR,{})}),Wp=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Vc.oF7,{})}),Kp=e=>{switch(e){case Yh.PACKAGE:return(0,x.jsx)(kp,{});case Yh.PROFILE:return(0,x.jsx)(zp,{});case Yh.CLASS:return(0,x.jsx)(Fp,{});case Yh.ASSOCIATION:return(0,x.jsx)(jp,{});case Yh.PROPERTY:return(0,x.jsx)(Yp,{});case Yh.ENUMERATION:return(0,x.jsx)(Up,{});case Yh.MEASURE:return(0,x.jsx)(Vp,{});case Yh.UNIT:return(0,x.jsx)(Gp,{});case Yh.FUNCTION:return(0,x.jsx)(Bp,{});case Yh.NATIVE_FUNCTION:return(0,x.jsx)(Hp,{});case Yh.DIAGRAM:return(0,x.jsx)(Wp,{});default:return(0,x.jsx)($p,{})}},Xp=(0,Qe.Pi)((0,et.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=lp(),r=Lt();return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[n===Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename package"),children:"Rename"}),n===Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename property"),children:"Rename"}),n!==Yh.PACKAGE&&n!==Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename"),children:"Rename"}),n===Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,N.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n!==Yh.PACKAGE&&n!==Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Move file"),children:"Move"}),n===Yh.FUNCTION&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),n!==Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i(s),children:"View Source"})]})})));var Zp;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(Zp=Zp||(Zp={}));const qp=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,et.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:h,viewConceptSource:d}=a,u=[Yh.PACKAGE,Yh.CLASS,Yh.ASSOCIATION].includes(t.data.li_attr.pureType),p=()=>{t.isLoading||(t.isOpen?h(t):c(t))},[,_]=(0,Mp.c)((()=>({type:"Class"===t.data.li_attr.pureType?Zp.CLASS:Zp.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(Wc,{content:(0,x.jsx)(Xp,{node:t,viewConceptSource:d}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Ic.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:_,onDoubleClick:()=>{t.isLoading||(u?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Vc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:u?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:Kp(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,dangerouslySetInnerHTML:{__html:t.label}})]})})},Jp=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,menuProps:{elevation:7},children:(0,x.jsx)("div",{className:"explorer__content__inner",onClick:()=>s.setSelectedNode(void 0),children:(0,x.jsx)(Cp,{components:{TreeNodeContainer:qp},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(V),innerProps:{onNodeOpen:e=>{(0,N.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,N.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof Qh||s instanceof Jh)&&e.directoryTreeState.revealPath(s.file,!0,new Rh(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}})})})})),Qp=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.conceptTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,N.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Vc.DuK,{})}),(0,x.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,x.jsx)(Vc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(jc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(Jp,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(eh,{children:"Failed to build concept tree"})]})]})})]})})),e_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState.nodeForCreateNewFile,[i,n]=(0,et.useState)(""),a=(0,et.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewFile(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,N.fl)(e.createNewFile(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(vc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),t_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState.nodeForCreateNewDirectory,[i,n]=(0,et.useState)(""),a=(0,et.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewDirectory(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,N.fl)(e.createNewDirectory(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(vc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),s_=(0,Qe.Pi)((0,et.forwardRef)((function(e,t){const{node:s}=e,i=Lt(),n=lp(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Folder"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Rename file"),children:"Rename"}),(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,N.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Move file"),children:"Move"})]})}))),i_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,et.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:h}=a,d=t.data.isFolderNode,u=d?t.isOpen?(0,x.jsx)("div",{children:(0,x.jsx)(Vc.ry,{})}):(0,x.jsx)("div",{children:(0,x.jsx)(Vc.ROc,{})}):(0,x.jsx)(Vc.QqN,{}),p=()=>{t.isLoading||(t.isOpen?h(t):c(t))};return(0,x.jsx)(Wc,{content:(0,x.jsx)(s_,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Ic.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||(d?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Vc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:d?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:u})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},n_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,menuProps:{elevation:7},children:(0,x.jsxs)("div",{className:"explorer__content__inner",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(Cp,{components:{TreeNodeContainer:i_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(V),innerProps:{onNodeOpen:e=>{(0,N.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,N.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),(0,x.jsx)(e_,{}),(0,x.jsx)(t_,{})]})})})),a_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,N.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Vc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof kh&&(0,N.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Vc.cOE,{})}),(0,x.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,x.jsx)(Vc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(jc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(n_,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(eh,{children:"Failed to build directory tree"})]})]})})]})})),r_=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Ic.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case yh.CONCEPT:return(0,x.jsx)(Qp,{});case yh.FILE:return(0,x.jsx)(a_,{});default:return null}})()},e.activeActivity)})})),o_=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)("logo",t),children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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"})})]})})},l_=(0,Qe.Pi)((()=>{const e=lp(),t=t=>()=>e.setActiveActivity(t),s=[{mode:yh.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Vc.DE2,{})},{mode:yh.FILE,title:"File Explorer",icon:(0,x.jsx)(Vc.QqN,{})}].filter((e=>Boolean(e)));return(0,x.jsxs)("div",{className:"activity-bar",children:[(0,x.jsx)("div",{className:"activity-bar__logo",children:(0,x.jsx)(o_,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Ic.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)))})]})})),c_=(0,Qe.Pi)((e=>{const t=lp(),s=Lt();return(0,x.jsxs)("div",{className:"editor__status-bar",children:[(0,x.jsx)("div",{className:"editor__status-bar__left",children:(0,x.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,x.jsxs)("div",{className:"editor__status-bar__right",children:[(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":t.executionState.isInProgress}),disabled:t.executionState.isInProgress,onClick:()=>{(0,N.fl)(t.executeGo()).catch(s.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,x.jsx)(Vc.pgN,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(t.auxPanelDisplayState.isOpen)}),onClick:()=>t.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,x.jsx)(Vc.FxN,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!s.assistantService.isHidden}),onClick:()=>s.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,x.jsx)(Vc.UHp,{})})]})]})})),h_=e=>{(0,et.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},d_=(0,Qe.Pi)((e=>{const{editorState:t}=e,s=(0,et.useRef)(void 0),i=t._textEditor,n=lp(),a=Lt(),r=t.file.content,o=(0,et.useRef)(null),{ref:l,width:c,height:h}=(0,Qc.NB)();if((0,et.useEffect)((()=>{if(o.current){const e=o.current,i=A.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,language:C.PURE,theme:T.LEGEND});i.onDidChangeCursorPosition((()=>{const e=i.getPosition();e&&(s.current=e)})),i.onDidChangeModelContent((()=>{const e=i.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),i.focus(),t.setTextEditor(i)}}),[n,a,t]),i){i.getValue()!==r&&i.setValue(r);const e=i.getModel();if(e){e.updateOptions({tabSize:2});const s=t.coordinate;s?.errorMessage?((e,t)=>{A.editor.setModelMarkers(e,"dummy_problem_marker_owner",t.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:A.MarkerSeverity.Error}))))})(e,[{message:s.errorMessage,startLineNumber:s.line,startColumn:s.column,endLineNumber:s.line,endColumn:s.column}]):A.editor.setModelMarkers(e,"Error",[])}}return h_(t),(0,et.useEffect)((()=>{void 0!==c&&void 0!==h&&i?.layout({width:c,height:h})}),[i,c,h]),(0,et.useEffect)((()=>{const e=t.coordinate;i&&e&&((e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)})(i,{lineNumber:e.line,column:e.column})}),[i,t.coordinate]),(0,et.useEffect)((()=>()=>{i&&(e=>{e.dispose(),e.getModel()?.dispose()})(i)}),[i]),(0,et.useEffect)((()=>()=>{s.current&&t.setCoordinate(new Rh(t.filePath,s.current.lineNumber,s.current.column))}),[t]),(0,x.jsx)("div",{className:"panel edit-panel",children:(0,x.jsx)("div",{className:"panel__content edit-panel__content edit-panel__content--headless",children:(0,x.jsx)("div",{ref:l,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:o})})})})}));var u_,p_=s(1367),__=s(5903);!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(u_=u_||(u_={}));class m_ extends tc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Yt([zo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const g_=(0,N.aD)(((e,t)=>{e.value=t})),E_=((0,N.aD)(((e,t)=>{L(e.properties,t)})),(0,N.aD)(((e,t)=>{w(e.properties,yo(t))}))),f_=((0,N.aD)(((e,t,s)=>{P(e.properties,t,s)})),(0,N.aD)(((e,t)=>{L(e.derivedProperties,t)})),(0,N.aD)(((e,t)=>{w(e.derivedProperties,So(t))})),(0,N.aD)(((e,t,s)=>{P(e.derivedProperties,t,s)})),(0,N.aD)(((e,t)=>{w(e.constraints,Io(t))})),(0,N.aD)(((e,t)=>{L(e.constraints,t)})),(0,N.aD)(((e,t,s)=>{P(e.constraints,t,s)})),(0,N.aD)(((e,t)=>{w(e.generalizations,_o(t))}))),T_=((0,N.aD)(((e,t)=>{L(e.generalizations,t)})),(0,N.aD)(((e,t,s)=>{P(e.generalizations,t,s)})),(0,N.aD)(((e,t)=>{w(e._subclasses,t)})),(0,N.aD)(((e,t)=>{L(e._subclasses,t)})),(0,N.aD)(((e,t)=>{_o(e),po(t),e.value=t,e.ownerReference.value=t.rawType}))),C_=((0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{T_(e.genericType,po(t))})),(0,N.aD)(((e,t)=>{e.multiplicity=t})),(0,N.aD)(((e,t)=>{e.aggregation=t})),(0,N.aD)(((e,t)=>{e.value=Eo(t),g_(e.ownerReference,t._OWNER)})),(0,N.aD)(((e,t)=>{w(e.taggedValues,uo(t))})),(0,N.aD)(((e,t)=>{L(e.taggedValues,t)})),(0,N.aD)(((e,t)=>{w(e.stereotypes,co(t))})),(0,N.aD)(((e,t)=>{L(e.stereotypes,t)})),(0,N.aD)(((e,t)=>{e.tag.value=fo(t),e.tag.ownerReference.value=t._OWNER})),(0,N.aD)(((e,t)=>{e.value=t})),(0,N.aD)(((e,t)=>{e.value=t})),(0,N.aD)(((e,t,s)=>{P(e.taggedValues,t,s)})),(0,N.aD)(((e,t,s)=>{P(e.stereotypes,t,s)})),(0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{e.functionDefinition=Fs(t)})),(0,N.aD)(((e,t)=>{w(e.p_tags,fo(t))})),(0,N.aD)(((e,t)=>{L(e.p_tags,t)})),(0,N.aD)(((e,t)=>{w(e.p_stereotypes,Eo(t))})),(0,N.aD)(((e,t)=>{L(e.p_stereotypes,t)})),(0,N.aD)(((e,t,s)=>{P(e.p_tags,t,s)})),(0,N.aD)(((e,t,s)=>{P(e.p_stereotypes,t,s)})),(0,N.aD)(((e,t)=>{L(e.parameters,t)})),(0,N.aD)(((e,t)=>{w(e.parameters,js(t))})),(0,N.aD)(((e,t)=>{g_(e.returnType,Lo(t))})),(0,N.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,N.aD)(((e,t,s)=>{P(e.parameters,t,s)})),(0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{w(e.values,Co(t))})),(0,N.aD)(((e,t)=>{L(e.values,t)})),(0,N.aD)(((e,t,s)=>{P(e.values,t,s)})),(0,N.aD)(((e,t)=>{e.value=Co(t),g_(e.ownerReference,t._OWNER)})),(0,N.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return K(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),z(e.properties[(s+1)%2])})(e,t),n=H(t.genericType.ownerReference.value,ss,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&K(L(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),w(s.propertiesFromAssociations,i);const r=new Kd(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,N.aD)(((e,t)=>{e.canonicalUnit=No(t)})),(0,N.aD)(((e,t)=>{e.conversionFunction=Fs(t)})),(0,N.aD)(((e,t)=>{e.classViews=t.map(Mo)}))),x_=(0,N.aD)(((e,t)=>{w(e.classViews,Mo(t))})),O_=(0,N.aD)(((e,t)=>{L(e.classViews,t)})),N_=(0,N.aD)(((e,t)=>{e.associationViews=t.map(Uo)})),A_=(0,N.aD)(((e,t)=>{L(e.associationViews,t)})),y_=(0,N.aD)(((e,t)=>{e.generalizationViews=t.map(jo)})),S_=(0,N.aD)(((e,t)=>{w(e.generalizationViews,jo(t))})),v_=(0,N.aD)(((e,t)=>{L(e.generalizationViews,t)})),I_=(0,N.aD)(((e,t)=>{e.propertyViews=t.map(Vo)})),R_=(0,N.aD)(((e,t)=>{w(e.propertyViews,Vo(t))})),w_=(0,N.aD)(((e,t)=>{L(e.propertyViews,t)})),P_=(0,N.aD)(((e,t)=>{e.hideProperties=t})),L_=(0,N.aD)(((e,t)=>{e.hideStereotypes=t})),b_=(0,N.aD)(((e,t)=>{e.hideTaggedValues=t})),D_=(0,N.aD)(((e,t)=>{e._offsetX=t})),M_=(0,N.aD)(((e,t)=>{e._offsetY=t})),k_=(0,N.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)})),F_=(0,N.aD)(oc),j_=(0,N.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 nc(n.x,n.y).normal(new nc(l.x,l.y)).unit(),h=nc.fromPoints(n,new Wl(t,s));if(Math.abs(c.dotProduct(h))<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,h=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=h&&(o=new Wl(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&rc(e,r),o})),U_=(0,N.aD)(rc),V_=(0,N.aD)(((e,t)=>{e.rectangle=t})),G_=(0,N.aD)(((e,t)=>{e.position=t})),z_=(0,N.aD)((e=>{e._dummyObservable={}}));var B_,$_,H_;!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"}(B_=B_||(B_={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}($_=$_||($_={})),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"}(H_=H_||(H_={}));const Y_=.05,W_=[50,75,90,100,110,125,150,200,250,300,400],K_=e=>(e instanceof Zd?"/ ":"")+e.name;class X_{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,N.rC)(this,{isReadOnly:N.LO,interactionMode:N.LO,relationshipMode:N.LO,zoom:N.LO,mouseOverClassView:N.LO,mouseOverClassName:N.LO,mouseOverClassCorner:N.LO,mouseOverClassProperty:N.LO,mouseOverPropertyHolderViewLabel:N.LO,selectionStart:N.LO,selectedClassCorner:N.LO,selectedClasses:N.LO,selectedPropertyOrAssociation:N.LO,selectedInheritance:N.LO,leftClick:N.LO,middleClick:N.LO,rightClick:N.LO,changeMode:N.aD,setIsReadOnly:N.aD,setMouseOverClassView:N.aD,setMouseOverClassName:N.aD,setMouseOverClassCorner:N.aD,setMouseOverClassProperty:N.aD,setMouseOverPropertyHolderViewLabel:N.aD,setSelectionStart:N.aD,setSelectedClassCorner:N.aD,setSelectedClasses:N.aD,setSelectedPropertyOrAssociation:N.aD,setSelectedInheritance:N.aD,setLeftClick:N.aD,setMiddleClick:N.aD,setRightClick:N.aD,setZoomLevel:N.aD,align:N.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new Kl(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wl(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 Wl(0,0),this.virtualScreen=new Xl(new Wl(0,0),new Kl(0,0)),this.zoom=1,this.triangle=[new Wl(0,0),new Wl(-15,-10),new Wl(-15,10)],this.diamond=[new Wl(0,0),new Wl(-10,-5),new Wl(-20,0),new Wl(-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=B_.LAYOUT,this.relationshipMode=$_.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 Wl(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Wl(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 Kl(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wl(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 Wl(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case B_.LAYOUT:case B_.PAN:case B_.ZOOM_IN:case B_.ZOOM_OUT:case B_.ADD_CLASS:if(t!==$_.NONE)throw new M(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case B_.ADD_RELATIONSHIP:if(t===$_.NONE)throw new M("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new k(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===B_.ADD_RELATIONSHIP)switch(t){case $_.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||jl(e.class.value).includes(t.class.value)||jl(t.class.value).includes(e.class.value)||f_(e.class.value,Wd.create(new Kd(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new ic(this.diagram,e,t);return S_(this.diagram,s),s}};break;case $_.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new Xd(`property_${e.class.value.properties.length+1}`,Vd.ONE,Wd.create(new Kd(t.class.value)),e.class.value);if(E_(e.class.value,s),e!==t){const i=new sc(this.diagram,wu.create(s),e,t);return R_(this.diagram,i),i}};break;default:throw new k(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case H_.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>G_(t,new Wl(e,t.position.y))));break}case H_.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>G_(t,new Wl(e-t.rectangle.width/2,t.position.y))));break}case H_.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=>G_(t,new Wl(e-t.rectangle.width,t.position.y))));break}case H_.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>G_(t,new Wl(t.position.x,e))));break}case H_.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>G_(t,new Wl(t.position.x,e-t.rectangle.height/2))));break}case H_.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=>G_(t,new Wl(t.position.x,e-t.rectangle.height))));break}case H_.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];G_(s,new Wl(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];G_(n,new Wl(i.position.x+i.rectangle.width+s,n.position.y))}}break}case H_.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];G_(s,new Wl(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];G_(n,new Wl(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 Wl((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 Wl((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 Wl(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Wl(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 Wl(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=z(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=ec.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof sc){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,hc(r).x),n=Math.max(n,hc(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 Xl(new Wl(t,s),new Kl(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Wl(0,0),this.virtualScreen=new Xl(new Wl(this.canvasDimension.width/2,this.canvasDimension.height/2),new Kl(0,0))}executeZoom(e,t){e=Math.max(e,Y_);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Wl(((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,Y_)),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)),Y_))}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 Zl(this.diagram,i,_s.create(e));return G_(n,t??this.canvasCoordinateToModelCoordinate(new Wl(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),x_(this.diagram,n),z_(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)&&S_(this.diagram,new ic(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&S_(this.diagram,new ic(this.diagram,t,n)),Ul(e).forEach((e=>{e.genericType.value.rawType===s&&R_(this.diagram,new sc(this.diagram,wu.create(e),n,t))})),Ul(s).forEach((s=>{s.genericType.value.rawType===e&&R_(this.diagram,new sc(this.diagram,wu.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=K_(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 ns&&(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=ke(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||(Ul(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;V_(e,new Kl(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 Ul(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof Zd?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof qd?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}}z_(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=K_(e),o=ke(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 h=t(l),d=s(l),u=this.modelCoordinateToCanvasCoordinate(new Wl(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new Wl(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new Wl(Math.min(h,p),Math.min(d,_));return new Xl(g,new Kl(Math.max(h,p)+Math.max(l,c)-g.x,Math.max(d,_)+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 Xl(new Wl(0,0),new Kl(0,0))}drawPropertyOrAssociation(e){const t=ec.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 Xd){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let h=0,d=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&&(h=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===u_.COMPOSITE||s.aggregation===u_.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(h+(this.screenOffset.x+lc(this.diamond[0],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[1],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[2],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[3],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[0],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[0],e))*this.zoom),s.aggregation===u_.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===u_.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=ec.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+lc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cc(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)&&U_(e,e.path.map((e=>new Wl(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const t=(e=this.selectedClasses).length?e[0]:void 0;t&&this.center(t.position.x+t.rectangle.width/2,t.position.y+t.rectangle.height/2)}else this.autoRecenter();var e}switchToZoomMode(){this.changeMode(this.interactionMode!==B_.ZOOM_IN?B_.ZOOM_IN:B_.ZOOM_OUT,$_.NONE)}switchToViewMode(){this.changeMode(B_.LAYOUT,$_.NONE)}switchToPanMode(){this.changeMode(B_.PAN,$_.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(B_.ADD_RELATIONSHIP,$_.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(B_.ADD_RELATIONSHIP,$_.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(B_.ADD_CLASS,$_.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof ss&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof ss&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Eh)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{O_(this.diagram,e),N_(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),y_(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),I_(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof m_?A_(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof sc&&w_(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&v_(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=>{P_(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{L_(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{b_(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=>x_(this.diagram,e))),t[1].forEach((e=>S_(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,p_.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Zl(this.diagram,(0,a.Z)(),_s.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=>x_(this.diagram,e))),t[1].forEach((e=>S_(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case B_.LAYOUT:this.diagram.generalizationViews.forEach((e=>F_(e))),this.diagram.associationViews.forEach((e=>F_(e))),this.diagram.propertyViews.forEach((e=>F_(e)));break;case B_.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(B_.LAYOUT,$_.NONE);break}case B_.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=W_[0]-10?10*Math.floor(t/10)+10:t>=W_[W_.length-1]?100*Math.floor(t/100)+100:z(W_.find((e=>e>t))),this.zoomPoint(s/100,new Wl(e.x,e.y));break}case B_.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=W_[0]?10*Math.ceil(t/10)-10:t>=W_[W_.length-1]+100?100*Math.ceil(t/100)-100:z((0,__.Z)(W_,(e=>e<t))),this.zoomPoint(s/100,new Wl(e.x,e.y));break}case B_.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(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&&(D_(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),M_(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),D_(e.to,-(s.position.x+s.rectangle.width/2-t.x)),M_(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(B_.LAYOUT,$_.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([B_.ADD_RELATIONSHIP,B_.ADD_CLASS,B_.ZOOM_IN,B_.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(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 Wl(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case B_.PAN:return void(this.positionBeforeLastMove=new Wl(e.x,e.y));case B_.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(dc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||C_(this.diagram,this.reorderDiagramDomain(z(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||C_(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 Wl(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=j_(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=j_(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=j_(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 B_.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(B_.LAYOUT,$_.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Wl(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Wl(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Wl(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Wl(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===B_.PAN)this.screenOffset=new Wl(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Wl(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Wl(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case B_.LAYOUT:if(this.selectedClassCorner&&(V_(this.selectedClassCorner,new Kl(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),z_(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,G_(i,new Wl(n,r)),z_(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?k_(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&k_(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 Xl(new Wl(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Kl(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(uc(this.selection,e)||uc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case B_.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 Wl(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),dc(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.fontSize;const a=this.computeClassNameWidth(e);new Xl(this.modelCoordinateToCanvasCoordinate(new Wl(e.position.x+(e.rectangle.width-a)/2,n)),new Kl(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Ul(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Xl(this.modelCoordinateToCanvasCoordinate(new Wl(e.position.x+this.classViewSpaceX,n)),new Kl(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=ec.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,p_.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Zl(t,(0,a.Z)(),_s.create(Fl(e.value,ss))))))),(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))),h=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,d=i?l-c-30:l+r+30;return(s||n>0)&&(G_(t[0],new Wl(h,d)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];G_(e,new Wl(i.position.x+i.rectangle.width+10,d))}}))),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 ic(t,s,e):[]))))))]}}var Z_=s(8533);const q_=(0,Qe.Pi)((e=>{const{diagramEditorState:t}=e,s=Lt(),i=t.diagram,n=(0,et.useRef)(null),{width:a,height:r}=(0,Qc.NB)({refreshMode:"debounce",refreshRate:50,targetRef:n}),o=(0,et.useCallback)(((e,i)=>{if(e instanceof ed){const n=i.getClientOffset(),a=n?t.renderer.canvasCoordinateToModelCoordinate(t.renderer.eventCoordinateToCanvasCoordinate(new Wl(n.x,n.y))):void 0;(0,N.fl)(t.addClassView(e.li_attr.pureId,a)).catch(s.alertUnhandledError)}}),[s,t]),[,l]=(0,Z_.L)((()=>({accept:Zp.CLASS,drop:(e,t)=>o(e,t)})),[o]);return l(n),(0,et.useEffect)((()=>{if(n.current){const e=new X_(n.current,i);t.setRenderer(e),t.setupRenderer(),e.render(),e.autoRecenter()}}),[n,t,i]),(0,et.useEffect)((()=>{t.isDiagramRendererInitialized&&t.renderer.refresh()}),[t,a,r]),(0,x.jsx)("div",{ref:n,className:"diagram-canvas",tabIndex:0,onContextMenu:e=>e.preventDefault()})})),J_=(0,Qe.Pi)((e=>{const{editorState:t}=e;return(0,x.jsx)("div",{className:"panel edit-panel",children:(0,x.jsx)("div",{className:"panel__content edit-panel__content edit-panel__content--headless",children:(0,x.jsx)(q_,{diagramEditorState:t})})})}));var Q_=s(3297),em=s(4153);const tm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Ic.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,x.jsx)(x.Fragment,{children:t})};function sm(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Q_.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,x.jsx)(Nc.Z,{children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,x.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 im=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,h=(0,et.useRef)(null),[d,u]=(0,et.useState)(null);return(0,et.useEffect)((()=>{void 0!==t&&(t&&!d&&h.current?u(h.current):!t&&d&&u(null))}),[d,t]),(0,x.jsxs)("button",{ref:h,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(d?(l?.(),u(null)):h.current&&(c?.(),u(h.current)))},tabIndex:-1,title:r,children:[i,(0,x.jsx)(Yc,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:d,open:(void 0===t||Boolean(t))&&Boolean(d),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},nm=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;e.stopPropagation();let t=e.deltaX;t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},am=(0,Qe.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(Xc,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(Xc,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),rm=(0,Qe.Pi)((e=>{const t=(0,et.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,et.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(),h=((c?.left??0)-(c?.right??0))/2,d=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&d<h||o>l&&d>h||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,Z_.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,h]=(0,Mp.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,et.useEffect)((()=>{e((0,em.r)())}),[e])})(h),(0,x.jsx)("div",{ref:t,className:(0,Ic.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(d=i,e=>{1===e.nativeEvent.button&&s.closeTab(d)}),children:(0,x.jsx)(tm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(Wc,{content:(0,x.jsx)(am,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,x.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,x.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.q1B,{})})]})})});var d})),om=(0,Qe.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(im,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(Kc,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(Xc,{className:"tab-manager__menu__item",onClick:()=>t.openTab(e),children:[(0,x.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,x.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Vc.v4q,{})})})),lm=(0,Qe.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,x.jsxs)("div",{className:"tab-manager",children:[(0,x.jsxs)("div",{className:"tab-manager__content",onWheel:nm,children:[t.tabs.map((e=>(0,x.jsx)(rm,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(sm,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(om,{managerTabState:t})]})})),cm=()=>{const[e,t]=(0,et.useState)(!1),{ref:s,width:i,height:n}=(0,Qc.NB)();return(0,et.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,x.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,x.jsxs)("div",{className:(0,Ic.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},hm=(0,Qe.Pi)((()=>{const e=lp(),t=e.tabManagerState.currentTab;return t?(0,x.jsxs)("div",{className:"panel edit-panel",children:[(0,x.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,x.jsx)("div",{className:"edit-panel__header__tabs",children:(0,x.jsx)(lm,{tabManagerState:e.tabManagerState})}),(0,x.jsx)("div",{className:"panel__header__actions"})]}),(0,x.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof kh?(0,x.jsx)(d_,{editorState:t}):t instanceof ip?(0,x.jsx)(J_,{editorState:t}):null},t.uuid)]}):(0,x.jsx)(cm,{})}));var dm=s(166),um=s(5247);const pm=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,et.useRef)(null);return(0,et.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(dm.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,x.jsx)("div",{style:t,children:i[e]})}):(0,x.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},_m=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Vc.VRP,{})}),mm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Vc.VAA,{})}),gm=e=>{const{innerProps:{ref:t,...s}}=e;return(0,x.jsx)("div",{...s,ref:t,children:(0,x.jsx)("div",{className:"selector-input__indicator selector-input__clear-indicator",children:(0,x.jsx)(Vc.q1B,{})})})},Em=e=>(0,x.jsx)(um.baseComponents.Input,{...e,isHidden:!1}),fm=(0,et.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...h}=e,d=i?um.CreatableSelect:um.Select,u=l?"selector-input--dark":"selector-input";return(0,x.jsx)(d,{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:gm,DropdownIndicator:mm,LoadingIndicator:_m,MenuList:pm,Input:Em,...r},...{...h,darkMode:l,noMatchMessage:n}})})),Tm=(e,t)=>e.label.localeCompare(t.label),Cm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,et.useRef)(null),a=(0,et.useMemo)((()=>(0,ih.Z)((()=>{(0,N.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(vc.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,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Open file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)(fm,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Tm),onChange:s=>{s?.value&&(r(),i.reset(),(0,N.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,x.jsx)("button",{className:(0,Ic.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.toggleRegExp(),children:(0,x.jsx)(Vc.x47,{})})]})]})})})),xm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.textSearchCommandState,i=(0,et.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,N.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(vc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Search"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,x.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,x.jsx)(Vc.a2g,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,x.jsx)(Vc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),Om=(Nm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,Qc.NB)(),r=Ap(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=Ap(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=Ap(e.auxPanelDisplayState.isMaximized);return(0,et.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,et.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,et.useEffect)((()=>{const s=((e,t=!1)=>t?(0,Q.parseUrl)(e).query:(0,Q.parse)(e))(window.location.search);(0,N.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,et.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),h_(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(l_,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(Op,{orientation:"vertical",children:[(0,x.jsx)(yp,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(r_,{})}),(0,x.jsx)(Sp,{}),(0,x.jsx)(yp,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(Op,{orientation:"horizontal",children:[(0,x.jsx)(yp,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(hm,{})}),(0,x.jsx)(Sp,{children:(0,x.jsx)(vp,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(yp,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(Dp,{})})]})})]})})})]}),(0,x.jsx)(c_,{actionsDisabled:!s}),s&&(0,x.jsx)(Cm,{}),s&&(0,x.jsx)(xm,{})]})})),function(){return(0,x.jsx)(op,{children:(0,x.jsx)(Nm,{})})});var Nm;const Am=()=>(0,x.jsx)(Ah,{children:(0,x.jsx)(xh,{children:(0,x.jsx)(Om,{})})}),ym=JSON.parse('{"i8":"6.2.14","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Sm extends o{}class vm extends Sm{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Im extends vm{static NAME=ym.Rw.p;constructor(){super(Im.NAME,ym.i8)}getExtraKeyedCommandConfigEntries(){return e=Mh,Object.entries(e).map((e=>({key:e[0],content:e[1]})));var e}}class Rm extends qe{static create(){const e=new Rm(kt.create());return e.withBasePlugins([new Im]),e.withBasePresets([new Ec]),e}async configureApplication(e){return new Dt(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Fe),A.editor.addKeybindingRules([{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyB,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyO,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyP,command:null},{keybinding:A.KeyCode.F1,command:null},{keybinding:A.KeyCode.F8,command:null},{keybinding:A.KeyCode.F9,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,je),A.languages.setMonarchTokensProvider(C.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","projects",be.CLASS,be.ASSOCIATION,be.ENUMERATION,be.MEASURE,be.PROFILE,be.FUNCTION,be.MAPPING,be.RUNTIME,be.CONNECTION,be.FILE_GENERATION,be.GENERATION_SPECIFICATION,be.DATA_ELEMENT,De.JSON_MODEL_CONNECTION,De.MODEL_CHAIN_CONNECTION,De.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",be.SERVICE,be.FLAT_DATA,be.DATABASE,De.FLAT_DATA_CONNECTION,De.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@"],languageStructs:["import","native","if","fold"],parsers:[Me.PURE,Me.CONNECTION,Me.RUNTIME,Me.MAPPING,Me.SERVICE,Me.FLATDATA,Me.RELATIONAL,Me.GENERATION_SPECIFICATION,Me.FILE_GENERATION_SPECIFICATION,Me.DATA].concat(s).map((e=>`###${e}`)),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:/\[(?:\d+(?:\.\.(?:\d+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,tokenizer:{root:[{include:"@package"},[/(\.)([\w_]+)/,["delimiter","property"]],{include:"@function"},[/^\s*###[\w]+/,{cases:{"@parsers":"parser-marker","@default":"invalid"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@languageStructs":"language-struct","@keywords":"keyword.$0","@default":"identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],{include:"@number"},[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],{include:"@characters"}],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"]],function:[[/(cast)(\()(@)/,["function","","cast"]],[/(->\s*)(cast)(\()(@)/,["","function","","cast"]],[/(->\s*)([\w_]+)(\s*\()/,["","function",""]],[/([\w_]+)(\s*\()/,["function",""]],[/(->\s*)([\w_]+)/,["","function"]]],package:[[/(@package)(\*)/,["package","tag"]],[/(@package)([\w_]+)/,["package","type"]],[/(@package)([\w_]+)(\s*)(@multiplicity)/,["package","type","","multiplicity"]],[/([\w_]+)(\s*:\s*)(@package)([\w_]+)(\s*)(@multiplicity)/,["attribute","","package","type","","multiplicity"]],[/(:\s*)([\w_]+)(\s*)(@multiplicity)/,["","type","","multiplicity"]]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doc:[[/[^/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],characters:[[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]]}}))})(e);const s="Monospaced font 'Roboto Mono' has not been loaded properly, text editor display problems might occur";await document.fonts.load("1em Roboto Mono").then((()=>{document.fonts.check("1em Roboto Mono")?(A.editor.remeasureFonts(),t.info(d.create(pe.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(d.create(pe.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(d.create(pe.APPLICATION_SETUP_FAILURE),s))),(0,N.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,O.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,x.jsx)(Je.VK,{basename:this.baseUrl,children:(0,x.jsx)(nt,{children:(0,x.jsx)(Pt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)(Am,{})})})}))}}class wm{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Rm.create().setup({baseUrl:e}).withPresets(wm.getPresetCollection()).withPlugins(wm.getPluginCollection()).start().catch((e=>{throw e}))}}wm.run("/ide/")},4174: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(1659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},2889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.UHp=t.DuK=t.ce8=t.dRK=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.jtq=t.HXR=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(8978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),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,"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,"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,"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,"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}});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(5186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(9385);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}});var o=s(563);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(6636);var l=s(1914);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}});var h=s(7245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return h.BiAtom}});s(924);var d=s(4543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return d.FiPackage}});s(5100);var u=s(8920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},5247: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(4319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(1776);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(h=0;h<e.length;h++){for(var[s,i,n]=e[h],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(h--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var h=e.length;h>0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[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+"."+{246:"e0f93158",399:"4bd7d49b",471:"d1ead9bf",947:"b545969f"}[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"),h=0;h<c.length;h++){var d=c[h];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+s){r=d;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 h=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(h)},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(7757)));l=o.O(l)})();
2
- //# sourceMappingURL=index.4bc6cdf6.js.map
1
+ (()=>{"use strict";var e,t,s,i,n,a={7757:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.7","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(1004);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 h{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 d{channel;name;timestamp=Date.now();static create(e){const t=new d;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:_,info:m,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T,C,x=s(2322),O=s(7029),N=s(75),A=s(361);!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(T=T||(T={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql"}(C=C||(C={}));var y=s(5928),S=s(1112);const v=e=>e.constructor,I=()=>()=>{},R=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),w=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),P=(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)},L=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class b 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 D 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 M extends D{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class k extends D{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,y.Z)(i,(e=>void 0!==e)));var i;return(0,S.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function F(e){if(!(e instanceof Error))throw new M("Expected error to be thrown")}const j=e=>{try{return e()}catch{return}};class U extends D{constructor(e,t){super("Assertion Error",e,t)}}const V=e=>null!=e;function G(e,t=""){if(null==e)throw new U(t||"Value is nullable")}const z=(e,t="")=>(G(e,t),e),B=e=>t=>((e,t)=>e instanceof t)(t,e);function $(e,t,s=""){if(!(e instanceof t))throw new U(s||`Value is expected to be of type '${t.name}'`)}const H=(e,t,s="")=>($(e,t,s),e);function Y(e,t=""){if(""===z(e,t))throw new U(t||"Expected string value to be non-empty")}function W(e,t=""){return Y(e,t),e}function K(e,t=""){if(!e)throw new U(t||"Expected predicate to be truthy")}const X=e=>"string"==typeof e,Z=e=>"object"==typeof e&&null!==e;var q=s(9391),J=s(3654),Q=s(4126);s(2659);const ee=q.W,te="charset=utf-8";var se,ie,ne;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(se=se||(se={})),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="*/*"}(ie=ie||(ie={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ne=ne||(ne={}));const ae={mode:"cors",credentials:"include",redirect:"manual"},re=(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 oe extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Z(e))return X(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&X(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const le=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 oe(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===ee.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ie.APPLICATION_JSON:return e.json();case ie.TEXT_PLAIN:return e.text();default:return Promise.reject(new oe(e,`Can't process response for request with Content-Type '${i}'`))}},ce=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>le(e,t,s))):fetch(e,t).then((e=>le(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ie.APPLICATION_JSON,e!==ne.GET&&(s[se.CONTENT_TYPE]=`${ie.APPLICATION_JSON};${te}`),re(s,t)};class de{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...ae,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ne.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ne.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ne.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ne.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&&!j((()=>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(V).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((X(s)||Z(s))&&r?.enableCompression&&(K(e!==ne.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,J.Wt)(Z(e)?JSON.stringify(e):e)]))(s),n=re(n,{[se.CONTENT_TYPE]:`${ie.APPLICATION_ZLIB};${te}`})),void 0!==s)if(X(s)||s instanceof Blob)c=s;else{if(!Z(s))throw new U("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const h={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,h).then((e=>(e=>0===e.status||e.status===ee.UNAUTHORIZED)(e)?ce(l,h,o):le(e,h,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?ce(l,h,o):Promise.reject(e)))}}const ue=(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 pe;!function(e){e.TEXT_EDITOR_FONT_LOADED="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_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(pe=pe||(pe={}));const _e="::",me=["$implicit"];var ge,Ee,fe,Te,Ce;(Ce=ge=ge||(ge={})).CORE="CORE",Ce.MAIN="ROOT",Ce.MODEL_GENERATION="MODEL_GENERATION_ROOT",Ce.SYSTEM="SYSTEM_ROOT",Ce.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Te=Ee=Ee||(Ee={})).STRING="String",Te.BOOLEAN="Boolean",Te.BINARY="Binary",Te.NUMBER="Number",Te.INTEGER="Integer",Te.FLOAT="Float",Te.DECIMAL="Decimal",Te.DATE="Date",Te.STRICTDATE="StrictDate",Te.DATETIME="DateTime",Te.STRICTTIME="StrictTime",Te.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(fe=fe||(fe={}));const xe=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Oe,Ne,Ae,ye,Se,ve,Ie,Re,we,Pe;(Ne=Oe=Oe||(Oe={})).ANY="meta::pure::metamodel::type::Any",Ne.NIL="meta::pure::metamodel::type::Nil",Ne.PROFILE_DOC="meta::pure::profiles::doc",Ne.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ne.PROFILE="meta::pure::metamodel::extension::Profile",Ne.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ne.MEASURE="meta::pure::metamodel::type::Measure",Ne.CLASS="meta::pure::metamodel::type::Class",Ne.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ne.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ne.FLAT_DATA="meta::flatData::metamodel::FlatData",Ne.DATABASE="meta::relational::metamodel::Database",Ne.MAPPING="meta::pure::mapping::Mapping",Ne.SERVICE="meta::legend::service::metamodel::Service",Ne.CONNECTION="meta::pure::runtime::PackageableConnection",Ne.RUNTIME="meta::pure::runtime::PackageableRuntime",Ne.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ne.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ne.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ne.DATA_ELEMENT="meta::pure::data::DataElement",Ne.TDS_ROW="meta::pure::tds::TDSRow",(ve=Ae=Ae||(Ae={})).BUSINESS_TEMPORAL="businesstemporal",ve.PROCESSING_TEMPORAL="processingtemporal",ve.BITEMPORAL="bitemporal",(Se=ye=ye||(ye={})).ALL_VERSIONS="AllVersions",Se.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(Re=Ie=Ie||(Ie={})).STORE="STORE",Re.MAPPING="MAPPING",Re.RUNTIME="RUNTIME",Re.FILE_GENERATION="FILE_GENERATION",Re.SERVICE="SERVICE",(Pe=we=we||(we={})).TODAY="meta::pure::functions::date::today",Pe.NOW="meta::pure::functions::date::now",Pe.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Pe.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Pe.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Pe.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Pe.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Pe.IS_ON_DAY="meta::pure::functions::date::isOnDay",Pe.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Pe.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Pe.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Pe.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Pe.MINUS="meta::pure::functions::math::minus",Pe.ADJUST="meta::pure::functions::date::adjust",Pe.LET="meta::pure::functions::lang::letFunction";const Le="yyyy-MM-dd'T'HH:mm:ssxxxx";var be,De,Me;!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"}(be=be||(be={})),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"}(De=De||(De={})),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"}(Me=Me||(Me={}));const ke=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`,Fe={base:"vs-dark",inherit:!0,colors:{},rules:[{token:"package",foreground:"808080"},{token:"parser-marker",foreground:"c586c0"},{token:"property",foreground:"dcdcaa"},{token:"function",foreground:"dcdcaa"},{token:"language-struct",foreground:"c586c0"},{token:"multiplicity",foreground:"2d796b"},{token:"attribute",foreground:"9cdcfe"},{token:"cast",foreground:"569cd6"}]},je={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:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var Ue=s(9013);class Ve{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Ue.qC)(this.schema,e)}fromJson(e){return(0,Ue.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,y.Z)(t,(e=>null!==e))):e);var t}}const Ge=e=>(0,Ue.PG)((t=>void 0===t?Ue.AM:(0,Ue.qC)(e,t)),(t=>(0,Ue.vB)(e,t))),ze=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Ue.AM:[],Be=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Ue.AM:[]:Ue.AM,$e=e=>(0,Ue.PG)((()=>e),(()=>e));var He=s(0);class Ye{_documentationKey;markdownText;title;text;url;related;static serialization=new Ve((0,Ue.yu)(Ye,{markdownText:(0,Ue.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Ue.jt)((0,Ue.pb)((0,Ue.Ru)())),title:(0,Ue.jt)((0,Ue.Ru)()),text:(0,Ue.jt)((0,Ue.Ru)()),url:(0,Ue.jt)((0,Ue.Ru)())}));static create(e,t){const s=Ye.serialization.fromJson(e);return s._documentationKey=t,s}}const We=e=>Object.entries(e).map((e=>({key:e[0],content:Ye.create(e[1],e[0])})));class Ke{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.log.warn(d.create(pe.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),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,He.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.log.warn(d.create(pe.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.log.warn(d.create(pe.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),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]=Ye.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Xe{}class Ze extends Xe{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 qe{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Ze}setup(e){return this.baseUrl=W(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 de;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){F(e),this.logger.error(d.create(pe.APPLICATION_CONFIGURATION_FAILURE),e)}G(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){F(e),this.logger.error(d.create(pe.APPLICATION_CONFIGURATION_FAILURE),e)}return G(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 de(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(W(e.url,"Can't load documentation registry: 'url' field is missing or empty"));G(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){F(e),this.logger.warn(d.create(pe.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...We(t),...e.keyedDocumentationEntries]}async start(){G(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(d.create(pe.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw F(e),this.logger.error(d.create(pe.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var Je=s(4926),Qe=s(9038),et=s(2784);class tt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,N.rC)(this,{_isNavigationBlocked:N.LO,isNavigationBlocked:N.Fl,blockNavigation:N.aD,unblockNavigation:N.aD}),this.historyAPI=e}get window(){return z(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 st=s(979);const it=(0,et.createContext)(void 0),nt=({children:e})=>{const t=(0,st.k6)(),s=(0,Qe.fv)((()=>new tt(t)));return(0,x.jsx)(it.Provider,{value:s,children:e})};class at{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var rt;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(rt=rt||(rt={}));class ot{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class lt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ot;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 ct,ht,dt,ut=s(4174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(ct||(ct={}));class pt{state;_message;_messageFormatter;constructor(){this.state=ct.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=ct.INITIAL,this}inProgress(){return this.state=ct.IN_PROGRESS,this}fail(){return this.state=ct.FAILED,this}pass(){return this.state=ct.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===ct.INITIAL}get isInProgress(){return this.state===ct.IN_PROGRESS}get hasFailed(){return this.state===ct.FAILED}get hasSucceeded(){return this.state===ct.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,N.rC)(new pt,{state:N.LO,_message:N.LO,reset:N.aD,inProgress:N.aD,pass:N.aD,fail:N.aD,complete:N.aD,setMessage:N.aD,isInInitialState:N.Fl,isInProgress:N.Fl,hasFailed:N.Fl,hasSucceeded:N.Fl,hasCompleted:N.Fl,message:N.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(ht=ht||(ht={}));class _t{currentMode=ht.STANDARD;onSearchModeChange;constructor(e){(0,N.rC)(this,{currentMode:N.LO,isAdvancedSearchActive:N.Fl,setCurrentMode:N.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==ht.STANDARD}generateSearchText(e){switch(this.currentMode){case ht.INCLUDE:return`'"${e}"`;case ht.EXACT:return`="${e}"`;case ht.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(dt=dt||(dt={}));class mt{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,N.rC)(this,{isOpen:N.LO,setIsOpen:N.aD}),this.documentationKey=e._documentationKey,this.title=W(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class gt{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 Et=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class ft{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=dt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=pt.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,N.rC)(this,{isHidden:N.LO,isOpen:N.LO,panelRenderingKey:N.LO,isOverSearchLimit:N.LO,selectedTab:N.LO,searchText:N.LO,searchResults:N.LO,currentDocumentationEntry:N.LO,showSearchConfigurationMenu:N.LO,currentContextualDocumentationEntry:N.Fl,setIsHidden:N.aD,setIsOpen:N.aD,setSelectedTab:N.aD,setSearchText:N.aD,resetSearch:N.aD,search:N.aD,openDocumentationEntry:N.aD,refreshPanelRendering:N.aD,setShowSearchConfigurationMenu:N.aD}),this.applicationStore=e,this.searchEngine=new ut.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Et),{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 _t((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new gt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(V).filter(Et).map((e=>new mt(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 mt(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 mt(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 Tt{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class Ct{static logEvent_ApplicationInitialized(e,t){e.logEvent(pe.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(pe.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(pe.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class xt{applicationStore;contextStack=[];constructor(e){(0,N.rC)(this,{contextStack:N.LO,currentContext:N.Fl,push:N.aD,pop:N.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 M(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&Ct.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 Ot{applicationStore;commandRegistry=new Map;constructor(e){(0,N.rC)(this,{commandRegistry:N.LO,registerCommand:N.aD,deregisterCommand:N.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(d.create(pe.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 Nt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,N.rC)(this,{keyMap:N.LO,commandKeyMap:N.LO,isHotkeysBlocked:N.LO,updateHotkey:N.aD,blockGlobalHotkeys:N.aD,unblockGlobalHotkeys:N.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&w(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(d.create(pe.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===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.commandCenter.runCommand(e))return}}var At,yt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(At=At||(At={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(yt=yt||(yt={}));const St=6e3;var vt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(vt=vt||(vt={}));class It{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Rt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Tt;telemetryService=new at;tracerService=new lt;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,N.rC)(this,{notification:N.LO,blockingAlertInfo:N.LO,actionAlertInfo:N.LO,TEMPORARY__isLightThemeEnabled:N.LO,backdropContainerElementID:N.LO,showBackdrop:N.LO,setBackdropContainerElementID:N.aD,setShowBackdrop:N.aD,setBlockingAlert:N.aD,setActionAlertInfo:N.aD,setNotification:N.aD,notify:N.aD,notifySuccess:N.aD,notifyWarning:N.aD,notifyIllegalState:N.aD,notifyError:N.aD,TEMPORARY__setIsLightThemeEnabled:N.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new xt(this),this.documentationService=new Ke(this),this.assistantService=new ft(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new Ot(this),this.keyboardShortcutsService=new Nt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new It(vt.INFO,e,t??[],null===s?void 0:s??St))}notifySuccess(e,t,s){this.setNotification(new It(vt.SUCCESS,e,t??[],null===s?void 0:s??St))}notifyWarning(e,t,s){this.setNotification(new It(vt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??St))}notifyIllegalState(e,t,s){this.setNotification(new It(vt.ILEGAL_STATE,X(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??St))}notifyError(e,t){let s;e instanceof b?s=e.detail:e instanceof Error?s=e.message:(K(X(e),"Can't display error"),s=e),s&&this.setNotification(new It(vt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return F(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(d.create(pe.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const wt=(0,et.createContext)(void 0),Pt=({children:e,config:t,pluginManager:s})=>{const i=z((0,et.useContext)(it),"Can't find web application navigator in context"),n=(0,Qe.fv)((()=>new Rt(t,i,s)));return(0,x.jsx)(wt.Provider,{value:n,children:e})},Lt=()=>z((0,et.useContext)(wt),"Can't find application store in context");class bt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=W(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=W(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=We(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=z(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=z(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=z(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Dt extends bt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),G(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=W(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 Mt extends h{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 kt extends Mt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new kt}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 Ft=JSON.parse('{"i8":"7.1.9","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 jt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Ut=e=>t=>(0,N.bi)(t)?t:e(t),Vt=e=>(t,s)=>(0,N.bi)(t)?t:e(t,s),Gt=e=>{(0,N.rC)(e,{_isDeleted:N.LO,_isDisposed:N.LO,name:N.LO,package:N.LO,isDeleted:N.Fl,path:N.Fl,_elementHashCode:N.Fl,hashCode:N.Fl,setIsDeleted:N.aD,dispose:N.aD})},zt=Ut((e=>(0,N.rC)(e,{value:N.LO,valueForSerialization:N.Fl})));var Bt=s(4485),$t=s(3096);const Ht=e=>Bt.sha1().update(e).digest("hex"),Yt=e=>Ht(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Ht(e):e.hashCode)).join(","));var Wt,Kt;(Kt=Wt=Wt||(Wt={})).PACKAGE="PACKAGE",Kt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Kt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Kt.PROFILE="PROFILE",Kt.TAG_POINTER="TAG_POINTER",Kt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Kt.TAGGED_VALUE="TAGGED_VALUE",Kt.ENUMERATION="ENUMERATION",Kt.ENUM_VALUE="ENUM_VALUE",Kt.CLASS="CLASS",Kt.PROPERTY="PROPERTY",Kt.PROPERTY_POINTER="PROPERTY_POINTER",Kt.MULTIPLICITY="MULTIPLICITY",Kt.CONSTRAINT="CONSTRAINT",Kt.DERIVED_PROPERTY="DERIVED_PROPERTY",Kt.ASSOCIATION="ASSOCIATION",Kt.FUNCTION="FUNCTION",Kt.MEASURE="MEASURE",Kt.UNIT="UNIT",Kt.RUNTIME="RUNTIME",Kt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Kt.ENGINE_RUNTIME="ENGINE_RUNTIME",Kt.LEGACY_RUNTIME="LEGACY_RUNTIME",Kt.RUNTIME_POINTER="RUNTIME_POINTER",Kt.STORE_CONNECTIONS="STORE_CONNECTIONS",Kt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Kt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Kt.CONNECTION_POINTER="CONNECTION_POINTER",Kt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Kt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Kt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Kt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Kt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Kt.FLAT_DATA="FLAT_DATA",Kt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Kt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Kt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Kt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Kt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Kt.FLAT_DATA_STRING="FLAT_DATA_STRING",Kt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Kt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Kt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Kt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Kt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Kt.FLAT_DATA_DATE="FLAT_DATA_DATE",Kt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Kt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Kt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Kt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Kt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Kt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Kt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Kt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Kt.DATABASE="DATABASE",Kt.DATABASE_SCHEMA="DATABASE_SCHEMA",Kt.DATABASE_JOIN="DATABASE_JOIN",Kt.DATABASE_FILTER="DATABASE_FILTER",Kt.DATBASE_VIEW="DATBASE_VIEW",Kt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Kt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Kt.RELATIONAL="RELATIONAL",Kt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Kt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Kt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Kt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Kt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Kt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Kt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Kt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Kt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Kt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Kt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Kt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Kt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Kt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Kt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Kt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Kt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Kt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Kt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Kt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Kt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Kt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Kt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Kt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Kt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Kt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Kt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Kt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Kt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Kt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Kt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Kt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Kt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Kt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Kt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Kt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Kt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Kt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Kt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Kt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Kt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Kt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Kt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Kt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Kt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Kt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Kt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Kt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Kt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Kt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Kt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Kt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Kt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Kt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Kt.SCHEMA_MAPPER="SCHEMA_MAPPER",Kt.TABLE_MAPPER="TABLE_MAPPER",Kt.MAPPING="MAPPING",Kt.MAPPING_INCLUDE="MAPPING_INCLUDE",Kt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Kt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Kt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Kt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Kt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Kt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Kt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Kt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Kt.PROPERTY_MAPPING="PROPERTY_MAPPING",Kt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Kt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Kt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Kt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Kt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Kt.MAPPING_TEST="MAPPING_TEST",Kt.STORE_TEST_DATA="STORE_TEST_DATA",Kt.INPUT_DATA="INPUT_DATA",Kt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Kt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Kt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Kt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Kt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Kt.FILTER_MAPPING="FILTER_MAPPING",Kt.COLUMN_MAPPING="COLUMN_MAPPING",Kt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Kt.SERVICE="SERVICE",Kt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Kt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Kt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Kt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Kt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Kt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Kt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Kt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Kt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Kt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Kt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Kt.SERVICE_TEST="SERVICE_TEST",Kt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Kt.GENERATION_TREE="GENERATION_TREE",Kt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Kt.FILE_GENERATION="FILE_GENERATION",Kt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Kt.SECTION_INDEX="SECTION_INDEX",Kt.SECTION="SECTION",Kt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Kt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Kt.RAW_LAMBDA="RAW_LAMBDA",Kt.RAW_VARIABLE="RAW_VARIABLE",Kt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Kt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Kt.ASSERT_FAIL="ASSERT_FAIL",Kt.ASSERT_PASS="ASSERT_PASS",Kt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Kt.EQUAL_TO="EQUAL_TO",Kt.EQUAL_TO_JSON="EQUAL_TO_JSON",Kt.EQUAL_TO_TDS="EQUAL_TO_TDS",Kt.TEST_RESULT="TEST_RESULT",Kt.TEST_ERROR="TEST_ERROR",Kt.TEST_FAILED="TEST_FAILED",Kt.TEST_PASSED="TEST_PASSED",Kt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Kt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Kt.MODEL_STORE_DATA="MODEL_STORE_DATA",Kt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Kt.DATA_ELEMENT="DATA_ELEMENT",Kt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Kt.RELATIONAL_TDS="RELATIONAL_TDS",Kt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Kt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Kt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Kt.EXPRESSION="EXPRESSION",Kt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Kt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Kt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Kt.INSTANCE_VALUE="INSTANCE_VALUE",Kt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Kt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Kt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Kt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Kt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Kt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Kt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Kt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Kt.FUNCTION_TYPE="FUNCTION_TYPE",Kt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Kt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Kt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Kt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Kt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Kt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Kt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Kt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Xt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},K(Z(t=e),"Can't hash non-object value"),$t(t,s);var t,s},Zt=(e,t)=>Yt([e?Xt(e):"",t?Xt(t):""]),qt=(e,t)=>[Wt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Ht).join(",");class Jt{stereotypes=[];taggedValues=[]}class Qt extends Jt{name}class es extends Qt{_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}::${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new M(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ts extends es{}class ss extends ts{_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 Yt([Wt.CLASS,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Yt(this.constraints),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class is extends ts{}class ns extends is{values=[];get _elementHashCode(){return Yt([Wt.ENUMERATION,this.path,Yt(this.values),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class as extends is{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Yt([Wt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new k}}class rs extends ts{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Yt([Wt.MEASURE,this.path,this.canonicalUnit??"",Yt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class os extends es{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class ls{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Yt([Wt.SECTION,this.parserName,Yt(this.elements.map((e=>e.valueForSerialization??"")))])}}class cs extends ls{imports=[];get hashCode(){return Yt([Wt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Yt(this.imports.map((e=>e.valueForSerialization??"")))])}}class hs extends ls{get hashCode(){return Yt([Wt.DEFAULT_CODE_SECTION,super.hashCode])}}class ds{_UUID=(0,a.Z)()}class us extends ds{ownerReference;constructor(e){super(),this.ownerReference=e}}class ps extends ds{value;constructor(e){super(),this.value=e}}class _s extends ps{constructor(e){super(e)}static create(e){return new _s(e)}get valueForSerialization(){return this.value.path}}const ms=Ut((e=>(0,N.rC)(e,{name:N.LO,value:N.LO.ref,hashCode:N.Fl}))),gs=Ut((e=>(Gt(e),(0,N.rC)(e,{type:N.LO,generationOutputPath:N.LO,scopeElements:N.LO,configurationProperties:N.LO,_elementHashCode:N.KG}),e.scopeElements.forEach((e=>{e instanceof ps&&zt(e)})),e.configurationProperties.forEach(ms),e))),Es=Ut((e=>((0,N.rC)(e,{id:N.LO,hashCode:N.Fl}),zt(e.generationElement),e))),fs=Ut((e=>(Gt(e),(0,N.rC)(e,{generationNodes:N.LO,fileGenerations:N.LO,_elementHashCode:N.KG}),e.generationNodes.forEach(Es),e.fileGenerations.forEach(zt),e)));var Ts=s(7295),Cs=s(2531);const xs=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Os=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],Ns=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Ts.P)(e,void 0,s);return G(i,"Can't stringify lossless JSON value"),i})((0,Cs.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class As{}class ys extends As{expectedOutput;constructor(e){super(),this.expectedOutput=Ns(e)}get hashCode(){return Yt([Wt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Ss{}class vs extends Ss{mappings=[];connections=[];get hashCode(){return Yt([Wt.ENGINE_RUNTIME,Yt(this.mappings.map((e=>qt(Ie.MAPPING,e.valueForSerialization??"")))),Yt(this.connections.filter((e=>e.storeConnections.length)))])}}class Is extends Ss{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Yt([Wt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Rs{}class ws extends Rs{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Yt([Wt.FLAT_DATA_INPUT_DATA,qt(Ie.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ps,Ls,bs;(bs=Ps=Ps||(Ps={})).JSON="JSON",bs.XML="XML";class Ds extends Rs{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ps.JSON?Ns(s):s}get hashCode(){return Yt([Wt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Ls=Ls||(Ls={}));class Ms extends Rs{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Yt([Wt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const ks=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),zt(e.type),e))),Fs=Ut((e=>(0,N.rC)(e,{body:N.LO.ref,parameters:N.LO.ref,hashCode:N.Fl}))),js=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,hashCode:N.Fl}),zt(e.type),e)));class Us{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Fs(e)}visit_RawVariableExpression(e){js(e)}visit_RawPrimitiveInstanceValue(e){ks(e)}}Vt(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Us(t)),e)));class Vs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Gs extends Vs{trueString;falseString;get hashCode(){return Yt([Wt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class zs extends Vs{get hashCode(){return Yt([Wt.FLAT_DATA_STRING])}}class Bs extends Vs{get hashCode(){return Yt([Wt.FLAT_DATA_NUMBER])}}class $s extends Vs{dateFormat;timeZone;get hashCode(){return Yt([Wt.FLAT_DATA_DATE,this.dateFormat?Yt(this.dateFormat):"",this.timeZone??""])}}class Hs extends Vs{fields=[];get hashCode(){return Yt([Wt.FLAT_DATA_RECORD_TYPE,Yt(this.fields)])}}const Ys=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{flatData:N.LO,sectionName:N.LO,hashCode:N.Fl}),e))),Ws=Ut((e=>((0,N.rC)(e,{label:N.LO,flatDataDataType:N.LO,optional:N.LO,address:N.LO,hashCode:N.Fl}),(e=>{e instanceof Gs?(0,N.rC)(e,{trueString:N.LO,falseString:N.LO,hashCode:N.Fl}):e instanceof zs||e instanceof Bs?(0,N.rC)(e,{hashCode:N.Fl}):e instanceof $s?(0,N.rC)(e,{dateFormat:N.LO,timeZone:N.LO,hashCode:N.Fl}):e instanceof Hs&&Ut(Ks)(e)})(e.flatDataDataType),e)));function Ks(e){return(0,N.rC)(e,{fields:N.LO,hashCode:N.Fl}),e.fields.forEach(Ws),e}Ut(Ks);const Xs=Ut(Ks),Zs=Ut((e=>((0,N.rC)(e,{name:N.LO,value:N.LO,hashCode:N.Fl}),e))),qs=Ut((e=>((0,N.rC)(e,{driverId:N.LO,name:N.LO,sectionProperties:N.LO,recordType:N.LO,hashCode:N.Fl}),e.sectionProperties.forEach(Zs),e.recordType&&Xs(e.recordType),e))),Js=(Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),Ut((e=>(Gt(e),(0,N.rC)(e,{sections:N.LO,_elementHashCode:N.KG}),e.sections.forEach(qs),e)))),Qs=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),ei=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{filter:N.LO,hashCode:N.Fl}),Qs(e.sourceRootRecordType),e.filter&&Fs(e.filter),e))),ti=Vt(((e,t)=>(Cr(e,t),Ir(e,t),(0,N.rC)(e,{rootInstanceSetImplementation:N.LO,hashCode:N.Fl}),e))),si=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,transform:N.LO,hashCode:N.Fl}),Fs(e.transform),e))),ii=Ut((e=>((0,N.rC)(e,{data:N.LO,hashCode:N.Fl}),zt(e.sourceFlatData),e))),ni=Ut((e=>((0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),e)));class ai{}class ri extends ai{serverPrincipal;get hashCode(){return Yt([Wt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class oi extends ai{get hashCode(){return Yt([Wt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class li extends ai{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Yt([Wt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class ci extends ai{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Yt([Wt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class hi extends ai{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Yt([Wt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class di extends ai{get hashCode(){return Yt([Wt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class ui extends ai{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Yt([Wt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Yt(this.additionalGcpScopes)])}}class pi extends ai{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Yt([Wt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class _i extends ai{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Yt([Wt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class mi{}class gi extends mi{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Yt([Wt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ei extends mi{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 Yt([Wt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class fi extends mi{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Yt([Wt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Ti extends mi{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Yt([Wt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Yt(this.testDataSetupSqls)])}}class Ci extends mi{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 Yt([Wt.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 xi extends mi{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 Yt([Wt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Oi extends mi{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Yt([Wt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class Ni{_UUID=(0,a.Z)()}class Ai extends Ni{mappers=[];get hashCode(){return Yt([Wt.MAPPER_POST_PROCESSOR,Yt(this.mappers)])}}const yi="{target}",Si="default";class vi{}class Ii extends vi{}class Ri extends Ii{}class wi extends Ri{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Yt(this.parameters)])}}var Pi;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Pi=Pi||(Pi={}));const Li=e=>[e].concat(e.children.length?Li(e.children[0]):[]);class bi extends vi{relationalOperationElement;joinTreeNode;get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Yt(this.joinTreeNode?Li(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Di extends vi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new k}}class Mi extends vi{alias;column;columnName;get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?yi:this.alias.name,this.column.value.name])}}class ki extends vi{value;constructor(e){super(),this.value=e}get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Fi extends vi{values=[];get hashCode(){return Yt([Wt.RELATIONAL_OPERATION_LITERAL_LIST,Yt(this.values)])}}class ji extends vi{owner;name;type;nullable;get hashCode(){return Yt([Wt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Ui{}class Vi extends Ui{infinityDate}class Gi{}class zi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BIGINT])}}class Bi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_SMALLINT])}}class $i extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_TINYINT])}}class Hi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_INTEGER])}}class Yi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_FLOAT])}}class Wi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_DOUBLE])}}class Ki extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Xi extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Zi extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class qi extends Gi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class Ji extends Gi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class Qi extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_TIMESTAMP])}}class en extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_VARCHAR])}}class tn extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BIT])}}class sn extends Gi{size;constructor(e){super(),this.size=e}get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class nn extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_REAL])}}class an extends Gi{get hashCode(){return Yt([Wt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class rn extends us{ownerReference;constructor(e){super(e),this.ownerReference=e}}class on extends rn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Ht).join(",")}get selfJoinPointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Si,yi].map(Ht).join(",")}}class ln extends rn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Ht).join(",")}get selfJoinPointerHashCode(){return[Wt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Si,yi].map(Ht).join(",")}}class cn{}class hn extends cn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Yt([this.from,this.to])}}class dn extends hn{get hashCode(){return Yt([super.hashCode,Wt.SCHEMA_MAPPER])}}class un extends hn{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Yt([super.hashCode,Wt.TABLE_MAPPER,this.schema])}}const pn=Ut((e=>((0,N.rC)(e,{packageableElementIncludes:N.LO,packageableElementExcludes:N.LO,hashCode:N.Fl}),e.packageableElementIncludes.forEach(zt),e.packageableElementExcludes.forEach(zt),e))),_n=(Ut((e=>(pr(e),(0,N.rC)(e,{schemaSet:N.LO,schemaId:N.LO,contentType:N.LO,modelUnit:N.LO,_elementHashCode:N.KG}),e.schemaSet&&zt(e.schemaSet),pn(e.modelUnit),e))),Ut((e=>((0,N.rC)(e,{binding:N.LO,hashCode:N.Fl}),zt(e.binding),e)))),mn=Ut((e=>((0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),e))),gn=(Ut((e=>(Yr(e),(0,N.rC)(e,{externalSource:N.LO,hashCode:N.Fl}),mn(e.externalSource),e))),Ut((e=>(0,N.rC)(e,{id:N.LO,location:N.LO,content:N.LO,hashCode:N.Fl})))),En=(Ut((e=>(Gt(e),(0,N.rC)(e,{format:N.LO,schemas:N.LO,_elementHashCode:N.KG}),e.schemas.forEach(gn),e))),Ut((e=>e instanceof zi||e instanceof Bi||e instanceof $i||e instanceof Hi||e instanceof Yi||e instanceof Wi||e instanceof Qi||e instanceof Date||e instanceof en||e instanceof tn||e instanceof nn||e instanceof an?(0,N.rC)(e,{hashCode:N.Fl}):e instanceof Ki||e instanceof Xi||e instanceof Zi||e instanceof sn?(0,N.rC)(e,{size:N.LO,hashCode:N.Fl}):e instanceof qi||e instanceof Ji?(0,N.rC)(e,{precision:N.LO,scale:N.LO,hashCode:N.Fl}):e))),fn=Ut((e=>((0,N.rC)(e,{name:N.LO,type:N.LO,nullable:N.LO,hashCode:N.Fl}),En(e.type),e))),Tn=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl,selfJoinPointerHashCode:N.Fl}),zt(e.ownerReference),e))),Cn=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl,selfJoinPointerHashCode:N.Fl}),zt(e.ownerReference),e))),xn=Ut((e=>((0,N.rC)(e,{relation:N.LO,name:N.LO,database:N.LO,isSelfJoinTarget:N.LO}),(e=>{e instanceof ln?Cn(e):e instanceof on&&Tn(e)})(e.relation),e))),On=Ut((e=>((0,N.rC)(e,{name:N.LO,parameters:N.LO,hashCode:N.Fl}),e.parameters.forEach(wn),e))),Nn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),An=Ut((e=>((0,N.rC)(e,{alias:N.LO,column:N.LO,columnName:N.LO,hashCode:N.Fl}),xn(e.alias),Nn(e.column),e))),yn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Sn=Ut((e=>((0,N.rC)(e,{alias:N.LO,children:N.LO,joinType:N.LO,hashCode:N.Fl}),e.alias&&xn(e.alias),e.children.forEach(Sn),yn(e.join),e))),vn=Ut((e=>((0,N.rC)(e,{relationalOperationElement:N.LO,joinTreeNode:N.LO,hashCode:N.Fl}),e.relationalOperationElement&&wn(e.relationalOperationElement),e.joinTreeNode&&Sn(e.joinTreeNode),e))),In=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),e.value instanceof vi&&wn(e.value),e))),Rn=Ut((e=>((0,N.rC)(e,{values:N.LO,hashCode:N.Fl}),e.values.forEach(In),e)));function wn(e){return e instanceof wi?On(e):e instanceof Di?xn(e):e instanceof Mi?An(e):e instanceof ji?fn(e):e instanceof ki?In(e):e instanceof Fi?Rn(e):e instanceof bi?vn(e):e}const Pn=Ut((e=>e)),Ln=Vt(((e,t)=>{if(e instanceof Vi)return Pn(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})),bn=Ut((e=>((0,N.rC)(e,{columnName:N.LO,relationalOperationElement:N.LO,hashCode:N.Fl}),wn(e.relationalOperationElement),e))),Dn=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Mn=Ut((e=>((0,N.rC)(e,{joinTreeNode:N.LO,database:N.LO,filterName:N.LO,hashCode:N.Fl}),e.joinTreeNode&&Sn(e.joinTreeNode),Dn(e.filter),e))),kn=Ut((e=>((0,N.rC)(e,{columns:N.LO}),e.columns.forEach(wn),e))),Fn=e=>{(0,N.rC)(e,{columns:N.LO,name:N.LO})},jn=Vt(((e,t)=>(Fn(e),(0,N.rC)(e,{primaryKey:N.LO,hashCode:N.Fl}),e.primaryKey.forEach(fn),e.milestoning.forEach((e=>Ln(e,t))),e))),Un=Vt(((e,t)=>(Fn(e),(0,N.rC)(e,{primaryKey:N.LO,columnMappings:N.LO,filter:N.LO,distinct:N.LO,groupBy:N.LO,hashCode:N.Fl}),e.primaryKey.forEach(fn),e.columnMappings.forEach(bn),e.filter&&Mn(e.filter),e.groupBy&&kn(e.groupBy),e))),Vn=Vt(((e,t)=>((0,N.rC)(e,{name:N.LO,tables:N.LO,views:N.LO,hashCode:N.Fl}),e.tables.forEach((e=>jn(e,t))),e.views.forEach((e=>Un(e,t))),e))),Gn=Ut((e=>((0,N.rC)(e,{name:N.LO,operation:N.LO,hashCode:N.Fl}),wn(e.operation),e))),zn=Ut((e=>((0,N.rC)(e,{name:N.LO,target:N.LO,aliases:N.LO,operation:N.LO,hashCode:N.Fl}),e.target&&xn(e.target),wn(e.operation),e))),Bn=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{schemas:N.LO,joins:N.LO,filters:N.LO,_elementHashCode:N.KG}),e.schemas.forEach((e=>Vn(e,t))),e.joins.forEach(zn),e.filters.forEach(Gn),e))),$n=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,relationalOperation:N.LO.ref,bindingTransformer:N.LO,hashCode:N.Fl}),e.bindingTransformer&&_n(e.bindingTransformer),e))),Hn=(e,t)=>(Ir(e,t),Cr(e,t),(0,N.rC)(e,{id:N.LO,rootInstanceSetImplementation:N.LO,primaryKey:N.LO}),e.primaryKey.forEach(wn),e),Yn=Vt(Hn),Wn=Vt(((e,t)=>(Hn(e,t),(0,N.rC)(e,{inlineSetImplementation:N.LO}),Mr(e.inlineSetImplementation,t),e))),Kn=Vt(((e,t)=>(Hn(e,t),(0,N.rC)(e,{otherwisePropertyMapping:N.LO,hashCode:N.Fl}),Nr(e.otherwisePropertyMapping,t),e))),Xn=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{primaryKey:N.LO}),e.primaryKey.forEach(wn),e))),Zn=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{columnMappings:N.LO,filter:N.LO,distinct:N.LO,groupBy:N.LO,mainTableAlias:N.LO,superSetImplementationId:N.LO,hashCode:N.Fl}),e.columnMappings.forEach(bn),e.filter&&Mn(e.filter),e.groupBy&&kn(e.groupBy),e.mainTableAlias&&xn(e.mainTableAlias),e))),qn=Ut((e=>((0,N.rC)(e,{data:N.LO,inputType:N.LO,hashCode:N.Fl}),zt(e.database),e))),Jn=Ut((e=>(0,N.rC)(e,{host:N.LO,port:N.LO,databaseName:N.LO,hashCode:N.Fl}))),Qn=Ut((e=>(0,N.rC)(e,{hostname:N.LO,port:N.LO,protocol:N.LO,httpPath:N.LO,hashCode:N.Fl}))),ea=Ut((e=>(0,N.rC)(e,{databaseName:N.LO,directory:N.LO,autoServerMode:N.LO,hashCode:N.Fl}))),ta=Ut((e=>(0,N.rC)(e,{testDataSetupCsv:N.LO,testDataSetupSqls:N.LO,hashCode:N.Fl}))),sa=Ut((e=>(0,N.rC)(e,{accountName:N.LO,region:N.LO,warehouseName:N.LO,databaseName:N.LO,cloudType:N.LO,quotedIdentifiersIgnoreCase:N.LO,proxyHost:N.LO,proxyPort:N.LO,nonProxyHosts:N.LO,organization:N.LO,accountType:N.LO,role:N.LO,hashCode:N.Fl}))),ia=Ut((e=>(0,N.rC)(e,{databaseName:N.LO,endpointURL:N.LO,port:N.LO,region:N.LO,clusterID:N.LO,host:N.LO,hashCode:N.Fl}))),na=Ut((e=>(0,N.rC)(e,{projectId:N.LO,defaultDataset:N.LO,proxyHost:N.LO,proxyPort:N.LO,hashCode:N.Fl}))),aa=Ut((e=>(0,N.rC)(e,{serverPrincipal:N.LO,hashCode:N.Fl}))),ra=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl}))),oa=Ut((e=>(0,N.rC)(e,{apiToken:N.LO,hashCode:N.Fl}))),la=Ut((e=>(0,N.rC)(e,{oauthKey:N.LO,scopeName:N.LO,hashCode:N.Fl}))),ca=Ut((e=>(0,N.rC)(e,{privateKeyVaultReference:N.LO,passPhraseVaultReference:N.LO,publicUserName:N.LO,hashCode:N.Fl}))),ha=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl}))),da=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,userNameVaultReference:N.LO,passwordVaultReference:N.LO,baseVaultReference:N.LO}))),ua=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,serviceAccountEmail:N.LO,additionalGcpScopes:N.LO}))),pa=Ut((e=>(0,N.rC)(e,{hashCode:N.Fl,vaultReference:N.LO}))),_a=e=>{(0,N.rC)(e,{from:N.LO,to:N.LO,hashCode:N.Fl})},ma=Ut((e=>(_a(e),e))),ga=Ut((e=>(_a(e),(0,N.rC)(e,{schema:N.LO}),ma(e.schema),e))),Ea=Vt(((e,t)=>((e=>{Yr(e),(0,N.rC)(e,{type:N.LO,timeZone:N.LO,quoteIdentifiers:N.LO})})(e),(0,N.rC)(e,{datasourceSpecification:N.LO,authenticationStrategy:N.LO,postProcessors:N.LO,hashCode:N.Fl}),((e,t)=>{if(e instanceof gi)return Jn(e);if(e instanceof Ei)return Qn(e);if(e instanceof fi)return ea(e);if(e instanceof Ti)return ta(e);if(e instanceof Ci)return sa(e);if(e instanceof xi)return ia(e);if(e instanceof Oi)return na(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 ri)return aa(e);if(e instanceof oi)return ra(e);if(e instanceof li)return oa(e);if(e instanceof ci)return la(e);if(e instanceof hi)return ca(e);if(e instanceof di)return ha(e);if(e instanceof pi)return da(e);if(e instanceof ui)return ua(e);if(e instanceof _i)return pa(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 Ai)return(e=>((e=>{(0,N.rC)(e,{hashCode:N.Fl})})(e),(0,N.rC)(e,{mappers:N.LO}),e.mappers.forEach((e=>{(e=>{e instanceof dn?ma(e):e instanceof un&&ga(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 fa{id}class Ta extends fa{__parent;assertions=[]}class Ca extends fa{__parent;tests=[]}class xa extends Ta{serializationFormat;parameters=[];keys=[];get hashCode(){return Yt([Wt.SERVICE_TEST,this.id,Yt(this.assertions),Yt(this.parameters),Yt(this.keys),this.serializationFormat??""])}}class Oa extends Ta{query;get hashCode(){return Yt([Wt.MAPPING_TEST,this.query,this.id,Yt(this.assertions)])}}class Na extends Ca{storeTestDatas=[];get hashCode(){return Yt([Wt.MAPPING_TEST_SUITE,Yt(this.storeTestDatas),this.id,Yt(this.tests)])}}class Aa extends Ca{testData;get hashCode(){return Yt([Wt.SERVICE_TEST_SUITE,this.id,Yt(this.tests),this.testData])}}class ya{id;parentTest}class Sa extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO,this.id,Xt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class va extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class Ia extends ya{expected;get hashCode(){return Yt([Wt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Ra{}class wa extends Ra{dataElement;get hashCode(){return Yt([Wt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Pa extends Ra{contentType;data;get hashCode(){return Yt([Wt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class La extends Ra{instances;get hashCode(){return Yt([Wt.MODEL_STORE_DATA,Yt(Array.from(this.instances.keys()).map((e=>e.path))),Xt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ba extends Ra{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Yt([Wt.RELATIONAL_CSV_DATA_TABLE,Yt(this.tables)])}}const Da=Ut((e=>((0,N.rC)(e,{contentType:N.LO,data:N.LO,hashCode:N.Fl}),e))),Ma=Ut((e=>((0,N.rC)(e,{dataElement:N.LO,hashCode:N.Fl}),e))),ka=Ut((e=>((0,N.rC)(e,{instances:N.LO,hashCode:N.Fl}),e))),Fa=Ut((e=>((0,N.rC)(e,{values:N.LO,table:N.LO,schema:N.LO,hashCode:N.Fl}),e))),ja=Ut((e=>((0,N.rC)(e,{tables:N.LO,hashCode:N.Fl}),e.tables.forEach(Fa),e)));function Ua(e,t){if(e instanceof wa)return Ma(e);if(e instanceof Pa)return Da(e);if(e instanceof La)return ka(e);if(e instanceof ba)return ja(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 Va=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{stereotypes:N.LO,taggedValues:N.LO,data:N.LO,_elementHashCode:N.KG}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),Ua(e.data,t),e)));class Ga{}class za extends Ga{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Yt([Wt.SERVICE_PURE_EXECUTION,this.func])}}class Ba extends za{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Yt([Wt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping.valueForSerialization??"",this.runtime])}}class $a extends za{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Yt([Wt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Yt(this.executionParameters)])}}class Ha{_OWNER;constructor(e){this._OWNER=e}}class Ya extends Ha{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Yt([Wt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Yt(this.asserts)])}}class Wa extends Ha{tests=[];get hashCode(){return Yt([Wt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Yt(this.tests)])}}const Ka=Vt(((e,t)=>((0,N.rC)(e,{connectionId:N.LO,testData:N.LO,hashCode:N.Fl}),Ua(e.testData,t),e))),Xa=Ut((e=>((0,N.rC)(e,{name:N.LO,value:N.LO.ref,hashCode:N.Fl}),e))),Za=Vt(((e,t)=>((0,N.rC)(e,{connectionsTestData:N.LO,hashCode:N.Fl}),e.connectionsTestData.forEach((e=>Ka(e,t))),e))),qa=Ut((e=>((0,N.rC)(e,{id:N.LO,serializationFormat:N.LO,assertions:N.LO,parameters:N.LO,keys:N.LO,hashCode:N.Fl}),e.parameters.forEach(Xa),e.assertions.forEach(ur),e))),Ja=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,tests:N.LO,testData:N.LO,hashCode:N.Fl}),e.tests.forEach((e=>dr(e,t))),Za(e.testData,t),e))),Qa=Ut((e=>((0,N.rC)(e,{parametersValues:N.LO,assert:N.LO,singleExecutionTestParent:N.LO,hashCode:N.Fl}),Fs(e.assert),e))),er=Ut((e=>((0,N.rC)(e,{data:N.LO,asserts:N.LO,hashCode:N.Fl}),e.asserts.forEach(Qa),e))),tr=Ut((e=>(er(e),(0,N.rC)(e,{key:N.LO}),e))),sr=Ut((e=>((0,N.rC)(e,{tests:N.LO,hashCode:N.Fl}),e.tests.forEach(tr),e))),ir=e=>{(0,N.rC)(e,{func:N.LO}),Fs(e.func)},nr=Vt(((e,t)=>(ir(e),(0,N.rC)(e,{runtime:N.LO,hashCode:N.Fl}),zt(e.mapping),no(e.runtime,t),e))),ar=Vt(((e,t)=>((0,N.rC)(e,{key:N.LO,runtime:N.LO,hashCode:N.Fl}),zt(e.mapping),no(e.runtime,t),e))),rr=Vt(((e,t)=>(ir(e),(0,N.rC)(e,{executionKey:N.LO,executionParameters:N.LO,hashCode:N.Fl}),e.executionParameters.forEach((e=>ar(e,t))),e))),or=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{pattern:N.LO,owners:N.LO,documentation:N.LO,autoActivateUpdates:N.LO,execution:N.LO,test:N.LO,tests:N.LO,patternParameters:N.Fl,_elementHashCode:N.KG}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),((e,t)=>{e instanceof Ba?nr(e,t):e instanceof $a&&rr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Ya?er(e):e instanceof Wa&&sr(e)})(e.test),e.tests.forEach((e=>Ja(e,t))),e))),lr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),e))),cr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),Da(e.expected),e))),hr=Ut((e=>((0,N.rC)(e,{id:N.LO,expected:N.LO,hashCode:N.Fl}),Da(e.expected),e)));function dr(e,t){if(e instanceof xa)return qa(e);if(e instanceof Oa)return mr(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 ur(e){return e instanceof Sa?lr(e):e instanceof va?hr(e):e instanceof Ia?cr(e):e}const pr=e=>{Gt(e),(0,N.rC)(e,{includes:N.LO}),e.includes.forEach(zt)},_r=Vt(((e,t)=>((0,N.rC)(e,{store:N.LO,data:N.LO,hashCode:N.Fl}),Ua(e.data,t),e))),mr=Ut((e=>((0,N.rC)(e,{id:N.LO,query:N.LO,assertions:N.LO,hashCode:N.Fl}),e.assertions.forEach(ur),e))),gr=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,tests:N.LO,storeTestDatas:N.LO,hashCode:N.Fl}),e.tests.forEach((e=>dr(e,t))),e.storeTestDatas.forEach((e=>_r(e,t))),e))),Er=Ut((e=>((0,N.rC)(e,{value:N.LO,valueForSerialization:N.Fl}),zt(e.ownerReference),e))),fr=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Tr=Ut((e=>((0,N.rC)(e,{localMappingProperty:N.LO,localMappingPropertyType:N.LO,localMappingPropertyMultiplicity:N.LO,hashCode:N.Fl}),zt(e.localMappingPropertyType),e))),Cr=(e,t)=>{(0,N.rC)(e,{sourceSetImplementation:N.LO,targetSetImplementation:N.LO}),vo(e.property),fr(e.sourceSetImplementation),e.targetSetImplementation&&fr(e.targetSetImplementation),e.localMappingProperty&&Tr(e.localMappingProperty)},xr=Vt(((e,t)=>(Cr(e,t),(0,N.rC)(e,{transformer:N.LO,transform:N.LO,explodeProperty:N.LO,hashCode:N.Fl}),e.transformer&&Er(e.transformer),Fs(e.transform),e)));class Or{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){xr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){si(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ti(e,this.observerContext)}visit_RelationalPropertyMapping(e){$n(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Ys(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Yn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Wn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Kn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Nr=(e,t)=>(e.accept_PropertyMappingVisitor(new Or(t)),e),Ar=Ut((e=>(0,N.rC)(e,{isDefault:N.Fl,valueForSerialization:N.Fl}))),yr=Ut((e=>(0,N.rC)(e,{valueForSerialization:N.Fl}))),Sr=e=>{(0,N.rC)(e,{root:N.LO}),zt(e.class),Ar(e.id),yr(e.root)},vr=Ut((e=>((0,N.rC)(e,{setImplementation:N.LO,class:N.LO,properties:N.LO}),e))),Ir=(e,t)=>{Sr(e),(0,N.rC)(e,{mappingClass:N.LO,propertyMappings:N.LO}),e.mappingClass&&vr(e.mappingClass),e.propertyMappings.forEach((e=>Nr(e,t)))},Rr=Ut((e=>((0,N.rC)(e,{}),fr(e.setImplementation),e))),wr=e=>{Sr(e),(0,N.rC)(e,{parameters:N.LO,operation:N.LO,hashCode:N.Fl}),e.parameters.forEach(Rr)},Pr=Ut((e=>(wr(e),e))),Lr=Ut((e=>(wr(e),(0,N.rC)(e,{validationFunction:N.LO}),Fs(e.validationFunction),e))),br=Vt(((e,t)=>(Ir(e,t),(0,N.rC)(e,{filter:N.LO,hashCode:N.Fl}),e.srcClass&&zt(e.srcClass),e.filter&&Fs(e.filter),e)));class Dr{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){Lr(e)}visit_OperationSetImplementation(e){Pr(e)}visit_PureInstanceSetImplementation(e){br(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ei(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Xn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Zn(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Mr=(e,t)=>(e.accept_SetImplementationVisitor(new Dr(t)),e),kr=Ut((e=>((0,N.rC)(e,{original:N.LO,substitute:N.LO}),zt(e.original),zt(e.substitute),e))),Fr=Ut((e=>((0,N.rC)(e,{included:N.LO,storeSubstitutions:N.LO}),zt(e.included),e.storeSubstitutions.forEach(kr),e))),jr=Ut((e=>(0,N.rC)(e,{value:N.LO}))),Ur=Ut((e=>((0,N.rC)(e,{sourceValues:N.LO,hashCode:N.Fl}),xo(e.enum),e.sourceValues.forEach(jr),e))),Vr=Ut((e=>((0,N.rC)(e,{sourceType:N.LO,enumValueMappings:N.LO,hashCode:N.Fl}),zt(e.enumeration),Ar(e.id),e.sourceType&&zt(e.sourceType),e.enumValueMappings.forEach(Ur),e))),Gr=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,stores:N.LO,propertyMappings:N.LO,hashCode:N.Fl}),zt(e.association),Ar(e.id),e.stores.forEach(zt),e.propertyMappings.forEach((e=>Nr(e,t))),e))),zr=Ut((e=>((0,N.rC)(e,{inputType:N.LO,data:N.LO,hashCode:N.Fl}),zt(e.sourceClass),e))),Br=Ut((e=>(0,N.rC)(e,{expectedOutput:N.LO,hashCode:N.Fl}))),$r=Vt(((e,t)=>((0,N.rC)(e,{name:N.LO,query:N.LO,inputData:N.LO,assert:N.LO,hashCode:N.Fl}),Fs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Ds)return zr(e);if(e instanceof ws)return ii(e);if(e instanceof Ms)return qn(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 ys&&Br(e)})(e.assert),e))),Hr=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{includes:N.LO,classMappings:N.LO,enumerationMappings:N.LO,associationMappings:N.LO,test:N.LO,tests:N.LO,_elementHashCode:N.KG}),e.includes.forEach(Fr),e.classMappings.forEach((e=>Mr(e,t))),e.enumerationMappings.forEach(Vr),e.associationMappings.forEach((e=>Gr(e,t))),e.test.forEach((e=>$r(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Aa?Ja(e,t):e instanceof Na?gr(e,t):e}(e,t))),e))),Yr=e=>{(0,N.rC)(e,{store:N.LO}),zt(e.store)},Wr=Ut((e=>(Yr(e),(0,N.rC)(e,{hashCode:N.Fl}),e))),Kr=Ut((e=>(Yr(e),(0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),zt(e.class),e))),Xr=Ut((e=>(Yr(e),(0,N.rC)(e,{url:N.LO,hashCode:N.Fl}),zt(e.class),e))),Zr=Ut((e=>(Yr(e),(0,N.rC)(e,{mappings:N.LO,hashCode:N.Fl}),e.mappings.forEach(zt),e)));class qr{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){Wr(e)}visit_ModelChainConnection(e){Zr(e)}visit_JsonModelConnection(e){Kr(e)}visit_XmlModelConnection(e){Xr(e)}visit_FlatDataConnection(e){ni(e)}visit_RelationalDatabaseConnection(e){Ea(e,this.observerContext)}}const Jr=(e,t)=>(e.accept_ConnectionVisitor(new qr(t)),e),Qr=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{connectionValue:N.LO,_elementHashCode:N.KG}),Jr(e.connectionValue,t),e))),eo=Vt(((e,t)=>((0,N.rC)(e,{id:N.LO,connection:N.LO,hashCode:N.Fl}),Jr(e.connection,t),e))),to=Vt(((e,t)=>((0,N.rC)(e,{storeConnections:N.LO,hashCode:N.Fl}),zt(e.store),e.storeConnections.forEach((e=>eo(e,t))),e))),so=Vt(((e,t)=>((0,N.rC)(e,{mappings:N.LO,connections:N.LO,hashCode:N.Fl}),e.mappings.forEach(zt),e.connections.forEach((e=>to(e,t))),e))),io=Ut((e=>((0,N.rC)(e,{hashCode:N.Fl}),zt(e.packageableRuntime),e))),no=(e,t)=>e instanceof Is?io(e):e instanceof vs?so(e,t):e,ao=Vt(((e,t)=>(Gt(e),(0,N.rC)(e,{runtimeValue:N.LO,_elementHashCode:N.KG}),so(e.runtimeValue,t),e)));class ro{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){lo(e,this.observerContext)}visit_SectionIndex(e){go(e)}visit_PrimitiveType(e){}visit_Profile(e){To(e)}visit_Enumeration(e){Oo(e)}visit_Measure(e){Ao(e)}visit_Class(e){Ro(e)}visit_Association(e){wo(e)}visit_ConcreteFunctionDefinition(e){Po(e)}visit_FlatData(e){Js(e)}visit_Database(e){Bn(e,this.observerContext)}visit_Mapping(e){Hr(e,this.observerContext)}visit_Service(e){or(e,this.observerContext)}visit_PackageableRuntime(e){ao(e,this.observerContext)}visit_PackageableConnection(e){Qr(e,this.observerContext)}visit_FileGenerationSpecification(e){gs(e)}visit_GenerationSpecification(e){fs(e)}visit_DataElement(e){Va(e,this.observerContext)}}const oo=Vt(((e,t)=>(e.accept_PackageableElementVisitor(new ro(t)),e))),lo=Vt(((e,t)=>((e=>{Gt(e),(0,N.rC)(e,{children:N.LO,hashCode:N.KG})})(e),e.children.forEach((e=>{e instanceof os?lo(e,t):oo(e,t)})),e))),co=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),ho=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),e))),uo=Ut((e=>((0,N.rC)(e,{value:N.LO,hashCode:N.Fl}),ho(e.tag),e))),po=Ut((e=>(0,N.rC)(e,{rawType:N.LO}))),_o=Ut((e=>((0,N.rC)(e,{value:N.LO}),po(e.value),zt(e.ownerReference),e))),mo=Ut((e=>((0,N.rC)(e,{parserName:N.LO,elements:N.LO}),e instanceof cs?(0,N.rC)(e,{imports:N.LO,hashCode:N.Fl}):e instanceof hs&&(0,N.rC)(e,{hashCode:N.Fl}),e))),go=Ut((e=>(Gt(e),(0,N.rC)(e,{sections:N.LO,_elementHashCode:N.KG}),e.sections.forEach(mo),e))),Eo=Ut((e=>(0,N.rC)(e,{value:N.LO}))),fo=Ut((e=>(0,N.rC)(e,{value:N.LO}))),To=Ut((e=>(Gt(e),(0,N.rC)(e,{p_stereotypes:N.LO,p_tags:N.LO,_elementHashCode:N.KG}),e.p_stereotypes.forEach(Eo),e.p_tags.forEach(fo),e))),Co=Ut((e=>((0,N.rC)(e,{name:N.LO,stereotypes:N.LO,taggedValues:N.LO,hashCode:N.Fl}),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),xo=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Oo=Ut((e=>(Gt(e),(0,N.rC)(e,{values:N.LO,stereotypes:N.LO,taggedValues:N.LO,_elementHashCode:N.KG}),e.values.forEach(Co),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),No=Ut((e=>((0,N.rC)(e,{measure:N.LO,conversionFunction:N.LO,hashCode:N.Fl}),e.conversionFunction&&Fs(e.conversionFunction),e))),Ao=Ut((e=>(Gt(e),(0,N.rC)(e,{canonicalUnit:N.LO,nonCanonicalUnits:N.LO,_elementHashCode:N.KG}),e.canonicalUnit&&No(e.canonicalUnit),e.nonCanonicalUnits.forEach(No),e))),yo=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,stereotypes:N.LO,taggedValues:N.LO,hashCode:N.Fl}),_o(e.genericType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),So=Ut((e=>((0,N.rC)(e,{name:N.LO,multiplicity:N.LO,stereotypes:N.LO,taggedValues:N.LO,body:N.LO.ref,parameters:N.LO.ref,hashCode:N.Fl}),_o(e.genericType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),vo=Ut((e=>((0,N.rC)(e,{value:N.LO,pointerHashCode:N.Fl}),zt(e.ownerReference),e))),Io=Ut((e=>((0,N.rC)(e,{name:N.LO,functionDefinition:N.LO,externalId:N.LO,enforcementLevel:N.LO,messageFunction:N.LO,hashCode:N.Fl}),Fs(e.functionDefinition),e.messageFunction&&Fs(e.messageFunction),e))),Ro=Ut((e=>(Gt(e),(0,N.rC)(e,{_subclasses:N.LO,properties:N.LO,propertiesFromAssociations:N.LO,derivedProperties:N.LO,generalizations:N.LO,constraints:N.LO,stereotypes:N.LO,taggedValues:N.LO,dispose:N.KG,_elementHashCode:N.KG}),e.properties.forEach(yo),e.propertiesFromAssociations.forEach(yo),e.derivedProperties.forEach(So),e.generalizations.forEach(_o),e.constraints.forEach(Io),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),wo=Ut((e=>(Gt(e),(0,N.rC)(e,{properties:N.LO,stereotypes:N.LO,taggedValues:N.LO,derivedProperties:N.LO,_elementHashCode:N.KG}),e.properties.forEach(yo),e.derivedProperties.forEach(So),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),Po=Ut((e=>(Gt(e),(0,N.rC)(e,{functionName:N.LO,returnMultiplicity:N.LO,parameters:N.LO.shallow,expressionSequence:N.LO.ref,stereotypes:N.LO,taggedValues:N.LO,_elementHashCode:N.KG}),e.parameters.forEach(js),zt(e.returnType),e.stereotypes.forEach(co),e.taggedValues.forEach(uo),e))),Lo=Ut((e=>e instanceof ns?Oo(e):e instanceof as?No(e):e instanceof ss?Ro(e):e instanceof rs?Ao(e):e)),bo=(Ut((e=>e instanceof ns?Oo(e):e instanceof as?No(e):e)),Ut((e=>(0,N.rC)(e,{_dummyObservable:N.LO})))),Do=Ut((e=>((0,N.rC)(e,{value:N.LO}),zt(e.ownerReference),e))),Mo=Ut((e=>(bo(e),(0,N.rC)(e,{id:N.LO,hideProperties:N.LO,hideTaggedValues:N.LO,hideStereotypes:N.LO,hashCode:N.Fl}),zt(e.class),e))),ko=Ut((e=>(Do(e.classView),e))),Fo=Ut((e=>((0,N.rC)(e,{path:N.LO,pathForSerialization:N.Fl}),ko(e.from),ko(e.to),e))),jo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),e))),Uo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),vo(e.property),zt(e.association),e))),Vo=Ut((e=>(Fo(e),(0,N.rC)(e,{hashCode:N.Fl}),vo(e.property),e))),Go=Ut((e=>(Gt(e),(0,N.rC)(e,{classViews:N.LO,associationViews:N.LO,generalizationViews:N.LO,propertyViews:N.LO,_elementHashCode:N.KG}),e.classViews.forEach(Mo),e.associationViews.forEach(Uo),e.generalizationViews.forEach(jo),e.propertyViews.forEach(Vo),e)));var zo;!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"}(zo=zo||(zo={}));class Bo extends es{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Yt([zo.DIAGRAM,this.path,Yt(this.classViews),Yt(this.generalizationViews),Yt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const $o="Diagram";class Ho extends jt{constructor(){super(Ft.Rw.LW,Ft.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[$o]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Bo)return $o}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Bo)return Go(e)}]}}class Yo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT,this.path])}}class Wo extends Yo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Yt([zo.DIAGRAM,this.path,Yt(this.classViews),Yt(this.generalizationViews),Yt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Ko{rectangle;position;get hashCode(){return Yt([zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Xo extends Ko{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Yt([zo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class Zo{x;y;get hashCode(){return Yt([zo.POINT,this.x.toString(),this.y.toString()])}}class qo{width;height;get hashCode(){return Yt([zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class Jo{points=[]}class Qo{sourceView;targetView;line;get hashCode(){return Yt([zo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Yt(this.line.points)])}}class el extends Qo{property;get hashCode(){return Yt([zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class tl extends el{get hashCode(){return Yt([zo.PROPERTY_VIEW,super.hashCode])}}class sl extends Qo{get hashCode(){return Yt([zo.GENERALIZATION_VIEW,super.hashCode])}}class il{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Yt([Wt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new il(0,0);static ZERO_ONE=new il(0,1);static ZERO_MANY=new il(0,void 0);static ONE=new il(1,1);static ONE_MANY=new il(1,void 0)}new Ve((0,Ue.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()})),(0,Ue.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Yt([Wt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Ue.Ru)(),type:(0,Ue.Ru)()});const nl=(0,Ue.yu)(il,{lowerBound:(0,Ue.Ru)(),upperBound:(0,Ue.jt)((0,Ue.Ru)())});class al{class;property;get hashCode(){return Yt([Wt.PROPERTY_POINTER,this.property,this.class??""])}}class rl{}class ol{queryTimeOutInSeconds=null;enableConstraints=!0}var ll,cl;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(ll||(ll={})),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"}(cl=cl||(cl={})),(0,Ue.yu)(class extends ol{},{_type:$e(ll.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Ue.Ru)(),enableConstraints:(0,Ue.Ru)()});const hl=(0,Ue.yu)(class extends rl{body;parameters;get hashCode(){return Yt([Wt.RAW_LAMBDA,Zt(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:$e(cl.LAMBDA),body:(0,Ue.LZ)(),parameters:(0,Ue.LZ)()}),dl=(0,Ue.yu)(class extends rl{class;name;multiplicity;get hashCode(){return Yt([Wt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:$e(cl.VARIABLE),class:(0,Ue.Ru)(),multiplicity:Ge(nl),name:(0,Ue.Ru)()});(0,Ue.yu)(class extends rl{multiplicity=il.ONE;type;value;get hashCode(){return Yt([Wt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Ue.bm)("_type",(0,Ue.PG)((e=>{switch(e){case Ee.INTEGER:return cl.CINTEGER;case Ee.DECIMAL:return cl.CDECIMAL;case Ee.STRING:return cl.CSTRING;case Ee.BOOLEAN:return cl.CBOOLEAN;case Ee.FLOAT:return cl.CFLOAT;case Ee.DATETIME:return cl.CDATETIME;case Ee.STRICTDATE:return cl.CSTRICTDATE;case Ee.STRICTTIME:return cl.CSTRICTTIME;case Ee.LATESTDATE:return cl.CLATESTDATE;default:throw new k(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case cl.CINTEGER:return Ee.INTEGER;case cl.CDECIMAL:return Ee.DECIMAL;case cl.CSTRING:return Ee.STRING;case cl.CBOOLEAN:return Ee.BOOLEAN;case cl.CFLOAT:return Ee.FLOAT;case cl.CDATETIME:return Ee.DATETIME;case cl.CSTRICTDATE:return Ee.STRICTDATE;case cl.CSTRICTTIME:return Ee.STRICTTIME;case cl.CLATESTDATE:return Ee.LATESTDATE;default:throw new k(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Ue.jt)((0,Ue.Ru)())});const ul=(0,Ue.yu)(al,{class:(0,Ue.jt)((0,Ue.Ru)()),property:(0,Ue.Ru)()}),pl=(0,Ue.yu)(class{profile;value;get hashCode(){return Yt([Wt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()}),_l=(0,Ue.yu)(class{profile;value;get hashCode(){return Yt([Wt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()}),ml=(0,Ue.yu)(class{tag;value;get hashCode(){return Yt([Wt.TAGGED_VALUE,this.tag,this.value])}},{tag:Ge(_l),value:(0,Ue.Ru)()}),gl=((0,Ue.yu)(class extends Yo{stereotypes=[];tags=[];get hashCode(){return Yt([Wt.PROFILE,this.path,Yt(this.stereotypes),Yt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:$e("profile"),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ru)()),tags:(0,Ue.pb)((0,Ue.Ru)())}),(0,Ue.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ENUM_VALUE,this.value,Yt(this.stereotypes),Yt(this.taggedValues)])}},{stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),value:(0,Ue.Ru)()})),El=((0,Ue.yu)(class extends Yo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ENUMERATION,this.path,Yt(this.values),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:$e("Enumeration"),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),values:(0,Ue.pb)(Ge(gl))}),(0,Ue.yu)(class extends Yo{measure;conversionFunction;get hashCode(){return Yt([Wt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new k}},{_type:$e("unit"),conversionFunction:(0,Ue.jt)(Ge(hl)),measure:(0,Ue.Ru)(),name:(0,Ue.Ru)(),package:(0,Ue.Ru)()})),fl=((0,Ue.yu)(class extends Yo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Yt([Wt.MEASURE,this.path,this.canonicalUnit??"",Yt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:$e("measure"),canonicalUnit:(0,Ue.jt)(Ge(El)),name:(0,Ue.Ru)(),nonCanonicalUnits:(0,Ue.pb)(Ge(El)),package:(0,Ue.Ru)()}),(0,Ue.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Yt(this.stereotypes),Yt(this.taggedValues)])}},{aggregation:(0,Ue.jt)((0,Ue.Ru)()),multiplicity:Ge(nl),name:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1}))),type:(0,Ue.Ru)()})),Tl=(0,Ue.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Yt([Wt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Yt(this.stereotypes),Yt(this.taggedValues),Zt(this.parameters,this.body)])}},{body:(0,Ue.LZ)(),name:(0,Ue.Ru)(),parameters:(0,Ue.LZ)(),returnMultiplicity:Ge(nl),returnType:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),Cl=(0,Ue.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Yt([Wt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Ue.jt)((0,Ue.Ru)()),externalId:(0,Ue.jt)((0,Ue.Ru)()),functionDefinition:Ge(hl),messageFunction:(0,Ue.jt)(Ge(hl)),name:(0,Ue.Ru)()}),xl=((0,Ue.yu)(class extends Yo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Yt([Wt.CLASS,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.superTypes),Yt(this.constraints),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:$e("class"),constraints:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Cl,e)),{skipIfEmpty:!1}))),name:(0,Ue.Ru)(),originalMilestonedProperties:(0,Ue.PG)((e=>Be(e,(e=>Ue.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>Ue.AM),{skipIfEmpty:!1}))),package:(0,Ue.Ru)(),properties:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(fl,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Ue.bm)("qualifiedProperties",(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Tl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),superTypes:(0,Ue.PG)((e=>Be(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),(0,Ue.yu)(class extends Yo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Yt([Wt.ASSOCIATION,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.stereotypes),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:$e("association"),name:(0,Ue.Ru)(),originalMilestonedProperties:(0,Ue.PG)((e=>Be(e,(e=>Ue.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>Ue.AM),{skipIfEmpty:!1}))),package:(0,Ue.Ru)(),properties:(0,Ue.pb)(Ge(fl)),derivedProperties:(0,Ue.bm)("qualifiedProperties",(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(Tl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),(0,Ue.yu)(class extends Yo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Yt([Wt.FUNCTION,this.path,Yt(this.parameters),this.returnType,Yt(this.taggedValues),Yt(this.stereotypes),Zt(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:$e("function"),body:(0,Ue.pb)((0,Ue.LZ)()),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),parameters:(0,Ue.pb)(Ge(dl)),postConstraints:(0,Ue.pb)((0,Ue.Ru)()),preConstraints:(0,Ue.pb)((0,Ue.Ru)()),returnMultiplicity:Ge(nl),returnType:(0,Ue.Ru)(),stereotypes:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(pl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(pl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Ue.PG)((e=>Be(e,(e=>(0,Ue.qC)(ml,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>ze(e,(e=>(0,Ue.vB)(ml,e)),{skipIfEmpty:!1})))}),"diagram"),Ol=(0,Ue.yu)(Zo,{x:(0,Ue.Ru)(),y:(0,Ue.Ru)()}),Nl=(0,Ue.yu)(qo,{height:(0,Ue.Ru)(),width:(0,Ue.Ru)()}),Al=(0,Ue.yu)(Jo,{points:(0,Ue.pb)(Ge(Ol))}),yl=(0,Ue.yu)(Xo,{class:(0,Ue.Ru)(),hideProperties:(0,Ue.jt)((0,Ue.Ru)()),hideStereotypes:(0,Ue.jt)((0,Ue.Ru)()),hideTaggedValues:(0,Ue.jt)((0,Ue.Ru)()),id:(0,Ue.Ru)(),position:Ge(Ol),rectangle:Ge(Nl)}),Sl=(0,Ue.yu)(tl,{line:Ge(Al),property:Ge(ul),sourceView:(0,Ue.Ru)(),targetView:(0,Ue.Ru)()}),vl=(0,Ue.yu)(sl,{line:Ge(Al),sourceView:(0,Ue.Ru)(),targetView:(0,Ue.Ru)()}),Il=(0,Ue.yu)(Wo,{_type:$e(xl),classViews:(0,Ue.pb)(Ge(yl)),generalizationViews:(0,Ue.pb)(Ge(vl)),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),propertyViews:(0,Ue.pb)(Ge(Sl))});class Rl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}const wl=(e,t)=>{const s=e.lastIndexOf(_e);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+_e.length,e.length)]},Pl=(e,t)=>`${e?`${e}::`:""}${t}`,Ll=(e,t)=>{e.children.push(t),t.package=e},bl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Dl=(e,t,s,i)=>{const n=t.indexOf(_e),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof os&&e.name===a)),!r){if(!s)throw new U(`Can't find child package '${a}' in package '${e.path}'`);K(!me.includes(a),`Can't create package with reserved name '${a}'`),r=new os(a),r.package=e,e.children.push(r)}return i&&i.set(Pl(e.path,a),r),-1!==n?Dl(r,t.substring(n+_e.length),s,i):r},Ml=(e,t,s,i)=>{if(i){const n=i.get(Pl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Pl(e.path,a),r=i.get(n);if(r)return Dl(r,t.substring(a.length+_e.length,t.length),s,i);const o=a.lastIndexOf(_e);a=-1!==o?a.substring(0,o):""}}return Dl(e,t,s,i)},kl=(e,t,s)=>(Y(t,"Package path is required"),Ml(e.root,t,!0,s)),Fl=(e,t)=>H(e.rawType,t),jl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Fl(e.value,ss);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Ul=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Vl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Gl=(e,t)=>`${z(e,"Package path is required")}::${z(t,"Name is required")}`;class zl{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){Y(e.package,"Element 'package' field is missing or empty"),Y(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new U(`Element '${e}' already exists`);s.add(e)}else K(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Gl(e.package,e.name),t,i);const n=this.firstPass(e,t);return Ll(kl(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 Bl=e=>e.classView.value.id,$l=e=>{const t=new tl,s=new Jo;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new al;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Bl(e.from),t.targetView=Bl(e.to),t},Hl=e=>{const t=new sl,s=new Jo;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Bl(e.from),t.targetView=Bl(e.to),t},Yl=e=>{const t=new Xo;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 Zo;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new qo;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Wl{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Yt([zo.POINT,this.x.toString(),this.y.toString()])}}class Kl{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Yt([zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class Xl{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Wl(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 Xl(new Wl(e.position.x+e.rectangle.width,e.position.y),new Kl(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new Xl(new Wl(e.position.x,e.position.y+e.rectangle.height),new Kl(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Yt([zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class Zl extends Xl{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Wl(0,0),new Kl(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Yt([zo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class ql{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class Jl extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Ql extends Jl{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Ql(e)}}class ec{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new ql(Ql.create(t)),this.to=new ql(Ql.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 Wl(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Wl(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 ec.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Yt([zo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Yt(this.pathForSerialization)])}}class tc extends ec{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Yt([zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class sc extends tc{get hashCode(){return Yt([zo.PROPERTY_VIEW,super.hashCode])}}class ic extends ec{get hashCode(){return Yt([zo.GENERALIZATION_VIEW,super.hashCode])}}class nc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new nc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new nc(this.x/e,this.y/e)}normal(e){return new nc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const ac=(e,t)=>e.classViews.find((e=>e.id===t)),rc=(e,t)=>{e.path=t},oc=e=>{const t=e.buildFullPath(),s=ec.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=nc.fromPoints(s[e+1],s[e]).unit(),n=nc.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])}rc(e,i)},lc=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),cc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),hc=e=>new Wl(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),dc=e=>{const t=hc(e);return new Xl(new Wl(t.x-5,t.y-5),new Kl(10,10))},uc=(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)),pc=e=>{const t=z(e.x,"Point 'x' coordinate is missing"),s=z(e.y,"Point 'y' coordinate is missing");return new Wl(t,s)};class _c extends Rl{constructor(){super(Ft.Rw.zE,Ft.i8)}V1_getExtraElementBuilders(){return[new zl({elementClassName:"Diagram",_class:Wo,firstPass:(e,t)=>{$(e,Wo);const s=new Bo(e.name),i=Gl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Bo),s},secondPass:(e,t)=>{$(e,Wo);const s=(i=Gl(e.package,e.name),n=t.currentSubGraph,z(n.getOwnNullableExtensionElement(i,Bo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{Y(e.class,"Class view 'class' field is missing or empty"),Y(e.id,"Class view 'id' field is missing or empty"),G(e.rectangle,"Class view 'rectangle' field is missing"),G(e.position,"Class view 'position' field is missing");const i=new Zl(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=z(e.width,"Rectangle 'width' is missing"),s=z(e.height,"Rectangle 'height' is missing");return new Kl(t,s)})(e.rectangle),i.position=pc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{G(e.property,"Property view 'property' field is missing"),G(e.line,"Property view 'line' field is missing");const i=z(ac(s,z(e.sourceView)),"Property view 'sourceView' field is missing"),n=z(ac(s,z(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new sc(s,a,i,n);return r.path=e.line.points.map((e=>pc(e))),oc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{G(e.line,"Generalization view 'line' field is missing");const s=z(ac(t,z(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=z(ac(t,z(e.targetView)),"Generalization view 'targetView' field is missing"),n=new ic(t,s,i);return n.path=e.line.points.map((e=>pc(e))),oc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Wo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Wo)return(0,Ue.qC)(Il,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===xl)return(0,Ue.vB)(Il,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Bo)return(e=>{const t=new Wo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Yl),t.generalizationViews=e.generalizationViews.map(Hl),t.propertyViews=e.propertyViews.map($l),t})(e)}]}}class mc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class gc extends mc{constructor(){super(Ft.Rw.f1,Ft.i8)}getExtraPureGraphExtensionClasses(){return[Bo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Bo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof ss?Ul(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>L(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>L(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=>L(e.generalizationViews,t)))})(t,e)))}]}}class Ec extends c{constructor(){super(Ft.Rw.NA,Ft.i8,[new gc,new Ho,new _c])}}var fc=s(5453),Tc=s(3493),Cc=s(3908);const xc=(0,fc.Z)({transitions:{create:()=>"none"}}),Oc=e=>{const{children:t}=e;return(0,x.jsx)(Tc.Z,{injectFirst:!0,children:(0,x.jsx)(Cc.Z,{theme:xc,children:t})})};var Nc=s(3820),Ac=s(9631),yc=s(2238),Sc=s(8683),vc=s(889),Ic=s(6277);const Rc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)(t,i),children:s})};return s.displayName=e,s},wc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)("modal",{"modal--dark":s},i),children:t})},Pc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Ic.clsx)("modal__title",i),children:[s&&(0,x.jsx)("div",{className:"modal__title__icon",children:s}),(0,x.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Os.includes(e.toLowerCase())?e.toLowerCase():xs(e))).replace(/^(?:\w+)\b/u,(e=>xs(e))).replace(/\b(?:\w+)$/u,(e=>xs(e))))})]});var n},Lc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Ic.clsx)("modal__header",i),children:(0,x.jsx)(Pc,{title:t})}):(0,x.jsx)("div",{className:(0,Ic.clsx)("modal__header",i),children:s})},bc=(Rc("ModalHeaderActions","modal__header__actions"),Rc("ModalBody","modal__body")),Dc=Rc("ModalFooter","modal__footer"),Mc=e=>{switch(e){case yt.PROCEED_WITH_CAUTION:return"btn--caution";case yt.PROCEED:case yt.STANDARD:default:return"btn--dark"}},kc=(0,Qe.Pi)((e=>{const{info:t}=e,s=Lt(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,h=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,x.jsx)(vc.Z,{open:Boolean(s.actionAlertInfo),onClose:I,TransitionProps:{onEnter:()=>l?.()},children:(0,x.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),h()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??At.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(Lc,{title:i}),(0,x.jsxs)(bc,{children:[(0,x.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,x.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,x.jsxs)(Dc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Mc(e.type??yt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),h()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,x.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:h,children:"Cancel"})]})]})})})),Fc=(0,Qe.Pi)((()=>{const e=Lt().actionAlertInfo;return e?(0,x.jsx)(kc,{info:e}):null})),jc=e=>{const{isLoading:t}=e,s=(0,et.useRef)(null);return(0,et.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,x.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Uc=(0,Qe.Pi)((()=>{const e=Lt().blockingAlertInfo;return e?(0,x.jsx)(vc.Z,{open:Boolean(e),onClose:I,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(wc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)(jc,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(bc,{children:[(0,x.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,x.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Vc=s(2889),Gc=s(8619),zc=s(3029);const Bc=(0,Qe.Pi)((()=>{const e=Lt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??vt.INFO,[a,r]=(0,et.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Vc.uMt,{})});switch(n){case vt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Vc.nnZ,{})});break;case vt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Vc.xDH,{})});break;case vt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Vc.LPM,{})});break;case vt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Vc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Gc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:St,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(zc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,x.jsxs)("div",{className:"notification__message__content",children:[o,(0,x.jsx)("div",{className:(0,Ic.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,x.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Vc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var $c;!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"}($c=$c||($c={}));var Hc=s(1826);const Yc=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(Hc.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Wc=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,et.useRef)(null),[c,h]=(0,et.useState)(!1),[d,u]=(0,et.useState)(),[p,_]=(0,et.useState)(0),[m,g]=(0,et.useState)(0),E=()=>{u(void 0),h(!1),g(0),_(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},T=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(d!==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),h(!0),g(a),_(n)}};return(0,x.jsxs)("div",{ref:l,className:t,onContextMenu:T,children:[s,(0,x.jsx)(Yc,{open:c,anchorPosition:{left:p,top:m},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:T},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${m}`)]})},Kc=(0,et.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Ic.clsx)("menu",s),...n,children:i})})),Xc=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Ic.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})};Rc("MenuContentDivider","menu__divider"),Rc("MenuContentItemIcon","menu__item__icon"),Rc("MenuContentItemLabel","menu__item__label");var Zc=s(2794),qc=s(1215);const Jc=e=>(0,x.jsx)(Zc.D,{className:(0,Ic.clsx)("markdown-content",e.className),remarkPlugins:[qc.Z],children:e.value.value});var Qc=s(2515);const eh=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,Qc.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,et.useState)(!1),{ref:o,width:l,height:c}=(0,Qc.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,et.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,x.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,x.jsx)("div",{ref:s,className:(0,Ic.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var th=s(1222);const sh=e=>{const{children:t,...s}=e;return(0,x.jsx)(th.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var ih=s(3474),nh=s(5068),ah=s(1327),rh=s(7793),oh=s(6569),lh=s(6678);const ch=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,x.jsxs)("div",{className:(0,Ic.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(rh.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(oh.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(lh.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,x.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var hh;!function(e){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_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"}(hh=hh||(hh={}));const dh=(0,Qe.Pi)((e=>{const{configState:t}=e,s=Lt();return(0,x.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,x.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,x.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(hh.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Vc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(ch,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[ht.STANDARD,ht.INCLUDE,ht.EXACT,ht.INVERSE],size:1})})]})})),uh=(0,Qe.Pi)((e=>{const{entry:t}=e,s=Lt(),i=()=>{t.isOpen||Ct.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(Wc,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(Kc,{children:(0,x.jsx)(Xc,{onClick:n,children:"Copy Documentation Key"})}),children:(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,x.jsx)("button",{className:(0,Ic.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,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{})}),t.url?(0,x.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{Ct.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(Jc,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),ph=(0,Qe.Pi)((()=>{const e=Lt(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,x.jsxs)(Wc,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(Xc,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(Xc,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,x.jsx)(x.Fragment,{children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(Jc,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,x.jsx)(uh,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(eh,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Vc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),_h=(0,Qe.Pi)((()=>{const e=Lt(),t=(0,et.useRef)(null),s=(0,et.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,et.useMemo)((()=>(0,ih.Z)((()=>i.search()),100)),[i]);return(0,et.useEffect)((()=>{t.current?.focus()}),[]),(0,x.jsxs)("div",{className:"virtual-assistant__search",children:[(0,x.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,x.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,Ic.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,x.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,x.jsx)("button",{ref:s,className:(0,Ic.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,x.jsx)(Vc.IEm,{})}),n?(0,x.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,x.jsx)(Vc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Vc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)(jc,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(dh,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(uh,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,x.jsxs)(x.Fragment,{children:[Boolean(i.searchResults.length)&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,x.jsx)(uh,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(eh,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Vc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,x.jsx)(Wc,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>{ue(`documentation-registry_${(0,nh.Z)(new Date(Date.now()),Le)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ie.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(Xc,{onClick:()=>{ue(`documentation-registry_${(0,nh.Z)(new Date(Date.now()),Le)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ie.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,x.jsxs)("div",{className:"virtual-assistant__character",children:[(0,x.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,x.jsx)(Vc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Vc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Vc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,x.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,x.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),mh=(0,Qe.Pi)((e=>{const{triggerElement:t}=e,s=Lt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(sh,{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,x.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===dt.SEARCH}),onClick:()=>s.setSelectedTab(dt.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Vc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Ic.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===dt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(dt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Vc.kdY,{}),i&&(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,x.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,x.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,x.jsx)(Vc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===dt.SEARCH&&(0,x.jsx)(_h,{}),n===dt.CONTEXTUAL_SUPPORT&&(0,x.jsx)(ph,{})]})]})},s.panelRenderingKey)})),gh=(0,Qe.Pi)((()=>{const[e,t]=(0,et.useState)(!1),[s,i]=(0,et.useState)((0,a.Z)()),n=Lt(),r=(0,et.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,et.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(ah,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,x.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,x.jsxs)("div",{className:(0,Ic.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,x.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(dt.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,x.jsx)(Vc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Vc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(Wc,{className:(0,Ic.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(Xc,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,x.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,x.jsx)(Vc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(mh,{triggerElement:r.current})]})},s)})),Eh="app.container",fh="app.backdrop-container",Th=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7"],Ch=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),xh=(0,Qe.Pi)((e=>{const{children:t}=e,s=Lt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(fh):document.getElementById(fh),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:Th,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Th.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,et.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=z(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=z(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![$c.SHIFT,$c.META,$c.ALT,$c.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(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,x.jsxs)(Oc,{children:[(0,x.jsx)(Uc,{}),(0,x.jsx)(Fc,{}),(0,x.jsx)(Bc,{}),s.showBackdrop&&(0,x.jsx)(Nc.Z,{container:i,children:(0,x.jsx)(Ac.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(yc.W,{backend:Sc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Eh,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Ch,{elementID:fh}),(0,x.jsx)(gh,{}),t]})})]})}));class Oh{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Nh=(0,et.createContext)(void 0),Ah=({children:e})=>{const t=Lt(),s=(0,Qe.fv)((()=>new Oh(t)));return(0,x.jsx)(Nh.Provider,{value:s,children:e})};var yh,Sh;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(yh=yh||(yh={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(Sh=Sh||(Sh={}));const vh=e=>e.startsWith("/")?e.substring(1,e.length):e;class Ih{content;constructor(){(0,N.rC)(this,{content:N.LO,setContent:N.aD})}setContent(e){this.content=e}}(0,Ue.yu)(Ih,{content:(0,Ue.Ru)()});class Rh{file;line;column;errorMessage;constructor(e,t,s,i){(0,N.rC)(this,{file:N.LO,line:N.LO,column:N.LO,errorMessage:N.LO,setErrorMessage:N.aD}),this.file=e,this.line=t,this.column=s,this.errorMessage=i}setErrorMessage(e){this.errorMessage=e}}class wh{uuid=(0,a.Z)();get description(){}}class Ph{currentTab;tabs=[];constructor(){(0,N.rC)(this,{currentTab:N.LO,tabs:N.LO,setCurrentTab:N.aD,closeTab:N.aD,closeAllTabs:N.aD,closeAllOtherTabs:N.aD,openTab:N.aD,swapTabs:N.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){G(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){P(this.tabs,e,t)}}class Lh extends wh{editorStore;constructor(e){super(),this.editorStore=e}}class bh extends Ph{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){const t=this.tabs.findIndex((t=>t===e));if(K(-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)}openTab(e){if(!this.tabs.find((t=>t===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)}}var Dh;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_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",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"}(Dh=Dh||(Dh={}));const Mh={[Dh.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[Dh.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[Dh.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Dh.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+`"},[Dh.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Dh.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Dh.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Dh.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Dh.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"},[Dh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Dh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Dh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"}};class kh extends Lh{_textEditor;file;filePath;coordinate;constructor(e,t,s,i){super(e),(0,N.rC)(this,{_textEditor:N.LO,file:N.LO,coordinate:N.LO,setTextEditor:N.aD,setFile:N.aD,setCoordinate:N.aD}),this.file=t,this.filePath=s,this.coordinate=i}get label(){return vh(this.filePath)}get description(){return vh(this.filePath)}get textEditor(){return z(this._textEditor,"Text editor must be initialized (this is likely caused by calling this method at the wrong place)")}setTextEditor(e){this._textEditor=e}setFile(e){this.file=e}setCoordinate(e){this.coordinate=e}clearError(){this.coordinate?.setErrorMessage(void 0)}registerCommands(){this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.GO_TO_DEFINITION,trigger:()=>void 0!==this._textEditor&&this.textEditor.hasTextFocus(),action:()=>{const e=this.textEditor.getPosition();if(e){const t=new Rh(this.filePath,e.lineNumber,e.column);(0,N.fl)(this.editorStore.executeNavigation(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.GO_BACK,action:()=>{(0,N.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Dh.FIND_USAGES,trigger:()=>void 0!==this._textEditor&&this.textEditor.hasTextFocus(),action:()=>{const e=this.textEditor.getPosition();if(e){const t=new Rh(this.filePath,e.lineNumber,e.column);(0,N.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}deregisterCommands(){[Dh.GO_TO_DEFINITION,Dh.GO_BACK,Dh.FIND_USAGES].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class Fh{editorStore;treeData;selectedNode;loadInitialDataState=pt.create();refreshDataState=pt.create();constructor(e){(0,N.rC)(this,{treeData:N.LO.ref,loadInitialDataState:N.LO,refreshDataState:N.LO,initialize:N.ls,expandNode:N.ls,openNode:N.ls,refreshTreeData:N.ls,setTreeData:N.aD,setSelectedNode:N.aD}),this.editorStore=e}getTreeData(){return z(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){F(e),this.editorStore.applicationStore.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({...z(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){F(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){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 F(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>z(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(z(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,N.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>z(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class jh{id;path}class Uh extends jh{file;statusType}(0,Ue.yu)(Uh,{id:(0,Ue.Ru)(),path:(0,Ue.Ru)(),file:(0,Ue.Ru)(),statusType:(0,Ue.Ru)()});class Vh extends jh{repo}(0,Ue.yu)(Vh,{id:(0,Ue.Ru)(),path:(0,Ue.Ru)(),repo:(0,Ue.Ru)()});class Gh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof Vh}get isFileNode(){return this.li_attr instanceof Uh}getNodeAttribute(e){return H(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Ue.yu)(Gh,{li_attr:(0,Ue.PG)((()=>Ue.AM),(e=>e.file&&"true"===e.file?(0,Ue.vB)(Uh,e):(0,Ue.vB)(Vh,e))),text:(0,Ue.Ru)(),icon:(0,Ue.Ru)(),children:(0,Ue.Ru)(),state:(0,Ue.Ru)()});const zh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},Bh=e=>e.endsWith(".pure"),$h=e=>`file_${e}`;class Hh extends Fh{nodeForCreateNewFile;nodeForCreateNewDirectory;constructor(e){super(e),(0,N.rC)(this,{nodeForCreateNewFile:N.LO,nodeForCreateNewDirectory:N.LO,setNodeForCreateNewFile:N.aD,setNodeForCreateNewDirectory:N.aD,revealPath:N.ls})}setNodeForCreateNewFile=e=>{K(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{K(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Ue.vB)(Gh,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,Ue.vB)(Gh,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,N.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(yh.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=zh(n);for(const e of i)if(Bh(e))yield(0,N.fl)(this.editorStore.loadFile(e,s));else{const t=z(this.getTreeData().nodes.get($h(e)),`Can't find directory node with path '${e}'`);yield(0,N.fl)(this.expandNode(t))}const a=z(this.getTreeData().nodes.get($h(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}var Yh,Wh,Kh,Xh;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram"}(Yh=Yh||(Yh={}));class Zh{pureId;pureType;get id(){return this.pureId}}class qh extends Zh{deprecated}(0,Ue.yu)(qh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),deprecated:(0,Ue.Ru)()});class Jh extends Zh{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Ue.yu)(Jh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),classPath:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class Qh extends Zh{RO;notpublic;user;file;line;column}(0,Ue.yu)(Qh,{pureId:(0,Ue.Ru)(),pureType:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),notpublic:(0,Ue.Ru)(),user:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class ed{li_attr;id;text;icon;children;state;getNodeAttribute(e){return H(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Ue.yu)(ed,{li_attr:(0,Ue.PG)((()=>Ue.AM),(e=>e.classPath?(0,Ue.vB)(Jh,e):e.file?(0,Ue.vB)(Qh,e):(0,Ue.vB)(qh,e))),id:(0,Ue.Ru)(),text:(0,Ue.Ru)(),icon:(0,Ue.Ru)(),children:(0,Ue.Ru)(),state:(0,Ue.Ru)()});class td extends Fh{loadConceptActivity=pt.create();statusText;constructor(e){super(e),(0,N.rC)(this,{statusText:N.LO,setStatusText:N.aD,pullConceptsActivity:N.aD,pollConceptsActivity:N.ls})}setStatusText(e){this.statusText=e}async getRootNodes(){return await(0,N.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Ue.vB)(ed,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,Ue.vB)(ed,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.li_attr instanceof Jh||e.data.li_attr instanceof Qh)&&("Diagram"===e.data.li_attr.pureType?yield(0,N.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId)):yield(0,N.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Rh(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()}}class sd{cached;datamarts;text}(0,Ue.yu)(sd,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)()});class id extends sd{error;sessionError}(0,Ue.yu)(id,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class nd extends id{RO;line;column;source}(0,Ue.yu)(nd,{cached:(0,Ue.Ru)(),datamarts:(0,Ue.pb)((0,Ue.Ru)()),text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class ad{text;reinit}class rd extends ad{cache;modifiedFiles=[]}(0,Ue.yu)(rd,{text:(0,Ue.Ru)(),cache:(0,Ue.Ru)(),modifiedFiles:(0,Ue.pb)((0,Ue.Ru)()),reinit:(0,Ue.Ru)()});class od extends ad{RO;line;column;source;error;sessionError}(0,Ue.yu)(od,{text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)(),sessionError:(0,Ue.Ru)()});class ld{RO;line;column;source}(0,Ue.yu)(ld,{RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)()});class cd extends ad{jumpTo}(0,Ue.yu)(cd,{text:(0,Ue.Ru)(),jumpTo:(0,Ue.Ry)(ld)});class hd{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Ue.yu)(hd,{sourceID:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),foundName:(0,Ue.Ru)()});class dd{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Ue.yu)(dd,{sourceID:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),foundName:(0,Ue.Ru)(),add:(0,Ue.Ru)(),messageToBeModified:(0,Ue.Ru)(),fileToBeModified:(0,Ue.Ru)(),lineToBeModified:(0,Ue.Ru)(),columnToBeModified:(0,Ue.Ru)()});class ud extends od{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Ue.yu)(ud,{candidateName:(0,Ue.Ru)(),candidatesWithPackageImported:(0,Ue.pb)((0,Ue.Ry)(hd)),candidatesWithPackageNotImported:(0,Ue.pb)((0,Ue.Ry)(dd))});class pd extends od{candidateName;candidates=[]}(0,Ue.yu)(pd,{candidateName:(0,Ue.Ru)(),candidates:(0,Ue.pb)((0,Ue.Ry)(dd))});class _d{id;parentId;file;line;column}(0,Ue.yu)(_d,{id:(0,Ue.Ru)(),parentId:(0,Ue.Ru)(),file:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)()});class md{children=[];li_attr;text;type}(0,Ue.yu)(md,{children:(0,Ue.pb)((0,Ue.Ry)(md)),li_attr:(0,Ue.Ry)(_d),text:(0,Ue.Ru)(),type:(0,Ue.Ru)()});class gd extends ad{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Ue.yu)(gd,{count:(0,Ue.Ru)(),filterPaths:(0,Ue.pb)((0,Ue.Ru)()),path:(0,Ue.Ru)(),relevantTestsOnly:(0,Ue.Ru)(),runnerId:(0,Ue.Ru)(),tests:(0,Ue.pb)((0,Ue.Ry)(md))});class Ed{uuid=(0,a.Z)()}class fd{uuid=(0,a.Z)();startLine;startColumn;endLine;endColumn;constructor(e,t,s,i){this.startLine=e,this.startColumn=t,this.endLine=s,this.endColumn=i}}(0,Ue.yu)(fd,{startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()});class Td extends Ed{sourceId;coordinates=[];constructor(){super(),(0,N.rC)(this,{coordinates:N.LO,dismissCoordinate:N.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){L(this.coordinates,e)}}(0,Ue.yu)(Td,{sourceId:(0,Ue.Ru)(),coordinates:(0,Ue.pb)((0,Ue.Ry)(fd))});class Cd{editorStore;constructor(e){this.editorStore=e}}class xd extends Cd{searchEntries=[];constructor(e,t){super(e),(0,N.rC)(this,{searchEntries:N.LO,numberOfFiles:N.Fl,numberOfResults:N.Fl}),this.searchEntries=t}dismissSearchEntry(e){L(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Od extends xd{usageConcept;constructor(e,t,s){const i=new Map;s.forEach((e=>{let t;i.has(e.source)?t=z(i.get(e.source)):(t=new Td,t.sourceId=e.source,i.set(e.source,t)),t.coordinates.push(new fd(e.startLine,e.startColumn,e.endLine,e.endColumn))})),super(e,Array.from(i.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=z(i.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class Nd extends Cd{result;constructor(e,t){super(e),this.result=t}}class Ad extends Cd{result;constructor(e,t){super(e),this.result=t}}!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Wh=Wh||(Wh={}));class yd{status;test}class Sd extends yd{test=[]}(0,Ue.yu)(Sd,{status:(0,Ue.Ru)(),test:(0,Ue.pb)((0,Ue.Ru)())});class vd{text;RO;line;column;source;error}(0,Ue.yu)(vd,{text:(0,Ue.Ru)(),RO:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),source:(0,Ue.Ru)(),error:(0,Ue.Ru)()});class Id extends yd{test=[];error}(0,Ue.yu)(Id,{status:(0,Ue.Ru)(),test:(0,Ue.pb)((0,Ue.Ru)()),error:(0,Ue.Ry)(vd)});class Rd{}class wd extends Rd{finished;tests=[]}(0,Ue.yu)(wd,{finished:(0,Ue.Ru)(),tests:(0,Ue.pb)((0,Ue.PG)((()=>Ue.AM),(e=>e.error?(0,Ue.vB)(Id,e):(0,Ue.vB)(Sd,e))))});class Pd extends Rd{error;text}(0,Ue.yu)(Pd,{error:(0,Ue.Ru)(),text:(0,Ue.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Kh=Kh||(Kh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Xh=Xh||(Xh={}));class Ld{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,N.rC)(this,{total:N.LO,time:N.LO,passedTests:N.LO,failedTests:N.LO,testsWithError:N.LO,notRunTests:N.LO,results:N.LO,passed:N.Fl,error:N.Fl,failed:N.Fl,passedTestIds:N.Fl,failedTestIds:N.Fl,testWithErrorIds:N.Fl,notRunTestIds:N.Fl,numberOfTestsRun:N.Fl,runPercentage:N.Fl,suiteStatus:N.Fl,setTime:N.aD,addResult:N.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?Kh.FAILED:this.passed?Kh.PASSED:Kh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Wh.PASSED:this.passedTests.add(t);break;case Wh.FAILED:this.failedTests.set(t,H(e,Id));break;case Wh.ERROR:this.testsWithError.set(t,H(e,Id));break;default:throw new k(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class bd{editorStore;testExecutionResult;checkTestRunnerState=pt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=pt.create();selectedNode;treeData;constructor(e,t){(0,N.rC)(this,{testResultInfo:N.LO.ref,allTests:N.LO,selectedTestId:N.LO,selectedNode:N.LO,treeData:N.LO.ref,setSelectedTestId:N.aD,setTestResultInfo:N.aD,setTreeData:N.aD,refreshTree:N.aD,setSelectedNode:N.aD,collapseTree:N.aD,expandTree:N.aD,buildTreeDataByLayer:N.aD,pullTestRunnerResult:N.aD,buildTestTreeData:N.ls,pollTestRunnerResult:N.ls,rerunTestSuite:N.ls,cancelTestRun:N.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return z(this.treeData,"Test tree data has not been initialized")}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...z(this.treeData)})}setSelectedNode(e){e?.id!==this.selectedNode?.id&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}*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.setSelectedNode(void 0),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.setSelectedNode(void 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=z(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?w(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{K(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 Ld(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,Ue.vB)(Pd,s):(0,Ue.vB)(wd,s);var s;return t instanceof wd?(await Promise.all(t.tests.map((t=>R((()=>{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){F(e),this.editorStore.applicationStore.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,N.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.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}const Dd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Md{source;line;column;startLine;startColumn;endLine;endColumn}(0,Ue.yu)(Md,{source:(0,Ue.Ru)(),line:(0,Ue.Ru)(),column:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)()});class kd{}class Fd extends kd{error;errorDialog;text}(0,Ue.yu)(Fd,{error:(0,Ue.Ru)(),errorDialog:(0,Ue.Ru)(),text:(0,Ue.Ru)()});class jd{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return z(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});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});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}'`:"'::'",format:"raw",mode:this.mode,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});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});getConceptPath=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptPath`,void 0,void 0,{file:e,line:t,column:s});getUsages=(e,t)=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});createFile=e=>this.networkClient.get(`${this.baseUrl}/newFile/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.get(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});deleteDirectoryOrFile=e=>this.networkClient.get(`${this.baseUrl}/deleteFile/${e}`,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}'`]}))}class Ud{_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,N.rC)(this,{_tempSize:N.LO,size:N.LO,defaultSize:N.LO,snapSize:N.LO,maxSize:N.LO,isOpen:N.Fl,isMaximizable:N.Fl,isMaximized:N.Fl,setSize:N.aD,open:N.aD,close:N.aD,toggle:N.aD,setMaxSize:N.aD,maximize:N.aD,minimize:N.aD,toggleMaximize:N.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 Vd{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Yt([Wt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Vd(0,0);static ZERO_ONE=new Vd(0,1);static ZERO_MANY=new Vd(0,void 0);static ONE=new Vd(1,1);static ONE_MANY=new Vd(1,void 0)}class Gd{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Yt([Wt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class zd extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class Bd extends zd{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Bd(e)}}class $d extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class Hd extends $d{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Hd(e)}}class Yd extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class Wd extends Yd{ownerReference;constructor(e){const t=_s.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new Wd(e)}}class Kd{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class Xd{_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 Yt([Wt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}}class Zd{_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 Yt([Wt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),Zt(this.parameters,this.body)])}}class qd extends is{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new qd(Ee.STRING);static BOOLEAN=new qd(Ee.BOOLEAN);static BINARY=new qd(Ee.BINARY);static NUMBER=new qd(Ee.NUMBER);static INTEGER=new qd(Ee.INTEGER);static FLOAT=new qd(Ee.FLOAT);static DECIMAL=new qd(Ee.DECIMAL);static DATE=new qd(Ee.DATE);static STRICTDATE=new qd(Ee.STRICTDATE);static DATETIME=new qd(Ee.DATETIME);static STRICTTIME=new qd(Ee.STRICTTIME);static LATESTDATE=new qd(Ee.LATESTDATE)}const Jd=()=>new ss(""),Qd=(e,t)=>new Xd("",Vd.ONE,Wd.create(new Kd(e)),t);class eu extends es{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Qd(Jd(),Jd()),Qd(Jd(),Jd())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Yt([Wt.ASSOCIATION,this.path,Yt(this.properties),Yt(this.derivedProperties),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class tu extends es{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Yt([Wt.MAPPING,this.path,Yt(this.classMappings),Yt(this.enumerationMappings),Yt(this.associationMappings),Yt(this.test),Yt(this.includes),Yt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class su extends es{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Yt([Wt.PROFILE,this.path,Yt(this.p_stereotypes.map((e=>e.value))),Yt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class iu extends es{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];get patternParameters(){return(0,He.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Yt([Wt.SERVICE,Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),this.path,this.pattern,Yt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Yt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class nu extends es{functionName;constructor(e){super(e),this.functionName=e}}class au extends nu{}class ru extends au{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Yt([Wt.FUNCTION,this.path,Yt(this.parameters),this.returnType.valueForSerialization??"",Yt(this.taggedValues),Yt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class ou extends es{includes=[]}class lu extends ou{sections=[];get _elementHashCode(){return Yt([Wt.FLAT_DATA,this.path,Yt(this.includes.map((e=>e.valueForSerialization??""))),Yt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class cu extends es{runtimeValue;get _elementHashCode(){return Yt([Wt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class hu extends es{connectionValue;get _elementHashCode(){return Yt([Wt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class du extends es{}class uu extends du{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Yt([Wt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Yt(this.scopeElements.map((e=>e instanceof ps?e.valueForSerialization??"":e))),Yt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class pu extends es{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Yt([Wt.GENERATION_TREE,this.path,Yt(this.generationNodes),Yt(this.fileGenerations.map((e=>qt(Ie.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class _u extends ou{schemas=[];joins=[];filters=[];get _elementHashCode(){return Yt([Wt.DATABASE,this.path,Yt(this.includes.map((e=>e.valueForSerialization??""))),Yt(this.schemas),Yt(this.joins),Yt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class mu{_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 gu extends es{data;get hashCode(){return Yt([Wt.DATA_ELEMENT,this.path,Yt(this.stereotypes.map((e=>e.pointerHashCode))),Yt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const Eu=new Set([es,ts,is,qd,ss,eu,ns,ru,su,rs,as,class extends es{sections=[];get _elementHashCode(){return Yt([Wt.SECTION_INDEX,this.path,Yt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},ou,tu,hu,cu,iu,pu,uu,gu]);class fu{root;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){this.root=new os(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(Eu.has(e))throw new M("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new mu(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(B(ns))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(B(rs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(B(ss))}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(B(lu))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(B(_u))}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]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new k("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new M("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 ss?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof ns?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof rs?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=>z(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>z(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>z(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>z(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>z(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>z(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>z(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>z(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>z(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>H(this.getOwnNullableStore(e),_u,`Can't find database '${e}'`);getOwnFlatDataStore=e=>H(this.getOwnNullableStore(e),lu,`Can't find flat-data store '${e}'`);getOwnMapping=e=>z(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>z(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>z(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>z(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>z(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>z(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>z(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=>R((()=>{e.dispose()})))))}getNullablePackage=e=>e?j((()=>Ml(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){Ll(t?kl(this,t,void 0):this.root,e),e instanceof tu?this.setOwnMapping(e.path,e):e instanceof ou?this.setOwnStore(e.path,e):e instanceof ts?this.setOwnType(e.path,e):e instanceof eu?this.setOwnAssociation(e.path,e):e instanceof su?this.setOwnProfile(e.path,e):e instanceof ru?this.setOwnFunction(e.path,e):e instanceof iu?this.setOwnService(e.path,e):e instanceof hu?this.setOwnConnection(e.path,e):e instanceof cu?this.setOwnRuntime(e.path,e):e instanceof uu?this.setOwnFileGeneration(e.path,e):e instanceof pu?this.setOwnGenerationSpecification(e.path,e):e instanceof gu?this.setOwnDataElement(e.path,e):e instanceof os||this.getExtensionForElementClass(v(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&bl(e.package,e),e instanceof tu?this.mappingsIndex.delete(e.path):e instanceof ou?this.storesIndex.delete(e.path):e instanceof ts?(this.typesIndex.delete(e.path),e instanceof rs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof eu?this.associationsIndex.delete(e.path):e instanceof su?this.profilesIndex.delete(e.path):e instanceof ru?this.functionsIndex.delete(e.path):e instanceof iu?this.servicesIndex.delete(e.path):e instanceof cu?this.runtimesIndex.delete(e.path):e instanceof hu?this.connectionsIndex.delete(e.path):e instanceof uu?this.fileGenerationsIndex.delete(e.path):e instanceof pu?this.generationSpecificationsIndex.delete(e.path):e instanceof gu?this.dataElementsIndex.delete(e.path):e instanceof os?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(v(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new k(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof os&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof os)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new k(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new k(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=wl(s);if(!(e instanceof os)){const t=this.getNullablePackage(i)??(""!==i?kl(this,i,void 0):this.root);e.name=n,e instanceof ru&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Vl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Vl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&bl(e.package,e),Ll(t,e))}var a,r;if(e instanceof tu)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof ou)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ts)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof rs&&(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 eu)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof su)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof ru)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof iu)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof cu)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof hu)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof uu)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof gu)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof pu)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof os){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new M("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){bl(r,e);const t=""!==i?kl(this,i,void 0):this.root;Ll(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(v(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 Tu extends fu{constructor(e,t){super(ge.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const Cu=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class xu{root=new os(ge.PROJECT_DEPENDENCY_ROOT);projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{this.projectDependencyModelsIndex.set(e,new Tu(this.extensionElementClasses,this.root))}))}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=Cu(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=Cu(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=Cu(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=Cu(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=Cu(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=Cu(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=Cu(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=Cu(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=Cu(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=Cu(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=Cu(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=Cu(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=Cu(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=Cu(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=Cu(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=Cu(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 z(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class Ou extends ou{static NAME="ModelStore";static INSTANCE=new Ou;constructor(){super(Ou.NAME)}accept_PackageableElementVisitor(e){throw new k}}class Nu extends fu{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(ge.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Ou.NAME,Ou.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[qd.STRING,qd.BOOLEAN,qd.BINARY,qd.NUMBER,qd.INTEGER,qd.FLOAT,qd.DECIMAL,qd.DATE,qd.STRICTDATE,qd.DATETIME,qd.STRICTTIME,qd.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Au extends fu{autoImports=[];constructor(e){super(ge.SYSTEM,e)}initializeAutoImports(){this.autoImports=xe.map((e=>H(this.getOwnNullableElement(e,!0),os,`Can't find auto-import package '${e}'`)))}}class yu extends fu{constructor(e){super(ge.MODEL_GENERATION,e)}}class Su extends fu{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(ge.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new yu(i),this.dependencyManager=new xu(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=>z(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>z(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=>z(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>H(this.getType(e),ns,`Can't find enumeration '${e}'`);getMeasure=e=>H(this.getType(e),rs,`Can't find measure '${e}'`);getUnit=e=>H(this.getType(e),as,`Can't find unit '${e}'`);getClass=e=>H(this.getType(e),ss,`Can't find class '${e}'`);getAssociation=e=>z(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>z(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??H(this.getType(e),ss),`Can't find property owner '${e}'`);getFunction=e=>H(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),ru,`Can't find function '${e}'`);getStore=e=>z(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=>H(this.getStore(e),lu,`Can't find flat-data store '${e}'`);getDatabase=e=>H(this.getStore(e),_u,`Can't find database store '${e}'`);getMapping=e=>z(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>z(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>z(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>z(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>z(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>z(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>z(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 z(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)=>z(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>j((()=>this.getClass(e)));getNullableMapping=e=>j((()=>this.getMapping(e)));getNullableService=e=>j((()=>this.getService(e)));getNullableRuntime=e=>j((()=>this.getRuntime(e)));getNullableFileGeneration=e=>j((()=>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=Vd.ONE:0===e&&1===t?s=Vd.ZERO_ONE:0===e&&void 0===t?s=Vd.ZERO_MANY:1===e&&void 0===t?s=Vd.ONE_MANY:0===e&&0===t&&(s=Vd.ZERO),s??new Vd(e,t)}addElement(e,t){const s=Pl(t??"",e.name);if(this.getNullableElement(s,!1))throw new M(`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 M(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class vu{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Iu{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ru extends us{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Wt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Ht).join(",")}}class wu extends Ru{ownerReference;constructor(e){const t=_s.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new wu(e)}}class Pu{source;line;column;startLine;startColumn;endLine;endColumn}(0,Ue.yu)(Pu,{column:(0,Ue.Ru)(),endLine:(0,Ue.Ru)(),endColumn:(0,Ue.Ru)(),line:(0,Ue.Ru)(),source:(0,Ue.Ru)(),startLine:(0,Ue.Ru)(),startColumn:(0,Ue.Ru)()});class Lu{package;name;tags=[];stereotypes=[]}(0,Ue.yu)(Lu,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ru)()),tags:(0,Ue.pb)((0,Ue.Ru)())});class bu{profile;value}(0,Ue.yu)(bu,{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()});class Du{profile;value}(0,Ue.yu)(Du,{profile:(0,Ue.Ru)(),value:(0,Ue.Ru)()});class Mu{tag;value}(0,Ue.yu)(Mu,{tag:(0,Ue.Ry)(Du),value:(0,Ue.Ru)()});class ku{rawType;typeParameter}(0,Ue.yu)(ku,{rawType:(0,Ue.jt)((0,Ue.Ru)()),typeParameter:(0,Ue.jt)((0,Ue.Ru)())});class Fu{name;stereotypes=[];taggedValues=[];multiplicity;genericType}(0,Ue.yu)(Fu,{genericType:(0,Ue.Ry)(ku),multiplicity:(0,Ue.Ru)(),name:(0,Ue.Ru)(),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu))});class ju{package;name;sourceInformation}(0,Ue.yu)(ju,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),sourceInformation:(0,Ue.Ry)(Pu)});class Uu{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Ue.yu)(Uu,{generalizations:(0,Ue.pb)((0,Ue.Ry)(ku)),name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),properties:(0,Ue.pb)((0,Ue.Ry)(Fu)),qualifiedProperties:(0,Ue.pb)((0,Ue.Ry)(Fu)),sourceInformation:(0,Ue.Ry)(Pu),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu))});class Vu{package;name;enumValues=[]}(0,Ue.yu)(Vu,{name:(0,Ue.Ru)(),package:(0,Ue.Ru)(),enumValues:(0,Ue.pb)((0,Ue.Ru)())});class Gu{x;y}(0,Ue.yu)(Gu,{x:(0,Ue.Ru)(),y:(0,Ue.Ru)()});class zu{height;width}(0,Ue.yu)(zu,{height:(0,Ue.Ru)(),width:(0,Ue.Ru)()});class Bu{points=[]}(0,Ue.yu)(Bu,{points:(0,Ue.pb)((0,Ue.Ry)(Gu))});class $u{id;source;target;geometry}(0,Ue.yu)($u,{geometry:(0,Ue.Ry)(Bu),id:(0,Ue.Ru)(),source:(0,Ue.Ru)(),target:(0,Ue.Ru)()});class Hu{name;owningType}(0,Ue.yu)(Hu,{name:(0,Ue.Ru)(),owningType:(0,Ue.Ru)()});class Yu{id;source;target;property;geometry}(0,Ue.yu)(Yu,{geometry:(0,Ue.Ry)(Bu),id:(0,Ue.Ru)(),property:(0,Ue.Ry)(Hu),source:(0,Ue.Ru)(),target:(0,Ue.Ru)()});class Wu{id;type;position;rectangleGeometry}(0,Ue.yu)(Wu,{id:(0,Ue.Ru)(),position:(0,Ue.Ry)(Gu),rectangleGeometry:(0,Ue.Ry)(zu),type:(0,Ue.Ru)()});class Ku{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[]}(0,Ue.yu)(Ku,{name:(0,Ue.Ru)(),generalizationViews:(0,Ue.pb)((0,Ue.Ry)($u)),package:(0,Ue.Ru)(),propertyViews:(0,Ue.pb)((0,Ue.Ry)(Yu)),stereotypes:(0,Ue.pb)((0,Ue.Ry)(bu)),taggedValues:(0,Ue.pb)((0,Ue.Ry)(Mu)),typeViews:(0,Ue.pb)((0,Ue.Ry)(Wu))});class Xu{classes=[];enumerations=[];profiles=[]}(0,Ue.yu)(Xu,{classes:(0,Ue.pb)((0,Ue.Ry)(Uu)),enumerations:(0,Ue.pb)((0,Ue.Ry)(Vu)),profiles:(0,Ue.pb)((0,Ue.Ry)(Lu))});class Zu{name;diagram;domainInfo}(0,Ue.yu)(Zu,{diagram:(0,Ue.Ry)(Ku),name:(0,Ue.Ru)(),domainInfo:(0,Ue.jt)((0,Ue.Ry)(Xu))});class qu{class;enumerations=[];profiles=[];specializations=[]}(0,Ue.yu)(qu,{class:(0,Ue.Ry)(Uu),enumerations:(0,Ue.pb)((0,Ue.Ry)(Vu)),profiles:(0,Ue.pb)((0,Ue.Ry)(Lu)),specializations:(0,Ue.pb)((0,Ue.Ry)(ju))});const Ju=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}`},Qu=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=wl(e),r=new ss(a);return Ll(Ml(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},ep=e=>{if("*"===e)return new Vd(0,void 0);{const t=e.split("..");if(1===t.length)return new Vd(parseInt(z(t[0]),10),parseInt(z(t[0]),10));if(2===t.length)return new Vd(parseInt(z(t[0]),10),"*"===t[1]?void 0:parseInt(z(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},tp=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;w(e.taggedValues,new Gd(Bd.create((i=s.getProfile(t.tag.profile),n=t.tag.value,z(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;w(e.stereotypes,Hd.create((i=s.getProfile(t.profile),n=t.value,z(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=Qu(z(t.rawType),s,i,void 0);w(e.generalizations,Wd.create(new Kd(n))),w(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{w(e.properties,new Xd(t.name,ep(t.multiplicity),Wd.create(new Kd(s.getOwnNullableEnumeration(z(t.genericType.rawType))??Qu(z(t.genericType.rawType),s,i,void 0))),e))})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{w(e.derivedProperties,new Zd(t.name,ep(t.multiplicity),Wd.create(new Kd(s.getOwnNullableEnumeration(z(t.genericType.rawType))??Qu(z(t.genericType.rawType),s,i,void 0))),e))}))},sp=e=>{const t=new Su(new Nu([]),new Au([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new ss(e.name);Ll(Ml(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 su(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new vu(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new Iu(s,e))))})),i.enumerations.forEach((e=>{const s=new ns(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":_e}${e.name}`,n=t.getClass(i);tp(n,e,t,s)}))}const i=e.diagram,n=new Bo(i.name);return Ll(Ml(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new Zl(n,e.id,_s.create(t.getClass(e.type)));s.position=new Wl(e.position.x,e.position.y),s.rectangle=new Kl(e.rectangleGeometry.width,e.rectangleGeometry.height),w(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new sc(n,wu.create((i=t.getClass(e.property.owningType),a=e.property.name,z(i instanceof ss?Ul(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),z(n.classViews.find((t=>t.id===e.source))),z(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Wl(e.x,e.y))),oc(s),w(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new ic(n,z(n.classViews.find((t=>t.id===e.source))),z(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Wl(e.x,e.y))),oc(t),w(n.generalizationViews,t)})),[n,t,s]};class ip extends Lh{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;constructor(e,t,s,i){super(e),(0,N.rC)(this,{_renderer:N.LO,diagram:N.LO,diagramInfo:N.LO,addClassView:N.ls,rebuild:N.aD,setRenderer:N.aD}),this.diagramPath=s,this.filePath=i,this.diagramInfo=t;const[n,a,r]=sp(t);this.diagram=n,this.graph=a,this.diagramClasses=r}get label(){return vh(this.diagramPath)}get description(){return vh(this.diagramPath)}get renderer(){return z(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)}rebuild(e){this.diagramInfo=e;const[t,s,i]=sp(e);this.diagram=t,this.graph=s,this.diagramClasses=i}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Rh(t.source,t.startLine,t.startColumn);(0,N.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?"":_e}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new su(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new vu(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new Iu(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":_e}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new ns(e.name);Ll(Ml(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":_e}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new ss(i.name),Ll(Ml(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=z(a),n=Qu(z(`${e.package}${""===e.package?"":_e}${e.name}`),t,s,e.sourceInformation);w(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||w(n.generalizations,Wd.create(new Kd(i)))})),r&&tp(a,i,t,s),a})((0,Ue.vB)(qu,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 -");return`cview_${e.map((e=>{const t=e.match(new RegExp("^cview_(?<count>\\d+)$"));return t?.groups?.count?parseInt(t.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0)+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}}class np{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,N.rC)(this,{text:N.LO,isCaseSensitive:N.LO,isRegExp:N.LO,reset:N.aD,setText:N.aD,setCaseSensitive:N.aD,setRegExp:N.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class ap{applicationStore;initState=pt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Sh.CONSOLE;auxPanelDisplayState=new Ud({initial:0,default:300,snap:100});activeActivity=yh.CONCEPT;sideBarDisplayState=new Ud({initial:300,default:300,snap:150});tabManagerState=new bh(this);executionState=pt.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=pt.create();fileSearchCommandState=new np;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=pt.create();textSearchCommandState=new np;openTextSearchCommand=!1;searchState;testRunState=pt.create();testRunnerState;constructor(e){(0,N.rC)(this,{isMaxAuxPanelSizeSet:N.LO,activeAuxPanelMode:N.LO,activeActivity:N.LO,consoleText:N.LO,navigationStack:N.LO,openFileSearchCommand:N.LO,fileSearchCommandResults:N.LO,fileSearchCommandState:N.LO,openTextSearchCommand:N.LO,textSearchCommandState:N.LO,searchState:N.LO,testRunnerState:N.LO,setOpenFileSearchCommand:N.aD,setOpenTextSearchCommand:N.aD,setActiveAuxPanelMode:N.aD,setActiveActivity:N.aD,setConsoleText:N.aD,setSearchState:N.aD,setTestRunnerState:N.aD,pullInitializationActivity:N.aD,pullExecutionStatus:N.aD,initialize:N.ls,checkIfSessionWakingUp:N.ls,loadDiagram:N.ls,loadFile:N.ls,reloadFile:N.ls,execute:N.ls,executeGo:N.ls,manageExecuteGoResult:N.ls,executeTests:N.ls,executeFullTestSuite:N.ls,executeNavigation:N.ls,navigateBack:N.ls,executeSaveAndReset:N.ls,fullReCompile:N.ls,refreshTrees:N.ls,updateFileUsingSuggestionCandidate:N.ls,updateFile:N.ls,searchFile:N.ls,searchText:N.ls,findUsages:N.ls,command:N.ls,createNewDirectory:N.ls,createNewFile:N.ls,deleteDirectoryOrFile:N.ls}),this.applicationStore=e,this.directoryTreeState=new Hh(this),this.conceptTreeState=new td(this),this.client=new jd(new de({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,N.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,Ue.vB)(nd,n):(0,Ue.vB)(id,n):(0,Ue.vB)(sd,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open()),o instanceof id?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof nd&&(yield(0,N.fl)(this.loadFile(o.source,new Rh(o.source,o.line,o.column,(o.text??"").split("\n").filter(Boolean)[0])))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return F(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.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.commandCenter.registerCommand({key:Dh.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Dh.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Dh.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof kh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:Dh.EXECUTE,action:()=>{(0,N.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.FULL_RECOMPILE,action:()=>{(0,N.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,N.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.RUN_ALL_TESTS,action:()=>{(0,N.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Dh.RUN_RELAVANT_TESTS,action:()=>{(0,N.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Dh.SEARCH_FILE,Dh.SEARCH_TEXT,Dh.GO_TO_FILE,Dh.TOGGLE_AUX_PANEL,Dh.EXECUTE,Dh.FULL_RECOMPILE,Dh.FULL_RECOMPILE_WITH_FULL_INIT,Dh.RUN_ALL_TESTS,Dh.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.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){const s=this.tabManagerState.tabs.find((t=>t instanceof ip&&t.filePath===e));if(s)this.tabManagerState.openTab(s);else{yield(0,N.fl)(this.checkIfSessionWakingUp());const s=new ip(this,(0,Ue.vB)(Zu,yield this.client.getDiagramInfo(t)),t,e);this.tabManagerState.openTab(s)}}*loadFile(e,t){const s=this.tabManagerState.tabs.find((t=>t instanceof kh&&t.filePath===e));if(s)t&&s.setCoordinate(t),this.tabManagerState.openTab(s);else{yield(0,N.fl)(this.checkIfSessionWakingUp());const s=new kh(this,(0,Ue.vB)(Ih,yield this.client.getFile(e)),e,t);this.tabManagerState.openTab(s)}}*reloadFile(e){yield Promise.all(this.tabManagerState.tabs.map((async t=>{t instanceof kh&&t.filePath===e?(t.setFile((0,Ue.vB)(Ih,await this.client.getFile(e))),t.setCoordinate(void 0)):t instanceof ip&&t.filePath===e&&t.rebuild((0,Ue.vB)(Zu,await this.client.getDiagramInfo(t.diagramPath)))})))}*execute(e,t,s,i){if(this.initState.hasSucceeded)if(this.executionState.isInProgress)this.applicationStore.notifyWarning("Another execution is already in progress!");else{this.searchState instanceof xd||this.setSearchState(void 0),this.executionState.inProgress();try{const a=this.tabManagerState.tabs.map((e=>e instanceof kh?{path:e.filePath,code:e.file.content}:e instanceof ip?{diagram:e.diagramPath,code:Ju(e.diagram)}:void 0)).filter(V),r=this.client.execute(a,e,t),o=1e3;let l,c=!1;yield Promise.all([r.then((e=>{c=!0,l=e})),new Promise((e=>setTimeout((()=>{!c&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),o,!0)))]);const h=(n=z(l)).error?n.candidateName&&n.PureUnmatchedFunctionException?(0,Ue.vB)(ud,n):n.candidateName&&n.candidates?(0,Ue.vB)(pd,n):(0,Ue.vB)(od,n):n.jumpTo?(0,Ue.vB)(cd,n):n.tests?(0,Ue.vB)(gd,n):(0,Ue.vB)(rd,n);this.applicationStore.setBlockingAlert(void 0),this.setConsoleText(h.text),h instanceof od?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,N.fl)(i(h))):h instanceof rd?(this.applicationStore.notifySuccess("Execution succeeded!"),h.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,N.fl)(this.initialize(!1,(()=>(0,N.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,N.fl)(i(h))):yield(0,N.fl)(i(h))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var n}else this.applicationStore.notifyWarning("Can't execute while initializing application")}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.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.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,N.fl)(this.execute("executeGo",{},!0,(e=>(0,N.fl)(this.manageExecuteGoResult(e)))))}*manageExecuteGoResult(e){const t=(0,N.fl)(this.refreshTrees());if(e instanceof od)yield(0,N.fl)(this.loadFile(e.source,new Rh(e.source,e.line,e.column,e.text.split("\n").filter(Boolean)[0]))),e instanceof ud?(this.setSearchState(new Nd(this,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof pd&&(this.setSearchState(new Ad(this,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof rd&&e.modifiedFiles.length)for(const t of e.modifiedFiles)yield(0,N.fl)(this.reloadFile(t));yield t}*executeTests(e,t){this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,N.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async e=>{const t=(0,N.fl)(this.refreshTrees());if(e instanceof od)await(0,N.fl)(this.loadFile(e.source,new Rh(e.source,e.line,e.column,e.text.split("\n").filter(Boolean)[0]))),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof gd){this.setActiveAuxPanelMode(Sh.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new bd(this,e);this.setTestRunnerState(t),await(0,N.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,N.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}await t}))))}*executeFullTestSuite(e){yield(0,N.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,N.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async e=>{e instanceof cd&&await(0,N.fl)(this.loadFile(e.jumpTo.source,new Rh(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column)))})))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,N.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*executeSaveAndReset(e){yield(0,N.fl)(this.execute("executeSaveAndReset",{},!0,(async t=>{this.initState.reset(),await(0,N.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.setActiveActivity(yh.CONCEPT,{keepShowingIfMatchedCurrent:!0})})))}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:At.CAUTION,actions:[{label:"Perform full re-compile",type:yt.PROCEED_WITH_CAUTION,handler:()=>{(0,N.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:yt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,N.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Sh.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){yield(0,N.fl)(this.execute("updateSource",{updatePath:e,updateSources:[{path:e,line:t,column:s,add:i,message:n}]},!1,(e=>(0,N.fl)(this.manageExecuteGoResult(e)))))}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,Ue.vB)(Td,e))(e)));this.setSearchState(new xd(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){F(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*findUsages(e){const t="Error finding references. Please make sure that the code compiles and that you are looking for references of non primitive types!";let s;try{s=yield this.client.getConceptPath(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Dd(s)}`,showLoading:!0});const e=(yield this.client.getUsages(s.owner?s.type?"meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",(s.owner?[`'${s.owner}'`]:[]).concat(`'${s.path}'`))).map((e=>(0,Ue.vB)(Md,e)));this.setSearchState(new Od(this,s,e)),this.setActiveAuxPanelMode(Sh.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}*command(e){try{const s=(t=yield e()).error?(0,Ue.vB)(Fd,t):new kd;return!(s instanceof Fd&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return F(e),this.applicationStore.notifyError(e),!1}var t}*createNewDirectory(e){yield(0,N.fl)(this.command((()=>this.client.createFolder(vh(e))))),yield(0,N.fl)(this.directoryTreeState.refreshTreeData())}*createNewFile(e){const t=yield(0,N.fl)(this.command((()=>this.client.createFile(vh(e)))));yield(0,N.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,N.fl)(this.loadFile(e)))}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,N.fl)(this.command((()=>this.client.deleteDirectoryOrFile(vh(e))))),this.tabManagerState.tabs.filter((t=>t instanceof kh&&t.filePath.startsWith(e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,N.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.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:At.CAUTION,actions:[{label:"Delete anyway",type:yt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:yt.PROCEED,default:!0}]})}}const rp=(0,et.createContext)(void 0),op=({children:e})=>{const t=Lt(),s=(0,Qe.fv)((()=>new ap(t)));return(0,x.jsx)(rp.Provider,{value:s,children:e})},lp=()=>z((0,et.useContext)(rp),"Can't find editor store in context"),cp=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,x.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),hp=(0,Qe.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=lp(),n=Lt(),a=e=>()=>(0,N.fl)(i.loadFile(s.sourceId,new Rh(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,x.jsxs)("div",{className:"search-panel__entry",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,x.jsx)(Vc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:vh(s.sourceId)})]}),(0,x.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,x.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,x.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,x.jsx)(Vc.q1B,{})})]})]}),(0,x.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:`line: ${e.startLine} - column: ${e.startColumn}`}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,x.jsx)(Vc.q1B,{})})})]},e.uuid)))})]})})),dp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=lp();return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,x.jsx)(hp,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(eh,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),up=(0,Qe.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Dd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(hp,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(eh,{children:`No usages found for ${Dd(t.usageConcept)}`})})),pp=(0,Qe.Pi)((e=>{const{candidate:t}=e,s=lp(),i=Lt(),n=()=>{(0,N.fl)(s.loadFile(t.sourceID,new Rh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${vh(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,x.jsx)(Vc.bK4,{})})})]})})),_p=(0,Qe.Pi)((e=>{const{candidate:t}=e,s=lp(),i=Lt();return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,N.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${vh(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,N.fl)(s.loadFile(t.sourceID,new Rh(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Vc.bK4,{})})})]})})),mp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,x.jsx)(pp,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,x.jsx)(_p,{candidate:e},e.uuid)))})]})]})})),gp=(0,Qe.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,x.jsx)(_p,{candidate:e},e.uuid)))})]})]})})),Ep=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)(jc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Od&&(0,x.jsx)(up,{usageState:e.searchState}),e.searchState instanceof xd&&(0,x.jsx)(dp,{searchState:e.searchState}),e.searchState instanceof Nd&&(0,x.jsx)(mp,{searchState:e.searchState}),e.searchState instanceof Ad&&(0,x.jsx)(gp,{searchState:e.searchState})]})})),fp=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Ic.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,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},Tp=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:Tp,TreeNodeContainer:fp},h=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Ic.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,x.jsx)(h.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,x.jsx)(h.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},Cp=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(V),h={TreeNodeView:Tp,TreeNodeContainer:fp},d=n?{...h,...n}:h;return(0,x.jsx)("div",{className:(0,Ic.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,x.jsx)(d.TreeNodeView,{level:0,node:e,getChildNodes:r,components:d,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var xp=s(410);const Op=xp.gs,Np="resizable-panel--collapsed",Ap=(e,t)=>({collapsiblePanel:{className:(0,Ic.clsx)(...t?.classes??[],{[Np]:e}),onStartResize:e=>{e.domElement.classList.remove(Np),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}}),yp=xp.jW,Sp=xp.nN,vp=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var Ip=s(177);const Rp=(0,Qe.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c}=a,h=r.testResultInfo,d=!t.data.type,u=t.id===r.selectedNode?.id,p=h?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?Xh.PASSED:t.failedTests.has(e)?Xh.FAILED:t.testsWithError.has(e)?Xh.ERROR:Xh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(s)))||t.testWithErrorIds.some((e=>e.startsWith(s)))?Xh.FAILED:t.notRunTestIds.some((e=>e.startsWith(s)))?Xh.RUNNING:Xh.PASSED})(t,h):void 0;let _=(0,x.jsx)(Vc.pTE,{});switch(p){case Xh.PASSED:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,x.jsx)(Vc.rE2,{})});break;case Xh.FAILED:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,x.jsx)(Vc.$Ow,{})});break;case Xh.ERROR:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,x.jsx)(Vc.xDH,{})});break;case Xh.RUNNING:_=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,x.jsx)(Vc.VRP,{})});break;default:_=(0,x.jsx)(Vc.pTE,{})}const m=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Ic.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":u}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{d?m():o(t)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:d?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,dangerouslySetInnerHTML:{__html:t.label}})]})})),wp=(0,Qe.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,children:(0,x.jsxs)("div",{className:"explorer__content__inner",onClick:()=>t.setSelectedNode(void 0),children:[i&&(0,x.jsx)(eh,{children:"No tests found"}),!i&&(0,x.jsx)(Cp,{components:{TreeNodeContainer:Rp},treeData:s,onNodeSelect:e=>t.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(V),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})})),Pp=(0,Qe.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=i.results.get(s),a=z(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__label",children:a.text})})}),(0,x.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!n&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),n instanceof Sd&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),n instanceof Id&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:n.error.text})]})]})})),Lp=(0,Qe.Pi)((e=>{const{testRunnerState:t}=e,s=lp(),i=Lt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Kh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(Op,{orientation:"vertical",children:[(0,x.jsx)(yp,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)(jc,{isLoading:t.treeBuildingState.isInProgress}),(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,x.jsx)(Vc.rE2,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,x.jsx)(Vc.$Ow,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,x.jsx)(Vc.xDH,{})]})]}),a&&(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,x.jsx)(Vc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Vc.jG4,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,N.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,x.jsx)(Vc.SCS,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,N.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,x.jsx)(Vc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(Ip.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,x.jsx)("div",{className:"panel__content",children:t.treeData&&(0,x.jsx)(wp,{testRunnerState:t})})]})}),(0,x.jsx)(Sp,{children:(0,x.jsx)(vp,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(yp,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(Pp,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header"}),(0,x.jsx)("div",{className:"panel__content",children:(0,x.jsx)(eh,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),bp=(0,Qe.Pi)((()=>{const e=lp().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(eh,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(Lp,{testRunnerState:e})]})})),Dp=(0,Qe.Pi)((()=>{const e=lp(),t={[Sh.CONSOLE]:{mode:Sh.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[Sh.SEARCH_RESULT]:{mode:Sh.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Vc.W1M,{})}),isVisible:!0},[Sh.TEST_RUNNER]:{mode:Sh.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Vc.Vzd,{})}),isVisible:!0}},s=Object.values(Sh).filter((e=>V(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,et.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Sh.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,x.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(V).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Ic.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,x.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(Sh.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(cp,{})}),i(Sh.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(Ep,{})}),i(Sh.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(bp,{})})]})]})}));var Mp=s(2689);const kp=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Vc.jtq,{})}),Fp=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),jp=()=>(0,x.jsx)("div",{className:"icon color--association",children:"A"}),Up=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),Vp=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),Gp=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),zp=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),Bp=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Vc.eid,{})}),$p=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Vc.UOT,{})}),Hp=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Vc.eid,{})}),Yp=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Vc.HXR,{})}),Wp=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Vc.oF7,{})}),Kp=e=>{switch(e){case Yh.PACKAGE:return(0,x.jsx)(kp,{});case Yh.PROFILE:return(0,x.jsx)(zp,{});case Yh.CLASS:return(0,x.jsx)(Fp,{});case Yh.ASSOCIATION:return(0,x.jsx)(jp,{});case Yh.PROPERTY:return(0,x.jsx)(Yp,{});case Yh.ENUMERATION:return(0,x.jsx)(Up,{});case Yh.MEASURE:return(0,x.jsx)(Vp,{});case Yh.UNIT:return(0,x.jsx)(Gp,{});case Yh.FUNCTION:return(0,x.jsx)(Bp,{});case Yh.NATIVE_FUNCTION:return(0,x.jsx)(Hp,{});case Yh.DIAGRAM:return(0,x.jsx)(Wp,{});default:return(0,x.jsx)($p,{})}},Xp=(0,Qe.Pi)((0,et.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=lp(),r=Lt();return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[n===Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename package"),children:"Rename"}),n===Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename property"),children:"Rename"}),n!==Yh.PACKAGE&&n!==Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename"),children:"Rename"}),n===Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,N.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n!==Yh.PACKAGE&&n!==Yh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Move file"),children:"Move"}),n===Yh.FUNCTION&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),n!==Yh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i(s),children:"View Source"})]})})));var Zp;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(Zp=Zp||(Zp={}));const qp=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,et.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:h,viewConceptSource:d}=a,u=[Yh.PACKAGE,Yh.CLASS,Yh.ASSOCIATION].includes(t.data.li_attr.pureType),p=()=>{t.isLoading||(t.isOpen?h(t):c(t))},[,_]=(0,Mp.c)((()=>({type:"Class"===t.data.li_attr.pureType?Zp.CLASS:Zp.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(Wc,{content:(0,x.jsx)(Xp,{node:t,viewConceptSource:d}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Ic.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:_,onDoubleClick:()=>{t.isLoading||(u?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Vc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:u?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:Kp(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,dangerouslySetInnerHTML:{__html:t.label}})]})})},Jp=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,menuProps:{elevation:7},children:(0,x.jsx)("div",{className:"explorer__content__inner",onClick:()=>s.setSelectedNode(void 0),children:(0,x.jsx)(Cp,{components:{TreeNodeContainer:qp},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(V),innerProps:{onNodeOpen:e=>{(0,N.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,N.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof Qh||s instanceof Jh)&&e.directoryTreeState.revealPath(s.file,!0,new Rh(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}})})})})),Qp=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.conceptTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,N.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Vc.DuK,{})}),(0,x.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,x.jsx)(Vc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(jc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(Jp,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(eh,{children:"Failed to build concept tree"})]})]})})]})})),e_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState.nodeForCreateNewFile,[i,n]=(0,et.useState)(""),a=(0,et.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewFile(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,N.fl)(e.createNewFile(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(vc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),t_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState.nodeForCreateNewDirectory,[i,n]=(0,et.useState)(""),a=(0,et.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewDirectory(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,N.fl)(e.createNewDirectory(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(vc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),s_=(0,Qe.Pi)((0,et.forwardRef)((function(e,t){const{node:s}=e,i=Lt(),n=lp(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Folder"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Rename file"),children:"Rename"}),(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,N.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Move file"),children:"Move"})]})}))),i_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,et.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:h}=a,d=t.data.isFolderNode,u=d?t.isOpen?(0,x.jsx)("div",{children:(0,x.jsx)(Vc.ry,{})}):(0,x.jsx)("div",{children:(0,x.jsx)(Vc.ROc,{})}):(0,x.jsx)(Vc.QqN,{}),p=()=>{t.isLoading||(t.isOpen?h(t):c(t))};return(0,x.jsx)(Wc,{content:(0,x.jsx)(s_,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Ic.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||(d?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Vc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:d?t.isOpen?(0,x.jsx)(Vc.v4q,{}):(0,x.jsx)(Vc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:u})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},n_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsx)(Wc,{className:"explorer__content",disabled:!0,menuProps:{elevation:7},children:(0,x.jsxs)("div",{className:"explorer__content__inner",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(Cp,{components:{TreeNodeContainer:i_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(V),innerProps:{onNodeOpen:e=>{(0,N.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,N.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),(0,x.jsx)(e_,{}),(0,x.jsx)(t_,{})]})})})),a_=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.directoryTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,N.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Vc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof kh&&(0,N.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Vc.cOE,{})}),(0,x.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,x.jsx)(Vc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(jc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(n_,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(eh,{children:"Failed to build directory tree"})]})]})})]})})),r_=(0,Qe.Pi)((()=>{const e=lp();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Ic.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case yh.CONCEPT:return(0,x.jsx)(Qp,{});case yh.FILE:return(0,x.jsx)(a_,{});default:return null}})()},e.activeActivity)})})),o_=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Ic.clsx)("logo",t),children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.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"})})]})})},l_=(0,Qe.Pi)((()=>{const e=lp(),t=t=>()=>e.setActiveActivity(t),s=[{mode:yh.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Vc.DE2,{})},{mode:yh.FILE,title:"File Explorer",icon:(0,x.jsx)(Vc.QqN,{})}].filter((e=>Boolean(e)));return(0,x.jsxs)("div",{className:"activity-bar",children:[(0,x.jsx)("div",{className:"activity-bar__logo",children:(0,x.jsx)(o_,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Ic.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)))})]})})),c_=(0,Qe.Pi)((e=>{const t=lp(),s=Lt();return(0,x.jsxs)("div",{className:"editor__status-bar",children:[(0,x.jsx)("div",{className:"editor__status-bar__left",children:(0,x.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,x.jsxs)("div",{className:"editor__status-bar__right",children:[(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":t.executionState.isInProgress}),disabled:t.executionState.isInProgress,onClick:()=>{(0,N.fl)(t.executeGo()).catch(s.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,x.jsx)(Vc.pgN,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(t.auxPanelDisplayState.isOpen)}),onClick:()=>t.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,x.jsx)(Vc.FxN,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!s.assistantService.isHidden}),onClick:()=>s.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,x.jsx)(Vc.UHp,{})})]})]})})),h_=e=>{(0,et.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},d_=(0,Qe.Pi)((e=>{const{editorState:t}=e,s=(0,et.useRef)(void 0),i=t._textEditor,n=lp(),a=Lt(),r=t.file.content,o=(0,et.useRef)(null),{ref:l,width:c,height:h}=(0,Qc.NB)();if((0,et.useEffect)((()=>{if(o.current){const e=o.current,i=A.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,language:C.PURE,theme:T.LEGEND});i.onDidChangeCursorPosition((()=>{const e=i.getPosition();e&&(s.current=e)})),i.onDidChangeModelContent((()=>{const e=i.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),i.focus(),t.setTextEditor(i)}}),[n,a,t]),i){i.getValue()!==r&&i.setValue(r);const e=i.getModel();if(e){e.updateOptions({tabSize:2});const s=t.coordinate;s?.errorMessage?((e,t)=>{A.editor.setModelMarkers(e,"dummy_problem_marker_owner",t.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:A.MarkerSeverity.Error}))))})(e,[{message:s.errorMessage,startLineNumber:s.line,startColumn:s.column,endLineNumber:s.line,endColumn:s.column}]):A.editor.setModelMarkers(e,"Error",[])}}return h_(t),(0,et.useEffect)((()=>{void 0!==c&&void 0!==h&&i?.layout({width:c,height:h})}),[i,c,h]),(0,et.useEffect)((()=>{const e=t.coordinate;i&&e&&((e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)})(i,{lineNumber:e.line,column:e.column})}),[i,t.coordinate]),(0,et.useEffect)((()=>()=>{i&&(e=>{e.dispose(),e.getModel()?.dispose()})(i)}),[i]),(0,et.useEffect)((()=>()=>{s.current&&t.setCoordinate(new Rh(t.filePath,s.current.lineNumber,s.current.column))}),[t]),(0,x.jsx)("div",{className:"panel edit-panel",children:(0,x.jsx)("div",{className:"panel__content edit-panel__content edit-panel__content--headless",children:(0,x.jsx)("div",{ref:l,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:o})})})})}));var u_,p_=s(1367),__=s(5903);!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(u_=u_||(u_={}));class m_ extends tc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Yt([zo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const g_=(0,N.aD)(((e,t)=>{e.value=t})),E_=((0,N.aD)(((e,t)=>{L(e.properties,t)})),(0,N.aD)(((e,t)=>{w(e.properties,yo(t))}))),f_=((0,N.aD)(((e,t,s)=>{P(e.properties,t,s)})),(0,N.aD)(((e,t)=>{L(e.derivedProperties,t)})),(0,N.aD)(((e,t)=>{w(e.derivedProperties,So(t))})),(0,N.aD)(((e,t,s)=>{P(e.derivedProperties,t,s)})),(0,N.aD)(((e,t)=>{w(e.constraints,Io(t))})),(0,N.aD)(((e,t)=>{L(e.constraints,t)})),(0,N.aD)(((e,t,s)=>{P(e.constraints,t,s)})),(0,N.aD)(((e,t)=>{w(e.generalizations,_o(t))}))),T_=((0,N.aD)(((e,t)=>{L(e.generalizations,t)})),(0,N.aD)(((e,t,s)=>{P(e.generalizations,t,s)})),(0,N.aD)(((e,t)=>{w(e._subclasses,t)})),(0,N.aD)(((e,t)=>{L(e._subclasses,t)})),(0,N.aD)(((e,t)=>{_o(e),po(t),e.value=t,e.ownerReference.value=t.rawType}))),C_=((0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{T_(e.genericType,po(t))})),(0,N.aD)(((e,t)=>{e.multiplicity=t})),(0,N.aD)(((e,t)=>{e.aggregation=t})),(0,N.aD)(((e,t)=>{e.value=Eo(t),g_(e.ownerReference,t._OWNER)})),(0,N.aD)(((e,t)=>{w(e.taggedValues,uo(t))})),(0,N.aD)(((e,t)=>{L(e.taggedValues,t)})),(0,N.aD)(((e,t)=>{w(e.stereotypes,co(t))})),(0,N.aD)(((e,t)=>{L(e.stereotypes,t)})),(0,N.aD)(((e,t)=>{e.tag.value=fo(t),e.tag.ownerReference.value=t._OWNER})),(0,N.aD)(((e,t)=>{e.value=t})),(0,N.aD)(((e,t)=>{e.value=t})),(0,N.aD)(((e,t,s)=>{P(e.taggedValues,t,s)})),(0,N.aD)(((e,t,s)=>{P(e.stereotypes,t,s)})),(0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{e.functionDefinition=Fs(t)})),(0,N.aD)(((e,t)=>{w(e.p_tags,fo(t))})),(0,N.aD)(((e,t)=>{L(e.p_tags,t)})),(0,N.aD)(((e,t)=>{w(e.p_stereotypes,Eo(t))})),(0,N.aD)(((e,t)=>{L(e.p_stereotypes,t)})),(0,N.aD)(((e,t,s)=>{P(e.p_tags,t,s)})),(0,N.aD)(((e,t,s)=>{P(e.p_stereotypes,t,s)})),(0,N.aD)(((e,t)=>{L(e.parameters,t)})),(0,N.aD)(((e,t)=>{w(e.parameters,js(t))})),(0,N.aD)(((e,t)=>{g_(e.returnType,Lo(t))})),(0,N.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,N.aD)(((e,t,s)=>{P(e.parameters,t,s)})),(0,N.aD)(((e,t)=>{e.name=t})),(0,N.aD)(((e,t)=>{w(e.values,Co(t))})),(0,N.aD)(((e,t)=>{L(e.values,t)})),(0,N.aD)(((e,t,s)=>{P(e.values,t,s)})),(0,N.aD)(((e,t)=>{e.value=Co(t),g_(e.ownerReference,t._OWNER)})),(0,N.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return K(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),z(e.properties[(s+1)%2])})(e,t),n=H(t.genericType.ownerReference.value,ss,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&K(L(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),w(s.propertiesFromAssociations,i);const r=new Kd(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,N.aD)(((e,t)=>{e.canonicalUnit=No(t)})),(0,N.aD)(((e,t)=>{e.conversionFunction=Fs(t)})),(0,N.aD)(((e,t)=>{e.classViews=t.map(Mo)}))),x_=(0,N.aD)(((e,t)=>{w(e.classViews,Mo(t))})),O_=(0,N.aD)(((e,t)=>{L(e.classViews,t)})),N_=(0,N.aD)(((e,t)=>{e.associationViews=t.map(Uo)})),A_=(0,N.aD)(((e,t)=>{L(e.associationViews,t)})),y_=(0,N.aD)(((e,t)=>{e.generalizationViews=t.map(jo)})),S_=(0,N.aD)(((e,t)=>{w(e.generalizationViews,jo(t))})),v_=(0,N.aD)(((e,t)=>{L(e.generalizationViews,t)})),I_=(0,N.aD)(((e,t)=>{e.propertyViews=t.map(Vo)})),R_=(0,N.aD)(((e,t)=>{w(e.propertyViews,Vo(t))})),w_=(0,N.aD)(((e,t)=>{L(e.propertyViews,t)})),P_=(0,N.aD)(((e,t)=>{e.hideProperties=t})),L_=(0,N.aD)(((e,t)=>{e.hideStereotypes=t})),b_=(0,N.aD)(((e,t)=>{e.hideTaggedValues=t})),D_=(0,N.aD)(((e,t)=>{e._offsetX=t})),M_=(0,N.aD)(((e,t)=>{e._offsetY=t})),k_=(0,N.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)})),F_=(0,N.aD)(oc),j_=(0,N.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 nc(n.x,n.y).normal(new nc(l.x,l.y)).unit(),h=nc.fromPoints(n,new Wl(t,s));if(Math.abs(c.dotProduct(h))<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,h=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=h&&(o=new Wl(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&rc(e,r),o})),U_=(0,N.aD)(rc),V_=(0,N.aD)(((e,t)=>{e.rectangle=t})),G_=(0,N.aD)(((e,t)=>{e.position=t})),z_=(0,N.aD)((e=>{e._dummyObservable={}}));var B_,$_,H_;!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"}(B_=B_||(B_={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}($_=$_||($_={})),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"}(H_=H_||(H_={}));const Y_=.05,W_=[50,75,90,100,110,125,150,200,250,300,400],K_=e=>(e instanceof Zd?"/ ":"")+e.name;class X_{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,N.rC)(this,{isReadOnly:N.LO,interactionMode:N.LO,relationshipMode:N.LO,zoom:N.LO,mouseOverClassView:N.LO,mouseOverClassName:N.LO,mouseOverClassCorner:N.LO,mouseOverClassProperty:N.LO,mouseOverPropertyHolderViewLabel:N.LO,selectionStart:N.LO,selectedClassCorner:N.LO,selectedClasses:N.LO,selectedPropertyOrAssociation:N.LO,selectedInheritance:N.LO,leftClick:N.LO,middleClick:N.LO,rightClick:N.LO,changeMode:N.aD,setIsReadOnly:N.aD,setMouseOverClassView:N.aD,setMouseOverClassName:N.aD,setMouseOverClassCorner:N.aD,setMouseOverClassProperty:N.aD,setMouseOverPropertyHolderViewLabel:N.aD,setSelectionStart:N.aD,setSelectedClassCorner:N.aD,setSelectedClasses:N.aD,setSelectedPropertyOrAssociation:N.aD,setSelectedInheritance:N.aD,setLeftClick:N.aD,setMiddleClick:N.aD,setRightClick:N.aD,setZoomLevel:N.aD,align:N.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new Kl(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wl(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 Wl(0,0),this.virtualScreen=new Xl(new Wl(0,0),new Kl(0,0)),this.zoom=1,this.triangle=[new Wl(0,0),new Wl(-15,-10),new Wl(-15,10)],this.diamond=[new Wl(0,0),new Wl(-10,-5),new Wl(-20,0),new Wl(-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=B_.LAYOUT,this.relationshipMode=$_.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 Wl(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Wl(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 Kl(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Wl(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 Wl(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case B_.LAYOUT:case B_.PAN:case B_.ZOOM_IN:case B_.ZOOM_OUT:case B_.ADD_CLASS:if(t!==$_.NONE)throw new M(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case B_.ADD_RELATIONSHIP:if(t===$_.NONE)throw new M("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new k(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===B_.ADD_RELATIONSHIP)switch(t){case $_.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||jl(e.class.value).includes(t.class.value)||jl(t.class.value).includes(e.class.value)||f_(e.class.value,Wd.create(new Kd(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new ic(this.diagram,e,t);return S_(this.diagram,s),s}};break;case $_.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new Xd(`property_${e.class.value.properties.length+1}`,Vd.ONE,Wd.create(new Kd(t.class.value)),e.class.value);if(E_(e.class.value,s),e!==t){const i=new sc(this.diagram,wu.create(s),e,t);return R_(this.diagram,i),i}};break;default:throw new k(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case H_.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>G_(t,new Wl(e,t.position.y))));break}case H_.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>G_(t,new Wl(e-t.rectangle.width/2,t.position.y))));break}case H_.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=>G_(t,new Wl(e-t.rectangle.width,t.position.y))));break}case H_.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>G_(t,new Wl(t.position.x,e))));break}case H_.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>G_(t,new Wl(t.position.x,e-t.rectangle.height/2))));break}case H_.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=>G_(t,new Wl(t.position.x,e-t.rectangle.height))));break}case H_.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];G_(s,new Wl(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];G_(n,new Wl(i.position.x+i.rectangle.width+s,n.position.y))}}break}case H_.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];G_(s,new Wl(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];G_(n,new Wl(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 Wl((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 Wl((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 Wl(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Wl(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 Wl(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=z(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=ec.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof sc){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,hc(r).x),n=Math.max(n,hc(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 Xl(new Wl(t,s),new Kl(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Wl(0,0),this.virtualScreen=new Xl(new Wl(this.canvasDimension.width/2,this.canvasDimension.height/2),new Kl(0,0))}executeZoom(e,t){e=Math.max(e,Y_);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Wl(((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,Y_)),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)),Y_))}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 Zl(this.diagram,i,_s.create(e));return G_(n,t??this.canvasCoordinateToModelCoordinate(new Wl(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),x_(this.diagram,n),z_(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)&&S_(this.diagram,new ic(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&S_(this.diagram,new ic(this.diagram,t,n)),Ul(e).forEach((e=>{e.genericType.value.rawType===s&&R_(this.diagram,new sc(this.diagram,wu.create(e),n,t))})),Ul(s).forEach((s=>{s.genericType.value.rawType===e&&R_(this.diagram,new sc(this.diagram,wu.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=K_(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 ns&&(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=ke(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||(Ul(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;V_(e,new Kl(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 Ul(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof Zd?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof qd?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}}z_(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=K_(e),o=ke(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 h=t(l),d=s(l),u=this.modelCoordinateToCanvasCoordinate(new Wl(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new Wl(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new Wl(Math.min(h,p),Math.min(d,_));return new Xl(g,new Kl(Math.max(h,p)+Math.max(l,c)-g.x,Math.max(d,_)+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 Xl(new Wl(0,0),new Kl(0,0))}drawPropertyOrAssociation(e){const t=ec.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 Xd){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let h=0,d=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&&(h=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(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&&(h=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,d=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===u_.COMPOSITE||s.aggregation===u_.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(h+(this.screenOffset.x+lc(this.diamond[0],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[1],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[2],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[3],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(h+(this.screenOffset.x+lc(this.diamond[0],e))*this.zoom,d+(this.screenOffset.y+cc(this.diamond[0],e))*this.zoom),s.aggregation===u_.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===u_.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=ec.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+lc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+cc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+lc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+cc(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)&&U_(e,e.path.map((e=>new Wl(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const t=(e=this.selectedClasses).length?e[0]:void 0;t&&this.center(t.position.x+t.rectangle.width/2,t.position.y+t.rectangle.height/2)}else this.autoRecenter();var e}switchToZoomMode(){this.changeMode(this.interactionMode!==B_.ZOOM_IN?B_.ZOOM_IN:B_.ZOOM_OUT,$_.NONE)}switchToViewMode(){this.changeMode(B_.LAYOUT,$_.NONE)}switchToPanMode(){this.changeMode(B_.PAN,$_.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(B_.ADD_RELATIONSHIP,$_.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(B_.ADD_RELATIONSHIP,$_.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(B_.ADD_CLASS,$_.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof ss&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof ss&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Eh)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{O_(this.diagram,e),N_(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),y_(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),I_(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof m_?A_(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof sc&&w_(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&v_(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=>{P_(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{L_(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{b_(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=>x_(this.diagram,e))),t[1].forEach((e=>S_(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,p_.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new Zl(this.diagram,(0,a.Z)(),_s.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=>x_(this.diagram,e))),t[1].forEach((e=>S_(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case B_.LAYOUT:this.diagram.generalizationViews.forEach((e=>F_(e))),this.diagram.associationViews.forEach((e=>F_(e))),this.diagram.propertyViews.forEach((e=>F_(e)));break;case B_.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(B_.LAYOUT,$_.NONE);break}case B_.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=W_[0]-10?10*Math.floor(t/10)+10:t>=W_[W_.length-1]?100*Math.floor(t/100)+100:z(W_.find((e=>e>t))),this.zoomPoint(s/100,new Wl(e.x,e.y));break}case B_.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=W_[0]?10*Math.ceil(t/10)-10:t>=W_[W_.length-1]+100?100*Math.ceil(t/100)-100:z((0,__.Z)(W_,(e=>e<t))),this.zoomPoint(s/100,new Wl(e.x,e.y));break}case B_.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(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&&(D_(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),M_(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),D_(e.to,-(s.position.x+s.rectangle.width/2-t.x)),M_(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(B_.LAYOUT,$_.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([B_.ADD_RELATIONSHIP,B_.ADD_CLASS,B_.ZOOM_IN,B_.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Wl(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 Wl(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case B_.PAN:return void(this.positionBeforeLastMove=new Wl(e.x,e.y));case B_.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(dc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||C_(this.diagram,this.reorderDiagramDomain(z(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||C_(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 Wl(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=j_(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=j_(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=j_(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 B_.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(B_.LAYOUT,$_.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Wl(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Wl(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Wl(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Wl(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===B_.PAN)this.screenOffset=new Wl(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Wl(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Wl(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case B_.LAYOUT:if(this.selectedClassCorner&&(V_(this.selectedClassCorner,new Kl(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),z_(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,G_(i,new Wl(n,r)),z_(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?k_(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&k_(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 Xl(new Wl(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new Kl(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(uc(this.selection,e)||uc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case B_.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 Wl(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),dc(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.fontSize;const a=this.computeClassNameWidth(e);new Xl(this.modelCoordinateToCanvasCoordinate(new Wl(e.position.x+(e.rectangle.width-a)/2,n)),new Kl(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Ul(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new Xl(this.modelCoordinateToCanvasCoordinate(new Wl(e.position.x+this.classViewSpaceX,n)),new Kl(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=ec.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,p_.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new Zl(t,(0,a.Z)(),_s.create(Fl(e.value,ss))))))),(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))),h=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,d=i?l-c-30:l+r+30;return(s||n>0)&&(G_(t[0],new Wl(h,d)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];G_(e,new Wl(i.position.x+i.rectangle.width+10,d))}}))),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 ic(t,s,e):[]))))))]}}var Z_=s(8533);const q_=(0,Qe.Pi)((e=>{const{diagramEditorState:t}=e,s=Lt(),i=t.diagram,n=(0,et.useRef)(null),{width:a,height:r}=(0,Qc.NB)({refreshMode:"debounce",refreshRate:50,targetRef:n}),o=(0,et.useCallback)(((e,i)=>{if(e instanceof ed){const n=i.getClientOffset(),a=n?t.renderer.canvasCoordinateToModelCoordinate(t.renderer.eventCoordinateToCanvasCoordinate(new Wl(n.x,n.y))):void 0;(0,N.fl)(t.addClassView(e.li_attr.pureId,a)).catch(s.alertUnhandledError)}}),[s,t]),[,l]=(0,Z_.L)((()=>({accept:Zp.CLASS,drop:(e,t)=>o(e,t)})),[o]);return l(n),(0,et.useEffect)((()=>{if(n.current){const e=new X_(n.current,i);t.setRenderer(e),t.setupRenderer(),e.render(),e.autoRecenter()}}),[n,t,i]),(0,et.useEffect)((()=>{t.isDiagramRendererInitialized&&t.renderer.refresh()}),[t,a,r]),(0,x.jsx)("div",{ref:n,className:"diagram-canvas",tabIndex:0,onContextMenu:e=>e.preventDefault()})})),J_=(0,Qe.Pi)((e=>{const{editorState:t}=e;return(0,x.jsx)("div",{className:"panel edit-panel",children:(0,x.jsx)("div",{className:"panel__content edit-panel__content edit-panel__content--headless",children:(0,x.jsx)(q_,{diagramEditorState:t})})})}));var Q_=s(3297),em=s(4153);const tm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Ic.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,x.jsx)(x.Fragment,{children:t})};function sm(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Q_.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,x.jsx)(Nc.Z,{children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,x.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 im=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,h=(0,et.useRef)(null),[d,u]=(0,et.useState)(null);return(0,et.useEffect)((()=>{void 0!==t&&(t&&!d&&h.current?u(h.current):!t&&d&&u(null))}),[d,t]),(0,x.jsxs)("button",{ref:h,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(d?(l?.(),u(null)):h.current&&(c?.(),u(h.current)))},tabIndex:-1,title:r,children:[i,(0,x.jsx)(Yc,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:d,open:(void 0===t||Boolean(t))&&Boolean(d),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},nm=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;e.stopPropagation();let t=e.deltaX;t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},am=(0,Qe.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(Kc,{children:[(0,x.jsx)(Xc,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(Xc,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(Xc,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),rm=(0,Qe.Pi)((e=>{const t=(0,et.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,et.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(),h=((c?.left??0)-(c?.right??0))/2,d=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&d<h||o>l&&d>h||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,Z_.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,h]=(0,Mp.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,et.useEffect)((()=>{e((0,em.r)())}),[e])})(h),(0,x.jsx)("div",{ref:t,className:(0,Ic.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(d=i,e=>{1===e.nativeEvent.button&&s.closeTab(d)}),children:(0,x.jsx)(tm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(Wc,{content:(0,x.jsx)(am,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,x.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,x.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.q1B,{})})]})})});var d})),om=(0,Qe.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(im,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(Kc,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(Xc,{className:"tab-manager__menu__item",onClick:()=>t.openTab(e),children:[(0,x.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,x.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,x.jsx)(Vc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Vc.v4q,{})})})),lm=(0,Qe.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,x.jsxs)("div",{className:"tab-manager",children:[(0,x.jsxs)("div",{className:"tab-manager__content",onWheel:nm,children:[t.tabs.map((e=>(0,x.jsx)(rm,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(sm,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(om,{managerTabState:t})]})})),cm=()=>{const[e,t]=(0,et.useState)(!1),{ref:s,width:i,height:n}=(0,Qc.NB)();return(0,et.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,x.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,x.jsxs)("div",{className:(0,Ic.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Vc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},hm=(0,Qe.Pi)((()=>{const e=lp(),t=e.tabManagerState.currentTab;return t?(0,x.jsxs)("div",{className:"panel edit-panel",children:[(0,x.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,x.jsx)("div",{className:"edit-panel__header__tabs",children:(0,x.jsx)(lm,{tabManagerState:e.tabManagerState})}),(0,x.jsx)("div",{className:"panel__header__actions"})]}),(0,x.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof kh?(0,x.jsx)(d_,{editorState:t}):t instanceof ip?(0,x.jsx)(J_,{editorState:t}):null},t.uuid)]}):(0,x.jsx)(cm,{})}));var dm=s(166),um=s(5247);const pm=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,et.useRef)(null);return(0,et.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(dm.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,x.jsx)("div",{style:t,children:i[e]})}):(0,x.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},_m=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Vc.VRP,{})}),mm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Vc.VAA,{})}),gm=e=>{const{innerProps:{ref:t,...s}}=e;return(0,x.jsx)("div",{...s,ref:t,children:(0,x.jsx)("div",{className:"selector-input__indicator selector-input__clear-indicator",children:(0,x.jsx)(Vc.q1B,{})})})},Em=e=>(0,x.jsx)(um.baseComponents.Input,{...e,isHidden:!1}),fm=(0,et.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...h}=e,d=i?um.CreatableSelect:um.Select,u=l?"selector-input--dark":"selector-input";return(0,x.jsx)(d,{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:gm,DropdownIndicator:mm,LoadingIndicator:_m,MenuList:pm,Input:Em,...r},...{...h,darkMode:l,noMatchMessage:n}})})),Tm=(e,t)=>e.label.localeCompare(t.label),Cm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,et.useRef)(null),a=(0,et.useMemo)((()=>(0,ih.Z)((()=>{(0,N.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(vc.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,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Open file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)(fm,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Tm),onChange:s=>{s?.value&&(r(),i.reset(),(0,N.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,x.jsx)("button",{className:(0,Ic.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.toggleRegExp(),children:(0,x.jsx)(Vc.x47,{})})]})]})})})),xm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.textSearchCommandState,i=(0,et.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,N.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(vc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Search"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,x.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,x.jsx)(Vc.a2g,{})}),(0,x.jsx)("button",{className:(0,Ic.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,x.jsx)(Vc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),Om=(Nm=(0,Qe.Pi)((()=>{const e=lp(),t=Lt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,Qc.NB)(),r=Ap(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=Ap(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=Ap(e.auxPanelDisplayState.isMaximized);return(0,et.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,et.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,et.useEffect)((()=>{const s=((e,t=!1)=>t?(0,Q.parseUrl)(e).query:(0,Q.parse)(e))(window.location.search);(0,N.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,et.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),h_(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(l_,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(Op,{orientation:"vertical",children:[(0,x.jsx)(yp,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(r_,{})}),(0,x.jsx)(Sp,{}),(0,x.jsx)(yp,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(Op,{orientation:"horizontal",children:[(0,x.jsx)(yp,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(hm,{})}),(0,x.jsx)(Sp,{children:(0,x.jsx)(vp,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(yp,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(Dp,{})})]})})]})})})]}),(0,x.jsx)(c_,{actionsDisabled:!s}),s&&(0,x.jsx)(Cm,{}),s&&(0,x.jsx)(xm,{})]})})),function(){return(0,x.jsx)(op,{children:(0,x.jsx)(Nm,{})})});var Nm;const Am=()=>(0,x.jsx)(Ah,{children:(0,x.jsx)(xh,{children:(0,x.jsx)(Om,{})})}),ym=JSON.parse('{"i8":"6.2.15","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Sm extends o{}class vm extends Sm{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Im extends vm{static NAME=ym.Rw.p;constructor(){super(Im.NAME,ym.i8)}getExtraKeyedCommandConfigEntries(){return e=Mh,Object.entries(e).map((e=>({key:e[0],content:e[1]})));var e}}class Rm extends qe{static create(){const e=new Rm(kt.create());return e.withBasePlugins([new Im]),e.withBasePresets([new Ec]),e}async configureApplication(e){return new Dt(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Fe),A.editor.addKeybindingRules([{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyB,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyO,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyP,command:null},{keybinding:A.KeyCode.F1,command:null},{keybinding:A.KeyCode.F8,command:null},{keybinding:A.KeyCode.F9,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,je),A.languages.setMonarchTokensProvider(C.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","projects",be.CLASS,be.ASSOCIATION,be.ENUMERATION,be.MEASURE,be.PROFILE,be.FUNCTION,be.MAPPING,be.RUNTIME,be.CONNECTION,be.FILE_GENERATION,be.GENERATION_SPECIFICATION,be.DATA_ELEMENT,De.JSON_MODEL_CONNECTION,De.MODEL_CHAIN_CONNECTION,De.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",be.SERVICE,be.FLAT_DATA,be.DATABASE,De.FLAT_DATA_CONNECTION,De.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@"],languageStructs:["import","native","if","fold"],parsers:[Me.PURE,Me.CONNECTION,Me.RUNTIME,Me.MAPPING,Me.SERVICE,Me.FLATDATA,Me.RELATIONAL,Me.GENERATION_SPECIFICATION,Me.FILE_GENERATION_SPECIFICATION,Me.DATA].concat(s).map((e=>`###${e}`)),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:/\[(?:\d+(?:\.\.(?:\d+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,tokenizer:{root:[{include:"@package"},[/(\.)([\w_]+)/,["delimiter","property"]],{include:"@function"},[/^\s*###[\w]+/,{cases:{"@parsers":"parser-marker","@default":"invalid"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@languageStructs":"language-struct","@keywords":"keyword.$0","@default":"identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],{include:"@number"},[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],{include:"@characters"}],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"]],function:[[/(cast)(\()(@)/,["function","","cast"]],[/(->\s*)(cast)(\()(@)/,["","function","","cast"]],[/(->\s*)([\w_]+)(\s*\()/,["","function",""]],[/([\w_]+)(\s*\()/,["function",""]],[/(->\s*)([\w_]+)/,["","function"]]],package:[[/(@package)(\*)/,["package","tag"]],[/(@package)([\w_]+)/,["package","type"]],[/(@package)([\w_]+)(\s*)(@multiplicity)/,["package","type","","multiplicity"]],[/([\w_]+)(\s*:\s*)(@package)([\w_]+)(\s*)(@multiplicity)/,["attribute","","package","type","","multiplicity"]],[/(:\s*)([\w_]+)(\s*)(@multiplicity)/,["","type","","multiplicity"]]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doc:[[/[^/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],characters:[[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]]}}))})(e);const s="Monospaced font 'Roboto Mono' has not been loaded properly, text editor display problems might occur";await document.fonts.load("1em Roboto Mono").then((()=>{document.fonts.check("1em Roboto Mono")?(A.editor.remeasureFonts(),t.info(d.create(pe.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(d.create(pe.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(d.create(pe.APPLICATION_SETUP_FAILURE),s))),(0,N.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,O.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,x.jsx)(Je.VK,{basename:this.baseUrl,children:(0,x.jsx)(nt,{children:(0,x.jsx)(Pt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)(Am,{})})})}))}}class wm{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Rm.create().setup({baseUrl:e}).withPresets(wm.getPresetCollection()).withPlugins(wm.getPluginCollection()).start().catch((e=>{throw e}))}}wm.run("/ide/")},4174: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(1659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},2889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.UHp=t.DuK=t.ce8=t.dRK=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.jtq=t.HXR=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(8978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),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,"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,"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,"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,"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}});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(5186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(9385);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}});var o=s(563);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(6636);var l=s(1914);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}});var h=s(7245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return h.BiAtom}});s(924);var d=s(4543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return d.FiPackage}});s(5100);var u=s(8920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},5247: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(4319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(1776);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(h=0;h<e.length;h++){for(var[s,i,n]=e[h],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(h--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var h=e.length;h>0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[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+"."+{246:"e0f93158",399:"4bd7d49b",471:"d1ead9bf",947:"b545969f"}[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"),h=0;h<c.length;h++){var d=c[h];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+s){r=d;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 h=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(h)},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(7757)));l=o.O(l)})();
2
+ //# sourceMappingURL=index.41adcd61.js.map